diff --git a/App.vue b/App.vue index 7109917..92a8953 100644 --- a/App.vue +++ b/App.vue @@ -22,8 +22,8 @@ export default { // themeColor: "#00B666", // themeBackgroundColor: "#00B66621", - themeColor: "#F9AA16", - themeBackgroundColor: "#F9AA1621", + themeColor: "#fea702", + themeBackgroundColor: "#fea70221", logo: "", // #ifdef MP-WEIXIN diff --git a/pages.json b/pages.json index f550fae..34ae621 100644 --- a/pages.json +++ b/pages.json @@ -699,7 +699,7 @@ "uniIdRouter": {}, "tabBar": { "color": "#606266", - "selectedColor": "#F9AA16", + "selectedColor": "#fea702", "borderStyle": "black", "backgroundColor": "#ffffff", // "custom": true, diff --git a/pages/home/child/promotion.vue b/pages/home/child/promotion.vue index 2fd3195..d870517 100644 --- a/pages/home/child/promotion.vue +++ b/pages/home/child/promotion.vue @@ -1,9 +1,8 @@ @@ -164,32 +159,30 @@ export default { props: {}, data() { return { + userinfo: uni.getStorageSync("apply-userinfo") || {}, bannerList: [], serviceList: [], - serviceListBefore: [], - serviceListAfter: [], currentStore: {}, connectModalShow: false, loading: true, - globalData: getApp().globalData, - currentIndex: 0, + serviceListBefore: [], + serviceListAfter: [], + currentIndex: 0, swiperFirstHeight: "0", swiperSecondHeight: "0", basicsSize: "0", imageSize: 0, dx: 0, - ml: 0, - ww: 0, }; }, /** * 生命周期函数--监听页面加载 */ created() { - var that = this; - that.getBannerList(); - that.getChannelList(); + // var that = this; + // that.getBannerList(); + // that.getChannelList(); }, /** * 生命周期函数--监听页面初次渲染完成 @@ -198,7 +191,12 @@ export default { /** * 生命周期函数--监听页面显示 */ - onShow() {}, + onShow() { + var that = this; + // that.userinfo = uni.getStorageSync("apply-userinfo") || {}; + that.getBannerList(); + that.getChannelList(); + }, /** * 生命周期函数--监听页面隐藏 */ @@ -215,6 +213,15 @@ export default { * 页面上拉触底事件的处理函数 */ onReachBottom() {}, + mounted() { + var that = this; + that.$nextTick(() => { + setTimeout(() => { + that.getBannerList(); + that.getChannelList(); + }, 100); + }); + }, methods: { handleTransition(e) { this.dx = e.detail.dx; @@ -234,142 +241,256 @@ export default { classify: 2, }, (res) => { + // console.log("轮播列表:", res); that.bannerList = res; }, - (res) => {} + (res) => { + // console.log(res); + }, ); }, getChannelList() { - let that = this; + let that = this, + _auth = false; that.G.Get( that.api.get_channel_info, { classify: 1, }, (res) => { - that.serviceList = res.map((item) => ({ - ...item, - image: item.icon || "", - })); - that.serviceListBefore = that.serviceList.filter((item, index) => index < 5); - that.serviceListAfter = that.serviceList.filter((item, index) => index >= 5); + // console.log("服务地址:", that.api.get_channel_info); + + // console.log("服务地址:", that.api.get_channel_info); + // console.log("resresresrse", res); + // console.log("resresresrse", res); - that.basicsSize = that.floorToDecimal(Number(uni.getSystemInfoSync().windowWidth / 5.35)); - that.imageSize = that.floorToDecimal(Number(that.basicsSize * 1 - 20)); + // let status = true; + // if (uni.getStorageSync("agencyInfo")) { + // that.G.Get( + // that.api.get_supplier_info, + // { + // agencyId: uni.getStorageSync("agencyInfo") ? uni.getStorageSync("agencyInfo").id : "", + // }, + // (info_res) => { + // if (info_res) { + // // 判断是否全部认证过以控制入驻平台是否显示 + // if (info_res.realNameAuth == 2 && info_res.certificationAuth == 2) { + // _auth = true; + // } else { + // _auth = false; + // } + // } + // } + // ); + // } - that.swiperFirstHeight = that.floorToDecimal(Number(that.basicsSize * 1 + 14)); - if (that.serviceListAfter.length > 0) { - that.swiperSecondHeight = that.floorToDecimal(Number(Math.ceil(that.serviceListAfter.length / 5) * (that.basicsSize * 1 + 14))); - } - that.ml = that.floorToDecimal(Number(uni.getSystemInfoSync().windowWidth / 5) - Number(uni.getSystemInfoSync().windowWidth / 5.35), 1); - this.ww = uni.getSystemInfoSync().windowWidth; + // let list = res.map((item) => { + // return { + // name: item.name, + // path: item.url, + // image: item.icon, + // ...item, + // icon: "", + // }; + // }); + // list = list.filter((item) => { + // if (_auth || that.userinfo.agencyStatus != 1) { + // if (_auth) { + // return item.type != 16; + // } else if (that.userinfo.agencyStatus != 1) { + // return item.type != 15; + // } + // } else { + // return true; + // } + // }); + // that.serviceList = list; + // that.loading = false; + // // console.log("serviceList", that.serviceList); + + new Promise((resolve) => { + let status = true; + if (uni.getStorageSync("agencyInfo")) { + this.G.Get( + this.api.get_supplier_info, + { + agencyId: uni.getStorageSync("agencyInfo") ? uni.getStorageSync("agencyInfo").id : "", + }, + (info_res) => { + if (info_res) { + // 判断是否全部认证过以控制入驻平台是否显示 + if (info_res.realNameAuth == 2 && info_res.certificationAuth == 2) { + _auth = true; + } else { + _auth = false; + } + resolve(status); + } + }, + ); + } else { + resolve(status); + } + }).then((status) => { + let list = res.map((item) => { + return { + ...item, + image: item.icon || "", + // name: item.name, + // path: item.url, + // image: item.icon, + // ...item, + // icon: "", + }; + }); + list = list.filter((item) => { + if (_auth || that.userinfo.agencyStatus != 1) { + if (_auth) { + return item.type != 16; + } else if (that.userinfo.agencyStatus != 1) { + return item.type != 15; + } + } else { + return true; + } + }); + that.serviceList = list; + // that.serviceList = list.map((item) => ({ + // ...item, + // image: item.icon || "", + // })); + that.serviceListBefore = that.serviceList.filter((item, index) => index < 11); + // that.serviceListAfter = that.serviceList.filter((item, index) => index >= 5); + + that.basicsSize = that.floorToDecimal(Number(uni.getSystemInfoSync().windowWidth / 5.35)); + that.imageSize = that.floorToDecimal(Number(that.basicsSize * 1 - 20)); + + that.swiperFirstHeight = that.floorToDecimal(Number(that.basicsSize * 1 + 14)); + // if (that.serviceListAfter.length > 0) { + // that.swiperSecondHeight = that.floorToDecimal(Number(Math.ceil(that.serviceListAfter.length / 5) * (that.basicsSize * 1 + 14))); + // } + that.loading = false; + // console.log("serviceList", that.serviceList); + }); + }, + (res) => { + // console.log(res); }, - (res) => {} ); }, floorToDecimal(num, $count = 2) { const factor = Math.pow(10, $count); return Math.floor(num * factor) / factor; }, - /** - * 拨打电话 - */ - makePhoneCall(e) { - var that = this; - if (!e.mark.tel) { - uni.showToast({ - title: "暂无联系方式", - icon: "none", - }); - return; - } - uni.makePhoneCall({ - phoneNumber: e.mark.tel, - }); - }, handleClickNum(e) { let that = this; - if (uni.getStorageSync("apply-userinfo")) { - if (e.item.type == 1) { - // 消息列表 - uni.switchTab({ - url: "/pages/message/index", - }); - } - if (e.item.type == 2) { - uni.navigateTo({ - url: `/root/detail/message?id=${e.item.params.ids}`, - }); - } - if (e.item.type == 3) { - // 自有职位 - uni.navigateTo({ - url: `/root/other/channelPage?jobtype=2`, - }); - } - if (e.item.type == 4) { - // 全部职位 - uni.navigateTo({ - url: `/root/other/channelPage`, - }); - } - if (e.item.type == 5) { - // 筛选职位 - uni.navigateTo({ - url: `/root/other/channelPage?manage=${JSON.stringify(e.item.params)}`, - }); - } - if (e.item.type == 6) { - // 特定职位 - uni.navigateTo({ - url: `/root/other/channelPage?shareJobIds=${e.item.params.ids}&from=mine`, - }); - } - if (e.item.type == 7) { - if (!e.item.url) { - uni.showToast({ - title: "小程序暂不支持", - icon: "none", - }); - } else { - uni.navigateTo({ - url: e.item.url, - }); - } - } - if (e.item.type == 8) { - // 主推职位(列表) - uni.navigateTo({ - url: "/root/other/channelPage?istop=1", - }); - } - if (e.item.type == 9) { - // 按工价排序 - uni.navigateTo({ - url: "/root/other/channelPage?sortTag=1", - }); - } - if (e.item.type == 11) { - // 按时间排序 - uni.navigateTo({ - url: "/root/other/channelPage?sortTag=0", - }); - } - if (e.item.type == 10) { - // 按距离排序 - uni.navigateTo({ - url: "/root/other/channelPage?sortTag=2", + // console.log("我的服务:", e); + let isLogin = uni.getStorageSync("apply-userinfo") ? true : false; + if (!isLogin && e.item.type == 16) { + uni.navigateTo({ + url: "/root/person/loginIndex", + }); + return false; + } + if (e.item.type == 1) { + // 消息列表 + uni.switchTab({ + url: "/pages/message/indexcopy", + }); + } + if (e.item.type == 2) { + uni.navigateTo({ + url: `/root/detail/message?id=${e.item.params.ids}`, + }); + } + if (e.item.type == 3) { + // 自有职位 + uni.navigateTo({ + url: `/root/other/channelPage?jobtype=2`, + }); + } + if (e.item.type == 4) { + // 全部职位 + uni.navigateTo({ + url: `/root/other/channelPage`, + }); + } + if (e.item.type == 5) { + // 筛选职位 + uni.navigateTo({ + url: `/root/other/channelPage?manage=${JSON.stringify(e.item.params)}`, + }); + } + if (e.item.type == 6) { + // 特定职位 + uni.navigateTo({ + url: `/root/other/channelPage?shareJobIds=${e.item.params.ids}&from=mine`, + }); + } + if (e.item.type == 7) { + if (!e.item.url) { + uni.showToast({ + title: "小程序暂不支持", + icon: "none", }); - } - if (e.item.type == 12) { - // 批量分享 + } else { uni.navigateTo({ - url: "/root/detail/shareJob", + url: e.item.url, }); } - } else { + } + if (e.item.type == 8) { + // 主推职位(列表) uni.navigateTo({ - url: "/root/login/index", + url: "/root/other/channelPage?istop=1", + }); + } + if (e.item.type == 9) { + // 按工价排序 + uni.navigateTo({ + url: "/root/other/channelPage?sortTag=1", + }); + } + if (e.item.type == 11) { + // 按时间排序 + uni.navigateTo({ + url: "/root/other/channelPage?sortTag=0", + }); + } + if (e.item.type == 10) { + // 按距离排序 + uni.navigateTo({ + url: "/root/other/channelPage?sortTag=2", + }); + } + if (e.item.type == 12) { + // 批量分享 + uni.navigateTo({ + url: "/root/detail/shareJob", + }); + } + if (e.item.type == 13) { + // 按佣金排序 + uni.navigateTo({ + url: "/root/other/channelPage?sortTag=3", + }); + } + if (e.item.type == 14) { + // 甄选职位 + uni.navigateTo({ + url: "/root/other/channelPage?picked=1", + }); + } + if (e.item.type == 15) { + // 今日发单 + uni.navigateTo({ + url: "/root/detail/todayRecord", + }); + } + if (e.item.type == 16) { + // 入驻平台 + uni.navigateTo({ + url: "/root/other/tobeAgencyChoose", }); } }, @@ -380,11 +501,12 @@ export default { }, }; - diff --git a/pages/home/child/promotion_jd.vue b/pages/home/child/promotion_jd.vue new file mode 100644 index 0000000..2fd3195 --- /dev/null +++ b/pages/home/child/promotion_jd.vue @@ -0,0 +1,427 @@ + + + + diff --git a/static/css/base.scss b/static/css/base.scss index 5ab568b..3ff5cde 100644 --- a/static/css/base.scss +++ b/static/css/base.scss @@ -3,8 +3,8 @@ $test: env("VITE_APP_THEMECOLOR"); // $main: #ff4400; // $filter_bg_color: #ff440011; // 其他的 -$main: #F9AA16; -$filter_bg_color: #F9AA1621; +$main: #fea702; +$filter_bg_color: #fea70221; $main_bg_color: $main; $page_bg_color: #ededed; $main_color: $main; diff --git a/static/image/tabbar/home_yellow.png b/static/image/tabbar/home_yellow.png index 33ed295..e17cf4d 100644 Binary files a/static/image/tabbar/home_yellow.png and b/static/image/tabbar/home_yellow.png differ diff --git a/static/image/tabbar/message_yellow.png b/static/image/tabbar/message_yellow.png index f1897ac..d801d81 100644 Binary files a/static/image/tabbar/message_yellow.png and b/static/image/tabbar/message_yellow.png differ diff --git a/static/image/tabbar/order_yellow.png b/static/image/tabbar/order_yellow.png index 5d4d103..750ddc3 100644 Binary files a/static/image/tabbar/order_yellow.png and b/static/image/tabbar/order_yellow.png differ diff --git a/static/image/tabbar/plus-square_yellow.png b/static/image/tabbar/plus-square_yellow.png index 40073d0..9152c8c 100644 Binary files a/static/image/tabbar/plus-square_yellow.png and b/static/image/tabbar/plus-square_yellow.png differ diff --git a/static/image/tabbar/user_yellow.png b/static/image/tabbar/user_yellow.png index bcf8cae..af7c5b5 100644 Binary files a/static/image/tabbar/user_yellow.png and b/static/image/tabbar/user_yellow.png differ