task.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="content">
  3. <scroll-view scroll-y="true" class="scroll-content" :enhanced="true" :bounces="false" :show-scrollbar="false" @scroll="pageScroll">
  4. <view class="task-header">
  5. <cu-custom :bgColor="scrollHeight>20?'bg-bluev-head':'none'">
  6. <block slot="content">任务广场</block>
  7. </cu-custom>
  8. <view class="sub-name">任务多,变现快!</view>
  9. <view class="sub-logo" :style="style"><image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/task-star-small.png" mode="widthFix"></image></view>
  10. </view>
  11. <view class="task-content">
  12. <view class="home-search">
  13. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/search-icon.png" mode="widthFix"></image>
  14. <input type="text" class="search-input" placeholder="搜一搜最新任务" />
  15. </view>
  16. <view :class="scrollHeight<20?'task-status':'fixed-filter task-status'" :style="fixedStyle">
  17. <filterMain :data="filterData" @success="searchFilter"></filterMain>
  18. </view>
  19. <view class="star-task-list">
  20. <navigator hover-class="none" url="/pages/task/detail" class="task-item" v-for="(item,indx) in 10" :key="indx">
  21. <view class="item-body">
  22. <view class="item-img">
  23. <image src="https://p9-dy.byteimg.com/obj/ecom-shop-material/jpeg_m_e3fa80e91300b16e0df15e2bcbd8c003_sx_426270_www800-800" mode="aspectFill"></image>
  24. </view>
  25. <view class="item-info">
  26. <view class="title">【官方正品】金纺柔顺剂宝宝衣物适用0漂白剂抗静电蓬松不僵硬CW-星川任务-202</view>
  27. <view class="item-tags">
  28. <view class="tag-item">抖音</view>
  29. <view class="tag-item">手拍</view>
  30. <view class="tag-item">真人出境</view>
  31. </view>
  32. <view class="item-price">
  33. <view class="item-platform">抖音L1</view>
  34. <view class="price-txt"><text>¥</text>20.0w</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="item-foot">
  39. <view class="item-join">
  40. <view class="cu-avatar-group">
  41. <view class="cu-avatar round sm" v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]"></view>
  42. </view>
  43. <view class="join-text"><text>180</text>/200人已参加</view>
  44. </view>
  45. <view class="foot-btn">
  46. <button class="btn disabled" :disabled="true">立即参加</button>
  47. </view>
  48. </view>
  49. </navigator>
  50. </view>
  51. <view class="star-task-more"></view>
  52. </view>
  53. </scroll-view>
  54. <halfLogin ref="loginCom"></halfLogin>
  55. </view>
  56. </template>
  57. <script>
  58. var app;
  59. import filterMain from "./filter";
  60. export default {
  61. components: {
  62. filterMain
  63. },
  64. data() {
  65. return {
  66. show:false,
  67. style:"",
  68. fixedStyle:"",
  69. scrollHeight:0,
  70. avatar: [
  71. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
  72. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
  73. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
  74. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg'
  75. ],
  76. filterData:[
  77. {
  78. "name":"任务状态",
  79. "children":[
  80. {
  81. "name":"全部",
  82. "hide":"任务状态",
  83. "index":0
  84. },
  85. {
  86. "name":"招募中",
  87. "hide":"招募中",
  88. "index":1
  89. },
  90. {
  91. "name":"已终止",
  92. "hide":"已终止",
  93. "index":2
  94. }
  95. ]
  96. },
  97. {
  98. "name":"平台等级",
  99. "children":[
  100. {
  101. "name":"全部",
  102. "hide":"平台等级",
  103. "index":0
  104. },
  105. {
  106. "name":"LV.1",
  107. "hide":"LV.1",
  108. "index":1
  109. },
  110. {
  111. "name":"LV.2",
  112. "hide":"LV.2",
  113. "index":2
  114. },
  115. {
  116. "name":"LV.3",
  117. "hide":"LV.3",
  118. "index":3
  119. },
  120. {
  121. "name":"LV.4",
  122. "hide":"LV.4",
  123. "index":4
  124. }
  125. ]
  126. },
  127. {
  128. "name":"任务奖励",
  129. "children":[
  130. {
  131. "name":"不限",
  132. "hide":"任务奖励",
  133. "index":0
  134. },
  135. {
  136. "name":"100以下",
  137. "hide":"100以下",
  138. "index":1
  139. },
  140. {
  141. "name":"100-500",
  142. "hide":"100-500",
  143. "index":2
  144. },
  145. {
  146. "name":"500以上",
  147. "hide":"以上",
  148. "index":3
  149. }
  150. ]
  151. },
  152. {
  153. "name":"排序方式",
  154. "children":[
  155. {
  156. "name":"不限",
  157. "hide":"排序方式",
  158. "index":0
  159. },
  160. {
  161. "name":"综合排序",
  162. "hide":"综合",
  163. "index":1
  164. },
  165. {
  166. "name":"奖励最高",
  167. "hide":"最高",
  168. "index":2
  169. },
  170. {
  171. "name":"奖励最低",
  172. "hide":"最低",
  173. "index":3
  174. },
  175. {
  176. "name":"最新发布",
  177. "hide":"最新",
  178. "index":4
  179. }
  180. ]
  181. }
  182. ]
  183. }
  184. },
  185. onLoad() {
  186. app = this;
  187. var StatusBar= this.StatusBar;
  188. var CustomBar= this.CustomBar;
  189. var style = `top:${StatusBar}px;`;
  190. app.style = style;
  191. app.fixedStyle = `top:${CustomBar}px;`;
  192. },
  193. methods: {
  194. pageScroll(event) {
  195. var scrollHeight = event.detail.scrollTop;
  196. app.scrollHeight = scrollHeight;
  197. if (scrollHeight > 20) {
  198. app.show = true;
  199. } else {
  200. app.show = false;
  201. }
  202. },
  203. searchFilter(){
  204. }
  205. }
  206. }
  207. </script>
  208. <style lang="scss">
  209. page{background-color: #f8f8f8;}
  210. .fixed-filter{position: fixed;background-image: linear-gradient(180deg, #f8f8f8 9%, #fff 100%);z-index: 999;padding: 10rpx 20rpx;right: 0;left: 0;}
  211. .task-header{position: relative;background-image: linear-gradient(180deg, #85DFFE 9%, #D5F4FF 62.55%, #f8f8f8 100%);height: 290rpx;}
  212. .task-header .sub-name{font-size: 32rpx;font-weight: 800;font-family: "bluevBold";padding-left: 20rpx;padding-top: 20rpx;}
  213. .task-header .sub-logo{
  214. position: absolute;
  215. top: 40rpx;
  216. /* #ifdef MP-WEIXIN */
  217. right: 220upx;
  218. /* #endif */
  219. /* #ifdef MP-ALIPAY */
  220. right: 150upx;
  221. /* #endif */
  222. }
  223. .task-header .sub-logo image{width: 220rpx;max-height: 220rpx;}
  224. .task-content{background-image: linear-gradient(180deg, #ffffff 1%, #f8f8f8 100%);border-radius: 40upx 40upx 0 0;padding: 20rpx;}
  225. .home-search-loading{margin: 20rpx;height: 68rpx;}
  226. .home-search{display: flex;align-items: center;background-color: rgba(246, 246, 246, 1);border-radius: 10rpx;height: 68rpx;padding: 0 20rpx;gap: 20rpx;}
  227. .home-search image{width: 32rpx;height: 32rpx;}
  228. .home-search .search-input{font-size: 24rpx;width: 100%;border: 0;height: 100%;box-sizing: none;box-shadow: none;}
  229. </style>