tasksquare.vue 31 KB

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