index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <template>
  2. <view class="top-cont">
  3. <image class="bg" src="https://user.test.ylrztop.com/images/sales_management_top_bg.png" mode="widthFix"></image>
  4. <view :style="{height: statusBarHeight,background: bgColor }"></view>
  5. <u-navbar title="销售管理" titleStyle="font-weight: 500;" @rightClick="rightClick" :autoBack="true"
  6. :bg-color="bgColor">
  7. </u-navbar>
  8. <view class="content">
  9. <!-- <view class="user-info">
  10. <view class="left">
  11. <view class="name-phone">
  12. <view class="name">{{user.nickName}}</view>
  13. <view class="phone" v-if="user!=null">{{utils.parsePhone(user.phonenumber)}}</view>
  14. </view>
  15. </view>
  16. <view class="msg-box" >
  17. {{user.deptName}}
  18. </view>
  19. </view> -->
  20. <!-- 常用工具 -->
  21. <!-- <view class="used-tools">
  22. <view class="title">常用工具</view>
  23. <view class="tools-list">
  24. <view class="item" @click="toCreateOrder()">
  25. <image src="../static/images/order.png" mode=""></image>
  26. <text class="text">商品制单</text>
  27. </view>
  28. <view class="item" @click="toCreateCoupon()">
  29. <image src="../static/images/icon_coupon.png" mode=""></image>
  30. <text class="text">制单优惠券</text>
  31. </view>
  32. <view class="item" @click="toPay()">
  33. <image src="../static/images/money.png" mode=""></image>
  34. <text class="text">微信收款</text>
  35. </view>
  36. <view class="item" @click="alipay()">
  37. <image src="../static/images/money.png" mode=""></image>
  38. <text class="text">支付宝收款</text>
  39. </view>
  40. <view class="item" @click="toOrder()">
  41. <image src="../static/images/order.png" mode=""></image>
  42. <text class="text">我的订单</text>
  43. </view>
  44. <view class="item" @click="toPackage()">
  45. <image src="../static/images/package.png" mode=""></image>
  46. <text class="text">商品套餐</text>
  47. </view>
  48. <view class="item" @click="toCoupon()">
  49. <image src="../static/images/icon_coupon.png" mode=""></image>
  50. <text class="text">套餐优惠券</text>
  51. </view>
  52. </view>
  53. </view> -->
  54. <view class="user-info2">
  55. <view class="left">
  56. <view class="head-img">
  57. <image :src="user.avatar==null?'../static/images/health/my_heads.png':user.avatar" mode="aspectFill"></image>
  58. </view>
  59. <view class="name-phone">
  60. <view class="align-end">
  61. <view class="name">{{user.nickName}}</view>
  62. <image class="w48 h48" src="../static/images/company/right_arrow_black_icon24.png" mode=""></image>
  63. </view>
  64. <view class="phone-box" v-if="user!=null">
  65. <image class="w32 h32" src="../static/images/company/phone_icon16.png" mode=""></image>
  66. <view class="phone">
  67. {{user.phonenumber}}
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="msg-box">
  73. {{user.deptName||''}}
  74. </view>
  75. </view>
  76. <view class="used-tools2">
  77. <view class="title">指标汇总</view>
  78. <view class="index-box">
  79. <view class="task">
  80. <view class="align-center" @click="navgetTo('/pages_company/todoList?type=0')">
  81. <image class="w48 h48" src="../static/images/company/appointed_task_icon.png" mode=""></image>
  82. <view class="box-title">指派任务</view>
  83. <image class="w24 h24" src="../static/images/company/right_arrow_right_icon.png" mode=""></image>
  84. </view>
  85. <view class="prop">{{(data[0].completionRate||0.00)+ "%"}}</view>
  86. </view>
  87. <view class="work">
  88. <view class="align-center" @click="navgetTo('/pages_company/todoList?type=1')">
  89. <image class="w48 h48" src="../static/images/company/work_item_icon.png" mode=""></image>
  90. <view class="box-title">工作事项</view>
  91. <image class="w24 h24" src="../static/images/company/right_arrow_right_icon.png" mode=""></image>
  92. </view>
  93. <view class="prop">{{(data[1].completionRate||0.00)+ "%"}}</view>
  94. </view>
  95. </view>
  96. </view>
  97. <view class="used-tools2">
  98. <view class="title">常用工具</view>
  99. <view class="tools-list">
  100. <view class="item" @click="navgetTo('/pages_user/user/userTui')">
  101. <image src="../static/images/company/my_promotion_icon.png" mode=""></image>
  102. <text class="text">我的推广</text>
  103. </view>
  104. <view class="item" @click="navgetTo('/pages_company/todoList')">
  105. <image src="../static/images/company/to_do_list_icon.png" mode=""></image>
  106. <text class="text">待办事项</text>
  107. </view>
  108. <view class="item" @click="toUser()">
  109. <image src="../static/images/company/customer_profile_icon.png" mode=""></image>
  110. <text class="text">客户档案</text>
  111. </view>
  112. <view class="item" @click="navgetTo('/pages_user/user/userTui')">
  113. <image src="../static/images/company/manager_examine_icon.png" mode=""></image>
  114. <text class="text">管理师考核</text>
  115. </view>
  116. <view class="item" @click="navgetTo('/pages_company/clientList')">
  117. <image src="../static/images/company/my_subordinate.png" mode=""></image>
  118. <text class="text">我的下级</text>
  119. </view>
  120. <view class="item" @click="navgetTo('/pages_company/complaintList')">
  121. <image src="../static/images/company/customer_complaints_icon.png" mode=""></image>
  122. <text class="text">客户投诉</text>
  123. </view>
  124. </view>
  125. </view>
  126. <!-- 退出登录按钮 -->
  127. <view class="log-out" @click="logout">退出登录</view>
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. import {getUserInfo,getQrImg,queryCateStatis} from '@/api/companyUser'
  133. export default {
  134. data() {
  135. return {
  136. statusBarHeight:'',
  137. top:0,
  138. // user:{
  139. // nickName:'健康管家小左',
  140. // phonenumber:'13996660261',
  141. // deptName:'测试企业',
  142. // avatar:null
  143. // },
  144. user:null,
  145. data:null,
  146. };
  147. },
  148. computed: {
  149. // 计算属性的 getter
  150. bgColor: function() {
  151. var top = this.top / 30;
  152. return 'rgba(11,179,242, ' + top + ')';
  153. },
  154. },
  155. onLoad() {
  156. console.log("onload")
  157. },
  158. onShow() {
  159. console.log("onshow")
  160. this.getUserInfo()
  161. this.queryCateStatis()
  162. // this.queryCateStatis(1)
  163. },
  164. methods: {
  165. // navgetTo(url){
  166. // uni.navigateTo({
  167. // url:url
  168. // })
  169. // },
  170. alipay(){
  171. // var url="http://alipay.yjf.runtzh.com/#/?companyId="+this.user.companyId+"&companyUserId="+this.user.userId
  172. // uni.setClipboardData({
  173. // data:url,
  174. // success:()=>{
  175. // uni.showToast({
  176. // title:'收款地址已复制到剪切板',
  177. // icon:'none'
  178. // })
  179. // }
  180. // });
  181. uni.navigateTo({
  182. url:'/pages_company/alipayImg'
  183. })
  184. },
  185. toUser(){
  186. // uni.navigateTo({
  187. // url:'/pages_company/clientList?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  188. // })
  189. uni.navigateTo({
  190. url:'/pages_company/doc?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  191. })
  192. },
  193. //客户档案
  194. toCard(){
  195. uni.navigateTo({
  196. url:'/pages_company/card?cardId='+this.user.cardId
  197. })
  198. },
  199. toCreateOrder(){
  200. uni.navigateTo({
  201. url:'/pages_company/order/productList'
  202. })
  203. },
  204. toPay(){
  205. uni.navigateTo({
  206. url:'/pages_user/user/pay?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  207. })
  208. },
  209. toOrder(){
  210. uni.navigateTo({
  211. url:'/pages_company/storeOrder?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  212. })
  213. },
  214. toPackage(){
  215. uni.navigateTo({
  216. url:'/pages_company/storeProductPackage?companyId='+this.user.companyId+"&companyUserId="+this.user.userId
  217. })
  218. },
  219. toCoupon(){
  220. uni.navigateTo({
  221. url:'/pages_company/coupon'
  222. })
  223. },
  224. toCreateCoupon(){
  225. uni.navigateTo({
  226. url:'/pages_company/order/coupon'
  227. })
  228. },
  229. toCreateOrderCoupon(){
  230. uni.navigateTo({
  231. url:'/pages_company/order/coupon'
  232. })
  233. },
  234. queryCateStatis(e){
  235. queryCateStatis().then(
  236. res => {
  237. if(res.code==200){
  238. this.data=res.data;
  239. }
  240. else{
  241. uni.showToast({
  242. icon:'none',
  243. title: res.msg,
  244. });
  245. }
  246. },
  247. rej => {}
  248. );
  249. },
  250. getUserInfo(){
  251. var data={token:uni.getStorageSync('CompanyUserToken')}
  252. getUserInfo(data).then(
  253. res => {
  254. if(res.code==200){
  255. this.user=res.data;
  256. }
  257. else if(res.code==403){
  258. uni.setStorageSync('CompanyUserToken',null);
  259. uni.navigateBack({
  260. delta:-1
  261. })
  262. }else{
  263. uni.showToast({
  264. icon:'none',
  265. title: res.msg,
  266. });
  267. }
  268. },
  269. rej => {}
  270. );
  271. },
  272. logout(){
  273. uni.showModal({
  274. title:"提示",
  275. content:"确认退出登录吗?",
  276. showCancel:true,
  277. cancelText:'取消',
  278. confirmText:'确定',
  279. success:res=>{
  280. if(res.confirm){
  281. uni.setStorageSync('CompanyUserToken',null);
  282. uni.navigateBack({
  283. delta:-1
  284. })
  285. }else{
  286. }
  287. }
  288. })
  289. },
  290. // 跳转页面
  291. navgetTo(url) {
  292. this.utils.isLogin().then(res => {
  293. if(res){
  294. uni.navigateTo({
  295. url: url
  296. })
  297. }
  298. })
  299. },
  300. }
  301. }
  302. </script>
  303. <style lang="scss">
  304. .bg {
  305. width: 100%;
  306. height: 380rpx;
  307. position: absolute;
  308. top: 0;
  309. left: 0;
  310. z-index: -1;
  311. }
  312. .content{
  313. padding-top: calc(var(--status-bar-height) + 140rpx) !important;
  314. margin: 20upx 0upx;
  315. padding:20upx;
  316. // .user-info{
  317. // padding: 30upx;
  318. // display: flex;
  319. // align-items: center;
  320. // justify-content: space-between;
  321. // .left{
  322. // position: relative;
  323. // display: flex;
  324. // .head-img{
  325. // width: 120upx;
  326. // height: 120upx;
  327. // border-radius: 50%;
  328. // overflow: hidden;
  329. // margin-right: 30upx;
  330. // border: 4upx solid #FFFFFF;
  331. // box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  332. // image{
  333. // width: 100%;
  334. // height: 100%;
  335. // }
  336. // }
  337. // .name-phone{
  338. // padding-top: 15upx;
  339. // .name{
  340. // font-size: 36upx;
  341. // font-family: PingFang SC;
  342. // font-weight: bold;
  343. // color: #111111;
  344. // line-height: 1;
  345. // }
  346. // .phone{
  347. // font-size: 28upx;
  348. // font-family: PingFang SC;
  349. // font-weight: 500;
  350. // color: #666666;
  351. // line-height: 1;
  352. // margin-top: 30upx;
  353. // }
  354. // }
  355. // }
  356. // .msg-box{
  357. // padding: 5rpx 15upx;
  358. // height: 30upx;
  359. // line-height: 30upx;
  360. // font-size: 22upx;
  361. // font-family: PingFang SC;
  362. // font-weight: 500;
  363. // color: #FFFFFF;
  364. // border-radius: 8rpx;
  365. // background-color: #0bb3f2;
  366. // }
  367. // }
  368. // .used-tools{
  369. // box-sizing: border-box;
  370. // background: #FFFFFF;
  371. // border-radius: 16upx;
  372. // padding: 40upx 30upx;
  373. // .title{
  374. // font-size: 32upx;
  375. // font-family: PingFang SC;
  376. // font-weight: bold;
  377. // color: #222222;
  378. // line-height: 1;
  379. // }
  380. // .tools-list{
  381. // margin-top: 50upx;
  382. // display: flex;
  383. // flex-wrap: wrap;
  384. // width: 100%;
  385. // .item{
  386. // box-sizing: border-box;
  387. // width: 25%;
  388. // display: flex;
  389. // flex-direction: column;
  390. // align-items: center;
  391. // justify-content: center;
  392. // margin-bottom: 50upx;
  393. // position: relative;
  394. // image{
  395. // width: 44upx;
  396. // height: 44upx;
  397. // }
  398. // .text{
  399. // font-size: 24upx;
  400. // font-family: PingFang SC;
  401. // font-weight: 500;
  402. // color: #111111;
  403. // line-height: 1;
  404. // margin-top: 20upx;
  405. // }
  406. // .contact-btn{
  407. // display: inline-block;
  408. // position: absolute;
  409. // top: 0;
  410. // left: 0;
  411. // width: 100%;
  412. // height: 100%;
  413. // opacity: 0;
  414. // }
  415. // }
  416. // }
  417. // }
  418. .user-info2{
  419. // padding: 30upx;
  420. margin-bottom: 30rpx;
  421. display: flex;
  422. align-items: center;
  423. justify-content: space-between;
  424. margin-bottom: 20rpx;
  425. .left{
  426. position: relative;
  427. display: flex;
  428. .head-img{
  429. width: 128upx;
  430. height: 128upx;
  431. border-radius: 50%;
  432. overflow: hidden;
  433. margin-right: 30upx;
  434. border: 4upx solid #FFFFFF;
  435. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  436. image{
  437. width: 100%;
  438. height: 100%;
  439. }
  440. }
  441. .name-phone{
  442. // padding-top: 15upx;
  443. display: flex;
  444. flex-direction: column;
  445. justify-content:center;
  446. .name{
  447. font-size: 40upx;
  448. font-family: PingFang SC;
  449. font-weight: bold;
  450. color: #111111;
  451. // line-height: 1;
  452. }
  453. .phone-box{
  454. width: 220rpx;
  455. height: 48rpx;
  456. background: #008FD3;
  457. border-radius: 24rpx 24rpx 24rpx 24rpx;
  458. display: flex;
  459. align-items: center;
  460. justify-content: center;
  461. margin-top: 14rpx;
  462. .phone{
  463. font-family: PingFang SC;
  464. font-weight: 400;
  465. font-size: 24rpx;
  466. color: #FFFFFF;
  467. line-height: 36rpx;
  468. margin-left: 6rpx;
  469. }
  470. }
  471. }
  472. }
  473. .msg-box{
  474. width: 144rpx;
  475. height: 56rpx;
  476. line-height: 56rpx;
  477. font-family: PingFang SC;
  478. font-weight: 400;
  479. font-size: 24rpx;
  480. color: #FFFFFF;
  481. text-align: center;
  482. background: linear-gradient( 90deg, #FEA501 0%, #FECB8A 100%);
  483. border-radius: 28rpx 28rpx 28rpx 28rpx;
  484. border: 1rpx solid #FEDDB9;
  485. }
  486. }
  487. .used-tools2{
  488. box-sizing: border-box;
  489. background: #FFFFFF;
  490. border-radius: 16upx;
  491. padding: 40upx 30upx;
  492. margin-bottom: 20rpx;
  493. .title{
  494. font-size: 32upx;
  495. font-family: PingFang SC;
  496. font-weight: bold;
  497. color: #222222;
  498. line-height: 1;
  499. }
  500. .tools-list{
  501. margin-top: 50upx;
  502. display: flex;
  503. flex-wrap: wrap;
  504. width: 100%;
  505. .item{
  506. box-sizing: border-box;
  507. width: 25%;
  508. display: flex;
  509. flex-direction: column;
  510. align-items: center;
  511. justify-content: center;
  512. margin-bottom: 50upx;
  513. position: relative;
  514. image{
  515. width: 48upx;
  516. height: 48upx;
  517. }
  518. .text{
  519. font-size: 24upx;
  520. font-family: PingFang SC;
  521. font-weight: 500;
  522. color: #111111;
  523. line-height: 1;
  524. margin-top: 20upx;
  525. }
  526. .contact-btn{
  527. display: inline-block;
  528. position: absolute;
  529. top: 0;
  530. left: 0;
  531. width: 100%;
  532. height: 100%;
  533. opacity: 0;
  534. }
  535. }
  536. }
  537. .index-box{
  538. margin-top: 30rpx;
  539. display: flex;
  540. align-items: center;
  541. justify-content: space-between;
  542. .box-title{
  543. font-family: PingFang SC;
  544. font-weight: 400;
  545. font-size: 24rpx;
  546. color: #626468;
  547. margin: 0 14rpx;
  548. }
  549. .prop{
  550. font-family: Roboto Slab;
  551. font-weight: 500;
  552. font-size: 48rpx;
  553. color: #222426;
  554. }
  555. .task{
  556. width: 311rpx;
  557. height: 142rpx;
  558. background: #EBF8FF;
  559. border-radius: 16rpx 16rpx 16rpx 16rpx;
  560. display: flex;
  561. flex-direction: column;
  562. justify-content: center;
  563. align-items: center;
  564. }
  565. .work{
  566. width: 311rpx;
  567. height: 142rpx;
  568. background: #FFF3DE;
  569. border-radius: 16rpx 16rpx 16rpx 16rpx;
  570. display: flex;
  571. flex-direction: column;
  572. justify-content: center;
  573. align-items: center;
  574. }
  575. }
  576. }
  577. .log-out{
  578. height: 80upx;
  579. line-height: 80upx;
  580. text-align: center;
  581. font-size: 28upx;
  582. font-family: PingFang SC;
  583. font-weight: 500;
  584. color: #666666;
  585. background: #FFFFFF;
  586. border-radius: 16upx;
  587. margin-top: 20upx;
  588. }
  589. }
  590. </style>