tasksquare.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383
  1. <template>
  2. <view class="nav">
  3. <view class="bg_box" style="background-color: #FFFFFF;" :style="{
  4. backgroundImage: mysNavConfig.bgImage,
  5. paddingTop: navBarTop,
  6. height: navBarHeight,
  7. opacity: opacity,
  8. }" :class="{ fixed: mysNavConfig.navFixed }"></view>
  9. <view class="mys_navBar" :style="{
  10. paddingTop: navBarTop,
  11. height: navBarHeight,
  12. paddingRight: navBarRight,
  13. }" :class="{ fixed: mysNavConfig.navFixed }">
  14. <!-- 左slot -->
  15. <view class="my_left_custom" :style="{ height: btnHeight }">
  16. <slot name="left"></slot>
  17. </view>
  18. <view class="btn_type" :style="{ height: btnHeight }">
  19. <view class="btn_box nav_btn_t1" :style="{
  20. width: btnWidth,
  21. height: btnHeight,
  22. marginLeft: navBarLeft,
  23. borderRadius: mysNavConfig.type2Config.radius,
  24. }">
  25. <view class="btn_back" @tap="onLeftClick()">
  26. <image class="nv_icon" :src="mysNavConfig.type2Config.leftPath"
  27. :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
  28. </view>
  29. <view class="line"></view>
  30. <view class="btn_home" @tap="onLeftHome('top')">
  31. <image class="nv_icon" :src="mysNavConfig.type2Config.rightPath"
  32. :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
  33. </view>
  34. </view>
  35. <!-- 标题 -->
  36. <view class="title_container" v-if="!mysNavConfig.searchConfig"
  37. :style="{ top: navBarTop, height: btnHeight }">
  38. <text class="title_text" v-if="!!mysNavConfig.navTitle" :style="{
  39. color: mysNavConfig.navTitle.color,
  40. fontSize: mysNavConfig.navTitle.fontSize,
  41. fontWeight: mysNavConfig.navTitle.fontWeight,
  42. }">{{ mysNavConfig.navTitle.text }}</text>
  43. <slot name="center2"></slot>
  44. </view>
  45. </view>
  46. </view>
  47. <aTip text="点击添加到我的小程序 \n下次访问更方便哦!" isCustom="true" />
  48. <view :style="{marginTop:navH}"></view>
  49. <view class="home">
  50. <view>
  51. <!-- 普通弹窗 -->
  52. <uni-popup ref="popup" background-color="#fff" @change="change">
  53. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  54. <view class="option1" style="margin-top: 20%;">
  55. <h3 style="margin-bottom: 10rpx;">社媒平台</h3>
  56. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby" :localdata="hobby">
  57. </uni-data-checkbox>
  58. </view>
  59. <view class="option2">
  60. <h3 style="margin-bottom: 10rpx;">稿费形式</h3>
  61. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby1" :localdata="hobby1">
  62. </uni-data-checkbox>
  63. </view>
  64. <view class="option3">
  65. <h3 style="margin-bottom: 10rpx;">任务形式</h3>
  66. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby2" :localdata="hobby2">
  67. </uni-data-checkbox>
  68. </view>
  69. <view class="butto">
  70. <button class="mini-btn" size="mini" @tap="Reset">重置</button>
  71. <button class="mini-btn" size="mini" @tap="determine">确定</button>
  72. </view>
  73. </view>
  74. </uni-popup>
  75. </view>
  76. <!-- <view class="imge">
  77. <image src="../../static/home/home1.png" mode=""></image>
  78. </view> -->
  79. <view class="uni-margin-wrap">
  80. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
  81. :interval="interval" :duration="duration">
  82. <swiper-item v-for="item in list1" @click="pick(item)">
  83. <image :src="item.img" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
  84. </swiper-item>
  85. </swiper>
  86. </view>
  87. <view class="commodity" style="margin-top: 3%;">
  88. <view class="project" v-for="(item,index) in projectList" :key="index" @tap="project(item)">
  89. <view class="projectdiagram" :style="{backgroundImage:`url(${item.coverphoto})`}">
  90. <view class="Mask" v-if="item.ddl">
  91. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png" mode="">
  92. </image>
  93. </view>
  94. <view style="padding-left: 4%;padding-top: 2%;">
  95. </view>
  96. </view>
  97. <view class="projecttext">
  98. <image :src="item.project_imgper" mode=""></image>
  99. <span>{{item.project_name|ellipsis}}</span>
  100. </view>
  101. <view style="padding-left: 1%;">
  102. <view class="TitleText" v-if="item.isself===1">
  103. <p>自报价</p>
  104. </view>
  105. <view class="TitleText" v-if="item.isfixedfee===1">
  106. <p>固定稿费</p>
  107. </view>
  108. <view class="TitleText" v-if="item.project_form===3">
  109. <p>线下探店</p>
  110. </view>
  111. </view>
  112. <view class="introduction">
  113. <view class="rleft" style="">
  114. <p>商品价值: <span
  115. style="color: red;font-weight: 600;">¥{{item.ProductInfo.ProductPrice}}</span></p>
  116. </view>
  117. <view class="rright" style="display: flex;justify-content:space-between;">
  118. <p>招募人数: <span style="color: balck;font-weight: 600;">{{item.taskNum}}</span></p>
  119. <p>报名人数: <span style="color: balck;font-weight: 600;">{{item.apply_num}}</span>
  120. </p>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <!-- 普通弹窗 公众号-->
  127. <uni-popup ref="popup4" class="share" background-color="#fff" @change="change">
  128. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  129. <view class="sharepage">
  130. <view class="projecttext1">
  131. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/project15.png"
  132. style="width: 80rpx; height: 80rpx;" mode=""></image>
  133. <span>YoungGee</span>
  134. </view>
  135. <view class="" style="margin-top: 5%;">
  136. <p style='color: #333333;font-size: 28rpx;text-align: center;'>扫码联系</p>
  137. </view>
  138. <view class="sharemap">
  139. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu.png"
  140. style="width: 400rpx;height: 400rpx;" mode=""></image>
  141. </view>
  142. </view>
  143. </view>
  144. </uni-popup>
  145. <view class="contact" @click="toggle4('center')">
  146. <view class="contt">
  147. <!-- <image class="img2" src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home2.png" mode=""></image> -->
  148. <image class="img1"
  149. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu_20211124192542.png" mode="">
  150. </image>
  151. </view>
  152. </view>
  153. </view>
  154. </template>
  155. <script>
  156. import aTip from "@/components/mys-tip_1.0.01/a_tip/aTip";
  157. import request from '@/components/request.js';
  158. /* 默认首页路径 */
  159. const homePath = "/pages/pupu/pupudao";
  160. /* 默认首页图标路径 */
  161. const homeIconPath = "/static/img/png4.png";
  162. /* 默认返回图标路径 */
  163. const backIconPath = "/static/img/png2.png";
  164. export default {
  165. props: {
  166. mysNavConfig: {
  167. type: Object,
  168. default () {
  169. return {
  170. /* 固定导航 */
  171. navFixed: true,
  172. /* 开启单页显示首页图标 */
  173. isHome: true,
  174. /* 占位开启 */
  175. navPadding: true,
  176. /* 背景 */
  177. bgColor: "#f8f8f8",
  178. /* 渐变色 */
  179. opacity: 1,
  180. /* 渐变开启 */
  181. isOpacity: false,
  182. /* 渐变延时效果 */
  183. opacityTime: 100,
  184. /* 左侧按钮样式 可选 type1 type2 (type2根据小程序胶囊位置调整) */
  185. btnType: "type1",
  186. /* type1 左侧文字配置 */
  187. leftText: {
  188. text: "",
  189. color: "",
  190. fontSize: "16px", // px upx rpx
  191. fontWeight: "", // blod
  192. },
  193. /* 标题 */
  194. navTitle: {
  195. text: "首页",
  196. color: "",
  197. fontSize: "32rpx", // px upx rpx
  198. fontWeight: "normal", // blod
  199. },
  200. /* type2 按钮 */
  201. type2Config: {
  202. // 左图标
  203. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png3.png",
  204. // 右图标
  205. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png1.png",
  206. // 圆角
  207. radius: "40rpx",
  208. },
  209. };
  210. },
  211. },
  212. scrollTop: {
  213. type: Number,
  214. default: function() {
  215. return 0;
  216. },
  217. },
  218. },
  219. filters: {
  220. ellipsis(value) {
  221. if (!value) return "";
  222. if (value.length > 20) {
  223. return value.slice(0, 20) + "...";
  224. }
  225. return value;
  226. },
  227. },
  228. components: {
  229. aTip
  230. },
  231. data() {
  232. return {
  233. navH: getApp().globalData.navHeight,
  234. token: '',
  235. per: 0,
  236. type4: 'center',
  237. //轮播图
  238. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
  239. background: ['color1', 'color2', 'color3'],
  240. indicatorDots: true,
  241. autoplay: true,
  242. interval: 3000,
  243. duration: 1000,
  244. list1: [{
  245. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
  246. name: '/pages/tasksquare/guide'
  247. },
  248. {
  249. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home7.png',
  250. name: '/pages/tasksquare/cooperation'
  251. // name: 'http://www.baidu.com/'
  252. },
  253. {
  254. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/guanwang.png',
  255. name: '/pages/tasksquare/guanwang'
  256. }
  257. ],
  258. //弹窗
  259. type: 'center',
  260. formData: {
  261. hobby: [],
  262. hobby1: [],
  263. hobby2: [],
  264. },
  265. hobby: [{
  266. text: '小红书',
  267. value: 1
  268. }, {
  269. text: '抖音',
  270. value: 2
  271. }, {
  272. text: '微博',
  273. value: 3
  274. }, {
  275. text: '快手',
  276. value: 4
  277. }, {
  278. text: 'B站',
  279. value: 5
  280. }, {
  281. text: '大众点评',
  282. value: 6
  283. }, {
  284. text: '知乎',
  285. value: 7
  286. }],
  287. hobby1: [{
  288. text: '产品置换',
  289. value: 1
  290. }, {
  291. text: '固定稿费',
  292. value: 2
  293. }, {
  294. text: '自报价',
  295. value: 3
  296. }],
  297. hobby2: [{
  298. text: '实体商品寄拍',
  299. value: 1
  300. }, {
  301. text: '虚拟产品测评',
  302. value: 2
  303. }, {
  304. text: '线下探店打卡',
  305. value: 3
  306. }],
  307. iconW: undefined,
  308. iconH: undefined,
  309. btnWidth: undefined,
  310. btnHeight: undefined,
  311. navBarTop: undefined,
  312. navBarHeight: undefined,
  313. navBarLeft: undefined,
  314. navBarRight: undefined,
  315. inputHeight: undefined,
  316. opacity: 0,
  317. isHome: false,
  318. homeIconPath: homeIconPath,
  319. backIconPath: backIconPath,
  320. img: '../../static/home/home.png',
  321. // 最多显示页数
  322. max_page: '',
  323. tupian: {
  324. wen: '原创图片',
  325. lin: 1,
  326. },
  327. projectList: [],
  328. img456: '../../static/home/home.png',
  329. platformList: [],
  330. filtCondition: '',
  331. };
  332. },
  333. computed: {
  334. isSharePage() {},
  335. },
  336. watch: {
  337. scrollTop(val) {
  338. if (!this.mysNavConfig.isOpacity) {
  339. return;
  340. }
  341. this.setOpacity(val, this.mysNavConfig.opacityTime);
  342. },
  343. },
  344. onShow() {
  345. this.isLogin()
  346. },
  347. onLoad() {
  348. this.getInfoList()
  349. this.per = 0
  350. this.getProjectListAPI()
  351. },
  352. //下拉刷新
  353. onPullDownRefresh() {
  354. this.per = 0
  355. this.getProjectListAPI()
  356. //停止下拉刷新
  357. uni.stopPullDownRefresh()
  358. },
  359. // 下拉懒加载
  360. async onReachBottom() {
  361. ++this.per;
  362. if (this.per >= this.max_page) {
  363. uni.showToast({
  364. title: "已加载全部"
  365. })
  366. } else {
  367. uni.showLoading({
  368. title: '加载中'
  369. })
  370. await this.$http.get('/youngee/c/g/get-project-list' +
  371. "?" +
  372. "idx" +
  373. "=" +
  374. this.per +
  375. "&cnt" +
  376. "=" +
  377. 20 + this.filtCondition
  378. ).then(res => {
  379. console.log(res)
  380. this.max_page = res.data.data.max_page
  381. for (var i = 0; i < res.data.data.ProjectInfos.length; i++) {
  382. // 封面图片
  383. res.data.data.ProjectInfos[i].ProductInfo = JSON.parse(res.data.data.ProjectInfos[i]
  384. .product_snap);
  385. // 封面图片
  386. let ProductPhoto = JSON.parse(res.data.data.ProjectInfos[i].product_photo_snap);
  387. for (let j = 0; j < ProductPhoto.length; ++j) {
  388. if (ProductPhoto[j].Symbol == 1) {
  389. res.data.data.ProjectInfos[i].coverphoto = ProductPhoto[j].PhotoUrl
  390. }
  391. }
  392. // res.data.data.ProjectInfos[i].coverphoto = res.data.data.ProjectInfos[i]
  393. // .ProductInfo
  394. // .ProductCovers.photo_url
  395. // 获取平台图片
  396. for (var j = 0; j < this.platformList.length; j++) {
  397. if (res.data.data.ProjectInfos[i].project_platform === this.platformList[j]
  398. .id) {
  399. res.data.data.ProjectInfos[i].project_imgper = this.platformList[j]
  400. .platform_icon
  401. }
  402. }
  403. // 任务数量&稿费形式
  404. res.data.data.ProjectInfos[i].taskNum = 0
  405. res.data.data.ProjectInfos[i].isfixedfee = 0
  406. res.data.data.ProjectInfos[i].isself = 0
  407. let lengthOfRecruitStrategys = res.data.data.ProjectInfos[i]
  408. .RecruitStrategys != null ? res.data.data.ProjectInfos[i]
  409. .RecruitStrategys
  410. .length : 0
  411. for (var j = 0; j < lengthOfRecruitStrategys; j++) {
  412. res.data.data.ProjectInfos[i].taskNum = Number(res.data.data
  413. .ProjectInfos[i]
  414. .taskNum) + Number(res.data.data.ProjectInfos[i]
  415. .RecruitStrategys[j]
  416. .recruit_number)
  417. if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 2) {
  418. res.data.data.ProjectInfos[i].isfixedfee = 1
  419. }
  420. if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 3) {
  421. res.data.data.ProjectInfos[i].isself = 1
  422. }
  423. }
  424. //结束时间
  425. var newdate = new Date()
  426. // console.log(newdate)
  427. var endTime = new Date(res.data.data.ProjectInfos[i].recruit_ddl.replace(
  428. /-/g, "/"));
  429. res.data.data.ProjectInfos[i].ddl = endTime - newdate < 0 ? 1 : 0
  430. res.data.data.ProjectInfos[i].recruit_ddl = this.thistime(res.data.data
  431. .ProjectInfos[i]
  432. .recruit_ddl)
  433. }
  434. this.projectList.push.apply(this.projectList, res.data.data.ProjectInfos);
  435. console.log(this.projectList)
  436. })
  437. uni.hideLoading();
  438. }
  439. },
  440. methods: {
  441. getProjectListAPI() {
  442. return this.$http.get('/youngee/c/g/get-project-list' +
  443. "?" +
  444. "idx" +
  445. "=" +
  446. this.per +
  447. "&cnt" +
  448. "=" +
  449. 20 + this.filtCondition
  450. ).then(res => {
  451. console.log(res)
  452. if (res.data.code === 0) {
  453. for (var i = 0; i < res.data.data.ProjectInfos.length; i++) {
  454. res.data.data.ProjectInfos[i].ProductInfo = JSON.parse(res.data.data.ProjectInfos[i]
  455. .product_snap);
  456. // 封面图片
  457. let ProductPhoto = JSON.parse(res.data.data.ProjectInfos[i].product_photo_snap);
  458. for (let j = 0; j < ProductPhoto.length; ++j) {
  459. if (ProductPhoto[j].Symbol == 1) {
  460. res.data.data.ProjectInfos[i].coverphoto = ProductPhoto[j].PhotoUrl
  461. }
  462. }
  463. // res.data.data.ProjectInfos[i].coverphoto = res.data.data.ProjectInfos[i]
  464. // .ProductInfo
  465. // .ProductCovers.photo_url
  466. // 获取平台图片
  467. for (var j = 0; j < this.platformList.length; j++) {
  468. if (res.data.data.ProjectInfos[i].project_platform === this.platformList[j]
  469. .id) {
  470. res.data.data.ProjectInfos[i].project_imgper = this.platformList[j]
  471. .platform_icon
  472. }
  473. }
  474. // 任务数量&稿费形式
  475. res.data.data.ProjectInfos[i].taskNum = 0
  476. res.data.data.ProjectInfos[i].isfixedfee = 0
  477. res.data.data.ProjectInfos[i].isself = 0
  478. let lengthOfRecruitStrategys = res.data.data.ProjectInfos[i]
  479. .RecruitStrategys != null ? res.data.data.ProjectInfos[i]
  480. .RecruitStrategys
  481. .length : 0
  482. for (var j = 0; j < lengthOfRecruitStrategys; j++) {
  483. res.data.data.ProjectInfos[i].taskNum = Number(res.data.data
  484. .ProjectInfos[i]
  485. .taskNum) + Number(res.data.data.ProjectInfos[i]
  486. .RecruitStrategys[j]
  487. .recruit_number)
  488. if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 2) {
  489. res.data.data.ProjectInfos[i].isfixedfee = 1
  490. }
  491. if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 3) {
  492. res.data.data.ProjectInfos[i].isself = 1
  493. }
  494. }
  495. //结束时间
  496. var newdate = new Date()
  497. // console.log(newdate)
  498. var endTime = new Date(res.data.data.ProjectInfos[i].recruit_ddl.replace(
  499. /-/g, "/"));
  500. res.data.data.ProjectInfos[i].ddl = endTime - newdate < 0 || res.data.data
  501. .ProjectInfos[i]
  502. .project_status > 4 ? 1 : 0
  503. res.data.data.ProjectInfos[i].recruit_ddl = this.thistime(res.data.data
  504. .ProjectInfos[i]
  505. .recruit_ddl)
  506. }
  507. this.max_page = res.data.data.max_page
  508. this.projectList = res.data.data.ProjectInfos;
  509. } else if (res.data.code === -4) {
  510. uni.showToast({
  511. title: "暂无任务"
  512. })
  513. this.max_page = 1
  514. this.projectList = []
  515. } else {
  516. uni.showToast({
  517. title: res.data.msg
  518. })
  519. this.max_page = 1
  520. this.projectList = []
  521. }
  522. })
  523. },
  524. // 判断登陆是否过期
  525. isLogin() {
  526. return this.$https.get('/youngee/c/t/g/is-login')
  527. .then(res => {
  528. if (res.data.code === 403) {
  529. // 登陆已失效
  530. this.token = ""
  531. uni.clearStorage();
  532. } else {
  533. this.token = uni.getStorageSync('token')
  534. }
  535. })
  536. },
  537. // 信息表
  538. getInfoList() {
  539. return this.$http.get('/youngee/c/g/get-info-tables')
  540. .then(res => {
  541. this.hobby = []
  542. this.platformList = res.data.data.ThirdPlatform
  543. let l = this.platformList != null ? this.platformList.length : 0;
  544. for (var i = 0; i < l; i++) {
  545. var obj = {}
  546. obj.text = this.platformList[i].platform_name
  547. obj.value = this.platformList[i].id
  548. this.hobby.push(obj)
  549. }
  550. })
  551. },
  552. guid() {
  553. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  554. var r = Math.random() * 16 | 0,
  555. v = c === 'x' ? r : (r & 0x3 | 0x8);
  556. return v.toString(16);
  557. });
  558. },
  559. // 计算结束时间
  560. thistime(val) {
  561. // 转换格式
  562. var beginTime = new Date(val.replace(/-/g, "/"));
  563. // 当前时间
  564. var thisTime = new Date();
  565. // 相减
  566. var dateMiss = beginTime.getTime() - thisTime.getTime();
  567. // 天数
  568. var day = Math.floor(dateMiss / (24 * 3600 * 1000));
  569. // 减去天数剩下的毫秒数
  570. var backOne = dateMiss % (24 * 3600 * 1000);
  571. // 小时数
  572. var hours = Math.floor(backOne / (3600 * 1000));
  573. var deadline_time = '',
  574. deadline_time = day + '天' + hours + '时结束'
  575. return deadline_time
  576. },
  577. // 登录页面
  578. deng() {
  579. uni.navigateTo({
  580. url: '../index/login'
  581. });
  582. },
  583. pick(item) {
  584. console.log(item)
  585. uni.navigateTo({
  586. url: item.name
  587. });
  588. },
  589. //弹出层
  590. change(e) {
  591. console.log('当前模式:' + e.type + ',状态:' + e.show);
  592. },
  593. async determine() {
  594. this.per = 0;
  595. this.$refs.popup.close()
  596. var filtCondition = ''
  597. for (var i = 0; i < this.formData.hobby.length; i++) {
  598. filtCondition += "&platform[]" + "=" + this.formData.hobby[i]
  599. }
  600. for (var j = 0; j < this.formData.hobby1.length; j++) {
  601. filtCondition += "&feeform[]" + "=" + this.formData.hobby1[j]
  602. }
  603. for (var j = 0; j < this.formData.hobby2.length; j++) {
  604. filtCondition += "&projectform[]" + "=" + this.formData.hobby2[j]
  605. }
  606. this.filtCondition = filtCondition
  607. uni.showLoading({
  608. title: '加载中'
  609. });
  610. await this.getProjectListAPI()
  611. uni.hideLoading();
  612. },
  613. async Reset() {
  614. this.per = 0;
  615. this.$refs.popup.close()
  616. this.formData.hobby = [];
  617. this.formData.hobby1 = [];
  618. this.formData.hobby2 = [];
  619. this.filtCondition = '';
  620. uni.showLoading({
  621. title: '加载中'
  622. });
  623. await this.getProjectListAPI()
  624. uni.hideLoading();
  625. },
  626. toggle4(type) {
  627. this.type4 = type
  628. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  629. this.$refs.popup4.open(type)
  630. // this.$refs.popup1.close()
  631. },
  632. xieyi() {
  633. console.log('进入联系我们')
  634. },
  635. go(url) {
  636. uni.navigateTo({
  637. url: url,
  638. });
  639. },
  640. init() {
  641. if (this.mysNavConfig.isHome) {
  642. let pages = getCurrentPages().length;
  643. /* 单页显示home图标 */
  644. pages === 1 ? (this.isHome = true) : (this.isHome = false);
  645. }
  646. // 开启渐变 强制fixed
  647. this.navBarTop = uni.getSystemInfoSync().statusBarHeight + "px";
  648. if (!this.mysNavConfig.opacity) {
  649. this.opacity = 1;
  650. !this.mysNavConfig.isOpacity ? (this.opacity = 1) : ((this.mysNavConfig.navFixed = true), (this
  651. .opacity = 0));
  652. } else {
  653. this.opacity = this.mysNavConfig.opacity;
  654. !this.mysNavConfig.isOpacity ? "" : ((this.mysNavConfig.navFixed = true), (this.opacity = 0));
  655. }
  656. // #ifdef MP
  657. this.initMP();
  658. // #endif
  659. // #ifdef APP-PLUS-NVUE
  660. this.navBarHeight = 44 + uni.getSystemInfoSync().statusBarHeight + "px";
  661. // #endif
  662. },
  663. /* 小程序初始化位置 */
  664. initMP() {
  665. // getSystemInfoSync用于获取系统信息同步接口
  666. let gS = uni.getSystemInfoSync();
  667. // getMenuButtonBoundingClientRect用于获取胶囊按钮位置布局信息
  668. let rect = uni.getMenuButtonBoundingClientRect();
  669. let rectHeight = rect.height;
  670. this.btnWidth = rect.width + "px";
  671. this.btnHeight = rectHeight + "px";
  672. this.iconW = Math.floor(rect.width / 4 - 5) + "px";
  673. this.iconH = rectHeight / 2 + "px";
  674. this.inputHeight = rectHeight - 3 + "px";
  675. this.navBarTop = rect.top + "px";
  676. this.navBarLeft = gS.screenWidth - rect.right + "px";
  677. this.navBarRight = gS.screenWidth - rect.right + rect.width + "px";
  678. this.navBarHeight = gS.statusBarHeight + rectHeight + (rect.top - gS.statusBarHeight) * 2 + "px";
  679. },
  680. /* 点击左侧 */
  681. onLeftClick() {
  682. uni.navigateTo({
  683. url: '/pages/tasksquare/search'
  684. });
  685. },
  686. // 进入任务详情
  687. project(item) {
  688. // uni.navigateTo({
  689. // url: '/pages/test/test'
  690. // });
  691. console.log(item.project_id)
  692. if (item.project_type === 1) {
  693. uni.navigateTo({
  694. url: '/pages/tasksquare/taskdetail?id=' + item.project_id
  695. });
  696. } else {
  697. uni.navigateTo({
  698. url: '/pages/tasksquare/specialTask/specialTaskDetail?id=' + item.project_id
  699. });
  700. }
  701. // }
  702. },
  703. /* type2 点击分类 */
  704. onLeftHome(type) {
  705. this.type = type
  706. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  707. this.$refs.popup.open(type)
  708. },
  709. /* 点击右侧 */
  710. onRightClick() {
  711. console.log("onRightClick");
  712. uni.showToast({
  713. title: "onRightClick",
  714. duration: 1000,
  715. });
  716. this.$emit("onRightClick");
  717. },
  718. /**
  719. * @param scrollTop 页面顶部距离
  720. * @param down 滑动显示效果延时
  721. */
  722. setOpacity(scrollTop, down = 60) {
  723. if (scrollTop > 0) {
  724. if (scrollTop < down) {
  725. this.opacity = scrollTop / down;
  726. }
  727. if (scrollTop > down) {
  728. this.opacity = 1;
  729. }
  730. } else {
  731. this.opacity = 0;
  732. }
  733. },
  734. /* 搜索框改变值 */
  735. changeInput(e) {
  736. this.$emit("changeInput", e);
  737. },
  738. /* 搜索框提交 */
  739. submitInput(e) {
  740. this.$emit("submitInput", e);
  741. },
  742. /* 清空搜索 */
  743. clearInput() {
  744. this.$emit("clearInput");
  745. },
  746. /* 禁用状态下点击搜索框 */
  747. clickInput() {
  748. this.$emit("clickInput");
  749. },
  750. },
  751. created() {
  752. this.init();
  753. },
  754. onReady() {
  755. // setTimeout(() => {
  756. // // 改变手机状态栏颜色
  757. // uni.setNavigationBarColor({
  758. // frontColor: "#000000",
  759. // backgroundColor: "#FF4258",
  760. // });
  761. // }, 10);
  762. },
  763. };
  764. </script>
  765. <style>
  766. /deep/ .share .uni-popup .uni-popup__wrapper {
  767. width: 70% !important;
  768. border-radius: 15rpx !important;
  769. }
  770. </style>
  771. <style lang="scss" scoped>
  772. .option1 {
  773. padding: 5rpx 18rpx;
  774. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  775. width: 100rpx;
  776. text-align: center;
  777. }
  778. }
  779. .option2 {
  780. padding: 5rpx 18rpx;
  781. }
  782. .option3 {
  783. padding: 5rpx 18rpx;
  784. }
  785. //弹窗
  786. .sharepage {
  787. width: 90%;
  788. margin: 0 auto;
  789. // position: relative;
  790. }
  791. /deep/ .share.uni-popup .uni-popup__wrapper {
  792. width: 70%;
  793. border-radius: 15rpx;
  794. }
  795. .projecttext1 {
  796. // padding-top: 5%;
  797. padding: 0 0 0 1%;
  798. height: 80rpx;
  799. margin-top: 7%;
  800. text-align: center;
  801. }
  802. .projecttext1 span {
  803. color: #333333;
  804. font-size: 100%;
  805. font-weight: 550;
  806. text-indent: 2em;
  807. }
  808. .projecttext1 image {
  809. vertical-align: middle;
  810. width: 80rpx;
  811. height: 80rpx;
  812. display: inline-block;
  813. padding-right: 14rpx;
  814. }
  815. .sharemap {
  816. margin: 0 auto;
  817. text-align: center;
  818. margin-top: 15%;
  819. margin-bottom: 15%;
  820. }
  821. .sharemap image {
  822. width: 400rpx;
  823. height: 400rpx;
  824. }
  825. .butmin {
  826. height: 48rpx;
  827. background-color: #3397FA;
  828. color: #FFFFFF;
  829. line-height: 48rpx;
  830. }
  831. //弹出层
  832. /deep/ .uni-data-checklist .checklist-group .checklist-box {
  833. background-color: #FFFFFF !important;
  834. border-radius: 20rpx !important;
  835. padding: 8rpx 30rpx !important;
  836. border: 0 !important;
  837. }
  838. /deep/ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
  839. font-size: 24rpx;
  840. color: #333333;
  841. }
  842. /deep/ .mini-btn {
  843. height: 70rpx;
  844. width: 250rpx;
  845. line-height: 70rpx;
  846. margin: 20rpx;
  847. letter-spacing: 4rpx;
  848. background-color: #FCCF41;
  849. }
  850. /deep/ .mini-btn1 {
  851. height: 70rpx;
  852. width: 400rpx;
  853. line-height: 70rpx;
  854. margin: 20rpx;
  855. letter-spacing: 4rpx;
  856. color: white;
  857. ;
  858. }
  859. /deep/ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
  860. background-color: #FCCF41 !important;
  861. }
  862. .butto {
  863. text-align: center;
  864. }
  865. //其他
  866. .nav {
  867. position: relative;
  868. }
  869. .nv_padding {
  870. height: 88upx;
  871. background-color: transparent;
  872. }
  873. /* 图标默认大小 */
  874. .nv_icon {
  875. width: 16px;
  876. height: 16px;
  877. }
  878. .bg_box {
  879. position: absolute;
  880. width: 750upx;
  881. height: 88upx;
  882. z-index: 10;
  883. top: 0;
  884. background-color: transparent;
  885. /* #ifdef MP */
  886. box-sizing: border-box;
  887. /* #endif */
  888. /* #ifndef APP-PLUS-NVUE */
  889. background-size: cover;
  890. background-repeat: no-repeat;
  891. background-position: center center;
  892. /* #endif */
  893. }
  894. .mys_navBar {
  895. /* #ifndef APP-PLUS-NVUE */
  896. display: flex;
  897. height: 88upx;
  898. /* #endif */
  899. // #ifdef MP
  900. box-sizing: border-box;
  901. // #endif
  902. width: 750upx;
  903. flex-direction: row;
  904. background-color: transparent;
  905. position: absolute;
  906. z-index: 10;
  907. top: 0;
  908. }
  909. .fixed {
  910. position: fixed;
  911. }
  912. /*
  913. left 按钮
  914. */
  915. .btn_type {
  916. /* #ifndef APP-PLUS-NVUE */
  917. display: flex;
  918. /* #endif */
  919. /* #ifdef APP-PLUS-NVUE */
  920. margin-left: 16upx;
  921. /* #endif */
  922. // #ifndef MP
  923. align-items: center;
  924. // #endif
  925. flex: 1;
  926. flex-direction: row;
  927. // background-color: #fff;
  928. }
  929. .btn_box {
  930. /* #ifndef APP-PLUS-NVUE */
  931. display: flex;
  932. margin-left: 16upx;
  933. /* #endif */
  934. flex-direction: row;
  935. // #ifndef MP
  936. align-items: center;
  937. // #endif
  938. }
  939. .btn_back,
  940. .btn_home {
  941. /* #ifndef APP-PLUS-NVUE */
  942. display: flex;
  943. /* #endif */
  944. /* #ifndef APP-PLUS-NVUE */
  945. height: 100%;
  946. /* #endif */
  947. /* #ifdef APP-PLUS-NVUE */
  948. width: 76upx;
  949. height: 62upx;
  950. /* #endif */
  951. flex-direction: row;
  952. align-items: center;
  953. justify-content: center;
  954. flex: 1;
  955. }
  956. /* 按钮类型1 */
  957. .nav_btn_t1 {
  958. /* #ifndef APP-PLUS-NVUE */
  959. display: flex;
  960. /* #endif */
  961. // #ifdef MP
  962. box-sizing: border-box;
  963. // #endif
  964. flex-direction: row;
  965. align-items: center;
  966. border-style: solid;
  967. border-width: 1px;
  968. border-color: #C0C0C0;
  969. // background-color: rgba(0, 0, 0, 0.2);
  970. background-color: #FFFFFF;
  971. width: 130upx;
  972. height: 45upx;
  973. }
  974. .line {
  975. width: 1upx;
  976. height: 60%;
  977. /* #ifdef APP-PLUS-NVUE */
  978. height: 30upx;
  979. /* #endif */
  980. background-color: #C0C0C0;
  981. }
  982. /*
  983. 标题
  984. */
  985. .title_container {
  986. /* #ifndef APP-PLUS-NVUE */
  987. display: flex;
  988. /* #endif */
  989. position: absolute;
  990. left: 375upx;
  991. bottom: 0;
  992. transform: translateX(-50%);
  993. flex-direction: row;
  994. justify-content: center;
  995. align-items: center;
  996. }
  997. .title_text {
  998. // flex: 1;
  999. text-overflow: ellipsis;
  1000. /* #ifndef APP-PLUS-NVUE */
  1001. white-space: nowrap;
  1002. overflow: hidden;
  1003. font-weight: 550;
  1004. /* #endif */
  1005. /* #ifdef APP-PLUS-NVUE */
  1006. lines: 1;
  1007. /* #endif */
  1008. }
  1009. /*
  1010. 左边自定义
  1011. */
  1012. .my_left_box {
  1013. /* #ifndef APP-PLUS-NVUE */
  1014. display: flex;
  1015. /* #endif */
  1016. flex-direction: row;
  1017. align-items: center;
  1018. }
  1019. .my_left_icon {
  1020. /* #ifndef APP-PLUS-NVUE */
  1021. display: flex;
  1022. /* #endif */
  1023. flex-direction: row;
  1024. align-items: center;
  1025. justify-content: center;
  1026. /* #ifndef MP */
  1027. margin-left: 18upx;
  1028. /* #endif */
  1029. }
  1030. .my_left_custom {
  1031. /* #ifndef APP-PLUS-NVUE */
  1032. display: flex;
  1033. /* #endif */
  1034. flex-direction: row;
  1035. align-items: center;
  1036. // justify-content: center;
  1037. }
  1038. /* 文字 */
  1039. .leftText {
  1040. /* #ifndef APP-PLUS-NVUE */
  1041. display: flex;
  1042. /* #endif */
  1043. flex-direction: row;
  1044. align-items: center;
  1045. justify-content: center;
  1046. padding-left: 4upx;
  1047. font-size: 15px;
  1048. }
  1049. /*
  1050. 中间
  1051. */
  1052. .my_custom_box {
  1053. /* #ifndef APP-PLUS-NVUE */
  1054. display: flex;
  1055. /* #endif */
  1056. flex-direction: row;
  1057. align-items: center;
  1058. justify-content: center;
  1059. flex: 1;
  1060. }
  1061. /*
  1062. 搜索框
  1063. */
  1064. .nv_search_box {
  1065. /* #ifndef APP-PLUS-NVUE */
  1066. display: flex;
  1067. /* #endif */
  1068. flex-direction: row;
  1069. align-items: center;
  1070. flex: 1;
  1071. /* #ifndef MP */
  1072. height: 60upx;
  1073. /* #endif */
  1074. background-color: #f8f8f8;
  1075. padding-right: 20upx;
  1076. padding-left: 20upx;
  1077. border-radius: 60upx;
  1078. margin-right: 15upx;
  1079. margin-left: 15upx;
  1080. }
  1081. .nv_input {
  1082. flex: 1;
  1083. padding-left: 16upx;
  1084. font-size: 13px;
  1085. }
  1086. .close {
  1087. width: 50upx;
  1088. /* #ifndef APP-PLUS-NVUE */
  1089. display: flex;
  1090. /* #endif */
  1091. flex-direction: row;
  1092. align-items: center;
  1093. justify-content: center;
  1094. /* #ifndef MP */
  1095. height: 62upx;
  1096. /* #endif */
  1097. }
  1098. /*
  1099. 右边 自定义
  1100. */
  1101. .my_right_icon {
  1102. /* #ifndef APP-PLUS-NVUE */
  1103. display: flex;
  1104. /* #endif */
  1105. flex-direction: row;
  1106. align-items: center;
  1107. justify-content: center;
  1108. /* #ifndef MP */
  1109. // min-width: 70upx;
  1110. /* #endif */
  1111. padding-left: 6px;
  1112. padding-right: 10px;
  1113. }
  1114. .imge image {
  1115. width: 100%;
  1116. height: 260rpx;
  1117. }
  1118. .commodity {
  1119. margin-top: 10rpx;
  1120. display: flex;
  1121. flex-wrap: wrap;
  1122. justify-content: space-between;
  1123. }
  1124. .share {
  1125. text-align: center;
  1126. line-height: 10rpx;
  1127. margin-top: 10rpx;
  1128. }
  1129. .share image {
  1130. vertical-align: middle;
  1131. width: 25rpx;
  1132. height: 25rpx;
  1133. display: inline-block
  1134. }
  1135. .share p {
  1136. display: inline-block;
  1137. font-size: 24rpx;
  1138. color: #333333;
  1139. }
  1140. .project {
  1141. width: 49%;
  1142. height: 550rpx;
  1143. // background-color: #ccc;
  1144. border-radius: 20rpx;
  1145. // box-shadow: 0rpx 5rpx 5rpx #ccc;
  1146. margin-bottom: 0%;
  1147. }
  1148. .projectdiagram {
  1149. width: 100%;
  1150. height: 61%;
  1151. background-size: 100% 100%;
  1152. position: relative;
  1153. border-radius: 10rpx;
  1154. ;
  1155. }
  1156. .TitleText1 {
  1157. height: 30rpx;
  1158. background-color: #FDD442;
  1159. border-radius: 10rpx;
  1160. display: inline-block;
  1161. padding: 0rpx 20rpx 0rpx 20rpx;
  1162. line-height: 30rpx;
  1163. }
  1164. .TitleText2 {
  1165. opacity: 0.8;
  1166. height: 30rpx;
  1167. background-color: #FFFFFF;
  1168. border-radius: 20rpx;
  1169. display: inline-block;
  1170. padding: 0rpx 20rpx 0rpx 20rpx;
  1171. line-height: 30rpx;
  1172. }
  1173. .TitleText2 p {
  1174. color: #464100;
  1175. font-size: 24rpx;
  1176. }
  1177. .projecttext {
  1178. // padding-top: 5%;
  1179. padding: 0 0 0 1%;
  1180. // height: 80rpx;
  1181. }
  1182. .projecttext span {
  1183. color: #333333;
  1184. font-size: 25rpx;
  1185. font-weight: 550;
  1186. text-indent: 2em;
  1187. }
  1188. .TitleText1 p {
  1189. color: #333333;
  1190. font-size: 18rpx;
  1191. }
  1192. .projecttext {
  1193. // height: 70rpx;
  1194. }
  1195. .projecttext image {
  1196. vertical-align: middle;
  1197. width: 30rpx;
  1198. height: 30rpx;
  1199. display: inline-block;
  1200. padding-right: 14rpx;
  1201. }
  1202. .TitleText {
  1203. // height: 30rpx;
  1204. width: 25%;
  1205. background-color: #FDD442;
  1206. border-radius: 10rpx;
  1207. display: inline-block;
  1208. text-align: center;
  1209. // padding: 0rpx 10rpx 0rpx 10rpx;
  1210. margin-right: 6%;
  1211. line-height: 30rpx;
  1212. margin-top: 0%;
  1213. }
  1214. .TitleText p {
  1215. color: black;
  1216. font-size: 16rpx;
  1217. }
  1218. .introduction {
  1219. width: 100%;
  1220. margin: 10rpx auto 0;
  1221. }
  1222. .rleft p {
  1223. font-size: 18rpx;
  1224. color: #999999;
  1225. }
  1226. .rright p {
  1227. font-size: 18rpx;
  1228. color: #999999;
  1229. }
  1230. .Mask {
  1231. position: absolute;
  1232. background-color: #000000;
  1233. opacity: 0.6;
  1234. width: 100%;
  1235. height: 100%;
  1236. // z-index: 999;
  1237. text-align: center;
  1238. border-radius: 20rpx;
  1239. }
  1240. .Mask image {
  1241. width: 50%;
  1242. height: 52%;
  1243. padding-top: 25%;
  1244. }
  1245. .contt {
  1246. position: relative;
  1247. }
  1248. .contact {
  1249. position: fixed;
  1250. top: 80%;
  1251. right: 13%;
  1252. }
  1253. .img1 {
  1254. width: 84rpx;
  1255. height: 124rpx;
  1256. position: absolute;
  1257. }
  1258. .img2 {
  1259. width: 114rpx;
  1260. height: 40rpx;
  1261. position: absolute;
  1262. top: 130rpx;
  1263. left: -12rpx;
  1264. }
  1265. .swiper {
  1266. height: 300rpx;
  1267. }
  1268. .swiper-item {
  1269. display: block;
  1270. height: 300rpx;
  1271. line-height: 300rpx;
  1272. text-align: center;
  1273. }
  1274. .swiper-list {
  1275. margin-top: 40rpx;
  1276. margin-bottom: 0;
  1277. }
  1278. </style>