From 49889d6aba4902848383eb303a7c5aa47c534b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E4=B8=B9=E5=A6=AE?= <210340044@cau.edu.cn> Date: Tue, 7 Nov 2023 08:24:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/miniprogram-2/app.json | 7 +-- src/miniprogram-2/pages/history/history.js | 11 ++++- src/miniprogram-2/pages/match/match.js | 44 ++++++++++++++++++- src/miniprogram-2/pages/match/match.wxml | 1 + src/miniprogram-2/pages/match/match.wxss | 23 +++++++++- src/miniprogram-2/pages/match/photo.js | 20 ++++++--- src/miniprogram-2/pages/match/photo.wxml | 5 +++ src/miniprogram-2/pages/recommend/rec2.wxml | 2 +- src/miniprogram-2/pages/recommend/rec3.wxml | 3 +- .../pages/recommend/recommend.js | 6 +-- .../pages/recommend/recommend.wxml | 39 ++++++++++++---- .../pages/recommend/recommend.wxss | 37 +++++++++++++++- 12 files changed, 166 insertions(+), 32 deletions(-) diff --git a/src/miniprogram-2/app.json b/src/miniprogram-2/app.json index 04755aa..9969278 100644 --- a/src/miniprogram-2/app.json +++ b/src/miniprogram-2/app.json @@ -55,14 +55,11 @@ "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" }, - "scope.userInfo": { - "desc": "你的个人信息将用于小程序个性化推荐" - }, "scope.album": { "desc": "你的相册将用于小程序图片上传" }, - "scope.camera":{ - "desc":"你的相机将用于小程序拍照" + "scope.camera": { + "desc": "你的相机将用于小程序拍照" } } } \ No newline at end of file diff --git a/src/miniprogram-2/pages/history/history.js b/src/miniprogram-2/pages/history/history.js index 07294fd..f421818 100644 --- a/src/miniprogram-2/pages/history/history.js +++ b/src/miniprogram-2/pages/history/history.js @@ -72,7 +72,7 @@ Page({ * 页面的初始数据 */ data: { - + history:[] }, bindmaiViewTap() { wx.redirectTo({ @@ -98,7 +98,14 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.setData({ + logs: (wx.getStorageSync('history') || []).map(log => { + return { + date: util.formatTime(new Date(log)), + history:this.data.history + } + }) + }) }, /** diff --git a/src/miniprogram-2/pages/match/match.js b/src/miniprogram-2/pages/match/match.js index a056385..4ec6b6a 100644 --- a/src/miniprogram-2/pages/match/match.js +++ b/src/miniprogram-2/pages/match/match.js @@ -7,8 +7,48 @@ Page({ data: { phopath:"../match/photo", // imgList:"", - src:"" + src:"", + scene:"" }, + showActionSheet(){ + // _this=this; + wx.showActionSheet({ + itemList: ['游玩娱乐','工作通勤','派对party','逛街购物','酒席宴会','其他场所'], + success: (res) => { + switch(res.tapIndex) { + case 0: + this.scene="游玩娱乐"; + console.log(this.scene) + break; + case 1: + this.scene="工作通勤"; + console.log('工作通勤') + break; + case 2: + this.scene="派对party"; + console.log('派对party') + break; + case 3: + this.scene="逛街购物"; + console.log('逛街购物') + break; + case 4: + this.scene="酒席宴会"; + console.log('酒席宴会') + break; + case 5: + this.scene="其他场所"; + console.log('其他场所') + break; + } + wx.setStorageSync('scene', this.data.scene); + }, + fail (res) { + console.log('取消选项') + } + }) + }, + //跳转photo bindphoViewTap(){ wx.navigateTo({ @@ -146,7 +186,7 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - + }, /** diff --git a/src/miniprogram-2/pages/match/match.wxml b/src/miniprogram-2/pages/match/match.wxml index 9b9706a..0e2e485 100644 --- a/src/miniprogram-2/pages/match/match.wxml +++ b/src/miniprogram-2/pages/match/match.wxml @@ -1,6 +1,7 @@ + 选择场景 点击开始拍照 diff --git a/src/miniprogram-2/pages/match/match.wxss b/src/miniprogram-2/pages/match/match.wxss index 4d081e6..effc6bb 100644 --- a/src/miniprogram-2/pages/match/match.wxss +++ b/src/miniprogram-2/pages/match/match.wxss @@ -4,12 +4,31 @@ height: auto; background-color: #ddcfc3; } +.choose_scene{ + width:100%; + height:100px; + background-color: #ddcfc3; + text-align: center; + padding-top: 200px; +} .choose_way{ width:100%; - height:400px; + height:100px; background-color: #ddcfc3; text-align: center; - padding-top: 200px; + padding-bottom: 200px; +} +.info-center{ + position: fixed; + z-index: 999; + background-color: white; + display: flex; + align-items: center; + justify-content: center; + border-radius: 10rpx; + width: 90%; + margin-left: 5%; + margin-right: 5%; } .match_display{ width:auto; diff --git a/src/miniprogram-2/pages/match/photo.js b/src/miniprogram-2/pages/match/photo.js index 41f53e5..09ed4f0 100644 --- a/src/miniprogram-2/pages/match/photo.js +++ b/src/miniprogram-2/pages/match/photo.js @@ -6,7 +6,13 @@ Page({ */ data: { imgFilePath:"", - src:"" + src:"", + scene:"" + }, + return(){ + wx.navigateBack({ + delta: 1 + }) }, /** @@ -15,9 +21,12 @@ Page({ */ onLoad(options) { var img = wx.getStorageSync('imgFilePath'); + var sce = wx.getStorageSync('scene'); + console.log(sce); var that = this; that.setData({ - imgFilePath: img + imgFilePath: img, + scene:sce }) }, @@ -33,9 +42,10 @@ Page({ * 获取日期给history? */ onShow() { - const history = wx.getStorageSync('history') || [] - history.unshift(Date.now()) - wx.setStorageSync('history', history) + const hisImg = wx.setStorageSync('hisImg',this.imgFilePath) ||[] + const hisSce = wx.setStorageSync('hisSce', this.scene)||[] + //history.unshift(Date.now())//? + // wx.setStorageSync('history', history) }, /** diff --git a/src/miniprogram-2/pages/match/photo.wxml b/src/miniprogram-2/pages/match/photo.wxml index b1ee2ba..e60f4d5 100644 --- a/src/miniprogram-2/pages/match/photo.wxml +++ b/src/miniprogram-2/pages/match/photo.wxml @@ -1,7 +1,12 @@ + + 场景:{{scene}} + + 返回 + 设计妆容 diff --git a/src/miniprogram-2/pages/recommend/rec2.wxml b/src/miniprogram-2/pages/recommend/rec2.wxml index 2feacaa..814ef39 100644 --- a/src/miniprogram-2/pages/recommend/rec2.wxml +++ b/src/miniprogram-2/pages/recommend/rec2.wxml @@ -16,7 +16,7 @@ 质地很特别 上嘴迅速成膜不拔干 很爱这种不显唇纹的哑光感吃饭也不用担心掉色严重 24小时在线 谁能不爱呢 - #MAC热吻棒 #笔记灵感 #美式复古 #热吻吧显眼包 #美拉德 + #派对party #秋季 #冬季 diff --git a/src/miniprogram-2/pages/recommend/rec3.wxml b/src/miniprogram-2/pages/recommend/rec3.wxml index 265b089..3c9119b 100644 --- a/src/miniprogram-2/pages/recommend/rec3.wxml +++ b/src/miniprogram-2/pages/recommend/rec3.wxml @@ -5,6 +5,7 @@ 新中式|水是眼波横 1、唇妆涂的是TF黑金唇镜 22朝露,薄涂是很纯欲的樱花粉,厚涂是气质的玫瑰色。上嘴甜味氛围感拉满,很适合搭配白开水伪素颜淡妆。 -2、妆容统一杏粉色调,眼妆用消肿色简单带过,点彩刷沾取暖调粉色腮红,在面中大面积铺色打造白里透红的妆效 +2、妆容统一杏粉色调,眼妆用消肿色简单带过,点彩刷沾取暖调粉色腮红,在面中大面积铺色打造白里透红的妆效 +#工作通勤 #春季 diff --git a/src/miniprogram-2/pages/recommend/recommend.js b/src/miniprogram-2/pages/recommend/recommend.js index b778eb7..23b83b3 100644 --- a/src/miniprogram-2/pages/recommend/recommend.js +++ b/src/miniprogram-2/pages/recommend/recommend.js @@ -15,9 +15,7 @@ Page({ '../images/rec_main_1.jpg', '../images/rec_main_2.jpg', '../images/rec_main_3.jpg' - - ] - + ], }, bindrec1ViewTap(){ wx.navigateTo({ @@ -65,7 +63,7 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - + }, /** diff --git a/src/miniprogram-2/pages/recommend/recommend.wxml b/src/miniprogram-2/pages/recommend/recommend.wxml index 66f092c..83616b5 100644 --- a/src/miniprogram-2/pages/recommend/recommend.wxml +++ b/src/miniprogram-2/pages/recommend/recommend.wxml @@ -10,15 +10,36 @@ - 推荐页面 + 妆容区 - - - - - - - - + + + + + + + + 美拉德是我的舒适区 + + + + + + + + + + 新中式|水是眼波横 + + + + + + + + + + \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/recommend.wxss b/src/miniprogram-2/pages/recommend/recommend.wxss index 75c06fd..ee69716 100644 --- a/src/miniprogram-2/pages/recommend/recommend.wxss +++ b/src/miniprogram-2/pages/recommend/recommend.wxss @@ -1,7 +1,42 @@ /* pages/recommend/recommend.wxss */ - +page{ + width: 100%; + margin: 0; + background: #F2F2F2; +} swiper{ width: 100%; /* height: calc(100vw*9/16); */ height: 350px; } + .content{ + display: flex; + flex-direction: row; + margin: 20rpx; + overflow: hidden; +} + .left{ + width: 345rpx; + } + .right{ + width: 345rpx; + margin-left: 20rpx; + } + .block{ + background: #ffffff; + border-radius: 10rpx; + } + .pic{ + border-radius: 10rpx 10rpx 0rpx 0rpx; + width: 345rpx; +} +.title{ + padding: 5rpx 20rpx 0rpx 20rpx; + font-size: 30rpx; + font-weight: 600; + color: #333; + align-items: center; + display: flex; +} + +