detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="item">
  5. <view class="icon">
  6. <image src="./icon/icon_1.png" mode=""></image>
  7. </view>
  8. <view class="title">表决议题</view>
  9. <view class="text">{{detail.introduce}}</view>
  10. </view>
  11. <view class="item">
  12. <view class="icon">
  13. <image src="./icon/icon_2.png" mode=""></image>
  14. </view>
  15. <view class="title">会议时间</view>
  16. <view class="text">{{detail.time}}</view>
  17. </view>
  18. <view class="item">
  19. <view class="icon">
  20. <image src="./icon/icon_3.png" mode=""></image>
  21. </view>
  22. <view class="title">会议地点</view>
  23. <view class="text">{{detail.place}}</view>
  24. </view>
  25. <view class="item">
  26. <view class="icon">
  27. <image src="./icon/icon_4.png" mode=""></image>
  28. </view>
  29. <view class="title">签到时间</view>
  30. <view class="text">{{detail.sign_time}}</view>
  31. </view>
  32. </view>
  33. <view class="content">
  34. <view class="section">
  35. <view class="title" style="display: flex;justify-content: space-between;align-items: center;">
  36. 统计
  37. <view class="ringht" @click="should_list_detail()"
  38. style="font-size: 28rpx; color: #b0b0b0;font-weight: 500;">签到详情 <uni-icons type="arrowright"
  39. size="12" color="#b0b0b0"></uni-icons>
  40. </view>
  41. </view>
  42. <view class="box">
  43. <view class="item">
  44. <view class="num">{{detail.arrive_num}}</view>
  45. <view class="text">应到人数</view>
  46. </view>
  47. <view class="item">
  48. <view class="num">{{detail.actual_num}}</view>
  49. <view class="text">实到人数</view>
  50. </view>
  51. <view class="item">
  52. <view class="num">{{detail.leave_num}}</view>
  53. <view class="text">请假人数</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="section section_2">
  58. <view class="title">应到人</view>
  59. <view class="user_box">
  60. <view class="user" v-for="(item,index) in should_list" :key="index">
  61. <view class="avatar">
  62. <image :src="item.avatar" mode="aspectFill"></image>
  63. </view>
  64. <view class="name">{{item.name}}</view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="section section_2">
  69. <view class="title">实到人</view>
  70. <view class="user_box">
  71. <view class="user" v-for="(item,index) in real_list" :key="index">
  72. <view class="avatar">
  73. <image :src="item.avatar" mode="aspectFill"></image>
  74. </view>
  75. <view class="name">{{item.name}}</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="section section_3">
  80. <view class="title">投票详情</view>
  81. <view class="tip">投票项目:{{vote_list.title}}</view>
  82. <view class="tip">表决决议:{{vote_list.remark}}</view>
  83. <view class="charts-box">
  84. <qiun-data-charts type="pie" :opts="pie_1" :chartData="chartData" background="none" />
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 进入会议 -->
  89. <view class="btn">
  90. <view class="left">线上参与</view>
  91. <view class="right" @click="click()">
  92. <view class="icon">
  93. <image src="./icon/join.png" mode=""></image>
  94. </view>
  95. <view class="text">进入会议室</view>
  96. </view>
  97. </view>
  98. <view class="bottom">
  99. <view class="box btn_1" v-if="status == 0" @click="sign_in()">签到</view>
  100. <view class="box btn_2" v-if="status == 0" @click="open_popup()">请假</view>
  101. <view class="box btn_1" v-if="status != 0" style="background-color: #DCDCDC;">签到</view>
  102. <view class="box btn_2" v-if="status != 0" style="background-color: #C0C4CC;">请假</view>
  103. <view class="box btn_3" @click="vote()">投票</view>
  104. </view>
  105. <uni-popup ref="popup" type="center">
  106. <view
  107. style="background-color: #FFFFFF;width: 600rpx;border-radius: 10rpx;margin: 0 auto;box-sizing: border-box;padding: 25rpx;">
  108. <view style="border: 1rpx solid #ccc;margin-bottom: 20rpx;border-radius: 10rpx;">
  109. <textarea style="height: 200rpx;box-sizing: border-box;padding: 25rpx;width: 550rpx;"
  110. v-model="remark" placeholder="请输入请假原因" />
  111. </view>
  112. <view @click="leave()"
  113. style="background-color: #009FE8; height: 90rpx;color: #FFFFFF;text-align: center;line-height: 90rpx;">
  114. 提交</view>
  115. </view>
  116. </uni-popup>
  117. </view>
  118. </template>
  119. <script>
  120. export default {
  121. data() {
  122. return {
  123. // 当前用户工号
  124. staff_num: "",
  125. // 会议id
  126. id: "",
  127. // roomID
  128. roomID: "",
  129. detail: {},
  130. should_list: [],
  131. real_list: [],
  132. // 投票详情
  133. vote_list: {},
  134. // 当前状态
  135. status: " ",
  136. // 请假原因
  137. remark: "",
  138. // 投票选项
  139. vote_take_list: [],
  140. // 图表数据
  141. chartData: {
  142. categories: [],
  143. "series": [{
  144. "data": []
  145. }]
  146. },
  147. pie_1: {
  148. "dataLabel": false,
  149. "legend": {
  150. "position": "bottom",
  151. "float": "center"
  152. },
  153. "title": {
  154. "name": " "
  155. },
  156. "subtitle": {
  157. "name": " "
  158. },
  159. "extra": {
  160. "ring": {
  161. "centerColor": "#FFFFFF",
  162. "border": true,
  163. },
  164. }
  165. }
  166. };
  167. },
  168. onLoad(option) {
  169. // 设置会议标题
  170. uni.setNavigationBarTitle({
  171. title: option.title
  172. })
  173. this.id = option.id
  174. this.staff_num = uni.getStorageSync('user').staff_num
  175. // 获取会议详情
  176. this.get_detail()
  177. // 获取应到人列表
  178. this.get_should_list()
  179. // 获取实到人数
  180. this.get_real_list()
  181. // 获取投票详情
  182. this.get_vote_detail()
  183. // 获取当前签到状态
  184. this.get_staff_status()
  185. },
  186. methods: {
  187. // 获取会议信息
  188. get_detail() {
  189. this.$api.conference_one({
  190. id: this.id
  191. }).then((res) => {
  192. console.log(res.data.data)
  193. this.detail = res.data.data
  194. this.roomID = res.data.data.room_num
  195. })
  196. },
  197. // 获取应到人列表
  198. get_should_list() {
  199. this.$api.conference_staff_list({
  200. id: this.id,
  201. status: "all"
  202. }).then((res) => {
  203. console.log(res.data.data)
  204. this.should_list = res.data.data
  205. })
  206. },
  207. // 获取实到人数
  208. get_real_list() {
  209. this.$api.conference_staff_list({
  210. id: this.id,
  211. status: "arrive"
  212. }).then((res) => {
  213. console.log(res.data.data)
  214. this.real_list = res.data.data
  215. })
  216. },
  217. // 进入会议
  218. click() {
  219. console.log(this.detail)
  220. if (plus.os.name == 'Android') {
  221. plus.runtime.launchApplication({
  222. pname: 'com.hst.sdkTest',
  223. extra: { //要传递过去的参数
  224. // title: '该参数由桥梁APP启动时传递',
  225. serverip: '42.63.25.245',
  226. port: '1089',
  227. user: this.staff_num,
  228. password: 'jwkj123456',
  229. roomid: this.roomID
  230. }
  231. }, (e) => {
  232. console.log('Open system default browser failed: ' + e.message)
  233. if (e.message == 'null') {
  234. uni.showModal({
  235. title: '提示',
  236. content: '需要下载视频会议插件,是否继续下载?',
  237. success: function(res) {
  238. if (res.confirm) {
  239. console.log('用户点击确定');
  240. //打开外部url
  241. plus.runtime.openURL(
  242. "https://jiewei-icon.oss-cn-beijing.aliyuncs.com/apk/app-hst.apk",
  243. res => {
  244. uni.showToast({
  245. title: '打开当前地址出错啦,请稍后再试',
  246. icon: 'none'
  247. });
  248. })
  249. } else if (res.cancel) {
  250. console.log('用户点击取消');
  251. }
  252. }
  253. });
  254. }
  255. })
  256. }
  257. },
  258. // 签到详情
  259. should_list_detail() {
  260. uni.navigateTo({
  261. url: "./should_list/should_list?id=" + this.id
  262. })
  263. },
  264. // 获取当前签到状态
  265. get_staff_status() {
  266. this.$api.get_staff_status({
  267. id: this.id,
  268. status: ""
  269. }).then((res) => {
  270. console.log(res.data.data)
  271. this.status = res.data.data.status
  272. })
  273. },
  274. // 签到
  275. sign_in() {
  276. this.$api.conference_staff_status({
  277. id: this.id,
  278. status: 1
  279. }).then((res) => {
  280. console.log(res.data)
  281. this.get_staff_status()
  282. // 获取实到人数
  283. this.get_real_list()
  284. // 获取会议详情
  285. this.get_detail()
  286. if (res.data.code == 1) {
  287. uni.showToast({
  288. icon: "none",
  289. title: res.data.message
  290. })
  291. } else {
  292. uni.showToast({
  293. icon: "none",
  294. title: "签到成功"
  295. })
  296. }
  297. })
  298. },
  299. // 请假
  300. open_popup() {
  301. // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
  302. this.$refs.popup.open()
  303. },
  304. // 提交请假
  305. leave() {
  306. uni.showModal({
  307. title: '提示',
  308. content: '是否提交请假申请?',
  309. success: (res) => {
  310. if (res.confirm) {
  311. console.log('用户点击确定');
  312. this.$refs.popup.close()
  313. this.$api.conference_staff_status({
  314. id: this.id,
  315. status: 2,
  316. remark: this.remark
  317. }).then((res) => {
  318. console.log(res.data)
  319. if (res.data.code == 1) {
  320. uni.showToast({
  321. icon: "none",
  322. title: res.data.message
  323. })
  324. } else{
  325. uni.showToast({
  326. icon: "none",
  327. title: "请假成功"
  328. })
  329. }
  330. this.get_staff_status()
  331. // 获取实到人数
  332. this.get_real_list()
  333. // 获取会议详情
  334. this.get_detail()
  335. })
  336. } else if (res.cancel) {
  337. console.log('用户点击取消');
  338. }
  339. }
  340. });
  341. },
  342. // 获取投票详情
  343. get_vote_detail() {
  344. this.$api.conference_vote_list({
  345. id: this.id
  346. }).then((res) => {
  347. console.log(res.data.data[0])
  348. this.vote_list = res.data.data[0]
  349. let data = []
  350. res.data.data[0].formate.forEach((item, index) => {
  351. var sevm = {}
  352. sevm.name = item.name
  353. sevm.value = parseInt(item.num)
  354. data[index] = sevm
  355. })
  356. this.chartData.series[0].data = data
  357. console.log(data)
  358. })
  359. },
  360. // 投票
  361. vote() {
  362. uni.showLoading({
  363. mask: true
  364. });
  365. this.$api.conference_staff_vote({
  366. id: this.id
  367. }).then((res) => {
  368. uni.hideLoading()
  369. console.log(res)
  370. if (res.data.code == 1) {
  371. uni.showToast({
  372. icon: "none",
  373. title: res.data.message
  374. })
  375. } else {
  376. const id = res.data.data.id
  377. this.vote_take_list = res.data.data.content
  378. uni.showActionSheet({
  379. itemList: this.vote_take_list,
  380. success: (res) => {
  381. console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  382. console.log(this.vote_take_list)
  383. const take = this.vote_take_list[res.tapIndex]
  384. uni.showModal({
  385. title: '提示',
  386. content: '是否确认投' + this.vote_take_list[res.tapIndex] +
  387. '票?',
  388. success: (res) => {
  389. if (res.confirm) {
  390. console.log('用户点击确定');
  391. this.$refs.popup.close()
  392. this.$api.conference_staff_vote_take({
  393. id: id,
  394. choice: take
  395. }).then((res) => {
  396. console.log(res.data)
  397. if (res.data.code == 1) {
  398. uni.showToast({
  399. icon: "none",
  400. title: res.data
  401. .message
  402. })
  403. } else {
  404. uni.showToast({
  405. icon: "none",
  406. title: "投票成功"
  407. })
  408. // 获取投票详情
  409. this.get_vote_detail()
  410. }
  411. })
  412. } else if (res.cancel) {
  413. console.log('用户点击取消');
  414. }
  415. }
  416. });
  417. },
  418. fail: function(res) {
  419. console.log(res.errMsg);
  420. }
  421. });
  422. }
  423. })
  424. }
  425. }
  426. }
  427. </script>
  428. <style lang="scss">
  429. page {
  430. background-color: #F4F7F7;
  431. padding-bottom: 200rpx;
  432. }
  433. /* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */
  434. .charts-box {
  435. width: 100%;
  436. height: 300px;
  437. }
  438. .top {
  439. background-color: #FFFFFF;
  440. box-sizing: border-box;
  441. padding: 25rpx 50rpx;
  442. .item {
  443. display: flex;
  444. align-items: center;
  445. height: 90rpx;
  446. border-bottom: 1rpx solid #F5F6F6;
  447. .icon {
  448. image {
  449. display: block;
  450. width: 35rpx;
  451. height: 35rpx;
  452. }
  453. }
  454. .title {
  455. margin-left: 22rpx;
  456. font-size: 28rpx;
  457. color: #7e7e7e;
  458. }
  459. .text {
  460. margin-left: 66rpx;
  461. }
  462. }
  463. }
  464. .content {
  465. margin-top: 20rpx;
  466. background-color: #FFFFFF;
  467. box-sizing: border-box;
  468. padding: 50rpx;
  469. padding-bottom: 20rpx;
  470. .section {
  471. padding-bottom: 50rpx;
  472. border-bottom: 1rpx solid #F6F6F6;
  473. margin-bottom: 50rpx;
  474. .title {
  475. font-size: 34rpx;
  476. font-weight: 700;
  477. margin-bottom: 30rpx;
  478. }
  479. .box {
  480. display: flex;
  481. justify-content: space-between;
  482. .item {
  483. width: 166rpx;
  484. height: 166rpx;
  485. text-align: center;
  486. border-radius: 50%;
  487. box-sizing: border-box;
  488. border: 20rpx solid #FBBE42;
  489. .num {
  490. margin-top: 15rpx;
  491. font-size: 40rpx;
  492. }
  493. .text {
  494. font-size: 22rpx;
  495. color: #333;
  496. }
  497. }
  498. .item:nth-child(1) {
  499. border-color: #FBBE42;
  500. .num {
  501. color: #FBBE42;
  502. }
  503. }
  504. .item:nth-child(2) {
  505. border-color: #FF7472;
  506. .num {
  507. color: #FF7472;
  508. }
  509. }
  510. .item:nth-child(3) {
  511. border-color: #A472E6;
  512. .num {
  513. color: #A472E6;
  514. }
  515. }
  516. }
  517. }
  518. .section_2 {
  519. .user_box {
  520. overflow: hidden;
  521. .user {
  522. float: left;
  523. margin-right: 25rpx;
  524. width: 110rpx;
  525. text-align: center;
  526. .avatar {
  527. margin: 0 auto;
  528. width: 100rpx;
  529. height: 100rpx;
  530. border-radius: 50%;
  531. overflow: hidden;
  532. image {
  533. width: 100rpx;
  534. height: 100rpx;
  535. display: block;
  536. }
  537. }
  538. .name {
  539. margin-top: 10rpx;
  540. font-size: 22rpx;
  541. color: #666666;
  542. }
  543. }
  544. .user:nth-child(5n) {
  545. margin-right: 0;
  546. }
  547. }
  548. }
  549. }
  550. .btn {
  551. margin-top: 20rpx;
  552. background-color: #FFFFFF;
  553. height: 120rpx;
  554. display: flex;
  555. justify-content: space-between;
  556. align-items: center;
  557. box-sizing: border-box;
  558. padding: 0 50rpx;
  559. .left {
  560. font-size: 34rpx;
  561. font-weight: 700;
  562. }
  563. .right {
  564. width: 260rpx;
  565. height: 70rpx;
  566. background-color: #009FE8;
  567. display: flex;
  568. align-items: center;
  569. justify-content: center;
  570. border-radius: 15rpx;
  571. .icon {
  572. margin-right: 20rpx;
  573. image {
  574. width: 28rpx;
  575. height: 32rpx;
  576. display: block;
  577. }
  578. }
  579. .text {
  580. color: #FFFFFF;
  581. font-size: 30rpx;
  582. }
  583. }
  584. }
  585. .bottom {
  586. height: 100rpx;
  587. position: fixed;
  588. left: 0;
  589. bottom: 0rpx;
  590. display: flex;
  591. .box {
  592. width: 190rpx;
  593. height: 100rpx;
  594. line-height: 100rpx;
  595. text-align: center;
  596. font-size: 34rpx;
  597. font-weight: 700;
  598. color: #FFFFFF;
  599. }
  600. .btn_1 {
  601. width: 370rpx;
  602. background-color: #1EDE6A;
  603. }
  604. .btn_2 {
  605. background-color: #FF2753;
  606. }
  607. .btn_3 {
  608. background-color: #FFA124;
  609. }
  610. }
  611. </style>