tasksquare.vue 32 KB

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