actionDetail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view class="content">
  3. <image v-if="detail.pics" :src="detail.pics.split(',')[1]" mode="widthFix" class="top-img"></image>
  4. <view class="add-if">
  5. <view class="jj" v-if="!detail.partake">
  6. <view class="if-tit">
  7. 购买7万元宏根蒂品牌红酒成为
  8. </view>
  9. <view class="if-level">
  10. 品牌经纪人
  11. </view>
  12. <view class="if-status">
  13. {{userInfo.level > 0 ?'您已满足参与条件': '您未满足参与条件'}}
  14. </view>
  15. <view class="add-btn" :class="{'cant': userInfo.level == 0}" @click="add()">
  16. 立即参与
  17. </view>
  18. </view>
  19. <view v-else>
  20. <view class="flex">
  21. <image class="action_icon" src="../../static/img/action_left_icon.png" mode="widthFix"></image>
  22. <view class="text-white action_title">
  23. 参与进度
  24. </view>
  25. <image class="action_icon" src="../../static/img/action_right_icon.png" mode="widthFix"></image>
  26. </view>
  27. <view class="jj margin-t-20">
  28. </view>
  29. </view>
  30. </view>
  31. <view class="add-recoed flex">
  32. <view class="add-left">
  33. <image src="../../static/icon/time.png" mode="widthFix"></image>参与记录
  34. </view>
  35. <view class="add-left add-right" @click="goDetail()">
  36. 查看详情<image src="../../static/icon/write-go.png" mode="widthFix"></image>
  37. </view>
  38. </view>
  39. <view class="jj-wrap">
  40. <view class="jj-tit">
  41. 活动说明
  42. </view>
  43. <view class="jj" v-html="detail.content"></view>
  44. </view>
  45. <view class="" style="height: 60rpx;">
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  51. import empty from '@/components/empty';
  52. import {
  53. getActionDetail,
  54. addAction
  55. } from '@/api/index.js'
  56. import {
  57. getUser
  58. } from '@/api/user.js'
  59. export default {
  60. components: {
  61. uniLoadMore,
  62. empty
  63. },
  64. data() {
  65. return {
  66. userInfo: {
  67. },
  68. detail: {}
  69. }
  70. },
  71. onLoad(opt) {
  72. this.id = opt.id
  73. this.getUser()
  74. },
  75. onShow() {
  76. },
  77. onReachBottom() {
  78. },
  79. onReady() {
  80. },
  81. onBackPress() {
  82. uni.navigateTo({
  83. url: '/pages/index/index'
  84. })
  85. return true;
  86. },
  87. methods: {
  88. goDetail() {
  89. uni.navigateTo({
  90. url: '/pages/index/addList'
  91. })
  92. },
  93. getUser() {
  94. getUser().then(res => {
  95. this.userInfo = res.data
  96. this.getActionDetail()
  97. })
  98. },
  99. getActionDetail() {
  100. let that = this
  101. getActionDetail({
  102. }, that.id).then(res => {
  103. console.log(res);
  104. that.detail = res.data
  105. })
  106. },
  107. add() {
  108. uni.showLoading({
  109. title: '报名中',
  110. mask: true
  111. });
  112. addAction({
  113. out_id: this.id
  114. }).then(res => {
  115. uni.hideLoading()
  116. }).catch(() => {
  117. uni.hideLoading()
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. page {
  125. height: auto;
  126. min-height: 100%;
  127. background-color: #fdd717;
  128. }
  129. .add-if {
  130. width: 693rpx;
  131. margin: 20rpx auto;
  132. border: 3rpx solid #FED888;
  133. background: linear-gradient(0deg, #FF9805, #FFB606);
  134. border-radius: 20rpx;
  135. padding: 20rpx;
  136. .action_title {
  137. font-size: 44rpx;
  138. }
  139. .action_icon {
  140. height: 22rpx;
  141. width: 46rpx;
  142. }
  143. .if-tit {
  144. font-size: 43rpx;
  145. font-weight: bold;
  146. text-align: center;
  147. color: #6B4216;
  148. }
  149. .if-level {
  150. width: 274rpx;
  151. height: 76rpx;
  152. border: 2rpx solid #6B4216;
  153. border-radius: 14rpx;
  154. text-align: center;
  155. line-height: 76rpx;
  156. font-size: 37rpx;
  157. font-weight: bold;
  158. color: #6B4216;
  159. margin: 40rpx auto 30rpx;
  160. }
  161. .if-status {
  162. font-size: 26rpx;
  163. font-weight: 500;
  164. color: #666666;
  165. text-align: center;
  166. }
  167. .add-btn {
  168. width: 366rpx;
  169. height: 80rpx;
  170. background: linear-gradient(0deg, #FFB605, #FFD778);
  171. border-radius: 40rpx;
  172. line-height: 80rpx;
  173. font-size: 36rpx;
  174. font-weight: 500;
  175. color: #6B4216;
  176. text-align: center;
  177. margin: 30rpx auto 20rpx;
  178. &.bg-gray {
  179. color: #FFFFFF;
  180. }
  181. }
  182. }
  183. .add-recoed {
  184. width: 693rpx;
  185. height: 104rpx;
  186. border: 3rpx solid #FED888;
  187. background: linear-gradient(0deg, #FF9805, #FFB606);
  188. border-radius: 35rpx;
  189. margin: 20rpx auto;
  190. padding: 0 32rpx;
  191. .add-left {
  192. display: flex;
  193. align-items: center;
  194. image {
  195. width: 38rpx;
  196. margin: 0 15rpx 0 0;
  197. }
  198. font-size: 36rpx;
  199. font-weight: bold;
  200. color: #FFFFFF;
  201. }
  202. .add-right {
  203. font-size: 30rpx;
  204. font-weight: 500;
  205. color: #FFFFFF;
  206. image {
  207. width: 15rpx;
  208. margin: 0 0 0 15rpx;
  209. }
  210. }
  211. }
  212. .action-wrap {
  213. width: 704rpx;
  214. height: 330rpx;
  215. margin: 20rpx auto;
  216. image {
  217. width: 704rpx;
  218. height: 330rpx;
  219. border-radius: 20rpx;
  220. }
  221. }
  222. .jj-wrap {
  223. width: 693rpx;
  224. // height: 100rpx;
  225. padding: 49rpx 0 29rpx;
  226. border: 3rpx solid #FED888;
  227. background: linear-gradient(0deg, #FF9805, #FFB606);
  228. border-radius: 35rpx;
  229. margin: auto;
  230. .jj-tit {
  231. margin-bottom: 20rpx;
  232. font-size: 44rpx;
  233. font-weight: bold;
  234. color: #FFFFFF;
  235. text-align: center;
  236. position: relative;
  237. &::before {
  238. content: '';
  239. position: absolute;
  240. bottom: 0;
  241. left: 0;
  242. right: 0;
  243. margin: auto;
  244. width: 418rpx;
  245. height: 13rpx;
  246. background: linear-gradient(0deg, #FFCA4E, #F3F4AB);
  247. border-radius: 6rpx;
  248. }
  249. }
  250. }
  251. .jj {
  252. background-color: #fff;
  253. width: 653rpx;
  254. margin: auto;
  255. border-radius: 20rpx;
  256. border: 3px solid #FCE791;
  257. padding: 20rpx;
  258. }
  259. .top-img {
  260. width: 750rpx;
  261. }
  262. .cant {
  263. background: #D3D3D3 !important;
  264. color: #fff !important;
  265. }
  266. </style>