1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375 |
- <template>
- <view class="nav">
- <view class="bg_box" style="background-color: #FFFFFF;" :style="{
- backgroundImage: mysNavConfig.bgImage,
- paddingTop: navBarTop,
- height: navBarHeight,
- opacity: opacity,
- }" :class="{ fixed: mysNavConfig.navFixed }"></view>
- <view class="mys_navBar" :style="{
- paddingTop: navBarTop,
- height: navBarHeight,
- paddingRight: navBarRight,
- }" :class="{ fixed: mysNavConfig.navFixed }">
- <!-- 左slot -->
- <view class="my_left_custom" :style="{ height: btnHeight }">
- <slot name="left"></slot>
- </view>
- <view class="btn_type" :style="{ height: btnHeight }">
- <view class="btn_box nav_btn_t1" :style="{
- width: btnWidth,
- height: btnHeight,
- marginLeft: navBarLeft,
- borderRadius: mysNavConfig.type2Config.radius,
- }">
- <view class="btn_back" @tap="onLeftClick()">
- <image class="nv_icon" :src="mysNavConfig.type2Config.leftPath"
- :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
- </view>
- <view class="line"></view>
- <view class="btn_home" @tap="onLeftHome('top')">
- <image class="nv_icon" :src="mysNavConfig.type2Config.rightPath"
- :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
- </view>
- </view>
- <!-- 标题 -->
- <view class="title_container" v-if="!mysNavConfig.searchConfig"
- :style="{ top: navBarTop, height: btnHeight }">
- <text class="title_text" v-if="!!mysNavConfig.navTitle" :style="{
- color: mysNavConfig.navTitle.color,
- fontSize: mysNavConfig.navTitle.fontSize,
- fontWeight: mysNavConfig.navTitle.fontWeight,
- }">{{ mysNavConfig.navTitle.text }}</text>
- <slot name="center2"></slot>
- </view>
- </view>
- </view>
- <aTip text="点击添加到我的小程序 \n下次访问更方便哦!" isCustom="true" />
- <view :style="{marginTop:navH}"></view>
- <view class="home">
- <view>
- <!-- 普通弹窗 -->
- <uni-popup ref="popup" background-color="#fff" @change="change">
- <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
- <view class="option1" style="margin-top: 20%;">
- <h3 style="margin-bottom: 10rpx;">社媒平台</h3>
- <uni-data-checkbox mode="tag" multiple v-model="formData.hobby" :localdata="hobby">
- </uni-data-checkbox>
- </view>
- <view class="option2">
- <h3 style="margin-bottom: 10rpx;">稿费形式</h3>
- <uni-data-checkbox mode="tag" multiple v-model="formData.hobby1" :localdata="hobby1">
- </uni-data-checkbox>
- </view>
- <view class="option3">
- <h3 style="margin-bottom: 10rpx;">任务形式</h3>
- <uni-data-checkbox mode="tag" multiple v-model="formData.hobby2" :localdata="hobby2">
- </uni-data-checkbox>
- </view>
- <view class="butto">
- <button class="mini-btn" size="mini" @tap="Reset">重置</button>
- <button class="mini-btn" size="mini" @tap="determine">确定</button>
- </view>
- </view>
- </uni-popup>
- </view>
- <!-- <view class="imge">
- <image src="../../static/home/home1.png" mode=""></image>
- </view> -->
- <view class="uni-margin-wrap">
- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
- :interval="interval" :duration="duration">
- <swiper-item v-for="item in list1" @click="pick(item)">
- <image :src="item.img" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="commodity" style="margin-top: 3%;">
- <view class="project" v-for="(item,index) in projectList" :key="index" @tap="project(item)">
- <view class="projectdiagram" :style="{backgroundImage:`url(${item.coverphoto})`}">
- <view class="Mask" v-if="item.ddl">
- <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png" mode="">
- </image>
- </view>
- <view style="padding-left: 4%;padding-top: 2%;">
- </view>
- </view>
- <view class="projecttext">
- <image :src="item.project_imgper" mode=""></image>
- <span>{{item.project_name|ellipsis}}</span>
- </view>
- <view style="padding-left: 1%;">
- <view class="TitleText" v-if="item.isself===1">
- <p>自报价</p>
- </view>
- <view class="TitleText" v-if="item.isfixedfee===1">
- <p>固定稿费</p>
- </view>
- <view class="TitleText" v-if="item.project_form===3">
- <p>线下探店</p>
- </view>
- </view>
- <view class="introduction">
- <view class="rleft" style="">
- <p>商品价值: <span
- style="color: red;font-weight: 600;">¥{{item.ProductInfo.ProductPrice}}</span></p>
- </view>
- <view class="rright" style="display: flex;justify-content:space-between;">
- <p>招募人数: <span style="color: balck;font-weight: 600;">{{item.taskNum}}</span></p>
- <p>报名人数: <span style="color: balck;font-weight: 600;">{{item.apply_num}}</span>
- </p>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 普通弹窗 公众号-->
- <uni-popup ref="popup4" class="share" background-color="#fff" @change="change">
- <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
- <view class="sharepage">
- <view class="projecttext1">
- <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/project15.png"
- style="width: 80rpx; height: 80rpx;" mode=""></image>
- <span>YoungGee</span>
- </view>
- <view class="" style="margin-top: 5%;">
- <p style='color: #333333;font-size: 28rpx;text-align: center;'>扫码联系</p>
- </view>
- <view class="sharemap">
- <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu.png"
- style="width: 400rpx;height: 400rpx;" mode=""></image>
- </view>
- </view>
- </view>
- </uni-popup>
- <view class="contact" @click="toggle4('center')">
- <view class="contt">
- <!-- <image class="img2" src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home2.png" mode=""></image> -->
- <image class="img1"
- src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu_20211124192542.png" mode="">
- </image>
- </view>
- </view>
- </view>
- </template>
- <script>
- import aTip from "@/components/mys-tip_1.0.01/a_tip/aTip";
- import request from '@/components/request.js';
- /* 默认首页路径 */
- const homePath = "/pages/pupu/pupudao";
- /* 默认首页图标路径 */
- const homeIconPath = "/static/img/png4.png";
- /* 默认返回图标路径 */
- const backIconPath = "/static/img/png2.png";
- export default {
- props: {
- mysNavConfig: {
- type: Object,
- default () {
- return {
- /* 固定导航 */
- navFixed: true,
- /* 开启单页显示首页图标 */
- isHome: true,
- /* 占位开启 */
- navPadding: true,
- /* 背景 */
- bgColor: "#f8f8f8",
- /* 渐变色 */
- opacity: 1,
- /* 渐变开启 */
- isOpacity: false,
- /* 渐变延时效果 */
- opacityTime: 100,
- /* 左侧按钮样式 可选 type1 type2 (type2根据小程序胶囊位置调整) */
- btnType: "type1",
- /* type1 左侧文字配置 */
- leftText: {
- text: "",
- color: "",
- fontSize: "16px", // px upx rpx
- fontWeight: "", // blod
- },
- /* 标题 */
- navTitle: {
- text: "首页",
- color: "",
- fontSize: "32rpx", // px upx rpx
- fontWeight: "normal", // blod
- },
- /* type2 按钮 */
- type2Config: {
- // 左图标
- leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png3.png",
- // 右图标
- rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png1.png",
- // 圆角
- radius: "40rpx",
- },
- };
- },
- },
- scrollTop: {
- type: Number,
- default: function() {
- return 0;
- },
- },
- },
- filters: {
- ellipsis(value) {
- if (!value) return "";
- if (value.length > 20) {
- return value.slice(0, 20) + "...";
- }
- return value;
- },
- },
- components: {
- aTip
- },
- data() {
- return {
- navH: getApp().globalData.navHeight,
- token: '',
- per: 0,
- type4: 'center',
- //轮播图
- img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
- background: ['color1', 'color2', 'color3'],
- indicatorDots: true,
- autoplay: true,
- interval: 3000,
- duration: 1000,
- list1: [{
- img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
- name: '/pages/tasksquare/guide'
- },
- {
- img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home7.png',
- name: '/pages/tasksquare/cooperation'
- }
- ],
- //弹窗
- type: 'center',
- formData: {
- hobby: [],
- hobby1: [],
- hobby2: [],
- },
- hobby: [{
- text: '小红书',
- value: 1
- }, {
- text: '抖音',
- value: 2
- }, {
- text: '微博',
- value: 3
- }, {
- text: '快手',
- value: 4
- }, {
- text: 'B站',
- value: 5
- }, {
- text: '大众点评',
- value: 6
- }, {
- text: '知乎',
- value: 7
- }],
- hobby1: [{
- text: '产品置换',
- value: 1
- }, {
- text: '固定稿费',
- value: 2
- }, {
- text: '自报价',
- value: 3
- }],
- hobby2: [{
- text: '实体商品寄拍',
- value: 1
- }, {
- text: '虚拟产品测评',
- value: 2
- }, {
- text: '线下探店打卡',
- value: 3
- }],
- iconW: undefined,
- iconH: undefined,
- btnWidth: undefined,
- btnHeight: undefined,
- navBarTop: undefined,
- navBarHeight: undefined,
- navBarLeft: undefined,
- navBarRight: undefined,
- inputHeight: undefined,
- opacity: 0,
- isHome: false,
- homeIconPath: homeIconPath,
- backIconPath: backIconPath,
- img: '../../static/home/home.png',
- // 最多显示页数
- max_page: '',
- tupian: {
- wen: '原创图片',
- lin: 1,
- },
- projectList: [],
- img456: '../../static/home/home.png',
- platformList: [],
- filtCondition: '',
- };
- },
- computed: {
- isSharePage() {},
- },
- watch: {
- scrollTop(val) {
- if (!this.mysNavConfig.isOpacity) {
- return;
- }
- this.setOpacity(val, this.mysNavConfig.opacityTime);
- },
- },
- onShow() {
- this.isLogin()
- },
- onLoad() {
- this.getInfoList()
- this.per = 0
- this.getProjectListAPI()
- },
- //下拉刷新
- onPullDownRefresh() {
- this.per = 0
- this.getProjectListAPI()
- //停止下拉刷新
- uni.stopPullDownRefresh()
- },
- // 下拉懒加载
- async onReachBottom() {
- ++this.per;
- if (this.per >= this.max_page) {
- uni.showToast({
- title: "已加载全部"
- })
- } else {
- uni.showLoading({
- title: '加载中'
- })
- await this.$http.get('/youngee/c/g/get-project-list' +
- "?" +
- "idx" +
- "=" +
- this.per +
- "&cnt" +
- "=" +
- 20 + this.filtCondition
- ).then(res => {
- console.log(res)
- this.max_page = res.data.data.max_page
- for (var i = 0; i < res.data.data.ProjectInfos.length; i++) {
- // 封面图片
- res.data.data.ProjectInfos[i].ProductInfo = JSON.parse(res.data.data.ProjectInfos[i]
- .product_snap);
- // 封面图片
- let ProductPhoto = JSON.parse(res.data.data.ProjectInfos[i].product_photo_snap);
- for (let j = 0; j < ProductPhoto.length; ++j) {
- if (ProductPhoto[j].Symbol == 1) {
- res.data.data.ProjectInfos[i].coverphoto = ProductPhoto[j].PhotoUrl
- }
- }
- // res.data.data.ProjectInfos[i].coverphoto = res.data.data.ProjectInfos[i]
- // .ProductInfo
- // .ProductCovers.photo_url
- // 获取平台图片
- for (var j = 0; j < this.platformList.length; j++) {
- if (res.data.data.ProjectInfos[i].project_platform === this.platformList[j]
- .id) {
- res.data.data.ProjectInfos[i].project_imgper = this.platformList[j]
- .platform_icon
- }
- }
- // 任务数量&稿费形式
- res.data.data.ProjectInfos[i].taskNum = 0
- res.data.data.ProjectInfos[i].isfixedfee = 0
- res.data.data.ProjectInfos[i].isself = 0
- let lengthOfRecruitStrategys = res.data.data.ProjectInfos[i]
- .RecruitStrategys != null ? res.data.data.ProjectInfos[i]
- .RecruitStrategys
- .length : 0
- for (var j = 0; j < lengthOfRecruitStrategys; j++) {
- res.data.data.ProjectInfos[i].taskNum = Number(res.data.data
- .ProjectInfos[i]
- .taskNum) + Number(res.data.data.ProjectInfos[i]
- .RecruitStrategys[j]
- .recruit_number)
- if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 2) {
- res.data.data.ProjectInfos[i].isfixedfee = 1
- }
- if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 3) {
- res.data.data.ProjectInfos[i].isself = 1
- }
- }
- //结束时间
- var newdate = new Date()
- // console.log(newdate)
- var endTime = new Date(res.data.data.ProjectInfos[i].recruit_ddl.replace(
- /-/g, "/"));
- res.data.data.ProjectInfos[i].ddl = endTime - newdate < 0 ? 1 : 0
- res.data.data.ProjectInfos[i].recruit_ddl = this.thistime(res.data.data
- .ProjectInfos[i]
- .recruit_ddl)
- }
- this.projectList.push.apply(this.projectList, res.data.data.ProjectInfos);
- console.log(this.projectList)
- })
- uni.hideLoading();
- }
- },
- methods: {
- getProjectListAPI() {
- return this.$http.get('/youngee/c/g/get-project-list' +
- "?" +
- "idx" +
- "=" +
- this.per +
- "&cnt" +
- "=" +
- 20 + this.filtCondition
- ).then(res => {
- console.log(res)
- if (res.data.code === 0) {
- for (var i = 0; i < res.data.data.ProjectInfos.length; i++) {
- res.data.data.ProjectInfos[i].ProductInfo = JSON.parse(res.data.data.ProjectInfos[i]
- .product_snap);
- // 封面图片
- let ProductPhoto = JSON.parse(res.data.data.ProjectInfos[i].product_photo_snap);
- for (let j = 0; j < ProductPhoto.length; ++j) {
- if (ProductPhoto[j].Symbol == 1) {
- res.data.data.ProjectInfos[i].coverphoto = ProductPhoto[j].PhotoUrl
- }
- }
- // res.data.data.ProjectInfos[i].coverphoto = res.data.data.ProjectInfos[i]
- // .ProductInfo
- // .ProductCovers.photo_url
- // 获取平台图片
- for (var j = 0; j < this.platformList.length; j++) {
- if (res.data.data.ProjectInfos[i].project_platform === this.platformList[j]
- .id) {
- res.data.data.ProjectInfos[i].project_imgper = this.platformList[j]
- .platform_icon
- }
- }
- // 任务数量&稿费形式
- res.data.data.ProjectInfos[i].taskNum = 0
- res.data.data.ProjectInfos[i].isfixedfee = 0
- res.data.data.ProjectInfos[i].isself = 0
- let lengthOfRecruitStrategys = res.data.data.ProjectInfos[i]
- .RecruitStrategys != null ? res.data.data.ProjectInfos[i]
- .RecruitStrategys
- .length : 0
- for (var j = 0; j < lengthOfRecruitStrategys; j++) {
- res.data.data.ProjectInfos[i].taskNum = Number(res.data.data
- .ProjectInfos[i]
- .taskNum) + Number(res.data.data.ProjectInfos[i]
- .RecruitStrategys[j]
- .recruit_number)
- if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 2) {
- res.data.data.ProjectInfos[i].isfixedfee = 1
- }
- if (res.data.data.ProjectInfos[i].RecruitStrategys[j].fee_form === 3) {
- res.data.data.ProjectInfos[i].isself = 1
- }
- }
- //结束时间
- var newdate = new Date()
- // console.log(newdate)
- var endTime = new Date(res.data.data.ProjectInfos[i].recruit_ddl.replace(
- /-/g, "/"));
- res.data.data.ProjectInfos[i].ddl = endTime - newdate < 0 || res.data.data
- .ProjectInfos[i]
- .project_status > 4 ? 1 : 0
- res.data.data.ProjectInfos[i].recruit_ddl = this.thistime(res.data.data
- .ProjectInfos[i]
- .recruit_ddl)
- }
- this.max_page = res.data.data.max_page
- this.projectList = res.data.data.ProjectInfos;
- } else if (res.data.code === -4) {
- uni.showToast({
- title: "暂无任务"
- })
- this.max_page = 1
- this.projectList = []
- } else {
- uni.showToast({
- title: res.data.msg
- })
- this.max_page = 1
- this.projectList = []
- }
- })
- },
- // 判断登陆是否过期
- isLogin() {
- return this.$https.get('/youngee/c/t/g/is-login')
- .then(res => {
- if (res.data.code === 403) {
- // 登陆已失效
- this.token = ""
- uni.clearStorage();
- } else {
- this.token = uni.getStorageSync('token')
- }
- })
- },
- // 信息表
- getInfoList() {
- return this.$http.get('/youngee/c/g/get-info-tables')
- .then(res => {
- this.hobby = []
- this.platformList = res.data.data.ThirdPlatform
- let l = this.platformList != null ? this.platformList.length : 0;
- for (var i = 0; i < l; i++) {
- var obj = {}
- obj.text = this.platformList[i].platform_name
- obj.value = this.platformList[i].id
- this.hobby.push(obj)
- }
- })
- },
- guid() {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
- var r = Math.random() * 16 | 0,
- v = c === 'x' ? r : (r & 0x3 | 0x8);
- return v.toString(16);
- });
- },
- // 计算结束时间
- thistime(val) {
- // 转换格式
- var beginTime = new Date(val.replace(/-/g, "/"));
- // 当前时间
- var thisTime = new Date();
- // 相减
- var dateMiss = beginTime.getTime() - thisTime.getTime();
- // 天数
- var day = Math.floor(dateMiss / (24 * 3600 * 1000));
- // 减去天数剩下的毫秒数
- var backOne = dateMiss % (24 * 3600 * 1000);
- // 小时数
- var hours = Math.floor(backOne / (3600 * 1000));
- var deadline_time = '',
- deadline_time = day + '天' + hours + '时结束'
- return deadline_time
- },
- // 登录页面
- deng() {
- uni.navigateTo({
- url: '../index/login'
- });
- },
- pick(item) {
- // console.log(item)
- uni.navigateTo({
- url: item.name
- });
- },
- //弹出层
- change(e) {
- console.log('当前模式:' + e.type + ',状态:' + e.show);
- },
- async determine() {
- this.per = 0;
- this.$refs.popup.close()
- var filtCondition = ''
- for (var i = 0; i < this.formData.hobby.length; i++) {
- filtCondition += "&platform[]" + "=" + this.formData.hobby[i]
- }
- for (var j = 0; j < this.formData.hobby1.length; j++) {
- filtCondition += "&feeform[]" + "=" + this.formData.hobby1[j]
- }
- for (var j = 0; j < this.formData.hobby2.length; j++) {
- filtCondition += "&projectform[]" + "=" + this.formData.hobby2[j]
- }
- this.filtCondition = filtCondition
- uni.showLoading({
- title: '加载中'
- });
- await this.getProjectListAPI()
- uni.hideLoading();
- },
- async Reset() {
- this.per = 0;
- this.$refs.popup.close()
- this.formData.hobby = [];
- this.formData.hobby1 = [];
- this.formData.hobby2 = [];
- this.filtCondition = '';
- uni.showLoading({
- title: '加载中'
- });
- await this.getProjectListAPI()
- uni.hideLoading();
- },
- toggle4(type) {
- this.type4 = type
- // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
- this.$refs.popup4.open(type)
- // this.$refs.popup1.close()
- },
- xieyi() {
- console.log('进入联系我们')
- },
- go(url) {
- uni.navigateTo({
- url: url,
- });
- },
- init() {
- if (this.mysNavConfig.isHome) {
- let pages = getCurrentPages().length;
- /* 单页显示home图标 */
- pages === 1 ? (this.isHome = true) : (this.isHome = false);
- }
- // 开启渐变 强制fixed
- this.navBarTop = uni.getSystemInfoSync().statusBarHeight + "px";
- if (!this.mysNavConfig.opacity) {
- this.opacity = 1;
- !this.mysNavConfig.isOpacity ? (this.opacity = 1) : ((this.mysNavConfig.navFixed = true), (this
- .opacity = 0));
- } else {
- this.opacity = this.mysNavConfig.opacity;
- !this.mysNavConfig.isOpacity ? "" : ((this.mysNavConfig.navFixed = true), (this.opacity = 0));
- }
- // #ifdef MP
- this.initMP();
- // #endif
- // #ifdef APP-PLUS-NVUE
- this.navBarHeight = 44 + uni.getSystemInfoSync().statusBarHeight + "px";
- // #endif
- },
- /* 小程序初始化位置 */
- initMP() {
- // getSystemInfoSync用于获取系统信息同步接口
- let gS = uni.getSystemInfoSync();
- // getMenuButtonBoundingClientRect用于获取胶囊按钮位置布局信息
- let rect = uni.getMenuButtonBoundingClientRect();
- let rectHeight = rect.height;
- this.btnWidth = rect.width + "px";
- this.btnHeight = rectHeight + "px";
- this.iconW = Math.floor(rect.width / 4 - 5) + "px";
- this.iconH = rectHeight / 2 + "px";
- this.inputHeight = rectHeight - 3 + "px";
- this.navBarTop = rect.top + "px";
- this.navBarLeft = gS.screenWidth - rect.right + "px";
- this.navBarRight = gS.screenWidth - rect.right + rect.width + "px";
- this.navBarHeight = gS.statusBarHeight + rectHeight + (rect.top - gS.statusBarHeight) * 2 + "px";
- },
- /* 点击左侧 */
- onLeftClick() {
- uni.navigateTo({
- url: '/pages/tasksquare/search'
- });
- },
- // 进入任务详情
- project(item) {
- // uni.navigateTo({
- // url: '/pages/test/test'
- // });
- console.log(item.project_id)
- if (item.project_type === 1) {
- uni.navigateTo({
- url: '/pages/tasksquare/taskdetail?id=' + item.project_id
- });
- } else {
- uni.navigateTo({
- url: '/pages/tasksquare/specialTask/specialTaskDetail?id=' + item.project_id
- });
- }
- // }
- },
- /* type2 点击分类 */
- onLeftHome(type) {
- this.type = type
- // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
- this.$refs.popup.open(type)
- },
- /* 点击右侧 */
- onRightClick() {
- console.log("onRightClick");
- uni.showToast({
- title: "onRightClick",
- duration: 1000,
- });
- this.$emit("onRightClick");
- },
- /**
- * @param scrollTop 页面顶部距离
- * @param down 滑动显示效果延时
- */
- setOpacity(scrollTop, down = 60) {
- if (scrollTop > 0) {
- if (scrollTop < down) {
- this.opacity = scrollTop / down;
- }
- if (scrollTop > down) {
- this.opacity = 1;
- }
- } else {
- this.opacity = 0;
- }
- },
- /* 搜索框改变值 */
- changeInput(e) {
- this.$emit("changeInput", e);
- },
- /* 搜索框提交 */
- submitInput(e) {
- this.$emit("submitInput", e);
- },
- /* 清空搜索 */
- clearInput() {
- this.$emit("clearInput");
- },
- /* 禁用状态下点击搜索框 */
- clickInput() {
- this.$emit("clickInput");
- },
- },
- created() {
- this.init();
- },
- onReady() {
- // setTimeout(() => {
- // // 改变手机状态栏颜色
- // uni.setNavigationBarColor({
- // frontColor: "#000000",
- // backgroundColor: "#FF4258",
- // });
- // }, 10);
- },
- };
- </script>
- <style>
- /deep/ .share .uni-popup .uni-popup__wrapper {
- width: 70% !important;
- border-radius: 15rpx !important;
- }
- </style>
- <style lang="scss" scoped>
- .option1 {
- padding: 5rpx 18rpx;
- /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
- width: 100rpx;
- text-align: center;
- }
- }
- .option2 {
- padding: 5rpx 18rpx;
- }
- .option3 {
- padding: 5rpx 18rpx;
- }
- //弹窗
- .sharepage {
- width: 90%;
- margin: 0 auto;
- // position: relative;
- }
- /deep/ .share.uni-popup .uni-popup__wrapper {
- width: 70%;
- border-radius: 15rpx;
- }
- .projecttext1 {
- // padding-top: 5%;
- padding: 0 0 0 1%;
- height: 80rpx;
- margin-top: 7%;
- text-align: center;
- }
- .projecttext1 span {
- color: #333333;
- font-size: 100%;
- font-weight: 550;
- text-indent: 2em;
- }
- .projecttext1 image {
- vertical-align: middle;
- width: 80rpx;
- height: 80rpx;
- display: inline-block;
- padding-right: 14rpx;
- }
- .sharemap {
- margin: 0 auto;
- text-align: center;
- margin-top: 15%;
- margin-bottom: 15%;
- }
- .sharemap image {
- width: 400rpx;
- height: 400rpx;
- }
- .butmin {
- height: 48rpx;
- background-color: #3397FA;
- color: #FFFFFF;
- line-height: 48rpx;
- }
- //弹出层
- /deep/ .uni-data-checklist .checklist-group .checklist-box {
- background-color: #FFFFFF !important;
- border-radius: 20rpx !important;
- padding: 8rpx 30rpx !important;
- border: 0 !important;
- }
- /deep/ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
- font-size: 24rpx;
- color: #333333;
- }
- /deep/ .mini-btn {
- height: 70rpx;
- width: 250rpx;
- line-height: 70rpx;
- margin: 20rpx;
- letter-spacing: 4rpx;
- background-color: #FCCF41;
- }
- /deep/ .mini-btn1 {
- height: 70rpx;
- width: 400rpx;
- line-height: 70rpx;
- margin: 20rpx;
- letter-spacing: 4rpx;
- color: white;
- ;
- }
- /deep/ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
- background-color: #FCCF41 !important;
- }
- .butto {
- text-align: center;
- }
- //其他
- .nav {
- position: relative;
- }
- .nv_padding {
- height: 88upx;
- background-color: transparent;
- }
- /* 图标默认大小 */
- .nv_icon {
- width: 16px;
- height: 16px;
- }
- .bg_box {
- position: absolute;
- width: 750upx;
- height: 88upx;
- z-index: 10;
- top: 0;
- background-color: transparent;
- /* #ifdef MP */
- box-sizing: border-box;
- /* #endif */
- /* #ifndef APP-PLUS-NVUE */
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center center;
- /* #endif */
- }
- .mys_navBar {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- height: 88upx;
- /* #endif */
- // #ifdef MP
- box-sizing: border-box;
- // #endif
- width: 750upx;
- flex-direction: row;
- background-color: transparent;
- position: absolute;
- z-index: 10;
- top: 0;
- }
- .fixed {
- position: fixed;
- }
- /*
- left 按钮
- */
- .btn_type {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- /* #ifdef APP-PLUS-NVUE */
- margin-left: 16upx;
- /* #endif */
- // #ifndef MP
- align-items: center;
- // #endif
- flex: 1;
- flex-direction: row;
- // background-color: #fff;
- }
- .btn_box {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- margin-left: 16upx;
- /* #endif */
- flex-direction: row;
- // #ifndef MP
- align-items: center;
- // #endif
- }
- .btn_back,
- .btn_home {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- /* #ifndef APP-PLUS-NVUE */
- height: 100%;
- /* #endif */
- /* #ifdef APP-PLUS-NVUE */
- width: 76upx;
- height: 62upx;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- flex: 1;
- }
- /* 按钮类型1 */
- .nav_btn_t1 {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- // #ifdef MP
- box-sizing: border-box;
- // #endif
- flex-direction: row;
- align-items: center;
- border-style: solid;
- border-width: 1px;
- border-color: #C0C0C0;
- // background-color: rgba(0, 0, 0, 0.2);
- background-color: #FFFFFF;
- width: 130upx;
- height: 45upx;
- }
- .line {
- width: 1upx;
- height: 60%;
- /* #ifdef APP-PLUS-NVUE */
- height: 30upx;
- /* #endif */
- background-color: #C0C0C0;
- }
- /*
- 标题
- */
- .title_container {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- position: absolute;
- left: 375upx;
- bottom: 0;
- transform: translateX(-50%);
- flex-direction: row;
- justify-content: center;
- align-items: center;
- }
- .title_text {
- // flex: 1;
- text-overflow: ellipsis;
- /* #ifndef APP-PLUS-NVUE */
- white-space: nowrap;
- overflow: hidden;
- font-weight: 550;
- /* #endif */
- /* #ifdef APP-PLUS-NVUE */
- lines: 1;
- /* #endif */
- }
- /*
- 左边自定义
- */
- .my_left_box {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- }
- .my_left_icon {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- /* #ifndef MP */
- margin-left: 18upx;
- /* #endif */
- }
- .my_left_custom {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- // justify-content: center;
- }
- /* 文字 */
- .leftText {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- padding-left: 4upx;
- font-size: 15px;
- }
- /*
- 中间
- */
- .my_custom_box {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- flex: 1;
- }
- /*
- 搜索框
- */
- .nv_search_box {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- flex: 1;
- /* #ifndef MP */
- height: 60upx;
- /* #endif */
- background-color: #f8f8f8;
- padding-right: 20upx;
- padding-left: 20upx;
- border-radius: 60upx;
- margin-right: 15upx;
- margin-left: 15upx;
- }
- .nv_input {
- flex: 1;
- padding-left: 16upx;
- font-size: 13px;
- }
- .close {
- width: 50upx;
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- /* #ifndef MP */
- height: 62upx;
- /* #endif */
- }
- /*
- 右边 自定义
- */
- .my_right_icon {
- /* #ifndef APP-PLUS-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- justify-content: center;
- /* #ifndef MP */
- // min-width: 70upx;
- /* #endif */
- padding-left: 6px;
- padding-right: 10px;
- }
- .imge image {
- width: 100%;
- height: 260rpx;
- }
- .commodity {
- margin-top: 10rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- }
- .share {
- text-align: center;
- line-height: 10rpx;
- margin-top: 10rpx;
- }
- .share image {
- vertical-align: middle;
- width: 25rpx;
- height: 25rpx;
- display: inline-block
- }
- .share p {
- display: inline-block;
- font-size: 24rpx;
- color: #333333;
- }
- .project {
- width: 49%;
- height: 550rpx;
- // background-color: #ccc;
- border-radius: 20rpx;
- // box-shadow: 0rpx 5rpx 5rpx #ccc;
- margin-bottom: 0%;
- }
- .projectdiagram {
- width: 100%;
- height: 61%;
- background-size: 100% 100%;
- position: relative;
- border-radius: 10rpx;
- ;
- }
- .TitleText1 {
- height: 30rpx;
- background-color: #FDD442;
- border-radius: 10rpx;
- display: inline-block;
- padding: 0rpx 20rpx 0rpx 20rpx;
- line-height: 30rpx;
- }
- .TitleText2 {
- opacity: 0.8;
- height: 30rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
- display: inline-block;
- padding: 0rpx 20rpx 0rpx 20rpx;
- line-height: 30rpx;
- }
- .TitleText2 p {
- color: #464100;
- font-size: 24rpx;
- }
- .projecttext {
- // padding-top: 5%;
- padding: 0 0 0 1%;
- // height: 80rpx;
- }
- .projecttext span {
- color: #333333;
- font-size: 25rpx;
- font-weight: 550;
- text-indent: 2em;
- }
- .TitleText1 p {
- color: #333333;
- font-size: 18rpx;
- }
- .projecttext {
- // height: 70rpx;
- }
- .projecttext image {
- vertical-align: middle;
- width: 30rpx;
- height: 30rpx;
- display: inline-block;
- padding-right: 14rpx;
- }
- .TitleText {
- // height: 30rpx;
- width: 25%;
- background-color: #FDD442;
- border-radius: 10rpx;
- display: inline-block;
- text-align: center;
- // padding: 0rpx 10rpx 0rpx 10rpx;
- margin-right: 6%;
- line-height: 30rpx;
- margin-top: 0%;
- }
- .TitleText p {
- color: black;
- font-size: 16rpx;
- }
- .introduction {
- width: 100%;
- margin: 10rpx auto 0;
- }
- .rleft p {
- font-size: 18rpx;
- color: #999999;
- }
- .rright p {
- font-size: 18rpx;
- color: #999999;
- }
- .Mask {
- position: absolute;
- background-color: #000000;
- opacity: 0.6;
- width: 100%;
- height: 100%;
- // z-index: 999;
- text-align: center;
- border-radius: 20rpx;
- }
- .Mask image {
- width: 50%;
- height: 52%;
- padding-top: 25%;
- }
- .contt {
- position: relative;
- }
- .contact {
- position: fixed;
- top: 80%;
- right: 13%;
- }
- .img1 {
- width: 84rpx;
- height: 124rpx;
- position: absolute;
- }
- .img2 {
- width: 114rpx;
- height: 40rpx;
- position: absolute;
- top: 130rpx;
- left: -12rpx;
- }
- .swiper {
- height: 300rpx;
- }
- .swiper-item {
- display: block;
- height: 300rpx;
- line-height: 300rpx;
- text-align: center;
- }
- .swiper-list {
- margin-top: 40rpx;
- margin-bottom: 0;
- }
- </style>
|