tasksquare.vue 33 KB

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