123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676 |
- <template>
- <view class="content container">
- <!-- #ifdef MP-WEIXIN -->
- <view class="h110"></view>
- <!-- #endif -->
- <view class="bg"></view>
- <view class="cont-box">
- <view class="user-cont" @click="navTo('/pages/user/userInfo')">
- <view class="user-box" v-if="user!=null">
- <view class="left">
- <u-avatar :src="user.avatar" size="50"></u-avatar>
- <!-- <image class="img" :src="user.avatar" mode="aspectFill"></image> -->
- <view class="user" >
- <view class="username">{{user.nickName}}</view>
- <view class="account">{{user.email}}</view>
- </view>
- </view>
- <view class="right" >
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/right_arrow.png"></image>
- </view>
- </view>
- <view class="company" v-if="user!=null">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/icon_comp.png"></image>
- <view class="name">{{user.createBy||'暂无数据'}}</view>
- </view>
- </view>
-
- <view class="menu-box" style="margin-top: -20rpx;">
- <view class="title-box">
- <image class="icon" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/chang.png"></image>
- <view class="title">常用功能</view>
- </view>
- <view class="line"></view>
- <view class="menus">
- <view class="menu-item" @click="navTo('/pages/courseManage/manage/manageIndex')">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/menu_info.png"></image>
- <view class="m-name">销售管理</view>
- </view>
- <view class="menu-item" @click="navTo('/pages/user/users/users')">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/qudao.png"></image>
- <view class="m-name">审核销售</view>
- </view>
- <view class="menu-item" @click="handleShare">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/share-manage.png"></image>
- <view class="m-name">邀请销售</view>
- </view>
- <view class="menu-item" @click="navTo('/pages/courseManage/manage/lableSetup')">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/changeLable.png"></image>
- <view class="m-name">标签设置</view>
- </view>
- </view>
- </view>
- <view class="menu-box">
- <view class="title-box">
- <image class="icon" src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/qita.png"></image>
- <view class="title">其它工具</view>
- </view>
- <view class="line"></view>
- <view class="menus">
- <view class="menu-item" @click="navTo('/pages/user/about')">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/about.png"></image>
- <view class="m-name">关于我们</view>
- </view>
- <view class="menu-item" @click="navTo('/pages/user/editUser')">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/manergevip/setup.png"></image>
- <view class="m-name">设置</view>
- </view>
- </view>
-
- </view>
- <view class="btn-box" >
- <view class="sub-btn" @click="showLogout()">退出登录</view>
- </view>
- </view>
- <!-- 分享弹窗 -->
- <u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" @open="openShare">
- <view class="sharePop x-ac">
- <!--#ifdef MP-WEIXIN-->
- <view class="sharePop-item y-f" @click="shareimg">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/card_icon.png" mode="aspectFill"
- style="width: 80rpx; height: 80rpx;margin-top: 20rpx;"></image>
- <view style="font-weight: bold;margin-bottom: 4px;">生成卡片</view>
- <view style="font-size: 12px;color: #888;">指导分享轻松转发</view>
- <button open-type="share" class="share">分享课程</button>
- </view>
- <!--#endif-->
- <!-- <view class="sharePop-item y-f" @click="buildimg">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/poster_icon.png" mode="aspectFill"></image>
- <view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
- <view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
- </view> -->
- <!--#ifdef H5-->
- <view class="sharePop-item y-f" @click="shareSale">
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/images/link_icon.png" mode="aspectFill"></image>
- <view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
- <view style="font-size: 12px;color: #888;">生成链接一键复制</view>
- </view>
- <!--#endif-->
- </view>
- </u-popup>
- <!-- 长按保存海报 -->
- <u-popup :show="setImg" @close="closeimg" :round="12">
- <view class="w100 h500">
- <image :src="codeLink.url" class="codeimg w660" mode="widthFix"></image>
- </view>
- <view class="justify-around mtb40">
- <view class="column justify-center align-center" @click="downimg">
- <image src='https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/image/downicon.png' class="w80 h80"></image>
- <view class="mt10">长按图片保存</view>
- </view>
- </view>
- </u-popup>
- <!-- 设置链接有效时长弹窗 -->
- <!-- <u-modal :show="setTimeShow" content='content' class="model" @confirm="confirmTime">
- <view class="setTimebox">
- <view class="timetip">不传默认以系统参数为准</view>
- <view class="x-f">
- <text style="margin-right: 20px;">链接有效时长(分钟)</text>
- <u-input fontSize="14px" placeholder="链接有效时长" border="none" v-model="time" maxlength="5"></u-input>
- </view>
- </view>
- </u-modal> -->
- <!-- 卡片分享引导 -->
- <u-overlay :show="showzhidao" @click="showzhidao = false" style="z-index: 9999;">
- <view class="point-box">
- <view class="imgshe" >
- <image src='https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/image/point.png' class="w300 h300"></image>
- </view>
- <view class="column colorf fs32 xu-box fs40
- align-center justify-center">
- <view class="justify-center">点击右上角
- <image src="https://fbylive.obs.cn-southwest-2.myhuaweicloud.com/app/image/wxmore.png"
- class="w50 h50 mlr10"></image>
- </view>
- <view class="mt20">选择 “转发给朋友”</view>
- <view style="color: #cbcbcb;" class="fs28 mt40">点击任意位置关闭弹窗</view>
- </view>
- </view>
- </u-overlay>
- <u-modal :show="show" title="提示" :showCancelButton="true" @cancel="hideLogout()" @confirm="logout()" content='确认退出吗?'></u-modal>
- </view>
- </template>
- <script>
-
- import { getCompanyUser } from '@/api/user.js'
- import {
- sharecourselink,
- buildCode,
- getSDK,
- becomeVipuser,
- becomeVipuserImg
- } from '@/api/courseManage'
- import wx from 'weixin-js-sdk'
- export default {
- data() {
- return {
- show:false,
- user:null,
- showShare:false,
- copyLinks:'',
- setTimeShow:false,
- time:'',
- setImg:false,
- codeLink:'',
- showzhidao:false,
- imgs:this.$store.state.imgpath+'/app/image/logo.png'
- }
- },
- onShow() {
- this.getCompanyUsers()
- },
- onShareAppMessage() {
- return {
- title: this.$store.state.logoname+'小程序的'+this.user.nickName+'邀请您成为销售', // 分享卡片标题
- path: '/pages/courseManage/course/becomeSale?id='+this.user.companyId, // 目标页面路径
- // 携带参数:将当前页面的数据拼接到路径中
- imageUrl: this.user.avatar || this.imgs, // 分享卡片封面图(可选)
- success: (res) => {
- console.log("分享成功", res);
- },
- fail: (err) => {
- console.log("分享失败", err);
- },
- }
- },
- mounted() {
- },
- methods: {
- shareSale(){
- const fullUrl = location.href;
- const Path = fullUrl.split('/#')[0] || '';
- setTimeout(() => {
- uni.setClipboardData({
- data: Path+'/#/pages/courseManage/course/becomeSale?id='+this.user.companyId,
- success: () => {
- uni.showToast({
- title: '邀请链接已复制',
- icon: 'none',
- duration: 2000
- });
- // this.setTimeShow = !this.setTimeShow
- this.showShare = false
- // console.log(res)
- },
- fail: () => {
- uni.showToast({
- title: '复制失败',
- icon: 'none'
- });
- }
- });
- }, 100)
- },
- // 获取jssdk
- getjssdklist() {
- const param = {
- url: window.location.href.split('#')[0] // 注意去除 hash
- }
- getSDK(param).then(res => {
- wx.config({
- debug: false,
- appId: res.data.appId, // 必填,公众号的唯一标识
- timestamp: res.data.timestamp, // 必填,生成签名的时间戳
- nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
- signature: res.data.signature, // 必填,签名
- jsApiList: ["updateAppMessageShareData", "onMenuShareAppMessage", ] // 必填,需要使用的JS接口列表
- });
- })
- },
- shareimg(){
- //分享好友
- let self = this
- // 配置--配置全局
- wx.ready(function() { //需在用户可能点击分享按钮前就先调用
- wx.updateAppMessageShareData({
- title: self.user.userName+"邀请您成为群管", // 分享标题
- desc: self.user.deptName, // 分享描述
- link:self.copyLinks,
- imgUrl: self.codeLink.url ||self.imgs, // 分享图标
- success: function(res) {
- self.showzhidao=true
- self.setImg=false
- self.showShare=false
- // 设置成功
- uni.showToast({
- title: '卡片已生成',
- icon: 'none',
- duration: 1000
- });
- },
- fail: function(err) {
- // console.log(err);
- uni.showToast({
- title: '卡片生成失败,请重试',
- icon: 'none',
- duration: 2000
- })
- }
- })
- });
- },
- handleShare() {
- this.showShare = true
- // this.getjssdklist()
- // this.getlink('preload'); // 提前加载链接
- },
- //设置链接时长
- confirmTime() {
- this.setTimeShow = false
- this.showShare = false
- this.getlink('preload')
- this.copyLink()
- },
- closeimg(){
- this.setImg=false
- this.showShare=false
- },
- buildimg() {
- //生成海报
- this.setImg=!this.setImg
- this.getshareimg()
- },
- getshareimg(){
- //生成海报
- uni.showLoading({
- title: '正在生成中...'
- })
- const param={
- code:'',
- companyId:this.user.companyId,
- companyUserId:this.user.userId
- }
- becomeVipuserImg(param).then(res=>{
- if(res.code==200){
- this.codeLink=res.data
- this.getlink()
- // console.log(res)
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none',
- duration: 2000
- });
- }
- })
- },
- getlink(type){
- //生成链接
- const param={
- companyId:this.user.companyId,
- companyUserId:this.user.userId,
- tagids:'',
- limitTime:this.time
- }
- becomeVipuser(param).then(res=>{
- if(res.code==200){
- this.copyLinks=res.data
- if (this.copyLinks.startsWith('http://')) {
- this.copyLinks = this.copyLinks.replace('http://', 'https://');
- }
- // console.log(this.copyLinks,'分享链接')
- }else{
- }
- })
- },
- copyLink(){
- console.log(this.showShare)
- setTimeout(() => {
- uni.setClipboardData({
- data: this.copyLinks,
- success: () => {
- uni.showToast({
- title: '链接已复制',
- icon: 'none',
- duration: 2000
- });
- // this.setTimeShow = !this.setTimeShow
- this.showShare = false
- },
- fail: () => {
- uni.showToast({
- title: '复制失败',
- icon: 'none'
- });
- }
- });
- }, 100)
- },
- closeShare() {
- this.showShare = false
- },
- openShare() {
- // this.showShare = false
- },
- showLogout(){
- this.show=true;
- },
- hideLogout(){
- this.show=false;
- },
- logout(){
- uni.removeStorageSync('AppToken')
- // 条件编译判断平台,设置不同登录页路径
- let loginPage = '';
- // #ifdef H5
- loginPage = '/pages/auth/login';
- // #endif
- // #ifdef MP-WEIXIN
- loginPage = '/pages/auth/login';
- // #endif
- uni.navigateTo({
- url: loginPage,
- })
- },
- navTo(url){
- uni.navigateTo({
- url
- })
- },
- getCompanyUsers(){
- var data = {
- };
- getCompanyUser(data).then(res => {
- if(res.code==200){
- console.log(res)
- this.user=res.user;
- if(this.user.avatar){
- this.user.avatar=uni.getStorageSync('requestPath')+res.user.avatar
- }else{
- this.user.avatar=='';
- }
- }else{
-
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- page{
- height: 100%;
- background: #f6f6f6;
- }
- </style>
- <style scoped lang="scss">
- .share{
- display: inline-block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- }
- .container {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #222222;
- height: 100%;
- overflow: hidden;
- }
- .imgshe{
- display: flex;
- flex-direction: row-reverse
- }
- .point-box{
- height: 100%;
- width: 100%;
- .xu-box{
- border: #f5f5f5 4rpx dashed;
- padding: 20rpx 20rpx;
- }
- }
- .setTimebox {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- width: fit-content;
- height: fit-content;
- }
- .codeimg {
- position: absolute;
- z-index: 9999;
- left: 40rpx;
- top: 40rpx;
- }
- .timetip {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #2979ff;
- text-align: center;
- margin-bottom: 5px;
- }
- .content{
- position: relative;
- height: 100%;
- width: 100%;
- .bg{
- width: 100%;
- height: 360upx;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1;
- background: linear-gradient(to bottom, #dae9ff, #e1e1fd);
- // background: linear-gradient(to bottom, #8bbfff, #1773ff);
- border-radius: 0rpx 0rpx 60rpx 60rpx;
- }
- .cont-box{
- position: relative;
- z-index: 2;
- padding: 30rpx 30rpx 200rpx;
- .user-cont{
- // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
- padding: 30rpx;
- // background-color: #fff;
- border-radius: 15rpx;
- .user-box{
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .left{
- flex:1;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- image{
- border-radius: 50%;
- width:120rpx;
- height:120rpx;
- }
- .user{
- margin-left: 20rpx;
- width: calc(100% - 140rpx);
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: flex-start;
- .username{
- font-size: 38rpx;
- font-family: PingFang SC;
- color: #111;
- font-weight: bold;
- }
- .account{
- padding: 5rpx 0rpx;
- border-radius: 30rpx;
- margin-top: 20rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- color: #515151;
- }
- }
- }
- .right{
- image{
- width: 15rpx;
- height:30rpx;
- }
-
- }
-
- }
- .company{
- margin-top: 30rpx;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- image{
- width:40rpx;
- height:40rpx;
- }
- .name{
- margin-left: 15rpx;
- font-size: 28rpx;
- color: #111;
- }
- }
- }
-
- .menu-box{
- box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
- width: 100%;
- margin-top: 30rpx;
- padding: 30rpx;
- background-color: #fff;
- border-radius: 15rpx;
- .title-box{
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .icon{
- width: 40rpx;
- height:40rpx;
- }
- .title{
- margin-left: 10rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- color: #111;
- }
- }
- .line{
- margin-top: 15rpx;
- height: 0.5rpx;
- width: 100%;
- background-color: #efefef;
- }
- .menus{
- margin-top: 30rpx;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- flex-wrap: wrap;
- }
- .menu-item{
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 25%;
- margin-bottom: 20rpx;
- image{
- width:60rpx;
- height:60rpx;
- }
- .m-name{
- margin-top: 10rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- color: #111;
- }
- }
-
- }
- .menu-box1{
- width: 100%;
- margin-top: 30rpx;
- padding: 0rpx 30rpx;
- background-color: #fff;
- border-radius: 15rpx;
- .menu-item{
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- line-height: 100rpx;
- .left{
- flex:1;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- image{
- width: 30rpx;
- height:30rpx;
- }
- .label{
- margin-left: 10rpx;
- }
- }
- .right{
- image{
- width: 10rpx;
- height:15rpx;
- }
-
- }
- }
- }
- }
- }
- .btn-box{
- margin: 30rpx 0rpx 30rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- .sub-btn{
- // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
- border: 1rpx solid #f8f8f8;
- background: #FFFFFF;
- width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 30upx;
- font-family: PingFang SC;
- color: #2979ff;
- }
- }
- .sharePop {
- background-color: #fff;
- padding: 20px 0;
- border-radius: 20px 20px 0 0;
-
- &-item {
- padding: 0 10px;
- box-sizing: border-box;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- display: inline-flex !important;
-
- image {
- height: 48px;
- width: 48px;
- margin-bottom: 10px;
- }
- }
- }
- </style>
|