From 14b0d1484677d1e00e5439c9851c649c0c20351a Mon Sep 17 00:00:00 2001 From: liuyongli <1598631486@qq.com> Date: Fri, 27 May 2022 10:56:00 +0800 Subject: [PATCH 1/2] dev --- app.json | 1 + pages/index/index.js | 5 + pages/index/index.wxml | 2 +- .../brand/brandDetails/brandDetails.js | 318 ++++++++++++++++++ .../brand/brandDetails/brandDetails.json | 4 + .../brand/brandDetails/brandDetails.wxml | 48 +++ .../brand/brandDetails/brandDetails.wxss | 182 ++++++++++ .../brandDetails/images/ic_baocun@3x.png | Bin 0 -> 854 bytes .../brandDetails/images/ic_fenxiang@3x.png | Bin 0 -> 1147 bytes .../brandDetails/images/ic_shoucang@3x.png | Bin 0 -> 2402 bytes pages/index/subpage/ranking/ranking.wxss | 4 +- project.private.config.json | 18 +- 12 files changed, 578 insertions(+), 4 deletions(-) create mode 100644 pages/index/subpage/brand/brandDetails/brandDetails.js create mode 100644 pages/index/subpage/brand/brandDetails/brandDetails.json create mode 100644 pages/index/subpage/brand/brandDetails/brandDetails.wxml create mode 100644 pages/index/subpage/brand/brandDetails/brandDetails.wxss create mode 100644 pages/index/subpage/brand/brandDetails/images/ic_baocun@3x.png create mode 100644 pages/index/subpage/brand/brandDetails/images/ic_fenxiang@3x.png create mode 100644 pages/index/subpage/brand/brandDetails/images/ic_shoucang@3x.png diff --git a/app.json b/app.json index 45d5b82..26fa83c 100644 --- a/app.json +++ b/app.json @@ -4,6 +4,7 @@ "pages/logs/logs", "pages/index/subpage/ranking/ranking", "pages/index/subpage/brand/brand", + "pages/index/subpage/brand/brandDetails/brandDetails", "pages/quest/quest", "pages/material/material", "pages/user/user", diff --git a/pages/index/index.js b/pages/index/index.js index f4d74c9..cf7d2af 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -84,6 +84,11 @@ Page({ url: e.target.dataset.url }) }, + detail(){ + wx.navigateTo({ + url:"/pages/index/subpage/brand/brandDetails/brandDetails" + }) + }, onLoad: function (options) { wx.setNavigationBarTitle({ title: '', diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f0800e7..8bbfd77 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -28,7 +28,7 @@ - + {{item.type === 1 ? '视频' : '文章'}} diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.js b/pages/index/subpage/brand/brandDetails/brandDetails.js new file mode 100644 index 0000000..5905bb3 --- /dev/null +++ b/pages/index/subpage/brand/brandDetails/brandDetails.js @@ -0,0 +1,318 @@ +// pages/quest/quest.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + navItem: [{ + id: 0, + name: '全部状态', + is: false + }, { + id: 1, + name: '全部标签', + is: false + }, { + id: 2, + name: '全部日期', + is: false + }, { + id: 3, + name: '全部车型', + is: false + }], + selectItem: [{ + id: 0, + rank: [{ + name: '全部状态', + is: true + }, { + name: '待领取', + is: false + }, { + name: '进行中', + is: false + }, { + name: '已完成', + is: false + }] + }, { + id: 1, + rank: [{ + name: '全部标签', + is: true + }, { + name: '媒体测评', + is: false + }, { + name: '产品宣传', + is: false + }, { + name: '用户活动', + is: false + }, { + name: '趣味互动', + is: false + }] + }, { + id: 2, + rank: [{ + name: '全部日期', + is: true + }, { + name: '一个月内', + is: false + }, { + name: '三个月内', + is: false + }, { + name: '半年内', + is: false + }, { + name: '一年内', + is: false + }] + }, { + id: 3, + rank: [{ + name: '全部车型', + is: true + }, { + name: '星途追风ET-I', + is: false + }, { + name: '星途追风', + is: false + }, { + name: '星途TX', + is: false + }, { + name: '星途凌云', + is: false + }, { + name: '星途凌云S', + is: false + }, { + name: '星途揽月', + is: false + }, { + name: '揽月探享版至尊享受', + is: false + }] + }], + // 下拉选项,被选中那组的数据,由下面的js控制赋值 + selectedItem: [], + // 记录菜单栏第几项被点开,方便对样式的绑定 + listNum: -1, + // 下拉选项的隐藏和显示,默认隐藏 + showOrHide: false, + questes: [ + { + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + },{ + time: '2022-3-18~2022-5-18', + title: '星途揽月新款抖音视频需求需要马上贯彻落实', + text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + url: 'https://www.oa00.com/#/attendance/index', + type: 1, + num: '258w', + duration: '02:32', + }, + ], + }, + back(){ + wx.navigateBack({ + delta: 1 + }) + }, + // 点击菜单栏触发的事件函数 + handleClick: function (e) { + const index = e.currentTarget.dataset.id; + const { + selectItem, + navItem + } = this.data; + // 点击事件,开始时一定会执行的,先令所有下拉选项先隐藏 + const promise = new Promise((res) => { + this.setData({ + showOrHide: true + }) + res() + }) + promise.then(() => { + // 定义一个延迟0.1秒的函数,和函数动画事件对上 + setTimeout(() => { + // 当点击的是已经点开的菜单项,则隐藏 + if (this.data.listNum === index) { + navItem[index].is = false + // 重置所有样式 + this.setData({ + navItem, + listNum: -1 + }) + return; + } else { + // 否则就令当前的index = listNum方便下一次判断 + this.setData({ + listNum: index + }) + } + // 令当前点击的菜单栏高亮 + navItem.forEach((v, i) => i === index ? v.is = true : v.is = false) + // console.log(selectItem[index].rank) + this.setData({ + showOrHide: true, + selectedItem: selectItem[index].rank, + navItem + }) + }, 100) + }) + }, + // 关闭下拉选项的函数 + // 两种情况下会关闭下拉选项 + // 1. 选择下拉选项,选择后被选的下拉选项高亮,关闭下拉选项列表 + // 2. 点击遮罩层关闭 + closeMask: function (e) { + let { + navItem, + listNum, + selectedItem + } = this.data; + // 获取点击的下拉选项内容 + const { + contant + } = e.currentTarget.dataset + // 被点击的下拉选项高亮 + selectedItem.forEach((v) => v.name === contant ? v.is = true : v.is = false) + // 判断点击的是遮罩层还是下拉选项,如果是下拉选项则把选择的内容赋值到导航栏上,并且把v.is = false,让菜单栏高亮消失 + // 如果不是,不用赋值,直接把v.is = false,让菜单栏高亮消失 + contant ? (navItem.forEach((v, i) => { + (i === listNum ? (v.name = contant) : (v.name = v.name)); + // (i === listNum ? ( e.currentTarget.dataset.id !== 0 ? v.is = true : v.is = false) : (v.is = v.is)); + v.is = false + })) : (navItem.forEach((v) => v.is = false)) + // 调取借口触发筛选 + // console.log(navItem) + this.setData({ + listNum: -1, + showOrHide: false, + navItem, + selectedItem + }) + }, + to(e) { + wx.navigateTo({ + url: e.currentTarget.dataset.url + }) + }, + detail(){ + wx.navigateTo({ + url: 'url', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.setNavigationBarTitle({ + title: '任务中心', + success: function (res) {} + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.json b/pages/index/subpage/brand/brandDetails/brandDetails.json new file mode 100644 index 0000000..965b8e8 --- /dev/null +++ b/pages/index/subpage/brand/brandDetails/brandDetails.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.wxml b/pages/index/subpage/brand/brandDetails/brandDetails.wxml new file mode 100644 index 0000000..1e0e74b --- /dev/null +++ b/pages/index/subpage/brand/brandDetails/brandDetails.wxml @@ -0,0 +1,48 @@ + + + + + + 探享·心境界,星途揽月5座探享版开启预售 + + 2022-03-16 12:00:00 + 285w次播放 + + + + + 分享 + + + + 收藏 + + + + 保存 + + + + + + 相关推荐 + + + + {{item.title}} + {{item.text}} + {{item.time}} + + + + {{item.type === 1 ? '视频' : '文章'}} + + {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}}{{item.duration}} + + + + + + \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.wxss b/pages/index/subpage/brand/brandDetails/brandDetails.wxss new file mode 100644 index 0000000..e24f5d9 --- /dev/null +++ b/pages/index/subpage/brand/brandDetails/brandDetails.wxss @@ -0,0 +1,182 @@ +/* pages/index/subpage/brand/brandDetails/brandDetails.wxss */ + +.back { + position: absolute; + left: 32rpx; + top: 88rpx; +} + +.video { + width: 100%; + height: 440rpx; + +} + +.main { + background-color: #ffffff; + padding: 40rpx 32rpx; +} + +.main_title { + font-size: 40rpx; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #333333; + line-height: 48rpx; +} + +.title_tt { + display: flex; + height: 50rpx; + line-height: 50rpx; + justify-content: space-between; +} + +.title_aa { + width: 220rpx; + height: 84rpx; + line-height: 84rpx; + background-color: #F9F9F9; + font-size: 24rpx; + text-align: center; +} + +.data_tup { + width: 100%; + height: 84rpx; + line-height: 84rpx; + display: flex; + text-align: justify; + justify-content: space-between; +} + +text { + height: 84rpx; + line-height: 84rpx; +} + +.data_card { + width: 220rpx; + height: 84rpx; + margin: 0 16rpx; + background-color: rgb(249, 249, 249); + /* flex-direction: column; */ + text-align: center; + font-size: 24rpx; + font-family: PingFang SC; + font-weight: 400; + color: #333333; + line-height: 84rpx; +} + +.quest { + padding-top: 24rpx; + padding-left: 33rpx; + padding-right: 33rpx; +} + +.quest_text { + font-size: 36rpx; + font-family: PingFang SC; + font-weight: 400; + color: #333333; + line-height: 36rpx; +} + +.quest_crad { + pointer-events: auto; + padding: 32rpx; + width: 620rpx; + background-color: rgb(249, 249, 249); + margin-bottom: 16rpx; + border-radius: 16rpx; +} + +.card_time { + height: 50rpx; + font-size: 20rpx; + font-family: MiSans-Regular, MiSans; + font-weight: 400; + color: #999999; + line-height: 50rpx; +} + +.card_title { + width: 384rpx; + height: 32rpx; + font-size: 32rpx; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #333333; + line-height: 32rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 16rpx; +} + +.crad_text { + width: 396rpx; + height: 72rpx; + font-size: 24rpx; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #999999; + line-height: 36rpx; + display: -webkit-box; + text-overflow: ellipsis; + overflow: hidden; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.card_main { + width: 100%; + display: flex; + justify-content: space-between; +} + +.crad_left_top { + width: 360rpx; + height: 200rpx; +} + +.crad_right { + width: 240rpx; + height: 160rpx; + + +} + +.crad_image { + width: 240rpx; + height: 160rpx; + margin-left: 30rpx; + /* background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%); */ + border-radius: 8rpx; +} + +.crad_right_type { + width: 68rpx; + height: 34rpx; + background-color: #0000004f; + color: white; + border-radius: 20rpx; + font-size: 20rpx; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + margin-left: 190rpx; + margin-top: 10rpx; +} + +.crad_right_num { + position: absolute; + font-size: 22rpx; + color: white; + margin-top: 130rpx; + margin-left: 40rpx; + display: flex; + /* align-items: center; */ +} \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/images/ic_baocun@3x.png b/pages/index/subpage/brand/brandDetails/images/ic_baocun@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..2d42ab689da31deb7d955bd3ba6c09a33d459c0d GIT binary patch literal 854 zcmV-c1F8IpP)Px&5J^NqRCr$Pn>}b0K@`V-@6JRq5i2Wg(h9b=T4{42SV*ujSVXuZSOhe}X)YRw z2nrG|kQ5Rd5eq@M##Gwc3bxm1WhELhA9qhSMhJShJG-;@vCF%5=grLi=09)VzI!9s zFO+~7pKt;OC_*6y$N>2{5mS&U$Q0y9z!c=i&wNnN6f~o!fU~riKo~Rdg0jlUVU^Rnq{;tm!aD%!$cU>@dK!ML`^AwsmgAyMQm*Ylm$SL{1oe@gFoQC2kV1e zj*)I{3{V8UTmhP<`KG6`cgufMY(p>VWNcV4AwT%m<*d zj#FSA<-&gcD5;VHGme*(U7WbfN(0!^4p5`uI^6QvOe$2Z9AYaEo) zzKY$A&nJ!n8m2%o_R^KQ;0XYw-OK>!LX1BTnw<%!F*+zY5?)C$Q%iP}{J z2f^88mIz389m+vPcA?GzQqaV%WIBS%c{BH8KIb61y`BMzSa<_ufc$)eDaaIL3i2ah g3i9J;J}83UZ$AK%XQ+s+CIA2c07*qoM6N<$f?jTRO8@`> literal 0 HcmV?d00001 diff --git a/pages/index/subpage/brand/brandDetails/images/ic_fenxiang@3x.png b/pages/index/subpage/brand/brandDetails/images/ic_fenxiang@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..2f3e1fc3763a1d56c1bfddb959fd69b81f552a8c GIT binary patch literal 1147 zcmV->1cdvEP)Px(HAzH4RCr$Pn@wmHR}{y8=Or2?6~&Z-xG2Fc6jWTaF6_c8MFe#vN|)`XNTT=^ z(u&XeB9;oVplAZN3tei&jj^R#7jf@Oa3#TwAK=2zNc>3Nk$EKTd&%VGjB_XRGVjiA z;M{ZX`OW{_JNHZQPgMfq`BW$10ZpS256AhR0h}BcP&NV0K+awj3cLrNBiy2qy_}NA5z0pj z3<5as`3G1XrIIOZUjaYTBNwasYS-_8KY#@e>b%1oHb;SE|MEdvz2Q8{4hIblT#TUn zOt1W2)nA()L^uHv(zu#K;WG31!J2M%KznpOMf!lx905v0K|#}>kYgujfF`5oMZDrtD>qHJg$NdXEa@;MTHZ33=o#a&MqE`x*%960rYxxz7atU-LNW};5 z8r(o(aO31^BedDBpc(_Ds={AKmNQB}uq+II*WgAi3~rblW7Ywc;PmIeMx_^66{<{; zm%Hw6dvxx>SIgt5epV`|T3VIC=v+LIZ+Z5v>8H8@WJxPvh#bdc+wpE3bPKaaL8i0{ z;E4Xpr!A*t-GSly0#s$R`Y(lYbkef;Yza>A)PsT|r&W1}lXXBJl~#2H=ws5V9stEk ztE>ZxomS<5+Vv0+%(==J*@DS(o*wzlGWDssVczr;IB~R^D$?-9Hrq1Gn9rI4=Wsc0Mp{Uh1tSKu*(YqMF7R{FS8$4df8Qk1_#HX&0_tJ+XdUtuouMvtP}S+OZt18G$gfPzNo z_3mcgyxb469VrfxYwVV-g{v0n&y-DSDOMh!_U&j0-eu?IQRjhY;YZOqlyQfZCqriM zR3kA!S(>aS0x65j9Zo?xm_OD;C+!qU<#I>t^8_ByG+)O9@_^zU+3^bU3i1k?S_6KV zpC&&%AP*?sKje%m$kj36cp*nCEv5S;-%Kc!&@o_l2g#!a>E1e_gXHe7BDfFT<}snG z2<|Vl*ursbmDpvLprLNBL%9y!;xEDLP~+9dzfflh#FfnqU#J^zcAP7ju0pr?N##nW zrC}MevCrl+6m*nOJRoPw9Z|4n$kr>!D=40vy@I@gyn^Bp@Cu5@?*r@-)n|@7TIm1) N002ovPDHLkV1kji6=nbc literal 0 HcmV?d00001 diff --git a/pages/index/subpage/brand/brandDetails/images/ic_shoucang@3x.png b/pages/index/subpage/brand/brandDetails/images/ic_shoucang@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..2955a8286a746e0d1363c43688aa3ed6cd2008e9 GIT binary patch literal 2402 zcmV-o37z(dP)Px;97#k$RCr$Pn|p9n^%ciI=WY^cg7TDsf$CJ-f^=$`sGYvlK`AH$RXT++mMOF_ zv?iNaUiybHt_9mlC?dN_ElROP1WRXx*g_dmrnElV`e=2eP{mG_7KUdc&pdWd=XW=8 zcG-J(?>_D(f9&tSWbZw{^ZVTM{XNdPS17f#1f;|#J%JLS3=vWSR05RWBvOi?QUsME zC_e(F2+EINVdkLUXn@@erh;L>mr-s(7>zOtVI)XDGXD8z-2IvJB;Ozb^#w?v4M70vrf+CVkdh* zGc>>mu18sqGA@@+9q$p$fWjz(5JYnZo@!p$hcK5T{Ee;I$u2uUMpDQ4HgG>MreJW2 zW9R_z5SOtj8_9VG6w)$|@gPtK3@px=3f@Z_7GZ|+fLBP~0L5iBj~G7#s$ASQ6K^ZR zAz&B6^OW&E0S*(T9~T%+Ipc^j9k>=41@!lb-~!ky;OhimW^XjX^eQwGmc~rCrj67f6HtBu zeA@9ki)9Su$LZjw2Ncw?zz&p8Idt$pgqcL-rQ8S6edl~Fr<@xRCfNT`_Rz^*)=6jH zwu5>z@RUm=y^k`LX8EUEKkk4`^qjDt>T;kw$$)Skm`y~s<~@K!17AR9ZmoP;Kqv_Fk88e#HgcL&J+}oU&hRwq&$XlXUaS( z?52Yn*2!__smjf%TD=;JKcft}=#o%!e|CU^ zI?E2riw~Z{n+)S?gmOFE_%e7eM$H!B0?hi z!U51pB4RS34nMh#BB<{;Cd4ep6PAAzWAK^!(C0#9(XI`4I@aV8MBYZVR&HNmazCl< zZoLKzC*R+qNxqOBpgMgHnCfs-4NbBolk-s|Z?+vcTbvXNZ_|LYlOLpLEPottC{AMw>yu=&%y+C0aH^ zz8N~2?1p{h*g}k%4r6+Rh%C$wP=nq|lpPKZ9Hbu;SS=s=%)!yTZVQb=qT4~8s~jRb zsR+!HTSF(44Akl;5tDVWt0Rd`v6w_yc4r5uPOq?YJgKRI^LF}UIL%q*X!4}#E~_NN zrx97mv>&Y(Nr>=x+NKU=r9&3eEc+8_lK*4}=zDqzmG%MeE{BkOl`g);V`9>vMQIsi zWqfGIk`)XHtdR+! zR&h9s3A8>gQ^M^jJ_Yp&l-Ulc-7{F!5oV*?oSHsi_Cp;+7rRi*Wau=--^Ur&@}#7$ z7zH5bNmgc)C-PGQt&J&g>eZB{??HLk#s9xh#pIN#ZoZvV; zFdyNmLPe6cEd9Qn1$35ndRax8g|N=mSNH>+%y!EnCU)r!kh!BluO(_GGp=@xBvX>M zc%l%Hv}Ni2C@UQLa$l`_WF@R{jT}>_xA+cg<#jI+?;Vh;a1Yf)`5iFAZ@ItN8m!LJbiym0Hiudj$2EjF*EZ5~InrAP1)YowwX{PpFL3(J_c#fmQJ# zXW!l@Gq)zcHReTD@SeTj8OrW#cmLS~GN9sH_i7Y#;`d!{X&-my)#?bsG=}j;ws1_p zxdH0&xQKE~fn*}bCt2mTia9;TBFZhPd!J=hI6%E6H=kuySU|;;Tajet4wQRx$Hg<$f$)W(Y44@~1HA1zPU{N}QWMpo&jWVgKtq z9bC@YV#~=1SlpF literal 0 HcmV?d00001 diff --git a/pages/index/subpage/ranking/ranking.wxss b/pages/index/subpage/ranking/ranking.wxss index 4356de5..d8ff829 100644 --- a/pages/index/subpage/ranking/ranking.wxss +++ b/pages/index/subpage/ranking/ranking.wxss @@ -1,7 +1,8 @@ /* pages/index/subpage/ranking/ranking.wxss */ .top { width: 750rpx; - height: 420rpx; + height: 460rpx; + } .back { @@ -38,6 +39,7 @@ .nav { height: 96rpx; + line-height: 96rpx; width: 750rpx; display: flex; align-items: center; diff --git a/project.private.config.json b/project.private.config.json index 742204b..c8d0488 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,11 +1,11 @@ { - "projectname": "xx", + "projectname": "EXEEED", "setting": { "compileHotReLoad": true, "urlCheck": true }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "libVersion": "2.24.2", + "libVersion": "2.24.3", "condition": { "miniprogram": { "list": [ @@ -15,6 +15,20 @@ "query": "", "launchMode": "default", "scene": 1119 + }, + { + "name": "", + "pathName": "pages/index/subpage/brand/brandDetails/brandDetails", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/index/index", + "query": "", + "launchMode": "default", + "scene": null } ] } From 8374d321cdf1b0ea73aaa9ce30fe668e624d0e96 Mon Sep 17 00:00:00 2001 From: liuyongli <1598631486@qq.com> Date: Sun, 29 May 2022 17:35:00 +0800 Subject: [PATCH 2/2] 0529 --- .vscode/settings.json | 2 + app.json | 1 - components/spu-preview/index.js | 7 + components/spu-preview/index.wxml | 22 +- components/spu-preview/index.wxss | 13 +- miniprogram_npm/lin-ui/water-flow/index.js | 2 +- pages/index/index.js | 62 ++- pages/index/index.wxml | 4 +- .../brand/articleDetails/articleDetails.js | 330 --------------- .../brand/articleDetails/articleDetails.json | 4 - .../brand/articleDetails/articleDetails.wxml | 53 --- .../brand/articleDetails/articleDetails.wxss | 189 --------- pages/index/subpage/brand/brand.js | 172 +++++--- pages/index/subpage/brand/brand.json | 4 +- pages/index/subpage/brand/brand.wxml | 22 +- pages/index/subpage/brand/brand.wxss | 98 ++++- .../brand/brandDetails/brandDetails.js | 384 +++++++----------- .../brand/brandDetails/brandDetails.wxml | 60 +-- .../brand/brandDetails/brandDetails.wxss | 69 ++-- .../images}/img_phbang@2x.png | Bin .../images}/img_xingtusi@3x.png | Bin project.private.config.json | 7 + utils/downloadSaveFile.js | 199 +++++++++ utils/util.js | 70 ++-- 24 files changed, 747 insertions(+), 1027 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 pages/index/subpage/brand/articleDetails/articleDetails.js delete mode 100644 pages/index/subpage/brand/articleDetails/articleDetails.json delete mode 100644 pages/index/subpage/brand/articleDetails/articleDetails.wxml delete mode 100644 pages/index/subpage/brand/articleDetails/articleDetails.wxss rename pages/index/subpage/brand/{articleDetails/image => brandDetails/images}/img_phbang@2x.png (100%) rename pages/index/subpage/brand/{articleDetails/image => brandDetails/images}/img_xingtusi@3x.png (100%) create mode 100644 utils/downloadSaveFile.js diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/app.json b/app.json index a15b687..9365805 100644 --- a/app.json +++ b/app.json @@ -5,7 +5,6 @@ "pages/index/subpage/ranking/ranking", "pages/index/subpage/brand/brand", "pages/index/subpage/brand/brandDetails/brandDetails", - "pages/index/subpage/brand/articleDetails/articleDetails", "pages/quest/quest", "pages/material/material", "pages/user/user", diff --git a/components/spu-preview/index.js b/components/spu-preview/index.js index 64d695e..5f81ac2 100644 --- a/components/spu-preview/index.js +++ b/components/spu-preview/index.js @@ -31,6 +31,13 @@ Component({ * 组件的方法列表 */ methods: { + //跳转详情 + detail(){ + wx.navigateTo({ + url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3" + }) + + }, } }) diff --git a/components/spu-preview/index.wxml b/components/spu-preview/index.wxml index f4ce671..2be76d5 100644 --- a/components/spu-preview/index.wxml +++ b/components/spu-preview/index.wxml @@ -1,18 +1,24 @@ - + {{data.type === 1 ? '视频' : '文章'}} - + - - {{data.count}} - {{data.time}} + + + + - {{data.title}} + {{data.title}} - {{data.date}} + {{data.creatAt}} - + \ No newline at end of file diff --git a/components/spu-preview/index.wxss b/components/spu-preview/index.wxss index a300e3f..f2d7c85 100644 --- a/components/spu-preview/index.wxss +++ b/components/spu-preview/index.wxss @@ -4,7 +4,7 @@ display: flex; flex-direction: column; margin-bottom: 30rpx; - background: #FFFFFF; + background: #ffffff; border-radius: 16px; } @@ -26,16 +26,11 @@ } .date { - width: 196rpx; - height: 20rpx; - font-size: 20rpx; - font-family: MiSans-Regular, MiSans; + font-size: 24rpx; + font-family: MiSans; font-weight: 400; color: #999999; - line-height: 20rpx; - margin-top: 24rpx; - margin-left: 24rpx; - margin-bottom: 32rpx; + padding: 10rpx 32rpx 20rpx 32rpx ; } .type { diff --git a/miniprogram_npm/lin-ui/water-flow/index.js b/miniprogram_npm/lin-ui/water-flow/index.js index bf8ecb1..a168b43 100644 --- a/miniprogram_npm/lin-ui/water-flow/index.js +++ b/miniprogram_npm/lin-ui/water-flow/index.js @@ -1 +1 @@ -import eventUtil from"../core/utils/event-util";Component({properties:{columnGap:{type:String,value:"20rpx"}},data:{data:[],leftData:[],rightData:[]},attached(){this._init()},pageLifetimes:{show(){this._init()}},methods:{_init(){wx.lin=wx.lin||{},wx.lin.renderWaterFlow=(t=[],e=!1,a)=>{if("[object Array]"!==Object.prototype.toString.call(t))return console.error("[data]参数类型错误,渲染失败"),!1;this.setData({data:t}),e&&(this.data.leftData=[],this.data.rightData=[]),this._select(t,e).then(()=>{a&&a()}).catch(t=>{console.error(t)})}},_select(t,e){const a=wx.createSelectorQuery().in(this);return this.columnNodes=a.selectAll("#left, #right"),new Promise(a=>{this._render(t,0,e,()=>{a()})})},_render(t,e,a,i){(t.length>e||a)&&0!==this.data.data.length?this.columnNodes.boundingClientRect().exec(h=>{const r=h[0];this.data.leftHeight=r[0].height,this.data.rightHeight=r[1].height,this.data.leftHeight<=this.data.rightHeight||a?this.data.leftData.push(t[e]):this.data.rightData.push(t[e]),this.setData({leftData:this.data.leftData,rightData:this.data.rightData},()=>{this._render(t,++e,!1,i)})}):i&&i()},onTapItem(t){eventUtil.emit(this,"linitemtap",{item:t.currentTarget.dataset.item})}}}); \ No newline at end of file +import eventUtil from "../core/utils/event-util"; Component({ properties: { columnGap: { type: String, value: "20rpx" } }, data: { data: [], leftData: [], rightData: [] }, attached() { this._init() }, pageLifetimes: { show() { this._init() } }, methods: { _init() { wx.lin = wx.lin || {}, wx.lin.renderWaterFlow = (t = [], e = !1, a) => { if ("[object Array]" !== Object.prototype.toString.call(t)) return console.error("[data]参数类型错误,渲染失败"), !1; this.setData({ data: t }), e && (this.data.leftData = [], this.data.rightData = []), this._select(t, e).then(() => { a && a() }).catch(t => { console.error(t) }) } }, _select(t, e) { const a = wx.createSelectorQuery().in(this); return this.columnNodes = a.selectAll("#left, #right"), new Promise(a => { this._render(t, 0, e, () => { a() }) }) }, _render(t, e, a, i) { (t.length > e || a) && 0 !== this.data.data.length ? this.columnNodes.boundingClientRect().exec(h => { const r = h[0]; this.data.leftHeight = r[0].height, this.data.rightHeight = r[1].height, this.data.leftHeight <= this.data.rightHeight || a ? this.data.leftData.push(t[e]) : this.data.rightData.push(t[e]), this.setData({ leftData: this.data.leftData, rightData: this.data.rightData }, () => { this._render(t, ++e, !1, i) }) }) : i && i() }, onTapItem(t) { eventUtil.emit(this, "linitemtap", { item: t.currentTarget.dataset.item }) } } }); \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index cf7d2af..aa71f0c 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,7 +1,7 @@ // index.js // 获取应用实例 +import {http} from '../../utils/util' const app = getApp() - Page({ data: { toplist: [{ @@ -20,32 +20,7 @@ Page({ url: '/images/comment@3x.png', title: '总评论数', num: '1.0w' - }], - brandlist: [{ - url: '', - type: 1, - num: '258w', - time: '02:32', - title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' - }, { - url: '', - type: 1, - num: '258w', - time: '02:32', - title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' - }, { - url: '', - type: 2, - num: '258w', - time: '02:32', - title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' - }, { - url: '', - type: 2, - num: '258w', - time: '02:32', - title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' - }], + }], rankurl: [ '/images/img_diyi@3x.png', '/images/img_dier@3x.png', @@ -76,19 +51,17 @@ Page({ url: '/images/img_disan@3x.png', name: '希斯拉德', dis: 'LAWSON罗森(博瑞大厦店)' - }] + }], + records:[], }, to(e) { console.log(e.target.dataset.url) wx.navigateTo({ url: e.target.dataset.url }) + }, - detail(){ - wx.navigateTo({ - url:"/pages/index/subpage/brand/brandDetails/brandDetails" - }) - }, + onLoad: function (options) { wx.setNavigationBarTitle({ title: '', @@ -102,5 +75,24 @@ Page({ timingFunc: 'easeIn' } }) - } -}) \ No newline at end of file + this.getrecordslist() + + }, + + getrecordslist(){ + http("/topicActivity/list", "post", { + }).then(res =>{ + this.setData({ + records: res.data.records, + }) + }) + }, + detail(e){ + console.log(e) + wx.setStorageSync('info', e.currentTarget.dataset.cycle_id) + wx.navigateTo({ + url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3" + }) + + }, +}) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 8bbfd77..93146b3 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -28,7 +28,7 @@ - + {{item.type === 1 ? '视频' : '文章'}} @@ -36,7 +36,7 @@ - {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}} + {{item.title}} diff --git a/pages/index/subpage/brand/articleDetails/articleDetails.js b/pages/index/subpage/brand/articleDetails/articleDetails.js deleted file mode 100644 index 11f3be4..0000000 --- a/pages/index/subpage/brand/articleDetails/articleDetails.js +++ /dev/null @@ -1,330 +0,0 @@ -// pages/quest/quest.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - video: '', - videoHidden: true, - - - navItem: [{ - id: 0, - name: '全部状态', - is: false - }, { - id: 1, - name: '全部标签', - is: false - }, { - id: 2, - name: '全部日期', - is: false - }, { - id: 3, - name: '全部车型', - is: false - }], - selectItem: [{ - id: 0, - rank: [{ - name: '全部状态', - is: true - }, { - name: '待领取', - is: false - }, { - name: '进行中', - is: false - }, { - name: '已完成', - is: false - }] - }, { - id: 1, - rank: [{ - name: '全部标签', - is: true - }, { - name: '媒体测评', - is: false - }, { - name: '产品宣传', - is: false - }, { - name: '用户活动', - is: false - }, { - name: '趣味互动', - is: false - }] - }, { - id: 2, - rank: [{ - name: '全部日期', - is: true - }, { - name: '一个月内', - is: false - }, { - name: '三个月内', - is: false - }, { - name: '半年内', - is: false - }, { - name: '一年内', - is: false - }] - }, { - id: 3, - rank: [{ - name: '全部车型', - is: true - }, { - name: '星途追风ET-I', - is: false - }, { - name: '星途追风', - is: false - }, { - name: '星途TX', - is: false - }, { - name: '星途凌云', - is: false - }, { - name: '星途凌云S', - is: false - }, { - name: '星途揽月', - is: false - }, { - name: '揽月探享版至尊享受', - is: false - }] - }], - // 下拉选项,被选中那组的数据,由下面的js控制赋值 - selectedItem: [], - // 记录菜单栏第几项被点开,方便对样式的绑定 - listNum: -1, - // 下拉选项的隐藏和显示,默认隐藏 - showOrHide: false, - questes: [ - { - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - }, - ], - }, - back(){ - wx.navigateBack({ - delta: 1 - }) - }, - // 点击菜单栏触发的事件函数 - handleClick: function (e) { - const index = e.currentTarget.dataset.id; - const { - selectItem, - navItem - } = this.data; - // 点击事件,开始时一定会执行的,先令所有下拉选项先隐藏 - const promise = new Promise((res) => { - this.setData({ - showOrHide: true - }) - res() - }) - promise.then(() => { - // 定义一个延迟0.1秒的函数,和函数动画事件对上 - setTimeout(() => { - // 当点击的是已经点开的菜单项,则隐藏 - if (this.data.listNum === index) { - navItem[index].is = false - // 重置所有样式 - this.setData({ - navItem, - listNum: -1 - }) - return; - } else { - // 否则就令当前的index = listNum方便下一次判断 - this.setData({ - listNum: index - }) - } - // 令当前点击的菜单栏高亮 - navItem.forEach((v, i) => i === index ? v.is = true : v.is = false) - // console.log(selectItem[index].rank) - this.setData({ - showOrHide: true, - selectedItem: selectItem[index].rank, - navItem - }) - }, 100) - }) - }, - // 关闭下拉选项的函数 - // 两种情况下会关闭下拉选项 - // 1. 选择下拉选项,选择后被选的下拉选项高亮,关闭下拉选项列表 - // 2. 点击遮罩层关闭 - closeMask: function (e) { - let { - navItem, - listNum, - selectedItem - } = this.data; - // 获取点击的下拉选项内容 - const { - contant - } = e.currentTarget.dataset - // 被点击的下拉选项高亮 - selectedItem.forEach((v) => v.name === contant ? v.is = true : v.is = false) - // 判断点击的是遮罩层还是下拉选项,如果是下拉选项则把选择的内容赋值到导航栏上,并且把v.is = false,让菜单栏高亮消失 - // 如果不是,不用赋值,直接把v.is = false,让菜单栏高亮消失 - contant ? (navItem.forEach((v, i) => { - (i === listNum ? (v.name = contant) : (v.name = v.name)); - // (i === listNum ? ( e.currentTarget.dataset.id !== 0 ? v.is = true : v.is = false) : (v.is = v.is)); - v.is = false - })) : (navItem.forEach((v) => v.is = false)) - // 调取借口触发筛选 - // console.log(navItem) - this.setData({ - listNum: -1, - showOrHide: false, - navItem, - selectedItem - }) - }, - to(e) { - wx.navigateTo({ - url: e.currentTarget.dataset.url - }) - }, - detail(){ - wx.navigateTo({ - url: 'url', - }) - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - -// 点击cover播放 -videoPlay: function (e) { - console.log('点击播放'); - console.log(e); - //隐藏封面图和播放图标 - this.setData({ - tab_image: "none" //tab_image 来控制封面图 - }), - this.videoCtx.play(); -}, -onReady() { - this.videoCtx = wx.createVideoContext('myVideo') //根据id绑定 -}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } -}) \ No newline at end of file diff --git a/pages/index/subpage/brand/articleDetails/articleDetails.json b/pages/index/subpage/brand/articleDetails/articleDetails.json deleted file mode 100644 index 965b8e8..0000000 --- a/pages/index/subpage/brand/articleDetails/articleDetails.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "navigationStyle": "custom" -} \ No newline at end of file diff --git a/pages/index/subpage/brand/articleDetails/articleDetails.wxml b/pages/index/subpage/brand/articleDetails/articleDetails.wxml deleted file mode 100644 index 9952a19..0000000 --- a/pages/index/subpage/brand/articleDetails/articleDetails.wxml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - 星途揽月荣获“中央广播电视总台2021 - - 2022-03-16 12:00:00 - 285w次播放 - - - 4月26日,中央广播电视总台·2021 中国汽车风云盛典年度奖项揭晓。 -星途揽月凭借其环保的内饰选材,严苛的CN95级抗菌空调滤芯,以及顶级的AQS空气质量管理系统等七星级健康安全品质,荣获年度“最佳健康座舱奖”屡获殊荣。 -星途揽月在健康安全领域展现出了中国自主高端汽车品牌的领先实力,树立起行业安全品质的新标杆! - - - - - - 分享 - - - - 收藏 - - - - 保存 - - - - - - 相关推荐 - - - - {{item.title}} - {{item.text}} - {{item.time}} - - - - {{item.type === 1 ? '视频' : '文章'}} - - {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}}{{item.duration}} - - - - - - \ No newline at end of file diff --git a/pages/index/subpage/brand/articleDetails/articleDetails.wxss b/pages/index/subpage/brand/articleDetails/articleDetails.wxss deleted file mode 100644 index dc959b1..0000000 --- a/pages/index/subpage/brand/articleDetails/articleDetails.wxss +++ /dev/null @@ -1,189 +0,0 @@ -/* pages/index/subpage/brand/brandDetails/brandDetails.wxss */ - -.back { - position: absolute; - left: 32rpx; - top: 88rpx; -} - -.video { - width: 100%; - height: 440rpx; - -} - -.main { - background-color: #ffffff; - padding: 40rpx 32rpx; -} - -.main_title { - font-size: 40rpx; - font-family: PingFangSC-Semibold, ; - font-weight: 600; - color: #333333; - line-height: 48rpx; -} - -.title_tt { - display: flex; - height: 50rpx; - line-height: 50rpx; - justify-content: space-between; -} - -.title_aa { - width: 220rpx; - height: 84rpx; - line-height: 84rpx; - background-color: #F9F9F9; - font-size: 24rpx; - text-align: center; -} - -.title_text { - font-size: 28rpx; - font-family: PingFang SC; - font-weight: 400; - margin: 20rpx 0; -} - -.data_tup { - width: 100%; - height: 84rpx; - line-height: 84rpx; - display: flex; - text-align: justify; - justify-content: space-between; -} - -text { - height: 84rpx; - line-height: 84rpx; -} - -.data_card { - width: 220rpx; - height: 84rpx; - margin: 0 16rpx; - background-color: rgb(249, 249, 249); - /* flex-direction: column; */ - text-align: center; - font-size: 24rpx; - font-family: PingFang SC; - font-weight: 400; - color: #333333; - line-height: 84rpx; -} - -.quest { - padding-top: 24rpx; - padding-left: 33rpx; - padding-right: 33rpx; -} - -.quest_text { - font-size: 36rpx; - font-family: PingFang SC; - font-weight: 400; - color: #333333; - line-height: 36rpx; -} - -.quest_crad { - pointer-events: auto; - padding: 32rpx; - width: 620rpx; - background-color: rgb(249, 249, 249); - margin-bottom: 16rpx; - border-radius: 16rpx; -} - -.card_time { - height: 50rpx; - font-size: 20rpx; - font-family: MiSans-Regular, MiSans; - font-weight: 400; - color: #999999; - line-height: 50rpx; -} - -.card_title { - width: 384rpx; - height: 32rpx; - font-size: 32rpx; - font-family: PingFangSC-Semibold, PingFang SC; - font-weight: 600; - color: #333333; - line-height: 32rpx; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - margin-bottom: 16rpx; -} - -.crad_text { - width: 396rpx; - height: 72rpx; - font-size: 24rpx; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #999999; - line-height: 36rpx; - display: -webkit-box; - text-overflow: ellipsis; - overflow: hidden; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; -} - -.card_main { - width: 100%; - display: flex; - justify-content: space-between; -} - -.crad_left_top { - width: 360rpx; - height: 200rpx; -} - -.crad_right { - width: 240rpx; - height: 160rpx; - - -} - -.crad_image { - width: 240rpx; - height: 160rpx; - margin-left: 30rpx; - /* background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%); */ - border-radius: 8rpx; -} - -.crad_right_type { - width: 68rpx; - height: 34rpx; - background-color: #0000004f; - color: white; - border-radius: 20rpx; - font-size: 20rpx; - display: flex; - justify-content: center; - align-items: center; - position: absolute; - margin-left: 190rpx; - margin-top: 10rpx; -} - -.crad_right_num { - position: absolute; - font-size: 22rpx; - color: white; - margin-top: 130rpx; - margin-left: 40rpx; - display: flex; - /* align-items: center; */ -} \ No newline at end of file diff --git a/pages/index/subpage/brand/brand.js b/pages/index/subpage/brand/brand.js index 1da5371..bd3e0f6 100644 --- a/pages/index/subpage/brand/brand.js +++ b/pages/index/subpage/brand/brand.js @@ -1,84 +1,113 @@ // pages/index/subpage/brand/brand.js +import {http} from '../../../../utils/util' + Page({ /** * 页面的初始数据 */ data: { - demo: [{ - image: '', - title: '探享心境界,星途揽月5座探享版开启预售…柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', + // records:[], + records: [{ + url: '', type: 1, + num: '258w', time: '02:32', - date: '2022-03-16 12:00:00' + title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', + url: '', type: 1, + num: '258w', time: '02:32', - date: '2022-03-16 12:00:00' + title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', + url: '', type: 2, + num: '258w', time: '02:32', - date: '2022-03-16 12:00:00' + title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', + url: '', type: 2, + num: '258w', time: '02:32', - date: '2022-03-16 12:00:00' - }, { - image: '', - title: '赛道级性能SUV登场赛道级性能SUV登场赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', - type: 1, - time: '02:32', - date: '2022-03-16 12:00:00' - }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', - type: 1, - time: '02:32', - date: '2022-03-16 12:00:00' - }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', - type: 1, - time: '02:32', - date: '2022-03-16 12:00:00' - }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', - type: 1, - time: '02:32', - date: '2022-03-16 12:00:00' - }, { - image: '', - title: '赛道级性能SUV登场', - describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', - count: '285w', - type: 1, - time: '02:32', - date: '2022-03-16 12:00:00' - } - ] + title: '6.05版本更新笔记公开 挑战零式万魔殿边境之狱!' + }], + demo:[], + // demo: [{ + // image: '', + // title: '探享心境界,星途揽月5座探享版开启预售…柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 2, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 2, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场赛道级性能SUV登场赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // }, { + // image: '', + // title: '赛道级性能SUV登场', + // describe: '柔软顺滑、上身挺括显瘦,垂坠飘逸、不易皱好打理。', + // count: '285w', + // type: 1, + // time: '02:32', + // date: '2022-03-16 12:00:00' + // } + // ] }, /** @@ -91,8 +120,20 @@ Page({ wx.lin.renderWaterFlow(this.data.demo, false, () => { console.log('渲染成功') }) + this.getbrandlist() + }, + + getbrandlist:function(){ + http("/topicActivity/list", "post", { + }).then(res =>{ + console.log(res) + this.setData({ + demo: res.data.records, + + }) + wx.lin.renderWaterFlow(this.data.demo) + }) }, - /** * 生命周期函数--监听页面初次渲染完成 */ @@ -132,7 +173,8 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom() { - console.log('页面上拉触底事件的处理函数') + // console.log('页面上拉触底事件的处理函数') + this.getbrandlist() }, /** diff --git a/pages/index/subpage/brand/brand.json b/pages/index/subpage/brand/brand.json index 8835af0..d2b117f 100644 --- a/pages/index/subpage/brand/brand.json +++ b/pages/index/subpage/brand/brand.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "l-water-flow": "/miniprogram_npm/lin-ui/water-flow/index" + } } \ No newline at end of file diff --git a/pages/index/subpage/brand/brand.wxml b/pages/index/subpage/brand/brand.wxml index d2b2bd5..638ce79 100644 --- a/pages/index/subpage/brand/brand.wxml +++ b/pages/index/subpage/brand/brand.wxml @@ -1,13 +1,17 @@ - - - - 星途刚刚发布了新的素材,快来看看吧~ + + + + + + 星途刚刚发布了新的素材,快来看看吧~ + + - + + + - - - - + + \ No newline at end of file diff --git a/pages/index/subpage/brand/brand.wxss b/pages/index/subpage/brand/brand.wxss index cbfdb64..066393a 100644 --- a/pages/index/subpage/brand/brand.wxss +++ b/pages/index/subpage/brand/brand.wxss @@ -1,4 +1,9 @@ /* pages/index/subpage/brand/brand.wxss */ +.body{ + width: 100%; + height: 1000rpx; + background-color: #F9F9F9; +} .top_tip { height: 96rpx; background: #FFFFFF; @@ -13,6 +18,95 @@ padding: 0rpx 32rpx; } .flow{ - background-color: #F9F9F9; + /* background-color: #ffffff; */ padding: 24rpx 32rpx; -} \ No newline at end of file +} + +.brand_top { + display: flex; + justify-content: space-between; + padding: 0px 20rpx; + margin-top: 70rpx; +} + +.brand_title { + font-size: 36rpx; + font-weight: 900; +} + +.brand_tip { + display: flex; + align-items: center; + line-height: 24rpx; + font-size: 24rpx; + color: #999999; +} + +.brand_mes { + /* padding: 32rpx; */ + margin: 24rpx 32rpx 0rpx 32rpx; + /* height: 596rpx; */ + border-radius: 15rpx; + background-color: white; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.brand_card{ + width: 340rpx; + height: 422rpx; +} + +.brand_voa { + /* background-color: royalblue; */ + height: 250rpx; + width: 340rpx; + border-radius: 8rpx; +} + +.brand_voa_tip { + width: 304rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 28rpx; + margin-top: 16rpx; + font-weight: 900; +} + +.brand_voa_type { + width: 68rpx; + height: 34rpx; + background-color: #0000004f; + color: white; + border-radius: 20rpx; + font-size: 18rpx; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + margin-left: 220rpx; + margin-top: 18rpx; +} + +.brand_play { + border: 12rpx solid transparent; + border-right: 8rpx solid transparent; + /* border-top-left-radius: 30%; + border-bottom-left-radius: 30%; */ + border-left-color: white; +} + +.brand_voa_num { + position: absolute; + font-size: 18rpx; + color: rgb(255, 255, 255); + margin-top: -34rpx; + margin-left: 20rpx; + display: flex; + align-items: center; +} + + + diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.js b/pages/index/subpage/brand/brandDetails/brandDetails.js index 5905bb3..8cb0eb9 100644 --- a/pages/index/subpage/brand/brandDetails/brandDetails.js +++ b/pages/index/subpage/brand/brandDetails/brandDetails.js @@ -1,262 +1,121 @@ // pages/quest/quest.js +import {http} from '../../../../../utils/util' Page({ /** * 页面的初始数据 */ data: { - navItem: [{ - id: 0, - name: '全部状态', - is: false - }, { - id: 1, - name: '全部标签', - is: false - }, { - id: 2, - name: '全部日期', - is: false - }, { - id: 3, - name: '全部车型', - is: false - }], - selectItem: [{ - id: 0, - rank: [{ - name: '全部状态', - is: true - }, { - name: '待领取', - is: false - }, { - name: '进行中', - is: false - }, { - name: '已完成', - is: false - }] - }, { - id: 1, - rank: [{ - name: '全部标签', - is: true - }, { - name: '媒体测评', - is: false - }, { - name: '产品宣传', - is: false - }, { - name: '用户活动', - is: false - }, { - name: '趣味互动', - is: false - }] - }, { - id: 2, - rank: [{ - name: '全部日期', - is: true - }, { - name: '一个月内', - is: false - }, { - name: '三个月内', - is: false - }, { - name: '半年内', - is: false - }, { - name: '一年内', - is: false - }] - }, { - id: 3, - rank: [{ - name: '全部车型', - is: true - }, { - name: '星途追风ET-I', - is: false - }, { - name: '星途追风', - is: false - }, { - name: '星途TX', - is: false - }, { - name: '星途凌云', - is: false - }, { - name: '星途凌云S', - is: false - }, { - name: '星途揽月', - is: false - }, { - name: '揽月探享版至尊享受', - is: false - }] - }], - // 下拉选项,被选中那组的数据,由下面的js控制赋值 - selectedItem: [], - // 记录菜单栏第几项被点开,方便对样式的绑定 - listNum: -1, - // 下拉选项的隐藏和显示,默认隐藏 - showOrHide: false, - questes: [ - { - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - },{ - time: '2022-3-18~2022-5-18', - title: '星途揽月新款抖音视频需求需要马上贯彻落实', - text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', - url: 'https://www.oa00.com/#/attendance/index', - type: 1, - num: '258w', - duration: '02:32', - }, - ], + type:0, + // questes: [ + // { + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // },{ + // time: '2022-3-18~2022-5-18', + // title: '星途揽月新款抖音视频需求需要马上贯彻落实', + // text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...', + // url: 'https://www.oa00.com/#/attendance/index', + // type: 1, + // num: '258w', + // duration: '02:32', + // }, + // ], + records:[], + questes:[], + infoObject:{}, + isClick:false }, + back(){ wx.navigateBack({ delta: 1 }) }, - // 点击菜单栏触发的事件函数 - handleClick: function (e) { - const index = e.currentTarget.dataset.id; - const { - selectItem, - navItem - } = this.data; - // 点击事件,开始时一定会执行的,先令所有下拉选项先隐藏 - const promise = new Promise((res) => { - this.setData({ - showOrHide: true - }) - res() - }) - promise.then(() => { - // 定义一个延迟0.1秒的函数,和函数动画事件对上 - setTimeout(() => { - // 当点击的是已经点开的菜单项,则隐藏 - if (this.data.listNum === index) { - navItem[index].is = false - // 重置所有样式 - this.setData({ - navItem, - listNum: -1 - }) - return; - } else { - // 否则就令当前的index = listNum方便下一次判断 - this.setData({ - listNum: index - }) - } - // 令当前点击的菜单栏高亮 - navItem.forEach((v, i) => i === index ? v.is = true : v.is = false) - // console.log(selectItem[index].rank) - this.setData({ - showOrHide: true, - selectedItem: selectItem[index].rank, - navItem - }) - }, 100) - }) - }, - // 关闭下拉选项的函数 - // 两种情况下会关闭下拉选项 - // 1. 选择下拉选项,选择后被选的下拉选项高亮,关闭下拉选项列表 - // 2. 点击遮罩层关闭 - closeMask: function (e) { - let { - navItem, - listNum, - selectedItem - } = this.data; - // 获取点击的下拉选项内容 - const { - contant - } = e.currentTarget.dataset - // 被点击的下拉选项高亮 - selectedItem.forEach((v) => v.name === contant ? v.is = true : v.is = false) - // 判断点击的是遮罩层还是下拉选项,如果是下拉选项则把选择的内容赋值到导航栏上,并且把v.is = false,让菜单栏高亮消失 - // 如果不是,不用赋值,直接把v.is = false,让菜单栏高亮消失 - contant ? (navItem.forEach((v, i) => { - (i === listNum ? (v.name = contant) : (v.name = v.name)); - // (i === listNum ? ( e.currentTarget.dataset.id !== 0 ? v.is = true : v.is = false) : (v.is = v.is)); - v.is = false - })) : (navItem.forEach((v) => v.is = false)) - // 调取借口触发筛选 - // console.log(navItem) - this.setData({ - listNum: -1, - showOrHide: false, - navItem, - selectedItem - }) - }, - to(e) { + +to(e) { + console.log(e.target.dataset.url) + wx.navigateTo({ + url: e.target.dataset.url + }) + +}, + //跳转详情 + detail(e){ + console.log(e) + wx.setStorageSync('info', e.currentTarget.dataset.cycle_id) wx.navigateTo({ - url: e.currentTarget.dataset.url + url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3" }) + }, - detail(){ - wx.navigateTo({ - url: 'url', + getcollection(){ + + }, + //收藏 + collection(e){ + let userId = this.data.infoObject.id + let referenceId = this.data.infoObject.id + console.log(e) + // wx.navigateTo({ + // url:"/pages/user/subpage/newest/newest" + // }) + http("/userReference/add", "post", {userId,referenceId + }).then(res =>{ + this.setData({ + // userId:e.currentTarget.dataset.cycle_id, + // referenceId:this.id + + }) }) + }, + /** * 生命周期函数--监听页面加载 */ @@ -265,6 +124,21 @@ Page({ title: '任务中心', success: function (res) {} }) + this.setData({ + type:options.type, + infoObject:wx.getStorageSync('info') + }) + this.getrecordslist() + this.getcollection() + + }, + getrecordslist(){ + http("/topicActivity/list", "post", { + }).then(res =>{ + this.setData({ + records: res.data.records, + }) + }) }, /** @@ -312,7 +186,33 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage() { + onShareAppMessage:function() { + // if (res.from === 'button') { // 来自页面内分享按钮 + // console.log(e) + // } + return { + title:this.data.infoObject.title, + path:"pages/index/subpage/brand/brandDetails/brandDetails?type=3", + imageUrl:"/pages/index/shortimage/img_xingtusi@2x.png", + } + }, + //保存 + preserve(){ + // if(type=1){ + // 视频 + wx.saveVideoToPhotosAlbum({ + filePath: 'wxfile://xxx', + success (res) { + console.log(res.errMsg) + } + }) + // }else{ + //图片 + wx.saveImageToPhotosAlbum({ + filePath:"../../../shortimage/img_xingtue@2x.png", + success(res) { } + }) + // } } }) \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.wxml b/pages/index/subpage/brand/brandDetails/brandDetails.wxml index 65ed5e0..73f057f 100644 --- a/pages/index/subpage/brand/brandDetails/brandDetails.wxml +++ b/pages/index/subpage/brand/brandDetails/brandDetails.wxml @@ -1,48 +1,62 @@ - + + + + + + - 探享·心境界,星途揽月5座探享版开启预售 + {{infoObject.title}} - 2022-03-16 12:00:00 - 285w次播放 + {{infoObject.creatAt}} + + + + {{infoObject.content}} + - - + + + + + 分享 - + - 收藏 + {{isClick?'取消': '收藏'}} - + 保存 + 相关推荐 - - - - {{item.title}} - {{item.text}} - {{item.time}} - - - - {{item.type === 1 ? '视频' : '文章'}} - - {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}}{{item.duration}} - - + + + + {{item.title}} + {{item.content}} + {{item.creatAt}} + + + + {{item.type === 1 ? '视频' : '文章'}} + + + + \ No newline at end of file diff --git a/pages/index/subpage/brand/brandDetails/brandDetails.wxss b/pages/index/subpage/brand/brandDetails/brandDetails.wxss index e24f5d9..4013c34 100644 --- a/pages/index/subpage/brand/brandDetails/brandDetails.wxss +++ b/pages/index/subpage/brand/brandDetails/brandDetails.wxss @@ -31,16 +31,6 @@ line-height: 50rpx; justify-content: space-between; } - -.title_aa { - width: 220rpx; - height: 84rpx; - line-height: 84rpx; - background-color: #F9F9F9; - font-size: 24rpx; - text-align: center; -} - .data_tup { width: 100%; height: 84rpx; @@ -54,25 +44,9 @@ text { height: 84rpx; line-height: 84rpx; } - -.data_card { - width: 220rpx; - height: 84rpx; - margin: 0 16rpx; - background-color: rgb(249, 249, 249); - /* flex-direction: column; */ - text-align: center; - font-size: 24rpx; - font-family: PingFang SC; - font-weight: 400; - color: #333333; - line-height: 84rpx; -} - .quest { - padding-top: 24rpx; - padding-left: 33rpx; - padding-right: 33rpx; + padding: 24rpx 33rpx 0; + /* margin-top:20rpx */ } .quest_text { @@ -80,7 +54,8 @@ text { font-family: PingFang SC; font-weight: 400; color: #333333; - line-height: 36rpx; + line-height: 100rpx; + height: 100rpx; } .quest_crad { @@ -134,6 +109,8 @@ text { width: 100%; display: flex; justify-content: space-between; + background: #f9f9f9; + padding: 10rpxrpx; } .crad_left_top { @@ -179,4 +156,38 @@ text { margin-left: 40rpx; display: flex; /* align-items: center; */ +} + +.title_text { + font-size: 28rpx; + font-family: PingFang SC; + /* font-weight: 400; */ + margin: 10rpx 0; + line-height: 50rpx; +} +.data_tupp{ + +} +.d-flex{ + padding:30rpx; + background: #fff; + display: flex; + align-items: center; + justify-content: space-around; + width: 100%; + margin-bottom:50rpx +} +.share_btn{ + position: absolute; + left:0; + top:0; + opacity: 0; + width: 180rpx !important; + height: 84rpx; +} +.d-flex-list{ + position: relative; + padding:0rpx 30rpx; + background: #F9F9F9; + border-radius: 8rpx; } \ No newline at end of file diff --git a/pages/index/subpage/brand/articleDetails/image/img_phbang@2x.png b/pages/index/subpage/brand/brandDetails/images/img_phbang@2x.png similarity index 100% rename from pages/index/subpage/brand/articleDetails/image/img_phbang@2x.png rename to pages/index/subpage/brand/brandDetails/images/img_phbang@2x.png diff --git a/pages/index/subpage/brand/articleDetails/image/img_xingtusi@3x.png b/pages/index/subpage/brand/brandDetails/images/img_xingtusi@3x.png similarity index 100% rename from pages/index/subpage/brand/articleDetails/image/img_xingtusi@3x.png rename to pages/index/subpage/brand/brandDetails/images/img_xingtusi@3x.png diff --git a/project.private.config.json b/project.private.config.json index f94bb75..940870c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -36,6 +36,13 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "", + "pathName": "pages/index/subpage/brand/brand", + "query": "", + "launchMode": "default", + "scene": null } ] } diff --git a/utils/downloadSaveFile.js b/utils/downloadSaveFile.js new file mode 100644 index 0000000..05c12bb --- /dev/null +++ b/utils/downloadSaveFile.js @@ -0,0 +1,199 @@ +//位置为 /util/downloadSaveFile.js + +/** + * 下载单个文件 + * @param {string} [type] + * @param {string} url + * @callback successCallback + * @callback failCallback + */ +function downloadFile(type, url, successc, failc) { + checkAuth(() => { + wx.showLoading({ + title: '正在下载', + mask: true + }) + downloadSaveFile( + type, + url, + () => { + wx.hideLoading(); + wx.showToast({ + title: '下载成功', + icon: 'none', + }) + successc && successc(); + }, + (errMsg) => { + wx.hideLoading(); + wx.showToast({ + title: errMsg, + icon: 'none', + }) + failc && failc(); + } + ); + }) + } + + /** + * 下载多个文件 + * @param {string} [type] + * @param {string[]} urls + * @callback completeCallback + */ + function downloadFiles(type, urls, completec) { + let success = 0; + let fail = 0; + let total = urls.length; + let errMsgs = []; + + checkAuth(() => { + wx.showLoading({ + title: '正在下载', + mask: true + }) + for (let i = 0; i < urls.length; i++) { + downloadSaveFile( + type, + urls[i], + () => { + success++; + if (success + fail === total) { + saveCompleted(success, fail, completec, errMsgs); + } + }, + (errMsg) => { + fail++; + errMsg && errMsgs.push(`视频${i}${errMsg}`); + if (success + fail === total) { + saveCompleted(success, fail, completec, errMsgs); + } + } + ); + } + }) + } + + //保存完成 + function saveCompleted(success, fail, completec, errMsgs) { + wx.hideLoading(); + let errMsg = '无'; + if (errMsgs.length) { + errMsg = errMsgs.join('\n'); + } + + wx.showModal({ + title: `成功${success}项,失败${fail}项`, + content: `失败信息:\n${errMsg}`, + showCancel: false, + success(res) { + if (res.confirm) { + completec && completec(); + } + } + }) + } + + //下载文件 + function downloadSaveFile(type, url, successc, failc) { + wx.downloadFile({ + url: url, + success: res => { + if (res.statusCode === 200) { + if (type === 'video') { + //类型为视频 + wx.saveVideoToPhotosAlbum({ + filePath: res.tempFilePath, + success: res => { + successc && successc(); + }, + fail: res => { + failc && failc('保存失败'); + } + }) + } else if (type === 'image') { + //类型为图片 + wx.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, + success: res => { + successc && successc(); + }, + fail: res => { + failc && failc('保存失败'); + } + }) + } + } else { + failc && failc('状态码非200'); + } + }, + fail: res => { + failc && failc('下载失败'); + } + }) + } + + //检查权限 + function checkAuth(gotc) { + //查询权限 + wx.showLoading({ + title: '检查授权情况', + mask: true + }) + wx.getSetting({ + success(res) { + wx.hideLoading(); + if (!res.authSetting['scope.writePhotosAlbum']) { + //请求授权 + wx.authorize({ + scope: 'scope.writePhotosAlbum', + success() { + //获得授权,开始下载 + gotc && gotc(); + }, + fail() { + wx.showModal({ + title: '', + content: '保存到系统相册需要授权', + confirmText: '授权', + success(res) { + if (res.confirm) { + wx.openSetting({ + success(res) { + if (res.authSetting['scope.writePhotosAlbum'] === true) { + gotc && gotc(); + } + } + }) + } + }, + fail() { + wx.showToast({ + title: '打开设置页失败', + icon: 'none', + }) + } + }) + } + }) + } else { + //已有授权 + gotc && gotc(); + } + }, + fail() { + wx.hideLoading(); + wx.showToast({ + title: '获取授权失败', + icon: 'none', + }) + } + }) + } + + module.exports = { + downloadFile, + downloadFiles + }; + \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 239ba33..fe34fee 100644 --- a/utils/util.js +++ b/utils/util.js @@ -1,3 +1,4 @@ + import { host } from './config' @@ -25,32 +26,37 @@ const http = (url, method, data, isLoading = true) => { }); } return new Promise(function (resolve, reject) { - if ( url === '/user/login' || url === '/user/register') { + if (url === '/user/login' || url === '/user/register') { var header = {} } else { - wx.getStorage({ - key: 'token', - success (res) { - var token = res.data - var header = { - 'token': token - } - }, - fail(res) { - if (res.errMsg === "getStorage:fail data not found"){ - wx.showToast({ - title: '未登录\r\n点击个人中心头像登录', - icon: 'none', - duration: 2000 - }) - } - wx.hideLoading(); - }, - complete (res) { - console.log(res) - } - }) + // wx.getStorage({ + // key: 'token', + // success (res) { + // var token = res.data + // var header = { + // 'token': token + // } + // }, + // fail(res) { + // if (res.errMsg === "getStorage:fail data not found"){ + // wx.showToast({ + // title: '未登录\r\n点击个人中心头像登录', + // icon: 'none', + // duration: 2000 + // }) + // } + // wx.hideLoading(); + // }, + // complete (res) { + // // console.log(res) + // } + // }) + var header = { + 'token': wx.getStorageSync('token') + } } + console.log(url) + console.log(header) wx.request({ url: host + url, data: data, @@ -79,7 +85,23 @@ const http = (url, method, data, isLoading = true) => { }) } +const lookup = (e) => { + // console.log(e) + if (e.type === 1) { + wx.navigateTo({ + url: '/pages/lookup/loockvideo/video', + }) + wx.setStorage({ + key: 'video', + data: e + }) + } else { + + } +} + module.exports = { formatTime, - http + http, + lookup } \ No newline at end of file