sadjv1/anmo-user-uniapp/pages/my/index.vue

796 lines
24 KiB
Vue

<template>
<view class="" style="padding-bottom: 30px;">
<view class="headtop">
<view class="headbox">
<view class="u-flex text-white" style="padding-top: 30rpx;">
<view class="u-m-r-10">
<image :src="avatar" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
@click="goNav('/pages/my/userinfo')"></image>
</view>
<view class="u-flex-1 u-m-l-10 " v-if="!isLogin">
<view class="u-font-18 text-bold">
<view class="flex align-center">
<view class="margin-left-sm margin-top-xs">{{userName}}</view>
<view class="flex align-center" style="font-size: 14px;">
<image src="../../static/images/my/start.png" style="width: 13px;height: 12px;margin: 0 6rpx 0 20rpx;"></image>
5.0
</view>
<view class="xyf" @click="goNav('/my/wallet/xinyongfendetail')">{{creditScore}}</view>
</view>
<view class="flex margin-left-sm margin-top-xs" v-if="XCXIsSelect != '否'"
style="font-size: 22rpx;font-weight: 500;">
<view v-if="renzheng == 0" @click.stop="goNav('/my/renzheng/rzType')">
暂未实名认证
</view>
<view v-if="renzheng == 1" @click.stop="goNav('/my/renzheng/index')">
审核中
</view>
<view v-if="renzheng == 2" @click.stop="goNav('/my/renzheng/index')">
已实名认证
</view>
<view v-if="renzheng == 3" @click.stop="goNav('/my/renzheng/index')">
已拒绝
</view>
</view>
</view>
</view>
<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/public/login')">
登录
</view>
</view>
<!-- <view class="flex align-center justify-between padding-top" style="color: #ffffff;margin-top: 20rpx;">
<view class="text-center">
<view class="text-bold text-xl">{{ordersScore}}</view>
<view>综合评分</view>
</view>
<view class="text-center">
<view class="text-bold text-xl">{{succeedRate | formatPrice}}%</view>
<view>成交率</view>
</view>
<view class="text-center">
<view class="text-bold text-xl">{{sumCount}}</view>
<view>服务次数</view>
</view>
<view class="text-center">
<view class="text-bold text-xl"></view>
<view>信用分</view>
</view>
</view> -->
<view class="moneybox" v-if="XCXIsSelect != '否'">
<view class="">
<view class="flex flex-wrap">
<view class="flex align-center justify-between" style="width: 100%;">
<view class="">
<view style="color: #ffffff;font-size: 13px;">账户余额(元)</view>
<view class="margin-top-xs" style="font-size: 35px;color: #ffffff;">
<text class="money_text">{{money?money:'0'}}</text>
</view>
</view>
<view class="btnyt" @click="goQian()">立即提现</view>
</view>
<view class="flex align-center justify-between" style="width: 100%;margin-top: 20px;">
<view class="" style="text-align: center;width: 23%;" @click="goNav('/my/wallet/mymoneydetail')">
<view class="margin-top-xs" style="color: #fff;background-color: #118052;padding: 10px 0;border-radius: 10px;">
<text class="money_text1">{{dayMoney?dayMoney:'0'}}</text>
</view>
<view style="color: #fff;font-size: 26rpx;margin-top: 8px;">当日收益</view>
</view>
<view class="" style="text-align: center;width: 23%;">
<view class="margin-top-xs" style="color: #fff;background-color: #118052;padding: 10px 20px;border-radius: 10px;">
<text class="money_text1">0</text>
</view>
<view style="color: #fff;font-size: 26rpx;margin-top: 8px;">当期收益</view>
</view>
<view class="" style="text-align: center;width: 23%;" @click="goNav('/my/wallet/mymoneydetail')">
<view class="margin-top-xs" style="color: #fff;background-color: #118052;padding: 10px 0;border-radius: 10px;">
<text class="money_text1">{{monthMoney?monthMoney:'0'}}</text>
</view>
<view style="color: #fff;font-size: 26rpx;margin-top: 8px;">当月收益</view>
</view>
<view class="" style="text-align: center;width: 23%;">
<view class="margin-top-xs" style="color: #fff;background-color: #118052;padding: 10px 0;border-radius: 10px;">
<text class="money_text1">0</text>
</view>
<view style="color: #fff;font-size: 26rpx;margin-top: 8px;">当期结束日</view>
</view>
</view>
</view>
</view>
<!-- <view class="flex align-center justify-between padding-lr padding-tb-sm">
<view class="text-black" style="font-family: PingFang SC;color: #a88554;font-size: 26rpx;">
每次提现平台将扣除相应手续费</view>
<view class="xflist" @click="goNav('/my/wallet/mymoneydetail')">
钱包明细
<image src="../../static/images/my/right.png" style="width: 9rpx;height: 17rpx;margin-left: 10rpx;"></image>
</view>
</view> -->
</view>
</view>
<view class="margin-top" style="width: 100%;margin-top: -70px;padding: 30rpx;border-radius: 20px;background-color: #ffffff;">
<view class="" style="font-size: 32rpx;font-weight: bold;color: #333333;margin-bottom: 26rpx;">
关于我
</view>
<view class="flex justify-between" style="flex-wrap: wrap;">
<view class="sdza" @click="getJqqd()" style="background: url(../../static/images/my/gyw01.png);background-size: cover;">
<image src="../../static/images/my/gyw07.png" style="width: 30px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
生活照
</view>
</view>
<view class="sdza" @click="goNav('/my/publish/index')" style="background: url(../../static/images/my/gyw02.png);background-size: cover;">
<image src="../../static/images/my/gyw08.png" style="width: 28px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
我的项目
</view>
</view>
<view class="sdza" @click="getJqqd()" style="background: url(../../static/images/my/gyw03.png);background-size: cover;">
<image src="../../static/images/my/gyw09.png" style="width: 30px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
我的评价
</view>
</view>
<view class="sdza" @click="getJqqd()" style="background: url(../../static/images/my/gyw04.png);background-size: cover;">
<image src="../../static/images/my/gyw10.png" style="width: 32px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
证件
</view>
</view>
<view class="sdza" @click="getJqqd()" style="background: url(../../static/images/my/gyw05.png);background-size: cover;">
<image src="../../static/images/my/gyw11.png" style="width: 24px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
资质
</view>
</view>
<view class="sdza" @click="getJqqd()" style="background: url(../../static/images/my/gyw06.png);background-size: cover;">
<image src="../../static/images/my/gyw12.png" style="width: 27px;height: 30px;margin-bottom: 4px;margin-top: 15px;"></image>
<view class="">
合同
</view>
</view>
</view>
<view style="width: 100%;margin: 10px 0;" @click="goNav('/package/pages/zysc/index/index')" v-if="shopSel != '否'">
<image src="../../static/images/my/shangc.png" style="width: 100%;height: 80px;"></image>
</view>
<view class="" style="font-size: 32rpx;font-weight: bold;color: #333333;margin-bottom: 26rpx;">
常用功能
</view>
<view class="flex justify-between margin-top" style="width: 100%;flex-wrap: wrap;">
<!-- <view class="box">
<image src="../../static/images/my/yjian.png"></image>
<view class="box_text">我的项目</view>
</view>
<view class="box" @click="goNav('/my/wallet/index')" v-if="XCXIsSelect != '否'">
<image src="../../static/images/my/fbgl.png"></image>
<view class="box_text">我的钱包</view>
</view> -->
<view class="box" @click="goChat()">
<image src="../../static/images/my/kefu.png"></image>
<view class="box_text">联系客服</view>
</view>
<view class="box" @click="goNav('/my/help/feedbackIndex')">
<image src="../../static/images/my/help.png"></image>
<view class="box_text">帮助中心</view>
</view>
<!-- <view class="box" v-if="renzheng == 0 && XCXIsSelect != '否'" @click="goNav('/my/renzheng/rzType')">
<image src="../../static/images/my/renzheng.png"></image>
<view class="box_text">实名认证</view>
</view> -->
<view class="box" @click="goNav('/pages/poster/index')" v-if="renzheng > 0 && XCXIsSelect != '否'">
<image src="../../static/images/my/shops.png"></image>
<view class="box_text">邀请理疗师</view>
</view>
<!-- <view class="box" @click="goNav('/my/publish/money')" v-if="bzjCheck != '否' && XCXIsSelect != '否'">
<image src="../../static/images/my/baozhengjin.png"></image>
<view class="box_text">保证金</view>
</view> -->
<!-- <view class="box" @click="goNav('/my/team/team')" v-if="renzheng > 0 && XCXIsSelect != '否'">
<image src="../../static/images/my/team.png"></image>
<view class="box_text">我的团队</view>
</view> -->
<view class="box" @click="goNav('/my/setting/index')">
<image src="../../static/images/my/me.png"></image>
<view class="box_text">设置中心</view>
</view>
<!-- <view class="box" @click="uploadAudioStart()">
<image src="../../static/images/my/shop.png"></image>
<view class="box_text">报警开始</view>
</view>
<view class="box" @click="uploadAudioEnd()">
<image src="../../static/images/my/shop.png"></image>
<view class="box_text">报警结束</view>
</view> -->
<!-- <view class="box" v-if="renzheng == 0 && XCXIsSelect != '否'" @click="goNav('/my/renzheng/rzType')">
<image src="../../static/images/my/renzheng.png"></image>
<view class="box_text">实名认证</view>
</view> -->
<!-- <view class="box" @click="goNav('/my/publish/money')" v-if="bzjCheck != '否' && XCXIsSelect != '否'">
<image src="../../static/images/my/baozhengjin.png"></image>
<view class="box_text">保证金</view>
</view> -->
</view>
</view>
</view>
<!-- <view v-if="XCXIsSelect != '否'">
<view class="bgl" v-if="!phone || !openId || renzheng != 2">
<view>
<image
src="../../static/images/my/renwuzhongxin.png"
style="width: 148rpx;height: 35rpx;"></image>
</view>
<view class="">
<view class="flex align-center justify-between margin-top-xl">
<view>
<view class="flex align-center">
<view class="xinshou">新手任务</view>
<view class="title">手机号授权</view>
</view>
<view class="margin-top-xs" style="color: #999999;font-weight: bold;font-size: 24rpx;">
以免客户无法联系到您,从而错失客户</view>
</view>
<view class="btn1" v-if="phone">已完成</view>
<view class="btn" v-if="!phone">未完成</view>
</view>
<view class="flex align-center justify-between margin-top-xl">
<view>
<view class="flex align-center">
<view class="xinshou">新手任务</view>
<view class="title">关注公众号</view>
</view>
<view class="text-26 margin-top-xs"
style="color: #999999;font-weight: bold;font-size: 24rpx;">
方便接收新订单/状态消息提醒</view>
</view>
<view class="btn1" v-if="openId">已完成</view>
<view class="btn" v-if="!openId" @click="gowxImage()">未完成</view>
</view>
<view class="flex align-center justify-between margin-top-xl">
<view>
<view class="flex align-center">
<view class="xinshou">新手任务</view>
<view class="title">认证信息</view>
</view>
<view class="text-26 margin-top-xs"
style="color: #999999;font-weight: bold;font-size: 24rpx;">
实名认证/头像/资质</view>
</view>
<view class="btn1" v-if="renzheng == 2" @click.stop="goNav('/my/renzheng/index')">已完成</view>
<view class="btn" v-if="renzheng == 0" @click.stop="goNav('/my/renzheng/rzType')">未完成</view>
<view class="btn" v-if="renzheng != 0 && renzheng != 2"
@click.stop="goNav('/my/renzheng/index')">未完成</view>
</view>
</view>
</view>
</view> -->
</view>
</template>
<script>
import * as websocketUtils from 'utils/websocketUtils.js';
export default {
data() {
return {
ordersScore: 0,
creditScore: 0,
phone: '',
openId: '',
avatar: '../../static/logo.png',
isLogin: true,
userName: '匿名',
money: 0, //累计余额
dayMoney: 0, //今日收益
monthMoney: 0, //本月预估收益
cashMoney: 0, // 本月预估提现
userId: '',
isVip: false,
invitationCode: '', //邀请码
succeedRate: 0,
sumCount: 0,
renzheng: 0,
bzjCheck: '否',
XCXIsSelect: '否',
shopSel:'否',
isCashDeposit: ''
}
},
onLoad() {
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
this.shopSel = this.$queue.getData('shopSel');
},
onShow() {
this.bzjCheck = this.$queue.getData("bzjCheck");
this.userId = uni.getStorageSync('userId')
if (this.userId) {
this.isLogin = false
this.getUserInfo()
this.getCount();
this.getAmount()
this.getIsVip()
this.getArtificer()
} else {
this.ordersScore = 0;
this.creditScore = 0;
this.succeedRate = 0;
this.sumCount = 0;
this.isLogin = true
this.userName = '匿名'
this.money = 0
this.dayMoney = 0
this.monthMoney = 0
this.cashMoney = 0
this.avatar = '../../static/logo.png'
}
},
filters: {
formatPrice(data) {
if (typeof(data) === "number") {
return parseFloat(parseFloat(data) * 100).toFixed();
}
return 0.00;
}
},
methods: {
getJqqd(){
this.$queue.showToast('敬请期待!')
},
goChat() {
let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
let kefuPhone = this.$queue.getData('kefuPhone');
if (this.userId) {
if (kefu == 1) {
uni.makePhoneCall({
phoneNumber: kefuPhone //仅为示例
});
} else {
// #ifdef MP-WEIXIN
let that = this
try {
wx.openCustomerServiceChat({
extInfo: {
url: that.$queue.getData('kefuUrl')
},
corpId: that.$queue.getData('kefuAppId'),
success(res) {},
fail(res) {
console.error(res)
}
})
} catch (error) {
console.error("catchcatch" + error)
uni.showToast({
title: '请更新至微信最新版本'
});
}
// #endif
// #ifndef MP-WEIXIN
let url = this.$queue.getData('kefuUrl');
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
uni.navigateTo({
url
});
} else {
//#ifndef H5
uni.navigateTo({
url: '/pages/index/webView?url=' + url
});
//#endif
//#ifdef H5
window.location.href = url;
//#endif
}
// #endif
}
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/public/login'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
//跳转打开微信公众号
gowxImage() {
this.$Request.get('/app/common/type/2').then(res => {
if (res.code == 0) {
var imgPaths = [];
imgPaths.push(res.data.value)
uni.previewImage({
current: 0,
urls: imgPaths, //图片路径是个数组,数组里面放图片的全路径
longPressActions: { //长按保存图片到相册
itemList: ['保存图片'],
success: (data) => {
uni.saveImageToPhotosAlbum({ //保存图片到相册
filePath: res.data.value,
success: function() {
uni.showToast({
icon: 'success',
title: '保存成功'
})
},
fail: (err) => {
uni.showToast({
icon: 'none',
title: '保存失败,请重新尝试'
})
}
});
},
fail: (err) => {
console.log(err.errMsg);
}
}
})
}
});
},
//跳转用户端
gouser() {
wx.navigateToMiniProgram({
appId: 'wx36626f7398972421',
path: '/pages/index/index',
envVersion: 'release', // 打开正式版
success(res) {
// 打开成功
},
fail: function(err) {
console.log(err);
}
})
},
getCount() {
this.$Request.get("/app/artificer/selectArtificerIndex").then(res => {
if (res.code == 0) {
this.succeedRate = res.data.succeedRate;
console.log(this.succeedRate)
this.sumCount = res.data.sumCount;
}
})
},
goQian() {
uni.navigateTo({
url: '/my/wallet/index'
})
},
bindFb() {
let renzheng = uni.getStorageSync('renzheng')
console.log(this.userId, renzheng)
if (this.userId) {
uni.navigateTo({
url: '/my/publish/editor'
})
} else {
uni.showModal({
title: '提示',
content: '您还未实名认证,请先认证',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/my/renzheng/index'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
goNav(e, name) {
console.log(e)
if (this.userId) {
uni.navigateTo({
url: e
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/public/login'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
goLogin(e) {
uni.navigateTo({
url: e
})
},
//我的收益
getAmount() {
this.$Request.get("/app/artificer/selectArtificerMoney").then(res => {
if (res.code == 0) {
this.money = res.data.money //累计余额
this.dayMoney = res.data.dayMoney //今日收益
this.monthMoney = res.data.monthMoney //本月预估收益
this.cashMoney = res.data.cashMoney //本月预估提现
}
});
},
getUserInfo() {
this.$Request.get("/app/user/selectUserById").then(res => {
if (res.code == 0) {
this.userName = res.data.userName
this.invitationCode = res.data.invitationCode
this.avatar = res.data.avatar ? res.data.avatar : '../../static/logo.png'
// this.isAuthentication = res.data.isAuthentication
this.phone = res.data.phone;
this.openId = res.data.openId;
//保证金
if (res.data.isCashDeposit == 1 || res.data.isCashDeposit == null) {
this.isCashDeposit = 1
uni.setStorageSync("isCashDeposit", this.isCashDeposit)
} else if (res.data.isCashDeposit == 2) {
this.isCashDeposit = 2
uni.setStorageSync("isCashDeposit", this.isCashDeposit)
} else if (res.data.isCashDeposit == 3) {
this.isCashDeposit = 3
uni.setStorageSync("isCashDeposit", this.isCashDeposit)
}
uni.setStorageSync('avatar', res.data.avatar)
uni.setStorageSync('invitationCode', res.data.invitationCode)
//实名认证
if (res.data.isAuthentication == 0 || res.data.isAuthentication == null) {
this.renzheng = 0
uni.setStorageSync("renzheng", this.renzheng)
} else if (res.data.isAuthentication == 1) {
this.renzheng = 1
uni.setStorageSync("renzheng", this.renzheng)
} else if (res.data.isAuthentication == 2) {
this.renzheng = 2
uni.setStorageSync("renzheng", this.renzheng)
} else if (res.data.isAuthentication == 3) {
this.renzheng = 3
uni.setStorageSync("renzheng", this.renzheng)
}
}
});
},
//获取理疗师的信息
getArtificer() {
this.$Request.getT("/app/artificer/selectArtificer").then(res => {
if (res.code == 0) {
this.creditScore = res.data.creditScore ? res.data.creditScore : 0;
this.ordersScore = res.data.ordersScore ? res.data.ordersScore : 0;
// uni.setStorageSync("status", res.data.status)
uni.setStorageSync('artificerId', res.data.artificerId)
}
});
},
//会员
getIsVip() {
this.$Request.get("/app/UserVip/isUserVip").then(res => {
if (res.code == 0) {
this.isVip = res.data
uni.setStorageSync('isVIP', res.data)
}
});
},
//退出登录
TuiLogin() {
let that = this
if (that.userId) {
uni.showModal({
title: '提示',
content: '确定退出登录吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.removeStorageSync('userName')
uni.removeStorageSync('avatar')
uni.removeStorageSync('userId')
uni.removeStorageSync('token')
uni.removeStorageSync('phone')
uni.removeStorageSync('zhiFuBaoName')
uni.removeStorageSync('zhiFuBao')
uni.removeStorageSync('invitationCode')
uni.removeStorageSync('unionId')
uni.removeStorageSync('openId')
uni.removeStorageSync('isVIP')
uni.showToast({
title: '退出成功!',
icon: 'none'
})
that.isLogin = true
that.userName = '匿名'
that.money = 0
that.dayMoney = 0
that.monthMoney = 0
that.cashMoney = 0
that.avatar = '../../static/logo.png'
that.userId = uni.getStorageSync('userId')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/public/login'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
uploadAudioStart(){
//console.log('this ->',this);
websocketUtils.uploadAudioStart();
},
uploadAudioEnd(){
websocketUtils.uploadAudioEnd();
},
}
}
</script>
<style lang="scss">
page {
background-color: #f7f7f7;
}
.bg {
background: #FFFFFF;
}
.headbox{
background-image: url(../../static/images/my/bgbo.png);
background-size: cover;
height: 350px;
padding: 0 30rpx;
}
.xyf{
background: linear-gradient(to right, #000000, #3d3d3d);
padding: 1px 8px;
border-radius: 20px;
color: #efd177;
margin-left: 20rpx;
font-size: 12px;
}
.bgs {
background: linear-gradient(to bottom, #FFFFFF 15%, #F2F2F2 80%, );
}
.bgl {
background: linear-gradient(to bottom, #a8e1cc 10%, #FFFFFF 25%, );
width: 94%;
margin: 20rpx auto;
border-radius: 24rpx;
padding: 30rpx;
margin-top: 40rpx;
}
.money_text{
font-size: 32px;
font-weight: bold;
color: #fff;
}
.money_text1{
font-size: 17px;
font-weight: bold;
color: #fff;
}
.moneybox{
width: 100%;
margin-top: 36px;
}
.btnyt{
background-color: #ffffff;
width: 240rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
color: #333333;
font-size: 30rpx;
border-radius: 40rpx;
}
.xflist {
color: #80490b;
font-size: 28rpx;
}
.sdza{
width: 105px;
height: 80px;
text-align: center;
font-size: 13px;
font-weight: bold;
color: #fff;
margin-bottom: 10px;
}
.box {
width: 25%;
text-align: center;
margin-bottom: 20rpx;
.box_text {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #090909;
}
image {
width: 45px;
height: 45px;
}
}
.btn {
border: 1rpx solid #999999;
color: #999999;
border-radius: 39rpx;
padding: 10rpx 25rpx;
}
.btn1 {
border: 1rpx solid #096f4b;
color: #096f4b;
border-radius: 39rpx;
padding: 10rpx 25rpx;
}
.xinshou {
background: #FFF1D7;
color: #EDBD6B;
display: inline-flex;
border-radius: 12rpx;
padding: 5rpx 12rpx;
font-size: 24rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
margin-left: 10rpx;
}
</style>