signin.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="meet">
  3. <view class="mtop">
  4. <view class="tit">{{datainfo.conferenceTitle}}</view>
  5. <view class="ftxt">
  6. <text>会议地点</text>
  7. <view>{{datainfo.conferenceAddress}}</view>
  8. </view>
  9. <view class="ftxt">
  10. <text>会议时间</text>
  11. <view class="co1d">{{datainfo.conferenceDate}} {{datainfo.conferenceTime}}</view>
  12. </view>
  13. <view class="ftxt">
  14. <text>备注信息</text>
  15. <view>{{datainfo.remark}}</view>
  16. </view>
  17. </view>
  18. <view class="mtop madr">
  19. <view class="tit mb24">会议签到</view>
  20. <!-- <view class="madra">
  21. <image :src="adrimg"></image>
  22. <view>安徽省合肥市蜀山区高薪技术产业开发区黄山路59号 时代数码港</view>
  23. </view> -->
  24. <view class="madrb" @click="getCodeFn">
  25. <view class="time">{{kaTime}}</view>
  26. <view class="mqian">扫码签到</view>
  27. </view>
  28. <view class="tips flexcc">
  29. <!-- <image :src="choseimg"></image> -->
  30. <view>会议即将开始,请尽快签到哦</view>
  31. </view>
  32. <!-- <view class="madrc">
  33. <meet-step></meet-step>
  34. </view> -->
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {getMeetDetaiFn,getsignInFn} from "@/api/mine/meeting.js"
  40. import meetStep from "@/work/components/meeting/step.vue"
  41. export default{
  42. components:{meetStep},
  43. data(){
  44. return{
  45. adrimg:require("@/work/static/images/meeting/adr.png"),
  46. choseimg:require("@/work/static/images/meeting/chose.png"),
  47. recordList:[{tit:'123'}],
  48. datainfo:{},
  49. userId:this.$store.state.user.userId,
  50. kaTime:''
  51. }
  52. },
  53. onLoad(e) {
  54. this.id=e.id;
  55. this.getDataFn();
  56. this.gettimeFn();
  57. },
  58. methods:{
  59. gettimeFn() {
  60. var that = this;
  61. clearInterval(this.timefn)
  62. that.time();
  63. that.timefn = setInterval(function() {
  64. that.time();
  65. }, 1000);
  66. },
  67. time() {
  68. var date = new Date();
  69. var y = date.getFullYear();
  70. var m = date.getMonth() + 1;
  71. var d = date.getDate();
  72. var h = date.getHours();
  73. var min = date.getMinutes();
  74. var s = date.getSeconds();
  75. var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  76. var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  77. var yearStr = y + '/' + (m < 10 ? ('0' + m) : m) + '/' + (d < 10 ? ('0' + d) : d)
  78. var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? ('0' + s) : s);
  79. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min);
  80. this.kaTime =timeStr;
  81. // if(this.endTime&&this.type==0&&!this.pwdflag){
  82. // var endt=new Date(this.endTime).getTime()
  83. // var nowt=date.getTime()
  84. // if(nowt>endt){
  85. // this.type=1
  86. // this.videotype=1;
  87. // }else{
  88. // this.videotype=0;
  89. // }
  90. // }
  91. },
  92. getDataFn(){
  93. var params={
  94. conferenceId:this.id,
  95. userId:this.userId
  96. }
  97. getMeetDetaiFn(params).then(res=>{
  98. this.datainfo=res.data;
  99. })
  100. },
  101. getCodeFn(){
  102. var that = this;
  103. uni.scanCode({
  104. onlyFromCamera: true,
  105. autoZoom:false,
  106. scanType: ['qrCode'],
  107. success: function(red) {
  108. let result = red.result;
  109. if (typeof result == 'string') {
  110. try {
  111. } catch (e) {
  112. uni.navigateBack({
  113. delta: 1
  114. })
  115. uni.showToast({
  116. title: '扫码查询失败,请检查二维码是否正确',
  117. icon: "none"
  118. })
  119. return
  120. }
  121. }
  122. var id = red.result
  123. var params = {
  124. conferenceId: id,
  125. userId:that.userId,
  126. }
  127. getsignInFn(params).then(res => {
  128. if (res.code == 200) {
  129. if(res.msg=='核销失败'){
  130. that.$toast(res.msg)
  131. // that.$tab.navigateTo('/pages/order/stafffail')
  132. }else{
  133. that.$toast('签到成功')
  134. setTimeout(function(){
  135. uni.$emit('refreshdetail')
  136. uni.$emit('refreshlist')
  137. uni.navigateBack({
  138. delta:1
  139. })
  140. },1200)
  141. }
  142. } else {
  143. uni.showToast({
  144. title: res.msg,
  145. duration: 1000,
  146. icon: 'none'
  147. });
  148. }
  149. })
  150. },
  151. fail: function(e) {
  152. if (e && e.errMsg && e.errMsg.indexOf('scanCode:fail cancel') != -1) {
  153. return;
  154. }
  155. uni.showToast({
  156. title: '扫码失败',
  157. icon: "none"
  158. })
  159. },
  160. });
  161. },
  162. }
  163. }
  164. </script>
  165. <style scoped lang="scss">
  166. .meet{padding: 34rpx 24rpx;
  167. .mtop{width: 100%;background: #FFFFFF;box-shadow: 0px 0px 14rpx 0px rgba(153,152,152,0.39);
  168. border-radius: 10rpx;padding: 48rpx 40rpx 28rpx;margin-bottom: 30rpx;
  169. &.madr{padding: 48rpx 34rpx 28rpx;}
  170. .tit{font-weight: bold;font-size: 30rpx;color: #343434;margin-bottom: 36rpx;}
  171. .ftxt{display: flex;align-items: flex-start;margin-bottom: 20rpx;flex:0 1 auto;min-width: 50%;
  172. text{font-weight: bold;font-size: 26rpx;color: #CACACA;flex: 0 0 auto;min-width: 104rpx;text-align-last: justify;}
  173. view{flex: 1;color: #343434;font-size: 26rpx;margin-left: 20rpx;line-height: 34rpx;}
  174. }
  175. }
  176. .madra{display: flex;align-items: flex-start;margin-bottom: 56rpx;
  177. image{width: 24rpx;height: 26rpx;margin-right: 12rpx;flex: 0 0 auto;margin-top: 4rpx;}
  178. view{font-weight: 400;font-size: 26rpx;color: #222327;}
  179. }
  180. .madrb{
  181. width: 368rpx;height: 194rpx;background: #1D64E2;box-shadow: 0px 0px 10rpx 0px #6296F2;margin: 0 auto 34rpx;
  182. border-radius: 98rpx;display: flex;align-items: center;flex-direction: column;justify-content: center;
  183. .time{font-weight: bold;font-size: 30rpx;color: #FFFFFF;margin-bottom: 10rpx;}
  184. .mqian{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  185. }
  186. .tips{margin-bottom: 52rpx;
  187. image{width: 20rpx;height: 20rpx;margin-right: 14rpx;}
  188. view{font-weight: 400;font-size: 26rpx;color: #666666;}
  189. }
  190. .madrc{padding-left: 34rpx;}
  191. }
  192. </style>