增加VIP会员

This commit is contained in:
唐明明
2024-04-09 17:29:23 +08:00
parent e520ff11d2
commit 70c5d15d44
16 changed files with 852 additions and 139 deletions

View File

@@ -7,11 +7,15 @@
<!-- logo -->
<view class="topCont-logo">
<image class="topCont-logo-img" src="https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/06/06/fbd7ddba29e4ac81467b3d218233bb02.png" mode="widthFix"></image>
<view class="topCont-logo-go" @click="seekClick">
立即咨询
<view>
<view class="topCont-logo-btn" @click="$Router.push({name: 'vip'})" v-if="vip.name != ''">
会员权益
</view>
<view class="topCont-logo-btn" @click="seekClick">
立即咨询
</view>
</view>
</view>
<!-- 专业优质在线法律平台 -->
<view class="topCont-text">
<view class="topCont-text-name">
@@ -272,7 +276,8 @@
<!-- 金牌律师 -->
<view class="list">
<view class="list-title">
金牌律师
金牌律师
<view class="list-title-sm" @click="$Router.push({ name: 'Lawyers' })">全部</view>
</view>
<view class="lawyer">
<view class="lawyer-item" v-for="(item, index) in lawyersArr" :key="index" @click="$Router.push({name: 'lawyerDetails', params: {id: item.lawyer_id}})">
@@ -397,7 +402,11 @@
return {
businessArr : [], // 协商调解数组
canBuy : '', // 是否有免费个人咨询
officialShow : false, // 公众号
officialShow : false, // 公众号
vip : {
name: ""
},
autoplay : true,
interval : 3000,
@@ -515,11 +524,10 @@
},
// 首页数据
homeInfo() {
home().then(res => {
home().then(res => {
if(res.layad.is_lay_ad) {
this.layadImg = res.layad.lay_ad_img
}
let times = Number(res.layad.times.padEnd(4, 0))
if(this.first === 1 && res.layad.is_lay_ad) {
this.haveimg = true
@@ -529,7 +537,8 @@
this.haveimg = false
},times);
}
}
this.vip = res.vip
this.homeList = res.categories
this.lawyersArr = res.lawyers
this.noticesArr = res.notices
@@ -800,7 +809,9 @@
position: relative;
.topCont-logo {
display: flex;
line-height: 58rpx;
line-height: 58rpx;
justify-content: space-between;
align-items: center;
.topCont-logo-img {
margin-right: 15rpx;
width: 190rpx;
@@ -809,19 +820,17 @@
font-weight: 600;
}
.topCont-logo-go {
.topCont-logo-btn {
background-color: #ffffff;
border-radius: $radius*5;
text-align: center;
color: $mian-color;
font-size: $title-size;
line-height: 72rpx;
line-height: 68rpx;
font-weight: 600;
display: inline-block;
position: absolute;
right: $margin;
top: $margin + 10;
padding: 0 $padding + 10;
padding: 0 $padding;
&:last-child{ margin-left: 20rpx; }
}
}
.topCont-text {
@@ -967,7 +976,11 @@
.list-title {
font-weight: 600;
margin-bottom: 10rpx;
color: $text-color;
color: $text-color;
display: flex;
align-items: center;
justify-content: space-between;
&-sm{ font-size: 30rpx; color: gray; font-weight: normal; }
}
.lawyer {
overflow: hidden;

178
pages/index/lawyers.vue Normal file
View File

@@ -0,0 +1,178 @@
<template>
<view class="content">
<block v-if="lawyersArr.length > 0">
<view class="lawyer">
<view class="lawyer-item" v-for="(item, index) in lawyersArr" :key="index" @click="$Router.push({name: 'lawyerDetails', params: {id: item.lawyer_id}})">
<view class="lawyer-item-img">
<!-- 5:6 -->
<image :src="item.cover" mode="aspectFill"></image>
<view class="nowrap lawyer-item-name">
{{item.name}}
</view>
</view>
<view class="lawyer-item-cont">
<view class="nowrap lawyer-item-tips">
擅长
<block v-for="(items, itemsIndex) in item.tags" :key="itemsIndex">
{{items.name}},
</block>
</view>
<view class="lawyer-item-price">
<!-- <view class="lawyer-item-number">{{item.price}}</view> -->
<!-- <text>{{item.years}}+人咨询</text> -->
</view>
</view>
</view>
</view>
<!-- 分页 -->
<u-loadmore v-if="pagesShow" :status="status" />
</block>
<block v-else>
<view class="list-null">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
text="暂无律师数据"
>
</u-empty>
</view>
</block>
</view>
</template>
<script>
import { lawyers } from "@/apis/interfaces/index.js"
export default {
data() {
return {
lawyersArr : [],
// 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : false,
};
},
created() {
this.getList()
},
methods: {
// 获取列表
getList(){
uni.showLoading({
title: '加载中...',
mask : true
})
lawyers({
larer : 1,
page : this.page.current,
}).then(res => {
console.log(res)
let { data, page } = res;
let atList = page.current == 1 ? [] : this.lawyersArr
this.lawyersArr = atList.concat(data)
this.page = page
this.pagesShow = false
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
onCallPhone(phone){
uni.makePhoneCall({
phoneNumber: phone
})
}
},
onReachBottom() {
this.pagesShow = true;
if(this.page.has_more){
this.status = 'loading';
this.page.current++
this.getList()
return
}
this.status = 'nomore';
}
}
</script>
<style lang="scss">
.content{
box-sizing: border-box;
background: white;
padding-top: 1rpx;
}
// 列表
.lawyer {
overflow: hidden;
margin: 20rpx 15rpx 0;
.lawyer-item {
background-color: #fff;
width: calc(50% - 30rpx);
float: left;
margin: 0 15rpx $margin;
border: 2rpx solid #f1f1f1;
box-sizing: border-box;
border-radius: $radius-m;
overflow: hidden;
.lawyer-item-img {
position: relative;
width: 100%;
padding-top: 55%;
overflow: hidden;
background-color: #515151;
image {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.lawyer-item-name {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .1);
line-height: 54rpx;
color: #ffffff;
padding: 0 $padding - 10;
box-sizing: border-box;
font-size: $title-size-lg;
}
}
.lawyer-item-cont {
padding: $padding - 10;
box-sizing: border-box;
.lawyer-item-tips {
font-size: $title-size-m;
color: $text-color;
}
.lawyer-item-price {
display: flex;
margin-top: 10rpx;
line-height: 44rpx;
.lawyer-item-number {
flex: 1;
color: $mian-color;
font-weight: 600;
font-size: $title-size;
}
text {
font-size: $title-size-sm;
color: #9d9d9d;
}
}
}
}
}
// 空页面
.list-null{ height: 60vh; display: flex; align-items: center; justify-content: center; }
</style>

View File

@@ -79,7 +79,6 @@
// 图形码
captchaInfo() {
Captcha().then(res=>{
console.log(res)
this.captchaImg = res.img
this.captchaKey = res.key
}).catch(err=>{

View File

@@ -18,14 +18,14 @@
<image class="paymentList-img" :src="Payment == 'wechat' ? '/static/imgs/payCheck_active.png' : '/static/imgs/payCheck.png'" mode="widthFix"></image>
</view>
</view>
<view class="paymentList-label" @click="payType('umsMp')">
<!-- <view class="paymentList-label" @click="payType('umsMp')">
<view class="paymentList-left">
<image class="paymentList-icon" src="https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/06/06/2a4ea8f9f714e39088648383d5c52f32.png" mode="widthFix"></image>微信银联商务
</view>
<view class="paymentList-right">
<image class="paymentList-img" :src="Payment == 'umsMp' ? '/static/imgs/payCheck_active.png' : '/static/imgs/payCheck.png'" mode="widthFix"></image>
</view>
</view>
</view> -->
<view class="paymentList-label" @click="payType('umsAli')">
<view class="paymentList-left">
<image class="paymentList-icon" src="https://douhuo-storage.oss-cn-beijing.aliyuncs.com/images/2023/06/06/4aaf302e9d8a90c21c39b3d2f39cebc2.png" mode="widthFix"></image>支付宝银联商务

View File

@@ -14,9 +14,10 @@
{{userData.nickname}} <image v-if="userData.certification" class="userTop-icon" src="@/static/imgs/user_attestation.png"></image>
</view>
<view class="userTop-identity-tips">
普通用户 <image class="userTop-arrow" src="@/static/imgs/use_arrow.png"></image>
{{userData.identity.name}}<image class="userTop-arrow" src="@/static/imgs/use_arrow.png"></image>
</view>
</view>
</view>
<view class="user-vip" @click="$Router.push({name: 'vip'})">{{!userData.identity.can_open_vip && !userData.identity.can_renew_vip ? '会员权益': ''}}{{userData.identity.can_open_vip ? '开通会员': ''}}{{userData.identity.can_renew_vip ? '开通会员': ''}}</view>
</view>
<view class="userTop-height" v-else @click="$Router.push({name: 'Login'})">
<view class="userTop-head">
@@ -135,7 +136,16 @@
<view class="board-number">{{userData.business_orders_count.diff_count}}</view>
</view>
</view>
</view>
</view>
<view class="block-flex" v-if="userData.salesman" @click="onCallPhone(userData.salesman.username)">
<view class="block-flex-title">业务联系人</view>
<view>{{userData.salesman.nickname || '-'}}</view>
</view>
<!-- v-if="userData.identity.id > 1" -->
<view class="block-flex" @click="$Router.push({name: 'Tema'})">
<view class="block-flex-title">我的推荐</view>
<u-icon name="arrow-right"></u-icon>
</view>
<view class="tool">
<view class="tool-title">
其他工具
@@ -206,7 +216,12 @@
data() {
return {
userLogin : false, //登录状态
userData : {}, //用户数据
userData : {
identity: {
can_open_vip : false,
can_renew_vip : false
}
}, //用户数据
synthesisAll : '', // 综法数量
listArr : [], // 文章列表
page : {}, // 分页信息
@@ -231,7 +246,7 @@
methods:{
// 用户信息
userInfo() {
userIndex().then(res => {
userIndex().then(res => {
this.userData = res
}).catch(err => {
uni.showToast({
@@ -239,14 +254,19 @@
icon: "none"
})
})
},
// 拨打电话
onCallPhone(e){
wx.makePhoneCall({
phoneNumber: e,
fail: () => {}
})
},
// 综法订单数据数量
synthesisInfo() {
synthesisCount({channel: 'self'}).then(res => {
console.log(res)
this.synthesisAll = res
}).catch(err => {
uni.showToast({
@@ -281,7 +301,12 @@
}
</script>
<style lang="scss" scoped>
<style lang="scss" scoped>
.block-flex{
display: flex; color: gray; font-size: 32rpx; align-items: center; justify-content: space-between; padding: 20rpx 30rpx; line-height: 60rpx;
&-title{ color: #333; }
}
.userTop {
position: relative;
width: 100%;
@@ -300,7 +325,10 @@
padding: $padding;
box-sizing: border-box;
.userTop-height {
height: 110rpx;
height: 110rpx;
display: flex;
align-items: center;
flex-wrap: wrap;
.userTop-head {
width: 110rpx;
height: 110rpx;
@@ -317,7 +345,7 @@
}
}
.userTop-text {
width: calc(100% - 150rpx);
width: calc(100% - 310rpx);
float: left;
margin-left: 30rpx;
padding-top: $padding - 20;
@@ -354,7 +382,18 @@
margin-left: 4rpx;
}
}
}
}
.user-vip{
background: $mian-color;
color: white;
position: relative;
z-index: 1;
width: 170rpx;
font-size: 28rpx;
line-height: 70rpx;
border-radius: 35rpx;
text-align: center;
}
}
.userTop-see {
margin: 0 -10rpx;

View File

@@ -49,7 +49,7 @@
</view> -->
</view>
<view class="setupItem">
<view class="label" @click="$Router.push({name: 'Referee'})">
<!-- <view class="label" @click="$Router.push({name: 'Referee'})">
<view class="label-name">
<image class="label-name-img" src="/static/imgs/zK_04.png" mode="aspectFill"></image>
<view class="label-name-text">我的伙伴</view>
@@ -58,7 +58,7 @@
<view class="label-name-number" v-if="childrenCount">{{childrenCount}}</view>
<image class="label-name-arrow" src="/static/imgs/zK_arrow.png" mode="widthFix"></image>
</view>
</view>
</view> -->
<view class="label" @click="$Router.push({name: 'SignLog'})">
<view class="label-name">
<image class="label-name-img" src="/static/imgs/zK_08.png" mode="aspectFill"></image>
@@ -68,7 +68,7 @@
<image class="label-name-arrow" src="/static/imgs/zK_arrow.png" mode="widthFix"></image>
</view>
</view>
<view class="label" @click="$Router.push({name: 'Parent'})">
<!-- <view class="label" @click="$Router.push({name: 'Parent'})">
<view class="label-name">
<image class="label-name-img" src="/static/imgs/zK_05.png" mode="aspectFill"></image>
<view class="label-name-text">业务联系人</view>
@@ -76,7 +76,7 @@
<view class="label-tips">
<image class="label-name-arrow" src="/static/imgs/zK_arrow.png" mode="widthFix"></image>
</view>
</view>
</view> -->
<view class="label" @click="delSubscribe" v-if="hasSubscribe">
<view class="label-name">
<image class="label-name-img" src="/static/imgs/zK_07.png" mode="aspectFill"></image>

215
pages/user/team.vue Normal file
View File

@@ -0,0 +1,215 @@
<template>
<view class="content">
<block v-if="users.length > 0">
<view class="team-item" v-for="(item, index) in users" :key="index" @click="onCallPhone(item.real_username)">
<u-avatar :src="item.avatar" size="48"></u-avatar>
<view class="team-content">
<view class="nowrap name">{{item.nickname}}</view>
<view class="nowrap identitys">
<text class="identity certification-y" v-if="item.certification"><image src="@/static/icon/user_nav_03.png"></image>已实名</text>
<text class="identity identity-2" v-if="item.identity.order == 2">实习顾问</text>
<text class="identity identity-1" v-if="item.identity.order == 1">普通用户</text>
<text class="identity identity-3" v-if="item.identity.order == 3">顾问</text>
</view>
<view class="nowrap submit">联系电话{{item.username}}</view>
<view class="nowrap submit">注册时间{{item.created_at}}</view>
</view>
<view class="mobile">
<uni-icons class="mobile-icon" type="phone-filled" size="18" color="white"></uni-icons>
</view>
</view>
<!-- 分页 -->
<u-loadmore v-if="pagesShow" :status="status" />
</block>
<block v-else>
<view class="list-null">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
text="暂无客户数据"
>
</u-empty>
</view>
</block>
</view>
</template>
<script>
import { team } from '@/apis/interfaces/user.js'
export default {
data() {
return {
tabs : [],
tabVal : 0,
users : [],
count : {
all: 0
},
// 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : false,
};
},
created() {
this.getList()
},
methods: {
// 获取列表
getList(){
uni.showLoading({
title: '加载中...',
mask : true
})
team({
larer : 1,
page : this.page.current,
}).then(res => {
console.log(res)
let { lists, count } = res;
let atList = lists.page.current == 1 ? [] : this.lists
this.count = count
this.users = atList.concat(lists.data)
this.page = lists.page
this.pagesShow = false
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
onCallPhone(phone){
uni.makePhoneCall({
phoneNumber: phone
})
}
},
onReachBottom() {
this.pagesShow = true;
if(this.page.has_more){
this.status = 'loading';
this.page.current++
this.getList()
return
}
this.status = 'nomore';
}
}
</script>
<style lang="scss">
.content{
box-sizing: border-box;
background: white;
padding-top: 30rpx;
}
// 统计数据
.total{
margin: 30rpx 30rpx 0;
background: linear-gradient(to top left, #446EFE, #0f36bb);
box-shadow: 10rpx 0 15rpx 15rpx rgba(0, 0, 0, .03);
border-radius: 20rpx;
padding: 50rpx;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
.total-title{
font-size: 28rpx;
opacity: .8;
padding-top: 10rpx;
}
.total-number{
text-align: right;
font-weight: bold;
}
}
// 团队列表
.team-item{
background: white;
display: flex;
justify-content: space-between;
padding: 30rpx;
border-radius: 20rpx;
margin: 0 30rpx 30rpx 30rpx;
box-shadow: 10rpx 0 15rpx 15rpx rgba(0, 0, 0, .03);
position: relative;
overflow: hidden;
&::after{
width: 30rpx;
height: 30rpx;
border-radius: 15rpx;
background: linear-gradient(to top left, #446EFE, #0f36bb);
position: absolute;
left: -15rpx;
top: 30rpx;
content: " ";
}
.team-content{
width: calc( 100% - 48px - 100rpx );
padding-left: 30rpx;
box-sizing: border-box;
.name{
font-weight: bold;
font-size: 34rpx;
}
.submit{
line-height: 40rpx;
font-size: 26rpx;
color: gray;
}
.identitys{
margin-bottom: 10rpx;
.identity{
font-size: 24rpx;
border-radius: 15rpx;
line-height: 30rpx;
padding: 0 10rpx;
color: white;
margin-right: 20rpx;
&.identity-2{
background: #443DE2;
}
&.identity-1{
background: #e1e1e1;
}
&.identity-3{
background: #FEAD45;
}
&.certification-y{
background: #FFF7EC;
border-color: #FEAD45;
color: #FEAD45;
image{
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-bottom: 5rpx;
}
}
}
}
}
.mobile{
width: 100rpx;
border-radius: 35rpx;
margin-top: 9px;
height: 30px;
line-height: 30px;
color: white;
background: #446EFE;
text-align: center;
.mobile-icon{
display: inline-block;
}
}
}
// 空页面
.list-null{ height: 60vh; display: flex; align-items: center; justify-content: center; }
</style>

129
pages/user/vip.vue Normal file
View File

@@ -0,0 +1,129 @@
<template>
<view>
<view v-if="identity != null" :style="(identity.open || identity.renew) ? 'padding-bottom:230rpx': 'padding-bottom:110rpx'">
<image class="vip-cover" :src="identity.cover" mode="widthFix"></image>
<view class="vip-footer">
<view class="vip-text">
<text class="vip-text-item">{{identity.identity_name}}</text>
<text class="vip-text-item">到期时间: {{identity.end_at || '长期'}}</text>
</view>
<button class="vip-btn" v-if="identity.open || identity.renew" @click="vipShow = true">{{identity.open ? '开通': ''}}{{identity.renew ? '续费': ''}} ({{identity.price}}/{{identity.years}})</button>
</view>
</view>
<!-- 弹出层 -->
<u-popup :show="vipShow" mode="center" :round="10" closeable @close="vipShow = false">
<view class="vip-tips" v-if="identity != null">
<view class="vip-tips-title">开通会员</view>
<view class="vip-tips-price"><text class="vip-tips-price-sm"></text>{{identity.price}}</view>
<view class="vip-tips-text">年限{{identity.years}}</view>
<input class="vip-tips-input" placeholder="请输入真实姓名" v-model="nickname" />
<button class="vip-tips-btn" @click="onOpen">去支付</button>
</view>
</u-popup>
</view>
</template>
<script>
import { identity, vip } from '@/apis/interfaces/user'
export default {
data() {
return {
vipShow : false,
identity: null,
nickname: ""
};
},
onShow(){
uni.showLoading({
title: '加载中...',
mask : true
})
identity().then(res => {
this.identity = res;
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
methods: {
onOpen(){
if(this.nickname == ''){
uni.showToast({
title: '请输入真实姓名',
icon : 'none'
})
return
}
uni.showLoading({
title: "获取支付...",
mask : true
})
vip({ real_name: this.nickname }).then(res => {
uni.hideLoading()
let { order_type, order_id } = res
this.$Router.push({
name: "Pay",
params: {
orderId : order_id,
orderType : order_type
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.vip-cover{ width: 100%; vertical-align: top; }
.vip-footer{
padding: 30rpx;
background: #d2382c;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.vip-text{
color: #fff5e9;
font-size: 30rpx;
text-align: center;
line-height: 50rpx;
.vip-text-item{ padding: 0 15rpx; }
}
.vip-btn{
margin-top: 30rpx;
background: linear-gradient(to right, #fffefc, #fff0d9);
color: #d2382c;
font-weight: bold;
font-size: 34rpx;
border-radius: 45rpx;
line-height: 90rpx;
&::after{ display: none; }
}
}
// 开通会员弹出层
.vip-tips{
width: 75vw;
padding: 50rpx;
box-sizing: border-box;
.vip-tips-title{ text-align: center; font-weight: bold; font-size: 36rpx; padding-bottom: 30rpx; }
.vip-tips-price{
text-align: center;
font-weight: bold;
font-size: 50rpx;
color: #d2382c;
&-sm{ font-size: 80%; }
}
.vip-tips-text{ font-size: 30rpx; color: gray; padding-bottom: 50rpx; text-align: center; }
.vip-tips-input{ background: #f7f8f9; border-radius: 45rpx; height: 90rpx; margin-bottom: 30rpx; padding: 0 30rpx; text-align: center; font-size: 32rpx; }
.vip-tips-btn{ background: #d2382c; color: white; line-height: 90rpx; border-radius: 45rpx; font-weight: bold; font-size: 34rpx; }
}
</style>