detail.vue 15 KB

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