myPrizes.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view class="outter">
  3. <view class="head_title" :style="{height:head_height+'px'}">
  4. <view @click="navigateBack()" class="title" :style="{height:title_height+'px'}">
  5. <text class="iconfont .icon-Left"></text>
  6. 我的奖品
  7. </view>
  8. </view>
  9. <scroll-view scroll-with-animation="true" :scroll-top="scroll_top" scroll-y="true" class="body" :style="{height:'calc(100% - '+head_height+'px)'}">
  10. <view class="theme-title">
  11. <text class="title">我的奖品</text>
  12. <image mode="aspectFit" class="title-bg" src="https://www.productronicachina.com.cn/resources/files/0221/67b7dd27b30b7/标题星星.png"></image>
  13. </view>
  14. <view class="cont-box">
  15. <view class="prize-list">
  16. <view class="list-title">
  17. <view class="text">路线进度</view>
  18. <view class="button">继续打卡</view>
  19. </view>
  20. <view class="progress">
  21. <view class="progress-bg">
  22. <view :style="{width:(current_route/totle_route)*100+'%'}" class="progress-inner"></view>
  23. </view>
  24. <view v-for="item in prize_list" :style="{left:(item.route_require/totle_route)*100+'%'}" :class="['item',totle_route>=item.route_require?'active':'']">
  25. <text class="iconfont .icon-Check"></text>
  26. <view class="text">已满{{item.route_require}}条</view>
  27. </view>
  28. </view>
  29. <view class="title">
  30. 您目前的奖品
  31. </view>
  32. <view class="inner-list">
  33. <view v-for="item in prize_list" class="list-item">
  34. <image mode="aspectFill" class="image" :src="item.prize_image"></image>
  35. <view class="text">
  36. <view class="name">{{item.prize_name}}</view>
  37. <view class="route">成功打卡<text class="require">{{item.route_require}}条路线</text>即可获取</view>
  38. <view class="description">{{item.prize_desc}}</view>
  39. </view>
  40. <view class="button">{{getStateName(item.state)}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="bottom-text">
  45. <view style="font-size: 28rpx;margin-bottom: 20rpx;">领取奖品注意事项</view>
  46. <view style="font-size: 22rpx;line-height: 2;">1.展会期间,每人可领取完成最高线路的对应奖品,每人仅有一次兑奖机会。请谨慎兑奖。</view>
  47. <view style="font-size: 22rpx;line-height: 2;">2.礼品数量有限,仅限展会期间领取,先到先得,一旦赠完即止。</view>
  48. <view style="font-size: 22rpx;line-height: 2;">3.点击【可领取奖品】至展会现场礼品发放处【展位号待定】进行奖品核销与兑换。</view>
  49. <view style="font-size: 22rpx;line-height: 2;">4.满9条路线的观众兑奖完成后,可将名片投入礼品发放处【展位号待定】抽奖箱,获奖结果将于展后公布。</view>
  50. <view style="font-size: 22rpx;line-height: 2;">如有其他疑问,可至展会现场礼品发放处询问主办工作人员。</view>
  51. </view>
  52. </view>
  53. </scroll-view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. head_height:0,
  61. title_height:0,
  62. totle_route:9,
  63. current_route:6,
  64. prize_list:[
  65. {
  66. prize_name:'手机支架或降噪眼罩(随机)',
  67. prize_desc:'① 公文包或斜挎包(随机)<br/>② 有机会抽取大奖',
  68. prize_image:'',
  69. route_require:2,
  70. //
  71. state:'0'
  72. },
  73. {
  74. prize_name:'露营杯',
  75. prize_desc:'',
  76. prize_image:'',
  77. route_require:5,
  78. //
  79. state:'2'
  80. },
  81. ]
  82. };
  83. },
  84. methods: {
  85. getSafeHeight(){
  86. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  87. this.head_height = menuButtonInfo.bottom + 15
  88. this.title_height = menuButtonInfo.height
  89. },
  90. /**
  91. * 根据状态代码获取文本
  92. * @param {String} code 状态代码
  93. */
  94. getStateName(code){
  95. switch (code){
  96. case '0':
  97. return '不可领取'
  98. break
  99. case '1':
  100. return '待领取奖品'
  101. break
  102. case '2':
  103. return '可领取奖品'
  104. break
  105. case '3':
  106. return '已领取奖品'
  107. break
  108. default:
  109. break;
  110. }
  111. }
  112. },
  113. onLoad() {
  114. this.getSafeHeight()
  115. }
  116. }
  117. </script>
  118. <style lang="scss">
  119. .outter{
  120. height: 100%;
  121. position: relative;
  122. .head_title{
  123. width: 100%;
  124. background: linear-gradient( 270deg, #332968 9%, #435797 44%, #382E73 92%), rgba(0,0,0,0.2);
  125. padding-bottom: 15px;
  126. display: flex;
  127. align-items: flex-end;
  128. padding-left: 28rpx;
  129. .title{
  130. display: flex;
  131. align-items: center;
  132. color: white;
  133. font-size: 32rpx;
  134. .iconfont{
  135. font-size: 36rpx;
  136. margin-right: 8rpx;
  137. }
  138. }
  139. }
  140. .body{
  141. overflow: hidden;
  142. overflow-y: auto;
  143. background: linear-gradient( 180deg, #015A92 0%, #56A3E9 24%, #106591 98%);
  144. .cont-box{
  145. border-radius: 20rpx;
  146. margin: 30rpx;
  147. background-color: #EEEEEE;
  148. .prize-list{
  149. border-radius: 20rpx;
  150. background-color: white;
  151. padding: 36rpx 44rpx 30rpx;
  152. .inner-list{
  153. .list-item{
  154. padding: 20rpx 30rpx;
  155. background-color: #FAFAFA;
  156. border-radius: 20rpx;
  157. display: flex;
  158. .image{
  159. width: 128rpx;
  160. height: 128rpx;
  161. }
  162. .text{
  163. flex: 1;
  164. margin-left: 20rpx;
  165. margin-right: 60rpx;
  166. .name{
  167. font-size: 26rpx;
  168. margin-bottom: 10rpx;
  169. }
  170. .route{
  171. font-size: 18rpx;
  172. line-height: 1.8;
  173. .require{
  174. color: #015A92;
  175. }
  176. }
  177. .description{
  178. font-size: 18rpx;
  179. line-height: 1.8;
  180. }
  181. }
  182. .button{
  183. width: 128rpx;
  184. height: 48rpx;
  185. border-radius: 6rpx;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. color: white;
  190. font-size: 16rpx;
  191. font-weight: bold;
  192. background-color: #94A3B8;
  193. }
  194. }
  195. }
  196. .title{
  197. font-size: 24rpx;
  198. margin-bottom: 31rpx;
  199. }
  200. .progress{
  201. position: relative;
  202. height: 24rpx;
  203. width: 94%;
  204. margin-top: 24rpx;
  205. margin-bottom: 90rpx;
  206. display: flex;
  207. align-items: center;
  208. .item{
  209. position: relative;
  210. top:0;
  211. transform: translateX();
  212. background-color: white;
  213. position: absolute;
  214. height: 24rpx;
  215. width: 24rpx;
  216. display: flex;
  217. align-items: center;
  218. justify-content: center;
  219. border-radius: 12rpx;
  220. border: 1rpx solid #E57519;
  221. &.active{
  222. background-color: #E57519;
  223. }
  224. .iconfont{
  225. color: white;
  226. font-size: 18rpx;
  227. }
  228. .text{
  229. position: absolute;
  230. bottom: -40rpx;
  231. font-size: 20rpx;
  232. width: 100rpx;
  233. left: 50%;
  234. text-align: center;
  235. transform: translateX(-50%);
  236. }
  237. }
  238. .progress-bg{
  239. width: 100%;
  240. height: 9rpx;
  241. background-color: #D9CC9D;
  242. border-radius: 10rpx;
  243. .progress-inner{
  244. height: 100%;
  245. width: 50%;
  246. background-color: #E57519;
  247. border-radius: 10rpx;
  248. }
  249. }
  250. }
  251. .list-title{
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. .text{
  256. font-size: 24rpx;
  257. }
  258. .button{
  259. font-size: 18rpx;
  260. padding: 10rpx 20rpx;
  261. background-color: #4085C7;
  262. border-radius: 40rpx;
  263. font-weight: bold;
  264. color: white;
  265. }
  266. }
  267. }
  268. .bottom-text{
  269. padding: 36rpx 44rpx 30rpx;
  270. }
  271. }
  272. .theme-title{
  273. margin-top: 54rpx;
  274. margin-bottom: 32rpx;
  275. position: relative;
  276. height: 130rpx;
  277. display: flex;
  278. justify-content: center;
  279. align-items: center;
  280. .title{
  281. color: white;
  282. font-size: 55rpx;
  283. font-weight: bold;
  284. }
  285. .title-bg{
  286. position: absolute;
  287. left: 0;
  288. top: 0;
  289. height: 100%;
  290. }
  291. }
  292. }
  293. }
  294. </style>