meeting.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view class="content">
  3. <view class="table">
  4. <view class="table-title">
  5. <view class="title">
  6. 会议主题:
  7. </view>
  8. <view class="val">
  9. {{meeting.name}}
  10. </view>
  11. <view class="title">
  12. 会议主持人:
  13. </view>
  14. <view class="val">
  15. {{meeting.host}}
  16. </view>
  17. <view class="title">
  18. 开始时间:
  19. </view>
  20. <view class="val">
  21. {{meeting.start}}
  22. </view>
  23. <view class="title">
  24. 结束时间:
  25. </view>
  26. <view class="val">
  27. {{meeting.endtime}}
  28. </view>
  29. <view class="title">
  30. 会议内容:
  31. </view>
  32. <view class="val" v-html="meeting.content"></view>
  33. <template v-if="meeting.url">
  34. <view class="title">
  35. 会议地址:
  36. </view>
  37. <view class="val" @click="hhhh(meeting.url)">
  38. {{meeting.url}}
  39. </view>
  40. </template>
  41. <view class="button button1" @click="openJoin(0)">
  42. 本人参加
  43. </view>
  44. <view class="button" @click="openJoin(1)">
  45. 他人参加
  46. </view>
  47. </view>
  48. </view>
  49. <uni-popup ref="join" type="center">
  50. <view class="join-wrap">
  51. <view class="join-tit">
  52. {{is_true == 1?'他人参加':'本人参加'}}
  53. </view>
  54. <view class="content">
  55. <view class="left">
  56. 姓名
  57. </view>
  58. <input type="text" value="" placeholder="请输入姓名" v-model="name" />
  59. </view>
  60. <view class="content">
  61. <view class="left">
  62. 联系方式
  63. </view>
  64. <input type="text" value="" placeholder="请输入联系方式" v-model="phone" />
  65. </view>
  66. <view class="content">
  67. <view class="left">
  68. 职务
  69. </view>
  70. <picker class="input" :range="zhiwuList" @change="bindZhiwu">
  71. <view class="box-right" :class="{ 'hui' : zhiwu == '' }">{{ zhiwu || '请选择职务' }}</view>
  72. </picker>
  73. </view>
  74. <view class="join-btn" @click.stop="subJoin" :class="{'bghui':subing}">
  75. 确认提交
  76. </view>
  77. </view>
  78. </uni-popup>
  79. </view>
  80. </template>
  81. <script>
  82. import {
  83. getMeeting,
  84. joinMeeting
  85. } from '@/api/art.js'
  86. import {postlist} from '@/api/user.js'
  87. export default {
  88. data() {
  89. return {
  90. subing:false,
  91. id: '', //会议id
  92. meeting: {
  93. name:'',
  94. host: '',
  95. start: '',
  96. endtime: '',
  97. content: ''
  98. },
  99. name: '',
  100. phone: '',
  101. is_true: 0,
  102. zhiwuList: [],
  103. zhiwuList1:[],
  104. zhiwu: '',
  105. }
  106. },
  107. onLoad(opt) {
  108. this.id = opt.id
  109. this.getMeeting()
  110. this.getPostList()
  111. },
  112. onShow() {
  113. },
  114. onReachBottom() {
  115. },
  116. onReady() {
  117. },
  118. methods: {
  119. hhhh(url) {
  120. window.location.href = url
  121. },
  122. // 获取职务列表
  123. getPostList() {
  124. postlist().then(({
  125. data
  126. }) => {
  127. data.forEach(e => {
  128. this.zhiwuList.push(e.title)
  129. })
  130. this.zhiwuList1 = data
  131. console.log(data, "zhiwuList");
  132. })
  133. },
  134. // 获取会议详情
  135. getMeeting() {
  136. let obj = this
  137. getMeeting({
  138. id: obj.id
  139. }).then(res => {
  140. console.log(res)
  141. obj.meeting = res.data
  142. })
  143. },
  144. // 打开参会弹窗
  145. openJoin(val) {
  146. let obj = this
  147. obj.is_true = val
  148. obj.$refs.join.open()
  149. },
  150. //选择职务
  151. bindZhiwu(e) {
  152. this.zhiwu = this.zhiwuList[e.target.value];
  153. this.zhiwuId = this.zhiwuList1[e.target.value].id
  154. console.log(this.zhiwuId)
  155. },
  156. //参加会议
  157. subJoin() {
  158. let obj = this
  159. if(obj.subing) {
  160. return
  161. }
  162. if(obj.name == '') {
  163. return obj.$api.msg('请输入参会人员姓名')
  164. }
  165. if(obj.phone == '') {
  166. return obj.$api.msg('请输入参会人员联系方式')
  167. }
  168. if(obj.zhiwu == '') {
  169. return obj.$api.msg('请输入参会人员职务')
  170. }
  171. obj.subing = true
  172. joinMeeting({
  173. mid: obj.id,
  174. name: obj.name,
  175. post: obj.zhiwuId,
  176. contact: obj.phone,
  177. is_true: obj.is_true
  178. }).then(res => {
  179. obj.$refs.join.close()
  180. obj.subing = false
  181. uni.showToast({
  182. title:'提交成功',
  183. duration:2000
  184. });
  185. }).catch(err => {
  186. obj.subing = false
  187. })
  188. }
  189. }
  190. }
  191. </script>
  192. <style lang="scss">
  193. page {
  194. background-color: #fff;
  195. height: auto;
  196. min-height: 100%;
  197. }
  198. .table {
  199. width: 750rpx;
  200. background: #FFFFFF;
  201. // margin: 30rpx auto;
  202. }
  203. .table-title {
  204. .title {
  205. margin-left: 15rpx;
  206. font-size: 30rpx;
  207. font-weight: bold;
  208. color: #333333;
  209. line-height: 80rpx;
  210. }
  211. .val {
  212. padding-left: 30rpx;
  213. text-indent:28rpx;
  214. font-size: 28rpx;
  215. font-weight: 500;
  216. color: black;
  217. }
  218. }
  219. .button {
  220. margin: 60rpx auto;
  221. width: 300rpx;
  222. height: 80rpx;
  223. background: #fff;
  224. border-radius: 38rpx;
  225. font-size: 30rpx;
  226. font-weight: 500;
  227. color: #FE5341;
  228. border: #FE5341 1px solid;
  229. line-height: 80rpx;
  230. text-align: center;
  231. }
  232. .button1 {
  233. color:#fff ;
  234. background-color: #FE5341;
  235. }
  236. .join-wrap {
  237. height: 400rpx;
  238. width: 650rpx;
  239. background-color: #fff;
  240. border-radius: 20rpx;
  241. .join-tit {
  242. text-align: center;
  243. font-size: 36rpx;
  244. font-weight: bold;
  245. padding: 20rpx 0;
  246. }
  247. .join-btn {
  248. line-height: 85rpx;
  249. // width: 200rpx;
  250. background-color:#FE5341;
  251. color: #fff;
  252. font-size: 28rpx;
  253. // border-radius: 20rpx;
  254. text-align: center;
  255. border-radius: 0 0 20rpx 20rpx;
  256. margin: auto;
  257. }
  258. .content {
  259. display: flex;
  260. align-items: center;
  261. line-height: 80rpx;
  262. .left {
  263. width: 120rpx;
  264. margin: 0 30rpx;
  265. font-size: 28rpx;
  266. font-weight: bold;
  267. color: #333333;
  268. }
  269. input {
  270. margin: 0;
  271. }
  272. .box-right {
  273. flex-grow: 1;
  274. }
  275. .input {
  276. margin: 0;
  277. flex-grow: 1;
  278. }
  279. }
  280. }
  281. .hui {
  282. color: #999999 !important;
  283. }
  284. .bghui {
  285. background-color: #eee !important;
  286. }
  287. </style>