tasksquare.vue 32 KB

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