actionDetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 class="dqyj">
  29. 当前业绩量: {{detail.partake.money}}
  30. </view>
  31. <view class="show-jdt">
  32. <image src="../../static/img/action_bg.png" mode="" style="width: 601rpx;"></image>
  33. <view class="jdt">
  34. <view class="jdt-wrap">
  35. <view class="jdt-wc" :style="{'width': detail.partake.money == 0? '0%':(detail.partake.money*1 >= detail.number*1 ? '100%': (((detail.partake.money*1)/(detail.number*1)*100).toFixed(2) + '%')) }">
  36. </view>
  37. </view>
  38. </view>
  39. <view class="jdt-tit">
  40. 业绩量达到{{detail.number}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="add-recoed flex">
  47. <view class="add-left">
  48. <image src="../../static/icon/time.png" mode="widthFix"></image>参与记录
  49. </view>
  50. <view class="add-left add-right" @click="goDetail()">
  51. 查看详情<image src="../../static/icon/write-go.png" mode="widthFix"></image>
  52. </view>
  53. </view>
  54. <view class="jj-wrap">
  55. <view class="jj-tit">
  56. 活动说明
  57. </view>
  58. <view class="jj" v-html="detail.content"></view>
  59. </view>
  60. <view class="" style="height: 60rpx;">
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  66. import empty from '@/components/empty';
  67. import {
  68. getActionDetail,
  69. addAction
  70. } from '@/api/index.js'
  71. import {
  72. getUser
  73. } from '@/api/user.js'
  74. export default {
  75. components: {
  76. uniLoadMore,
  77. empty
  78. },
  79. data() {
  80. return {
  81. userInfo: {
  82. },
  83. detail: {}
  84. }
  85. },
  86. onLoad(opt) {
  87. this.id = opt.id
  88. this.getUser()
  89. },
  90. onShow() {
  91. },
  92. onReachBottom() {
  93. },
  94. onReady() {
  95. },
  96. onBackPress() {
  97. uni.navigateTo({
  98. url: '/pages/index/index'
  99. })
  100. return true;
  101. },
  102. methods: {
  103. goDetail() {
  104. uni.navigateTo({
  105. url: '/pages/index/addList'
  106. })
  107. },
  108. getUser() {
  109. getUser().then(res => {
  110. this.userInfo = res.data
  111. this.getActionDetail()
  112. })
  113. },
  114. getActionDetail() {
  115. let that = this
  116. getActionDetail({
  117. }, that.id).then(res => {
  118. console.log(res);
  119. that.detail = res.data
  120. })
  121. },
  122. add() {
  123. uni.showLoading({
  124. title: '报名中',
  125. mask: true
  126. });
  127. addAction({
  128. out_id: this.id
  129. }).then(res => {
  130. uni.hideLoading()
  131. }).catch(() => {
  132. uni.hideLoading()
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. page {
  140. height: auto;
  141. min-height: 100%;
  142. background-color: #fdd717;
  143. }
  144. .add-if {
  145. width: 693rpx;
  146. margin: 20rpx auto;
  147. border: 3rpx solid #FED888;
  148. background: linear-gradient(0deg, #FF9805, #FFB606);
  149. border-radius: 20rpx;
  150. padding: 20rpx;
  151. .action_title {
  152. font-size: 44rpx;
  153. }
  154. .action_icon {
  155. height: 22rpx;
  156. width: 46rpx;
  157. }
  158. .if-tit {
  159. font-size: 43rpx;
  160. font-weight: bold;
  161. text-align: center;
  162. color: #6B4216;
  163. }
  164. .if-level {
  165. width: 274rpx;
  166. height: 76rpx;
  167. border: 2rpx solid #6B4216;
  168. border-radius: 14rpx;
  169. text-align: center;
  170. line-height: 76rpx;
  171. font-size: 37rpx;
  172. font-weight: bold;
  173. color: #6B4216;
  174. margin: 40rpx auto 30rpx;
  175. }
  176. .if-status {
  177. font-size: 26rpx;
  178. font-weight: 500;
  179. color: #666666;
  180. text-align: center;
  181. }
  182. .add-btn {
  183. width: 366rpx;
  184. height: 80rpx;
  185. background: linear-gradient(0deg, #FFB605, #FFD778);
  186. border-radius: 40rpx;
  187. line-height: 80rpx;
  188. font-size: 36rpx;
  189. font-weight: 500;
  190. color: #6B4216;
  191. text-align: center;
  192. margin: 30rpx auto 20rpx;
  193. &.bg-gray {
  194. color: #FFFFFF;
  195. }
  196. }
  197. }
  198. .add-recoed {
  199. width: 693rpx;
  200. height: 104rpx;
  201. border: 3rpx solid #FED888;
  202. background: linear-gradient(0deg, #FF9805, #FFB606);
  203. border-radius: 35rpx;
  204. margin: 20rpx auto;
  205. padding: 0 32rpx;
  206. .add-left {
  207. display: flex;
  208. align-items: center;
  209. image {
  210. width: 38rpx;
  211. margin: 0 15rpx 0 0;
  212. }
  213. font-size: 36rpx;
  214. font-weight: bold;
  215. color: #FFFFFF;
  216. }
  217. .add-right {
  218. font-size: 30rpx;
  219. font-weight: 500;
  220. color: #FFFFFF;
  221. image {
  222. width: 15rpx;
  223. margin: 0 0 0 15rpx;
  224. }
  225. }
  226. }
  227. .action-wrap {
  228. width: 704rpx;
  229. height: 330rpx;
  230. margin: 20rpx auto;
  231. image {
  232. width: 704rpx;
  233. height: 330rpx;
  234. border-radius: 20rpx;
  235. }
  236. }
  237. .jj-wrap {
  238. width: 693rpx;
  239. // height: 100rpx;
  240. padding: 49rpx 0 29rpx;
  241. border: 3rpx solid #FED888;
  242. background: linear-gradient(0deg, #FF9805, #FFB606);
  243. border-radius: 35rpx;
  244. margin: auto;
  245. .jj-tit {
  246. margin-bottom: 20rpx;
  247. font-size: 44rpx;
  248. font-weight: bold;
  249. color: #FFFFFF;
  250. text-align: center;
  251. position: relative;
  252. &::before {
  253. content: '';
  254. position: absolute;
  255. bottom: 0;
  256. left: 0;
  257. right: 0;
  258. margin: auto;
  259. width: 418rpx;
  260. height: 13rpx;
  261. background: linear-gradient(0deg, #FFCA4E, #F3F4AB);
  262. border-radius: 6rpx;
  263. }
  264. }
  265. }
  266. .jj {
  267. background-color: #fff;
  268. width: 653rpx;
  269. margin: auto;
  270. border-radius: 20rpx;
  271. border: 3px solid #FCE791;
  272. padding: 20rpx;
  273. }
  274. .top-img {
  275. width: 750rpx;
  276. }
  277. .cant {
  278. background: #D3D3D3 !important;
  279. color: #fff !important;
  280. }
  281. .dqyj {
  282. font-size: 32rpx;
  283. font-weight: bold;
  284. color: #6B4216;
  285. padding: 35rpx 0;
  286. text-align: center;
  287. }
  288. .show-jdt {
  289. position: relative;
  290. height: 120rpx;
  291. image {
  292. height: 120rpx;
  293. }
  294. .jdt-tit {
  295. font-size: 17rpx;
  296. font-weight: bold;
  297. color: #B3703D;
  298. text-align: right;
  299. padding-right: 20rpx;
  300. position: absolute;
  301. bottom: 10rpx;
  302. right: 0;
  303. }
  304. .jdt {
  305. position: absolute;
  306. bottom: 47rpx;
  307. left: 0;
  308. right: 0;
  309. margin: auto;
  310. width: 577rpx;
  311. height: 28rpx;
  312. background: #B3703D;
  313. border: 2rpx solid #FFFFFF;
  314. box-shadow: 4rpx 9rpx 5rpx 0px rgba(0,0,0,0.32);
  315. border-radius: 14rpx;
  316. display: flex;
  317. justify-content: center;
  318. align-items: center;
  319. .jdt-wrap {
  320. width: 555rpx;
  321. height: 10rpx;
  322. border-radius: 5rpx;
  323. background: #bbb;
  324. position: relative;
  325. .jdt-wc {
  326. height: 10rpx;
  327. background: linear-gradient(0deg, #ECCF97, #FFF7E0, #EBCD93);
  328. border-radius: 5rpx;
  329. }
  330. }
  331. }
  332. }
  333. </style>