task.vue 6.4 KB

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