index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <template>
  2. <view class="content">
  3. <view class="bg"></view>
  4. <view class="cont-box">
  5. <view class="user-cont" @click="navTo('/pages/user/userInfo')">
  6. <view class="user-box" v-if="user!=null">
  7. <view class="left">
  8. <image src="../../static/images/default.png"></image>
  9. <view class="user" >
  10. <view class="username">{{user.nickName}}</view>
  11. <view class="account">{{user.deptName}}</view>
  12. </view>
  13. </view>
  14. <view class="right" >
  15. <image src="../../static/images/right_arrow.png"></image>
  16. </view>
  17. </view>
  18. <view class="company" v-if="user!=null">
  19. <image src="../../static/images/icon_comp.png"></image>
  20. <view class="name">{{user.deptName}}</view>
  21. </view>
  22. </view>
  23. <view class="menu-box">
  24. <view class="title-box">
  25. <image class="icon" src="../../static/manergevip/chang.png"></image>
  26. <view class="title">常用功能</view>
  27. </view>
  28. <view class="line"></view>
  29. <view class="menus">
  30. <!-- <view class="menu-item" @click="navTo('/pages/user/ai/index')">
  31. <image src="../../static/manergevip/serve.png"></image>
  32. <view class="m-name">AI客服</view>
  33. </view> -->
  34. <view class="menu-item" @click="navTo('/pages/user/qwSop/sop')">
  35. <image src="../../static/manergevip/sop.png"></image>
  36. <view class="m-name">群发SOP</view>
  37. </view>
  38. <!-- <view class="menu-item" @click="navTo('/pages/user/courseSop/sop')">
  39. <image src="../../static/images/menu_info.png"></image>
  40. <view class="m-name">课程群发SOP</view>
  41. </view> -->
  42. <view class="menu-item" @click="navTo('/pages/courseManage/index')">
  43. <image src="../../static/images/menu_info.png"></image>
  44. <view class="m-name">看课管理</view>
  45. </view>
  46. <view class="menu-item" @click="navTo('/pages/user/users/users')">
  47. <image src="../../static/manergevip/qudao.png"></image>
  48. <view class="m-name">渠道管理</view>
  49. </view>
  50. <view class="menu-item" @click="handleShare">
  51. <image src="../../static/manergevip/share-manage.png"></image>
  52. <view class="m-name">渠道邀请</view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- <view class="menu-box">
  57. <view class="title-box">
  58. <image class="icon" src="../../static/images/office.png"></image>
  59. <view class="title">客户管理</view>
  60. </view>
  61. <view class="line"></view>
  62. <view class="menus">
  63. <view class="menu-item" @click="navTo('/pages/user/crm/lineCustomer')">
  64. <image src="../../static/images/menu_info.png"></image>
  65. <view class="m-name">线索客户</view>
  66. </view>
  67. <view class="menu-item" @click="navTo('/pages/user/crm/myCustomer')">
  68. <image src="../../static/images/menu_info.png"></image>
  69. <view class="m-name">我的客户</view>
  70. </view>
  71. <view class="menu-item" @click="navTo('/pages/user/crm/importWxUser')">
  72. <image src="../../static/images/menu_info.png"></image>
  73. <view class="m-name">导入微信用户</view>
  74. </view>
  75. </view>
  76. </view> -->
  77. <!-- <view class="menu-box">
  78. <view class="title-box">
  79. <image class="icon" src="../../static/images/office.png"></image>
  80. <view class="title">常用工具</view>
  81. </view>
  82. <view class="line"></view>
  83. <view class="menus">
  84. <view class="menu-item" >
  85. <image src="../../static/images/menu_info.png"></image>
  86. <view class="m-name">制单</view>
  87. </view>
  88. <view class="menu-item" >
  89. <image src="../../static/images/menu_info.png"></image>
  90. <view class="m-name">微信收款</view>
  91. </view>
  92. <view class="menu-item" >
  93. <image src="../../static/images/menu_info.png"></image>
  94. <view class="m-name">支付宝收款</view>
  95. </view>
  96. <view class="menu-item" >
  97. <image src="../../static/images/menu_info.png"></image>
  98. <view class="m-name">订单管理</view>
  99. </view>
  100. <view class="menu-item" >
  101. <image src="../../static/images/menu_info.png"></image>
  102. <view class="m-name">商品套餐包</view>
  103. </view>
  104. <view class="menu-item" >
  105. <image src="../../static/images/menu_info.png"></image>
  106. <view class="m-name">优惠券</view>
  107. </view>
  108. </view>
  109. </view> -->
  110. <view class="menu-box">
  111. <view class="title-box">
  112. <image class="icon" src="../../static/manergevip/qita.png"></image>
  113. <view class="title">其它工具</view>
  114. </view>
  115. <view class="line"></view>
  116. <!-- <view class="menus">
  117. <view class="menu-item" @click="navTo('/pages/user/users/users')">
  118. <image src="../../static/images/menu_info.png"></image>
  119. <view class="m-name">通讯录</view>
  120. </view>
  121. </view> -->
  122. <view class="menus">
  123. <view class="menu-item" @click="navTo('/pages/user/about')">
  124. <image src="../../static/manergevip/about.png"></image>
  125. <view class="m-name">关于我们</view>
  126. </view>
  127. <view class="menu-item" @click="navTo('/pages/user/editUser')">
  128. <image src="../../static/manergevip/setup.png"></image>
  129. <view class="m-name">设置</view>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- <view class="menu-box1">
  134. <view class="menu-item" @click="navTo('/pages/user/about')">
  135. <view class="left">
  136. <image src="../../static/images/icon_about_us.png"></image>
  137. <view class="label">关于我们</view>
  138. </view>
  139. <view class="right">
  140. <image src="../../static/images/right_arrow.png"></image>
  141. </view>
  142. </view>
  143. <view class="menu-item" @click="navTo('/pages/user/editUser')">
  144. <view class="left">
  145. <image src="../../static/images/icon_set.png"></image>
  146. <view class="label">设置</view>
  147. </view>
  148. <view class="right">
  149. <image src="../../static/images/right_arrow.png"></image>
  150. </view>
  151. </view>
  152. </view> -->
  153. <view class="btn-box" >
  154. <view class="sub-btn" @click="showLogout()">退出登录</view>
  155. </view>
  156. </view>
  157. <!-- 分享弹窗 -->
  158. <u-popup :show="showShare" :closeOnClickOverlay="true" :round='20' @close="closeShare" @open="openShare">
  159. <view class="sharePop x-ac">
  160. <view class="sharePop-item y-f" @click="shareimg">
  161. <image src="@/static/images/card_icon.png" mode="aspectFill"
  162. style="width: 80rpx; height: 80rpx;margin-top: 20rpx;"></image>
  163. <view style="font-weight: bold;margin-bottom: 4px;">生成卡片</view>
  164. <view style="font-size: 12px;color: #888;">指导分享轻松转发</view>
  165. </view>
  166. <view class="sharePop-item y-f" @click="buildimg">
  167. <image src="@/static/images/poster_icon.png" mode="aspectFill"></image>
  168. <view style="font-weight: bold;margin-bottom: 4px;">生成海报</view>
  169. <view style="font-size: 12px;color: #888;">保存海报美观宣传</view>
  170. </view>
  171. <view class="sharePop-item y-f" @click="setTimeShow=true">
  172. <image src="@/static/images/link_icon.png" mode="aspectFill"></image>
  173. <view style="font-weight: bold;margin-bottom: 4px;">复制链接</view>
  174. <view style="font-size: 12px;color: #888;">生成链接一键复制</view>
  175. </view>
  176. </view>
  177. </u-popup>
  178. <!-- 长按保存海报 -->
  179. <u-popup :show="setImg" @close="closeimg" :round="12">
  180. <view class="w100 h500">
  181. <image :src="codeLink.url" class="codeimg w660" mode="widthFix"></image>
  182. </view>
  183. <view class="justify-around mtb40">
  184. <view class="column justify-center align-center" @click="downimg">
  185. <image src='@/static/image/downicon.png' class="w80 h80"></image>
  186. <view class="mt10">长按图片保存</view>
  187. </view>
  188. </view>
  189. </u-popup>
  190. <!-- 设置链接有效时长弹窗 -->
  191. <u-modal :show="setTimeShow" content='content' class="model" @confirm="confirmTime">
  192. <view class="setTimebox">
  193. <view class="timetip">不传默认以系统参数为准</view>
  194. <view class="x-f">
  195. <text style="margin-right: 20px;">链接有效时长(分钟)</text>
  196. <u-input fontSize="14px" placeholder="链接有效时长" border="none" v-model="time" maxlength="5"></u-input>
  197. </view>
  198. </view>
  199. </u-modal>
  200. <!-- 卡片分享引导 -->
  201. <u-overlay :show="showzhidao" @click="showzhidao = false" style="z-index: 9999;">
  202. <view class="point-box">
  203. <view class="imgshe" >
  204. <image src='@/static/image/point.png' class="w300 h300"></image>
  205. </view>
  206. <view class="column colorf fs32 xu-box fs40
  207. align-center justify-center">
  208. <view class="justify-center">点击右上角
  209. <image src="@/static/image/wxmore.png"
  210. class="w50 h50 mlr10"></image>
  211. </view>
  212. <view class="mt20">选择 “转发给朋友”</view>
  213. <view style="color: #cbcbcb;" class="fs28 mt40">点击任意位置关闭弹窗</view>
  214. </view>
  215. </view>
  216. </u-overlay>
  217. <u-modal :show="show" title="提示" :showCancelButton="true" @cancel="hideLogout()" @confirm="logout()" content='确认退出吗?'></u-modal>
  218. </view>
  219. </template>
  220. <script>
  221. import { getCompanyUser } from '@/api/user.js'
  222. import {
  223. sharecourselink,
  224. buildCode,
  225. getSDK,
  226. becomeVipuser,
  227. becomeVipuserImg
  228. } from '@/api/courseManage'
  229. import wx from 'weixin-js-sdk'
  230. export default {
  231. data() {
  232. return {
  233. show:false,
  234. user:null,
  235. showShare:false,
  236. copyLinks:'',
  237. setTimeShow:false,
  238. time:'',
  239. setImg:false,
  240. codeLink:'',
  241. showzhidao:false,
  242. imgs:'https://h5.wxcourse.cdwjyyh.com/icon/20250214100002.png'
  243. }
  244. },
  245. onShow() {
  246. this.getCompanyUser()
  247. },
  248. methods: {
  249. // 获取jssdk
  250. getjssdklist() {
  251. const param = {
  252. url: window.location.href.split('#')[0] // 注意去除 hash
  253. }
  254. getSDK(param).then(res => {
  255. wx.config({
  256. debug: false,
  257. appId: res.data.appId, // 必填,公众号的唯一标识
  258. timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  259. nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
  260. signature: res.data.signature, // 必填,签名
  261. jsApiList: ["updateAppMessageShareData", "onMenuShareAppMessage", ] // 必填,需要使用的JS接口列表
  262. });
  263. })
  264. },
  265. shareimg(){
  266. //分享好友
  267. let self = this
  268. // 配置--你到时候把配置全局 --就是这些东西 调接口拿
  269. wx.ready(function() { //需在用户可能点击分享按钮前就先调用
  270. wx.updateAppMessageShareData({
  271. title: self.user.userName+"邀请您成为群管", // 分享标题
  272. desc: self.user.deptName, // 分享描述
  273. link:self.copyLinks,
  274. imgUrl: self.codeLink.url ||self.imgs, // 分享图标
  275. success: function(res) {
  276. self.showzhidao=true
  277. self.setImg=false
  278. self.showShare=false
  279. // 设置成功
  280. uni.showToast({
  281. title: '卡片已生成',
  282. icon: 'none',
  283. duration: 1000
  284. });
  285. },
  286. fail: function(err) {
  287. console.log(err);
  288. uni.showToast({
  289. title: '卡片生成失败,请重试',
  290. icon: 'none',
  291. duration: 2000
  292. })
  293. }
  294. })
  295. });
  296. },
  297. handleShare() {
  298. this.showShare = true
  299. this.getjssdklist()
  300. this.getlink('preload'); // 提前加载链接
  301. },
  302. //设置链接时长
  303. confirmTime() {
  304. this.setTimeShow = false
  305. this.showShare = false
  306. this.getlink('preload')
  307. this.copyLink()
  308. },
  309. closeimg(){
  310. this.setImg=false
  311. this.showShare=false
  312. },
  313. buildimg() {
  314. //生成海报
  315. this.setImg=!this.setImg
  316. this.getshareimg()
  317. },
  318. getshareimg(){
  319. //生成海报
  320. uni.showLoading({
  321. title: '正在生成中...'
  322. })
  323. const param={
  324. code:'',
  325. companyId:this.user.companyId,
  326. companyUserId:this.user.userId
  327. }
  328. becomeVipuserImg(param).then(res=>{
  329. if(res.code==200){
  330. this.codeLink=res.data
  331. this.getlink()
  332. console.log(res)
  333. }else{
  334. uni.showToast({
  335. title: res.msg,
  336. icon: 'none',
  337. duration: 2000
  338. });
  339. }
  340. })
  341. },
  342. getlink(type){
  343. //生成链接
  344. const param={
  345. companyId:this.user.companyId,
  346. companyUserId:this.user.userId,
  347. tagids:'',
  348. limitTime:this.time
  349. }
  350. becomeVipuser(param).then(res=>{
  351. if(res.code==200){
  352. this.copyLinks=res.data
  353. if (this.copyLinks.startsWith('http://')) {
  354. this.copyLinks = this.copyLinks.replace('http://', 'https://');
  355. }
  356. console.log(this.copyLinks,'分享链接')
  357. }else{
  358. }
  359. })
  360. },
  361. copyLink(){
  362. setTimeout(() => {
  363. uni.setClipboardData({
  364. data: this.copyLinks,
  365. success: () => {
  366. uni.showToast({
  367. title: '链接已复制',
  368. icon: 'none',
  369. duration: 2000
  370. });
  371. // this.setTimeShow = !this.setTimeShow
  372. this.showShare = false
  373. },
  374. fail: () => {
  375. uni.showToast({
  376. title: '复制失败',
  377. icon: 'none'
  378. });
  379. }
  380. });
  381. }, 100)
  382. },
  383. closeShare() {
  384. this.showShare = false
  385. // console.log('open');
  386. },
  387. openShare() {
  388. // this.showShare = false
  389. // console.log('close');
  390. },
  391. showLogout(){
  392. this.show=true;
  393. },
  394. hideLogout(){
  395. this.show=false;
  396. },
  397. logout(){
  398. this.utils.logout();
  399. uni.$emit('closeWebSocket');
  400. uni.reLaunch({
  401. url: '/pages/auth/login',
  402. animationType: 'pop-in',
  403. animationDuration: 100
  404. })
  405. },
  406. navTo(url){
  407. console.log(url)
  408. uni.navigateTo({
  409. url
  410. })
  411. },
  412. getCompanyUser(){
  413. var data = {
  414. };
  415. getCompanyUser(data).then(res => {
  416. if(res.code==200){
  417. this.user=res.data;
  418. console.log(this.user)
  419. }else{
  420. }
  421. });
  422. },
  423. }
  424. }
  425. </script>
  426. <style lang="scss">
  427. page{
  428. height: 100%;
  429. background: #f6f6f6;
  430. }
  431. </style>
  432. <style scoped lang="scss">
  433. .imgshe{
  434. display: flex;
  435. flex-direction: row-reverse
  436. }
  437. .point-box{
  438. height: 100%;
  439. width: 100%;
  440. .xu-box{
  441. border: #f5f5f5 4rpx dashed;
  442. padding: 20rpx 20rpx;
  443. }
  444. }
  445. .setTimebox {
  446. font-family: PingFang SC, PingFang SC;
  447. font-weight: 400;
  448. font-size: 14px;
  449. width: fit-content;
  450. height: fit-content;
  451. }
  452. .codeimg {
  453. position: absolute;
  454. z-index: 9999;
  455. left: 40rpx;
  456. top: 40rpx;
  457. }
  458. .timetip {
  459. font-family: PingFang SC, PingFang SC;
  460. font-weight: 400;
  461. font-size: 14px;
  462. color: #2979ff;
  463. text-align: center;
  464. margin-bottom: 5px;
  465. }
  466. .content{
  467. position: relative;
  468. height: 100%;
  469. width: 100%;
  470. .bg{
  471. width: 100%;
  472. height: 200upx;
  473. position: absolute;
  474. top: 0;
  475. left: 0;
  476. z-index: 1;
  477. background: linear-gradient(to bottom,#115296, #b4d8ff);
  478. // border-radius: 0rpx 0rpx 60rpx 60rpx;
  479. }
  480. .cont-box{
  481. position: relative;
  482. z-index: 2;
  483. padding: 30rpx 30rpx 200rpx;
  484. .user-cont{
  485. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  486. padding: 30rpx;
  487. background-color: #fff;
  488. border-radius: 15rpx;
  489. .user-box{
  490. width: 100%;
  491. display: flex;
  492. align-items: center;
  493. justify-content: flex-start;
  494. .left{
  495. flex:1;
  496. display: flex;
  497. align-items: center;
  498. justify-content: flex-start;
  499. image{
  500. border-radius: 50%;
  501. width:120rpx;
  502. height:120rpx;
  503. }
  504. .user{
  505. margin-left: 20rpx;
  506. width: calc(100% - 140rpx);
  507. display: flex;
  508. flex-direction: column;
  509. align-items: flex-start;
  510. justify-content: flex-start;
  511. .username{
  512. font-size: 38rpx;
  513. font-family: PingFang SC;
  514. color: #111;
  515. font-weight: bold;
  516. }
  517. .account{
  518. padding: 5rpx 20rpx;
  519. border-radius: 30rpx;
  520. background-color: #115296;
  521. margin-top: 20rpx;
  522. font-size: 24rpx;
  523. font-family: PingFang SC;
  524. color: #fff;
  525. }
  526. }
  527. }
  528. .right{
  529. image{
  530. width: 15rpx;
  531. height:30rpx;
  532. }
  533. }
  534. }
  535. .company{
  536. margin-top: 30rpx;
  537. display: flex;
  538. align-items: center;
  539. justify-content: flex-start;
  540. image{
  541. width:40rpx;
  542. height:40rpx;
  543. }
  544. .name{
  545. margin-left: 15rpx;
  546. font-size: 28rpx;
  547. color: #111;
  548. }
  549. }
  550. }
  551. .menu-box{
  552. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  553. width: 100%;
  554. margin-top: 30rpx;
  555. padding: 30rpx;
  556. background-color: #fff;
  557. border-radius: 15rpx;
  558. .title-box{
  559. display: flex;
  560. align-items: center;
  561. justify-content: flex-start;
  562. .icon{
  563. width: 40rpx;
  564. height:40rpx;
  565. }
  566. .title{
  567. margin-left: 10rpx;
  568. font-size: 28rpx;
  569. font-family: PingFang SC;
  570. color: #111;
  571. }
  572. }
  573. .line{
  574. margin-top: 15rpx;
  575. height: 0.5rpx;
  576. width: 100%;
  577. background-color: #efefef;
  578. }
  579. .menus{
  580. margin-top: 30rpx;
  581. display: flex;
  582. align-items: center;
  583. justify-content: flex-start;
  584. flex-wrap: wrap;
  585. }
  586. .menu-item{
  587. display: flex;
  588. flex-direction: column;
  589. align-items: center;
  590. justify-content: center;
  591. width: 25%;
  592. margin-bottom: 20rpx;
  593. image{
  594. width:60rpx;
  595. height:60rpx;
  596. }
  597. .m-name{
  598. margin-top: 10rpx;
  599. font-size: 24rpx;
  600. font-family: PingFang SC;
  601. color: #111;
  602. }
  603. }
  604. }
  605. .menu-box1{
  606. width: 100%;
  607. margin-top: 30rpx;
  608. padding: 0rpx 30rpx;
  609. background-color: #fff;
  610. border-radius: 15rpx;
  611. .menu-item{
  612. width: 100%;
  613. display: flex;
  614. align-items: center;
  615. justify-content: flex-start;
  616. line-height: 100rpx;
  617. .left{
  618. flex:1;
  619. display: flex;
  620. align-items: center;
  621. justify-content: flex-start;
  622. image{
  623. width: 30rpx;
  624. height:30rpx;
  625. }
  626. .label{
  627. margin-left: 10rpx;
  628. }
  629. }
  630. .right{
  631. image{
  632. width: 10rpx;
  633. height:15rpx;
  634. }
  635. }
  636. }
  637. }
  638. }
  639. }
  640. .btn-box{
  641. margin: 30rpx 0rpx 30rpx;
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. .sub-btn{
  646. // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  647. border: 1rpx solid #f8f8f8;
  648. background: #FFFFFF;
  649. width: 100%;
  650. height: 88upx;
  651. line-height: 88upx;
  652. text-align: center;
  653. font-size: 30upx;
  654. font-family: PingFang SC;
  655. color: #111;
  656. }
  657. }
  658. .sharePop {
  659. background-color: #fff;
  660. padding: 50px 0;
  661. padding-bottom: 100px;
  662. border-radius: 20px 20px 0 0;
  663. &-item {
  664. padding: 0 10px;
  665. box-sizing: border-box;
  666. font-family: PingFang SC, PingFang SC;
  667. font-weight: 400;
  668. font-size: 14px;
  669. display: inline-flex !important;
  670. image {
  671. height: 48px;
  672. width: 48px;
  673. margin-bottom: 10px;
  674. }
  675. }
  676. }
  677. </style>