home.wxml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <!-- home -->
  2. <wxs src="../../utils/util.wxs" module="format" />
  3. <view class="home fg" wx:if="{{curNav == 0}}">
  4. <view style="overflow:hidden">
  5. <view class="swiperContainer">
  6. <swiper indicator-dots indicator-active-color="#eee" autoplay interval="3000" circular>
  7. <swiper-item wx:for="{{home.banners}}" wx:key>
  8. <image src="{{imgUrl + item.bannerImage}}" class="full" mode="scaleFill"></image>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. </view>
  13. <view class="home-nav-list">
  14. <image src="../../imgs/home/nav-bg.png"></image>
  15. <view class="home-nav-select">
  16. <view class="contest" bindtap="toLinkR">
  17. <image mode="widthFix" src="../../imgs/home/contest.png"></image>
  18. <view>参加竞赛</view>
  19. </view>
  20. <view class="ranking" bindtap="toLink" data-url="/pages/contest/ranking/ranking">
  21. <image mode="widthFix" src="../../imgs/home/ranking.png"></image>
  22. <view>排行榜</view>
  23. </view>
  24. <!-- <view class="study" bindtap="toLink" data-url="/pages/contest/answer/answer"> -->
  25. <view class="study" bindtap="clickStudy">
  26. <image mode="widthFix" src="../../imgs/home/study.png"></image>
  27. <view>在线学习</view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- <view class="hotNews fg">
  32. <view class="title">
  33. <view class="row crosscenter">
  34. <view class="bar"></view>
  35. <text class="txtpro txtbold" style="color: #002063">热点头条</text>
  36. </view>
  37. <view class="cuIcon-more" bindtap="clickHotnewsMore"></view>
  38. </view>
  39. <view>
  40. <view class="article" bindtap="clickArticle" wx:for="{{home.hotnews}}" wx:key data-i="{{index}}" data-id="{{item.id}}">
  41. <view class="imgbox">
  42. <image class="fullx" src="{{imgUrl + item.coverImage}}" mode="widthFix"></image>
  43. </view>
  44. <view class="content">
  45. <text style="color: #002063" class="txtbold">{{item.headlineTitle}}</text>
  46. <view class="imgsmr attr">
  47. <image src="../../imgs/clock-attr.png"></image>
  48. <text>{{item.releaseTime}}</text>
  49. </view>
  50. <view class="p">{{item.summary}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view> -->
  55. <view class="news-list">
  56. <view class="hot-title">
  57. <view class="title">热点头条</view>
  58. <view class="more" bindtap="clickHotnewsMore">
  59. <view>更多</view>
  60. <image mode="widthFix" src="../../imgs/home/arrow.png"></image></view>
  61. </view>
  62. <view class="news-list-content">
  63. <view class="news-list-item" bindtap="clickArticle" wx:for="{{home.hotnews}}" wx:key data-i="{{index}}" data-id="{{item.id}}">
  64. <image mode="widthFix" src="../../imgs/home/list-bg.png"></image>
  65. <view class="content">
  66. <image src="{{imgUrl + item.coverImage}}" class="left"></image>
  67. <view class="right">
  68. <view class="title">{{item.headlineTitle}}</view>
  69. <view class="introduce">{{item.summary}}</view>
  70. <view class="bottom">
  71. <view class="tagR">赛事</view>
  72. <view class="time">{{item.releaseTime}}</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- <view class="partners">
  80. <view class="title">
  81. <view class="row crosscenter">
  82. <view class="bar"></view>
  83. <text class="txtpro txtbold" style="color: #002063">合作伙伴</text>
  84. </view>
  85. </view>
  86. <view class="partnersContainer">
  87. <view class="level" wx:for="{{home.partners}}" wx:key>
  88. <view class="levelTitle">
  89. <view>{{item.title}}</view>
  90. </view>
  91. <view class="row around wrap">
  92. <view class="bor" style="margin-bottom: 1em">
  93. <image src="{{imgUrl + item.brandImage}}" mode="scaleToFill"></image>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view> -->
  99. <view class="sponsor">
  100. <view class="sponsor-title">合作伙伴</view>
  101. <view class="sponsor-list">
  102. <view class="sponsor-item" wx:for="{{home.partners}}" wx:key="index">
  103. <image mode="widthFix" src="{{imgUrl + item.brandImage}}"></image>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- <view class="authorization">
  108. <button open-type="getUserInfo" bindgetuserinfo="getUserinfo">点击授权</button>
  109. </view> -->
  110. </view>
  111. <!-- activity -->
  112. <view class="activities fg" wx:if="{{curNav == 1}}">
  113. <view class="searchContainer">
  114. <view class="row center search" bindtap="clickSearch">
  115. <input focus wx:if="{{searchOn}}" bindblur="blurSearch" bindinput="inputSearch"></input>
  116. <text class="cuIcon-search" wx:if="{{!searchOn}}"> 请输入活动关键字查询</text>
  117. </view>
  118. </view>
  119. <view class="activityContainer">
  120. <view class="activity" bindtap="clickActivity" wx:for="{{activity.list}}" wx:key data-i="{{index}}" data-id="{{item.id}}">
  121. <image src="{{imgUrl + item.coverImage}}"></image>
  122. <!-- <view class="tag {{item.status_attend=='已结束'?'finished':item.status_attend=='未开始'?'ready':'signing'}}" wx:if="{{item.status_attend}}">{{item.status_attend}}</view> -->
  123. <view class="tag {{(format.valueOf(item.applyEndTime)<format.valueOf())?'finished':(format.valueOf(item.applyStartTime)>format.valueOf())?'ready':'signing'}}" wx:if="{{item}}">
  124. <!-- {{format.valueOf(item.applyEndTime)<format.valueOf()?'已结束':format.valueOf(item.applyStartTime)>format.valueOf()?'报名中':'未开始'}} -->
  125. {{(format.valueOf(item.applyEndTime)<format.valueOf())?'已结束':(format.valueOf(item.applyStartTime)>format.valueOf())?'未开始':'报名中'}}
  126. </view>
  127. <view class="skiing">{{item.activityTitle}}</view>
  128. </view>
  129. </view>
  130. </view>
  131. <!-- community -->
  132. <view class="community fg" wx:if="{{curNav==2}}">
  133. <view class="searchContainer">
  134. <view class="row center search" bindtap="clickSearch">
  135. <input focus wx:if="{{searchOn}}" bindblur="blurSearch" bindinput="inputSearch"></input>
  136. <text class="cuIcon-search" wx:if="{{!searchOn}}"> 请输入活动关键字查询</text>
  137. </view>
  138. <view class="release-button" bindtap="clickAddtidings">发布</view>
  139. </view>
  140. <view class="bfc">
  141. <!-- item -->
  142. <view wx:for="{{community.list}}" wx:key>
  143. <view class="imgtxt" bindtap="clickCommunityArticle" data-item="{{item}}">
  144. <view class="img">
  145. <!-- <image mode="aspectFill" src="{{imgUrl + item.avatar}}"></image> -->
  146. <image mode="aspectFill" src="{{imgUrl + item.coverImage}}"></image>
  147. <image mode="scaleToFill" src="../../imgs/video-play.png" class="videoPlay" wx:if="{{item.fileType ==2}}"></image>
  148. </view>
  149. <view class="text">
  150. <view class="textcontent">
  151. <text class="txtelldup">{{item.articleTitle||''}}</text>
  152. </view>
  153. <view class="row between more subtxt">
  154. <view class="row crosscenter avatar flexible noscroll">
  155. <view class="circle">
  156. <image src="{{item.avatar}}" class="full"></image>
  157. </view>
  158. <view class="flexible noscroll nowrap-ell">
  159. <text>{{item.nickname||''}}</text>
  160. </view>
  161. </view>
  162. <view class="row crosscenter favor" catchtap="clickFavorite" data-i="{{index}}" data-id="{{item.id}}" data-isCollect="{{!!item.isCollect}}">
  163. <image class="favorite" src="../../imgs/favorite{{item.isCollect?'-checked':''}}.png"></image>
  164. <text>{{item.collectNumber||0}}</text>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <!-- item -->
  171. </view>
  172. </view>
  173. <!-- mine -->
  174. <view class="mine col full" wx:if="{{curNav==3}}">
  175. <view>
  176. <image class="fullx" src="../../imgs/mine-bg.png" mode="widthFix" style="display:block"></image>
  177. </view>
  178. <view class="wrp row fg" style="height: 200rpx" bindtap="clickMyinfo">
  179. <view class="circle shadow posrel bg" style="top: -158rpx; height: 236rpx; width: 236rpx;">
  180. <image class="" src="{{user.upload_head || user.avatar}}" class="full"></image>
  181. <!-- <image class="" src="{{user.avatarUrl}}" style="padding: 8rpx; height: 220rpx; width: 220rpx;"></image> -->
  182. </view>
  183. <view class="gapleft">
  184. <view class="txtbold txtlg imgsmr row bot gapbot">
  185. <text>{{user.realname || user.nickname || ''}}</text>
  186. <image src="../../imgs/{{user.sex==1?'male':'female'}}.png" style="margin-bottom: 6rpx" class="gapleft"></image>
  187. </view>
  188. <text class="txtsub subtxt">{{user.introduction||'这个家伙很懒,什么都没留下...'}}</text>
  189. </view>
  190. </view>
  191. <view class="inbot bory row center mineNav">
  192. <view class="{{mine.curNav == 0?'selected':''}}" bindtap="clickMinenav" data-cur="0">
  193. 我的发布
  194. </view>
  195. <view class="{{mine.curNav == 1?'selected':''}}" bindtap="clickMinenav" data-cur="1">
  196. 我的收藏
  197. </view>
  198. <view class="{{mine.curNav == 2?'selected':''}}" bindtap="clickMinenav" data-cur="2">
  199. 我的评论
  200. </view>
  201. <view class="{{mine.curNav == 3?'selected':''}}" bindtap="clickMinenav" data-cur="3">
  202. 我的活动
  203. </view>
  204. </view>
  205. <view class="fg flexible myPub myCollection" wx:if="{{mine.curNav==1 || mine.curNav==0}}">
  206. <view class="bfc">
  207. <!-- item -->
  208. <view wx:for="{{mine.list}}" wx:key>
  209. <view class="imgtxt" bindtap="clickCommunityArticle" data-item="{{item}}">
  210. <view class="img">
  211. <image mode="aspectFill" src="{{imgUrl + item.coverImage}}"></image>
  212. <image mode="scaleToFill" src="../../imgs/video-play.png" class="videoPlay" wx:if="{{item.file_type=='2'}}"></image>
  213. <view class="tag {{item.is_prize=='0'?'ready':item.is_prize=='1'?'finished':''}}" wx:if="{{item.is_prize!=2}}">{{item.is_prize==0?'审核中':item.is_prize==1?'未通过':''}}</view>
  214. <view class="removeTag circle row center" catchtap="clickRemoveArticle" data-id="{{item.id}}" data-i="{{index}}" data-mineNav="{{mine.curNav}}">
  215. <text class="cuIcon-deletefill txtanti"></text>
  216. </view>
  217. </view>
  218. <view class="text">
  219. <view class="textcontent">
  220. <text>{{item.articleTitle||''}}</text>
  221. </view>
  222. <view class="row between more subtxt">
  223. <view class="row crosscenter avatar flexible noscroll">
  224. <view class="circle">
  225. <image src="{{item.avatar}}" class="full"></image>
  226. </view>
  227. <view class="flexible noscroll nowrap-ell">
  228. <text>{{item.nickname||''}}</text>
  229. </view>
  230. </view>
  231. <view class="row crosscenter favor" catchtap="clickFavorite" wx:if="{{false}}" data-i="{{index}}" data-id="{{item.id}}">
  232. <image class="favorite" src="../../imgs/favorite{{item.isCollect?'-checked':''}}.png"></image>
  233. <text>{{item.collectNumber||0}}</text>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. <!-- item -->
  240. </view>
  241. </view>
  242. <view class="myComment flexible" wx:if="{{mine.curNav==2}}">
  243. <view class="inright row fg comment" wx:for="{{mine.list}}" wx:key>
  244. <image src="{{user.avatarUrl}}" class="gapright"></image>
  245. <view class="col flexible">
  246. <text class="txtsub nickname gapbot">{{user.articleTitle}}</text>
  247. <view class="row gapbot wrpright">
  248. <text class="flexible">{{item.comments}}</text>
  249. <text class="subtxt">{{item.createTime}}</text>
  250. </view>
  251. <view class="bortop wrpright row txtsub" style="padding-top: 8rpx">
  252. <text class="subtxt flexible">{{item.space_title}}</text>
  253. <text class="{{item.is_prize_show==1?'txtdanger':'subtxt'}}">{{['','待审核', '已通过', '未通过'][item.status]}}</text>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <view class="myActivities flexible" wx:if="{{mine.curNav==3}}">
  259. <view class="fg wrplg myAct" wx:for="{{mine.list}}" wx:key>
  260. <view class="txtbold">{{item.activityTitle}}</view>
  261. <view class="txtsub gaptop">
  262. <text class="subtxt">活动时间:</text>
  263. <text>{{item.activityTime}}</text>
  264. </view>
  265. <view class="txtsub">
  266. <text class="subtxt">活动地点:</text>
  267. <text>{{item.activityLocation}}</text>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <!-- bottom navigation bar -->
  273. <!-- <view class="navigation row around fg">
  274. <view class="nav col crosscenter {{curNav == 0 && 'act'}}" bindtap="clickNav" data-cur="0">
  275. <image src="../../imgs/home{{curNav==0? '-act':''}}.png"></image>
  276. <text>首页</text>
  277. </view>
  278. <view class="nav col crosscenter {{curNav==1&&'act'}}" bindtap="clickNav" data-cur="1">
  279. <image src="../../imgs/activity{{curNav==1? '-act':''}}.png"></image>
  280. <text>活动</text>
  281. </view>
  282. <view class="addTidings col crosscenter" bindtap="clickAddtidings" wx:if="{{curNav==2}}">
  283. <image src="../../imgs/add-tidings.png"></image>
  284. </view>
  285. <view class="nav col crosscenter {{curNav==2&&'act'}}" bindtap="clickNav" data-cur="2">
  286. <image src="../../imgs/community{{curNav==2?'-act':''}}.png"></image>
  287. <text>社区</text>
  288. </view>
  289. <view class="nav col crosscenter {{curNav==3&&'act'}}" bindtap="clickNav" data-cur="3">
  290. <image src="../../imgs/mine{{curNav==3?'-act':''}}.png"></image>
  291. <text>我的</text>
  292. </view>
  293. </view> -->
  294. <view class="nav-list">
  295. <image mode="widthFix" class="bg" src="../../imgs/nav/bg.png"></image>
  296. <view class="nav-select">
  297. <view class="home" bindtap="clickNav" data-cur="0">
  298. <image src="../../imgs/nav/home{{curNav==0? '-active':''}}.png"></image>
  299. <view>首页</view>
  300. </view>
  301. <view class="activity" bindtap="clickNav" data-cur="1">
  302. <image src="../../imgs/nav/activity{{curNav==1? '-active':''}}.png"></image>
  303. <view>活动</view>
  304. </view>
  305. <!-- <view class="release" bindtap="clickAddtidings" >
  306. <image mode="widthFix" src="../../imgs/nav/release.png"></image>
  307. </view> -->
  308. <view class="release" bindtap="toLinkR">
  309. <image mode="widthFix" src="../../imgs/nav/release.png"></image>
  310. </view>
  311. <view class="community" bindtap="clickNav" data-cur="2">
  312. <image src="../../imgs/nav/community{{curNav==2?'-active':''}}.png"></image>
  313. <view>社区</view>
  314. </view>
  315. <view class="me" bindtap="clickNav" data-cur="3">
  316. <image src="../../imgs/nav/me{{curNav==3?'-active':''}}.png"></image>
  317. <view>我的</view>
  318. </view>
  319. </view>
  320. </view>
  321. <!-- community img and video upload mask -->
  322. <view class="cover col center" wx:if="{{community.showAddtidings}}" catchtap="clickClosetidings">
  323. <view class="imglg txtanti txtsub">
  324. <view class="txtcenter col" bindtap="clickUploadpics">
  325. <image class="gapbot" src="../../imgs/picture.png"></image>
  326. <text>图片上传</text>
  327. </view>
  328. <view class="txtcenter col" style="margin-top: 120rpx" bindtap="clickUploadvideos">
  329. <image class="gapbot" src="../../imgs/video.png"></image>
  330. <text>视频上传</text>
  331. </view>
  332. </view>
  333. <!-- <view class="navigation row around">
  334. <view class="nav col crosscenter">
  335. <image></image>
  336. <text>0</text>
  337. </view>
  338. <view class="addTidings col crosscenter" bindtap="clickClosetidings">
  339. <image src="../../imgs/close-tidings.png" style="margin-top: calc(-32rpx - .4vh)"></image>
  340. </view>
  341. <view class="nav col crosscenter">
  342. <image></image>
  343. <text></text>
  344. </view>
  345. </view> -->
  346. </view>
  347. <view class="cu-modal {{showAuthPanel&&'show'}}">
  348. <view class="cu-dialog">
  349. <view class="cu-bar bg-white justify-end">
  350. <view class="content">微信授权</view>
  351. <view class="action" bindtap="clickHideAuthPanel">
  352. <text class="cuIcon-close text-red"></text>
  353. </view>
  354. </view>
  355. <view class="padding-xl">
  356. 使用小程序需要获取您的公开信息(昵称,头像等)
  357. </view>
  358. <view class="cu-bar bg-white justify-end">
  359. <view class="action">
  360. <button class="cu-btn line-green text-green" bindtap="clickHideAuthPanel">取消</button>
  361. <button class="cu-btn bg-green margin-left" open-type="getUserInfo" bindtap="getUserInfo">授权</button>
  362. </view>
  363. </view>
  364. </view>
  365. </view>