金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

198 lines
6.0 KiB

4 years ago
  1. <template>
  2. <view class="head">
  3. <lf-nav :spreadOut="false" :showIcon="true" bgColor="transparent" titleColor="white" title="我的报名"></lf-nav>
  4. <view class="bg-left"></view>
  5. <view class="bg-right"></view>
  6. <view class="register-card">
  7. <view class="lf-flex lf-p-l-40 register-content">
  8. <image class="register-head" :src="activity_details.user.avatar" mode="aspectFill"></image>
  9. <view class="lf-color-black lf-m-l-21 lf-font-32" v-if="activity_details.user.nick_name">
  10. {{activity_details.user.nick_name}}
  11. </view>
  12. </view>
  13. <view class="lf-p-l-40">
  14. <view class="lf-font-36 lf-color-black lf-font-bold ">{{activity_details.activity.name}}</view>
  15. <view class="lf-m-t-30">
  16. <view class="lf-m-t-20">
  17. <text class="lf-color-777 lf-font-28">活动时间</text><text class="lf-font-28 lf-color-black lf-m-l-10">{{activity_details.activity.apply_start}}-{{activity_details.activity.apply_end}}</text>
  18. </view>
  19. <view class="lf-m-t-20 lf-flex">
  20. <text class="lf-color-777 lf-font-28">活动内容</text>
  21. <rich-text class="lf-color-black lf-m-l-10" :nodes="activity_details.activity.content" v-if="activity_details.activity.content"></rich-text>
  22. </view>
  23. <view class="lf-m-t-20">
  24. <text class="lf-color-777 lf-font-28">报名时间</text><text class="lf-font-28 lf-color-black lf-m-l-10">{{activity_details.created_at}}</text>
  25. </view>
  26. <view class="lf-m-t-20">
  27. <text class="lf-color-777 lf-font-28">报名费用</text>
  28. <text class="lf-font-28 lf-color-black lf-m-l-10" v-if="activity_details.activity.price == 0">免费</text>
  29. <text class="lf-font-28 lf-color-black lf-m-l-10" v-else>{{activity_details.activity.price}}</text>
  30. </view>
  31. <view style="margin-top: 60rpx;display: flex;justify-content: center;" v-if="$isRight(activity_details)">
  32. <view class="lf-flex-column">
  33. <lf-qrcode :options="config.qrc"></lf-qrcode>
  34. <view class="lf-font-28 lf-row-center" style="color: #15716E;">{{activity_details.state}}</view>
  35. </view>
  36. </view>
  37. <view style="margin-top: 60rpx;">
  38. <view class="lf-font-32 lf-color-black">
  39. 报名信息
  40. </view>
  41. <view class="lf-m-t-30">
  42. <text class="lf-font-28 lf-color-777">报名人:</text><text class="lf-font-28 lf-color-777 lf-m-l-10">{{activity_details.name}}</text>
  43. </view>
  44. <view class="lf-m-t-30">
  45. <text class="lf-font-28 lf-color-777">手机号码:</text><text class="lf-font-28 lf-color-777 lf-m-l-10">{{activity_details.phone}}</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import lfQrcode from '@/components/lf-code/lf-qrcode.vue';
  55. export default {
  56. data() {
  57. return {
  58. config: {
  59. bar: {
  60. code: 'E01181016286106',
  61. color: '#000', // 条形码的颜色
  62. bgColor: '#FFFFFF', // 背景色
  63. width: 586, // 宽度
  64. height: 210 // 高度
  65. },
  66. qrc: {
  67. code: "",
  68. size: 352, // 二维码大小
  69. level: 4, //等级 0~4
  70. bgColor: '#FFFFFF', //二维码背景色 默认白色
  71. // border: {
  72. // color: ['#8A2387', '#F27121'], //边框颜色支持渐变色
  73. // lineWidth: 3, //边框宽度
  74. // },
  75. // img: '/static/logo.png', //图片
  76. // iconSize: 40, //二维码图标的大小
  77. color: '#000000', //边框颜色支持渐变色
  78. }
  79. },
  80. activity_id: 0,
  81. activity_details: ''
  82. }
  83. },
  84. components: {lfQrcode},
  85. onLoad(e) {
  86. this.activity_id = e.activity_id;
  87. this.getMyActivetiDetails();
  88. },
  89. methods: {
  90. getMyActivetiDetails() {
  91. this.$http
  92. .get({
  93. api: 'api/activity/my_detail',
  94. data: {
  95. id: this.activity_id
  96. },
  97. header: {
  98. Authorization: this.$cookieStorage.get('user_token')
  99. },
  100. })
  101. .then(res => {
  102. if (res.data.code == 200) {
  103. if (res.data.status) {
  104. this.activity_details = res.data.data;
  105. this.config.qrc.code = JSON.stringify({
  106. u_id: this.activity_details.user_id,
  107. a_id: this.activity_details.activity_id
  108. })
  109. console.log('活动详情',this.activity_details);
  110. } else {
  111. wx.showModal({
  112. content: res.message || '请下拉页面刷新重试',
  113. showCancel: false
  114. });
  115. }
  116. } else {
  117. wx.showModal({
  118. content: '请下拉页面刷新重试',
  119. showCancel: false
  120. });
  121. }
  122. wx.hideLoading();
  123. })
  124. .catch(() => {
  125. wx.hideLoading();
  126. wx.showModal({
  127. content: '请求失败',
  128. showCancel: false
  129. });
  130. });
  131. }
  132. }
  133. }
  134. </script>
  135. <style>
  136. page {
  137. height: 100%;
  138. }
  139. </style>
  140. <style lang="scss" scoped>
  141. .register-content {
  142. margin-top: -42rpx;
  143. margin-bottom: 50rpx;
  144. }
  145. .register-head {
  146. width: 160rpx;
  147. height: 160rpx;
  148. box-shadow: 0px 2rpx 8rpx 1rpx rgba(21, 113, 110, 0.2);
  149. border: 5rpx solid #FFFFFF;
  150. border-radius: 50%;
  151. }
  152. .register-card {
  153. width: 686rpx;
  154. height: max-content;
  155. margin-top: 240rpx;
  156. background: #FFFFFF;
  157. border-radius: 20rpx;
  158. padding-bottom: 40rpx;
  159. }
  160. .head {
  161. width: 750rpx;
  162. height: max-content;
  163. background: linear-gradient(270deg, #187B7A 0%, #2FAAA7 100%, #22A2A0 100%);
  164. position: relative;
  165. display: flex;
  166. align-items: flex-end;
  167. box-sizing: border-box;
  168. padding: 60rpx 32rpx 110rpx;
  169. color: #222222 !important;
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. }
  174. .bg-left{
  175. position: absolute;
  176. width: 196rpx;
  177. height: 196rpx;
  178. border-radius: 50%;
  179. background-color: rgba(255,255,255,0.04);
  180. left: -92rpx;
  181. bottom: 60rpx;
  182. }
  183. .bg-right{
  184. position: absolute;
  185. width: 520rpx;
  186. height: 520rpx;
  187. border-radius: 50%;
  188. background-color: rgba(255,255,255,0.04);
  189. right: -168rpx;
  190. top: -142rpx;
  191. }
  192. </style>