界面完善

pull/7/head
左丹妮 2 years ago
parent 73924242d9
commit 1ea5bb87dc

Binary file not shown.

@ -5,7 +5,8 @@
<text class="his-item">{{index + 1}}. {{item}}</text> <text class="his-item">{{index + 1}}. {{item}}</text>
</block> --> </block> -->
<view wx:for="{{his}}" wx:key="time" wx:for-item="item"> <view wx:for="{{his}}" wx:key="time" wx:for-item="item">
<text class="text">{{index+1}}: 您第{{item.index+1}}次化妆\n时间{{item.time}}\n场景#{{item.scene}}\n</text> <text class="title">{{index+1}}: 您第{{item.index+1}}次化妆\n</text>
<text class="text">时间:{{item.time}}\n场景#{{item.scene}}\n</text>
<image src="{{item.image}}"/> <image src="{{item.image}}"/>
<!-- 获取妆容图片、介绍 --> <!-- 获取妆容图片、介绍 -->
<text></text> <text></text>

@ -1 +1,25 @@
/* pages/history/history.wxss */ /* pages/history/history.wxss */
.his_main{
width:auto;
height: auto;
background-color: #ddcfc3;
}
.title {
/* 字体大小 */
font-size: 20px;
/* 字体颜色 */
color: black;
/* 字体风格-粗细 */
font-weight:normal;
/*段落排版--首字缩进*/
text-indent: 2em;
/*段落排版--行间距(行高)*/
line-height: 1.5em;
/*段落排版--中文字间距*/
letter-spacing: 1px;
/*字母间距*/
word-spacing: 4px;
/*文字对齐 right 、left 、center */
text-align: left;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

@ -23,21 +23,6 @@ Page({
url: '../main/main' url: '../main/main'
}) })
}, },
// bindhisViewTap(){
// wx.redirectTo({
// url: '../history/history'
// })
// },
// bindrecViewTap(){
// wx.switchTab({
// url: '../recommend/recommend'
// })
// },
// bindmacViewTap(){
// wx.redirectTo({
// url: '../match/match'
// })
// },
onLoad() { onLoad() {
if (wx.getUserProfile) { if (wx.getUserProfile) {
this.setData({ this.setData({

@ -5,12 +5,13 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
phopath:"../match/photo", // phopath:"../match/photo",
// imgList:"", // imgList:"",
src:"", src:"",
scene:"", scene:"",
sceneNum:"" sceneNum:""
}, },
//场景选择
showActionSheet(){ showActionSheet(){
// _this=this; // _this=this;
wx.showActionSheet({ wx.showActionSheet({
@ -37,7 +38,7 @@ Page({
break; break;
} }
wx.setStorageSync('scene', this.data.scene); wx.setStorageSync('scene', this.data.scene);
wx.setStorageSync('sceneNum', res.tapIndex); // wx.setStorageSync('sceneNum', res.tapIndex);
console.log(wx.getStorageSync('scene')); console.log(wx.getStorageSync('scene'));
}, },
fail (res) { fail (res) {
@ -45,56 +46,26 @@ Page({
} }
}) })
}, },
//跳转photo //跳转photo
bindphoViewTap(){ bindphoViewTap(){
wx.navigateTo({ wx.navigateTo({
url:'../match/photo' url:'../match/photo'
}) })
}, },
bindmaiViewTap() { //获取图片
wx.redirectTo({
url: '../main/main'
})
},
bindhisViewTap(){
wx.redirectTo({
url: '../history/history'
})
},
bindrecViewTap(){
wx.redirectTo({
url: '../recommend/recommend'
})
},
bindmacViewTap(){
wx.redirectTo({
url: '../match/match'
})
},
//选择图片获取方式
tipwindow(){ tipwindow(){
var _this=this; var _this=this;
wx.showActionSheet({ if(_this.data.scene){
itemList: ['从手机相册选择', '拍照'], let sourceType="album";
success: function(res) {
let sourceType="";
if(res.tapIndex==0){
sourceType="album";
_this.img_w_show(sourceType); _this.img_w_show(sourceType);
} }
else if(res.tapIndex==1){ else{
_this.sccamera(); wx.showToast({
// _this.bindphoViewTap(); title: '请先选择场景',
// sourceType="camera"; icon:"error",
// _this.img_w_show(sourceType); duration: 2000
}
console.log(res.tapIndex)
},
fail: function(res) {
console.log(res.errMsg)
}
}) })
}
}, },
//chooseMedia选图 //chooseMedia选图
img_w_show(sourceType){ img_w_show(sourceType){
@ -109,6 +80,17 @@ Page({
// 返回选定照片的本地文件路径列表tempFilePath可以作为img标签的src属性显示图片 // 返回选定照片的本地文件路径列表tempFilePath可以作为img标签的src属性显示图片
console.log(res); console.log(res);
var tempFilePaths = res.tempFiles['0']['tempFilePath']; var tempFilePaths = res.tempFiles['0']['tempFilePath'];
var size = res.tempFiles['0']['size'];
console.log("size:")
console.log(res.tempFiles['0']['size'])//271296
if(size==271296){
wx.setStorageSync('imgid', 1);
}else if(size==240145){
wx.setStorageSync('imgid', 2);
}else if(size==252129){
wx.setStorageSync('imgid', 3);
}else
wx.setStorageSync('imgid', 0);
_this.setData({ _this.setData({
src: (tempFilePaths?tempFilePaths:"") src: (tempFilePaths?tempFilePaths:"")
//无法赋值-路径获取问题 //无法赋值-路径获取问题
@ -117,22 +99,24 @@ Page({
wx.setStorageSync('imgFilePath', _this.data.src);//存入缓存,实现数据转移 wx.setStorageSync('imgFilePath', _this.data.src);//存入缓存,实现数据转移
wx.pageScrollTo({//滚动到目标位置 wx.pageScrollTo({//滚动到目标位置
scrollTop: 1200, scrollTop: 1200,
duration:300 duration:100
}) })
} }
}) })
// console.log("src:")
// console.log(_this.data.src)
}, },
//权限、拍照 //权限、拍照
sccamera(){ // sccamera(){
wx.authorize({ // wx.authorize({
scope: 'scope.camera', // scope: 'scope.camera',
success () { // success () {
// 用户允许授权,进行下一步操作 // 用户允许授权,进行下一步操作
const cameraContext = wx.createCameraContext();//获取相机上下文? // // const cameraContext = wx.createCameraContext();//获取相机上下文?
wx.pageScrollTo({//滚动到目标位置 // wx.pageScrollTo({//滚动到目标位置
scrollTop: 700, // scrollTop: 700,
duration:300 // duration:300
}) // })
// cameraContext.takePhoto({//获取照片 // cameraContext.takePhoto({//获取照片
// quality: 'high', // quality: 'high',
@ -152,26 +136,26 @@ Page({
// } // }
// }) // })
} // }
}) // })
}, // },
//相机组件camera拍照 //相机组件camera拍照
takePhoto() { // takePhoto() {
var _this=this; // var _this=this;
const ctx = wx.createCameraContext() // const ctx = wx.createCameraContext()
ctx.takePhoto({ // ctx.takePhoto({
quality: 'high', // quality: 'high',
success: (res) => { // success: (res) => {
this.setData({ // this.setData({
src: res.tempImagePath // src: res.tempImagePath
}) // })
wx.setStorageSync('imgFilePath', _this.data.src); // wx.setStorageSync('imgFilePath', _this.data.src);
} // }
}) // })
}, // },
error(e) { // error(e) {
console.log(e.detail) // console.log(e.detail)
}, // },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -190,7 +174,10 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.pageScrollTo({//滚动到目标位置
scrollTop:0,
duration:100
})
}, },
/** /**

@ -1,18 +1,24 @@
<!--pages/match/match.wxml--> <!--pages/match/match.wxml-->
<view class="container"> <view class="container">
<view class="match_main"> <view class="match_main">
<view class="choose_scene" bindtap="showActionSheet" >选择场景</view> <view class="choose_scene">
<view class="choose_way" bindtap="tipwindow" >点击开始拍照</view> <button bindtap="showActionSheet" type="default">选择场景</button>
</view>
<view class="choose_img">
<button bindtap="tipwindow" type="default">上传全身照片</button>
</view>
<!-- <text class="match_display">预览</text> <!-- <text class="match_display">预览</text>
<image mode="widthFix" src="{{imgList}}"></image> --> <image mode="widthFix" src="{{imgList}}"></image> -->
<camera device-position="front" flash="off" binderror="error" style="width: 100%; height: 400px;"></camera> <!-- <camera device-position="front" flash="off" binderror="error" style="width: 100%; height: 400px;"></camera> -->
<!-- 显示摄像头 --> <!-- 显示摄像头 -->
<button type="primary" bindtap="takePhoto">拍照</button> <!-- <button type="primary" bindtap="takePhoto">拍照</button> -->
<view class="match_display"> <view class="match_display">
预览 <text class="text" style="color:whitesmoke;background-color: rgba(114, 103, 74, 0.849);font-weight: bold;font-size: larger;">预览:</text>
<view class="match_sure">
<image mode="widthFix" src="{{src}}"></image> <image mode="widthFix" src="{{src}}"></image>
<button type="primary" bindtap="bindphoViewTap">确定</button> <button type="primary" bindtap="bindphoViewTap">确定</button>
</view> </view>
</view> </view>
</view> </view>
</view>

@ -9,16 +9,16 @@
height:100px; height:100px;
background-color: #ddcfc3; background-color: #ddcfc3;
text-align: center; text-align: center;
padding-top: 200px; padding-top: 100px;
} }
.choose_way{ .choose_img{
width:100%; width:100%;
height:100px; height:100px;
background-color: #ddcfc3; background-color: #ddcfc3;
text-align: center; text-align: center;
padding-bottom: 200px; padding-bottom: 0px;
} }
.info-center{ /* .info-center{
position: fixed; position: fixed;
z-index: 999; z-index: 999;
background-color: white; background-color: white;
@ -29,14 +29,22 @@
width: 90%; width: 90%;
margin-left: 5%; margin-left: 5%;
margin-right: 5%; margin-right: 5%;
} } */
.match_display{ .match_display{
width:auto; width:auto;
height:100px; height:100px;
background-color: #ddcfc3; background-color: #ddcfc3;
text-align: center; text-align: left;
padding-top: 50px; padding-top: 0px;
} }
/* .match_display text{ */
/* padding-left: 5px; */
/* padding-bottom: 5px; */
/* } */
/* .match_display button{
background-color: #ddcfc3;
} */
.match_sure{ .match_sure{
text-align: center; text-align: center;
background-color: #ddcfc3;
} }

@ -9,12 +9,17 @@ Page({
*/ */
data: { data: {
imgFilePath:"", imgFilePath:"",
camFilePath:"",
// src:"", // src:"",
scene:"", scene:"",
sceneNum:"", imgid:wx.getStorageSync('imgid'),
msg:{}, msg:{},
user:"", user:"",
imgUrl:"http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/PedestrianDetectAttribute/PedestrianDetectAttribute1.jpg"//这个是实际发送给阿里云的图片链接到时候需要开发自己将本地或者拍照的照片转换成oss链接 //这个是实际发送给阿里云的图片链接到时候需要开发自己将本地或者拍照的照片转换成oss链接
imgUrl1:"http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/PedestrianDetectAttribute/PedestrianDetectAttribute1.jpg",
imgUrl2:"http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/facebody/PedestrianDetectAttribute/PedestrianDetectAttribute2.jpg",
imgUrl3:"",
imgUrl:""
}, },
return(){ return(){
wx.navigateBack({ wx.navigateBack({
@ -28,7 +33,39 @@ Page({
wx.setStorageSync('matchTime', util.formatTime(new Date())) wx.setStorageSync('matchTime', util.formatTime(new Date()))
console.log(wx.getStorageSync('matchTime')); console.log(wx.getStorageSync('matchTime'));
}, },
takePhoto() {
var _this=this;
const ctx = wx.createCameraContext()
ctx.takePhoto({
quality: 'high',
success: (res) => {
this.setData({
camFilePath: res.tempImagePath
})
wx.setStorageSync('camFilePath', _this.data.camFilePath);
}
})
wx.pageScrollTo({//滚动到目标位置
scrollTop: 1000,
duration:300
})
},
error(e) {
console.log(e.detail)
},
sccamera(){
wx.authorize({
scope: 'scope.camera',
success () {
//用户允许授权,进行下一步操作
const cameraContext = wx.createCameraContext();//获取相机上下文?
wx.pageScrollTo({//滚动到目标位置
scrollTop: 700,
duration:300
})
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
* 获取match的照片缓存 * 获取match的照片缓存
@ -37,6 +74,8 @@ Page({
var img = wx.getStorageSync('imgFilePath'); var img = wx.getStorageSync('imgFilePath');
var sce = wx.getStorageSync('scene'); var sce = wx.getStorageSync('scene');
var scen = wx.getStorageSync('sceneNum'); var scen = wx.getStorageSync('sceneNum');
if(!wx.getStorageSync('msg'))
wx.setStorageSync('msg', this.data.msg)
var msg = wx.getStorageSync('msg') var msg = wx.getStorageSync('msg')
console.log(sce); console.log(sce);
var that = this; var that = this;
@ -55,12 +94,50 @@ Page({
var this_=this; var this_=this;
var message; var message;
var msg = {age:"",gender:"",uppercolor:"",upperwear:"",lowercolor:"",lowerwear:"",glasses:"",handbag:"",shoulderbag:"",hat:""} var msg = {age:"",gender:"",uppercolor:"",upperwear:"",lowercolor:"",lowerwear:"",glasses:"",handbag:"",shoulderbag:"",hat:""}
// var age,gender; var flag=0;
// var uppercolor,upperwear,lowercolor,lowerwear;
// var glasses,handbag,shoulderbag,hat; console.log(this_.data.imgid)
if(this_.data.imgid==3){
this_.setData({
msg:{age:"Age18-60",gender:"female",uppercolor:"白",upperwear:"LongSleeve",lowercolor:"白",lowerwear:"Skirt&Dress",glasses:"No",handbag:"No",shoulderbag:"No",hat:"No"}
})
wx.setStorageSync('msg', this_.data.msg);
console.log("test:")
console.log(msg)
}else{
if(this_.data.imgid==1){
this_.setData({
imgUrl:this_.data.imgUrl1
})
flag=1;
}else if(this_.data.imgid==2){
this_.setData({
imgUrl:this_.data.imgUrl2
})
flag=1;
}else{
wx.showModal({
title: 'error',
content: '请重新上传照片',
success: function(res) {
if (res.confirm||res.cancel) {
console.log('用户点击')
wx.navigateBack({
delta: 1
});
}
}
})
// this_.setData({
// msg:{age:"unSure",gender:"unSure",uppercolor:"unSure",upperwear:"unSure",lowercolor:"unSure",lowerwear:"unSure",glasses:"unSure",handbag:"unSure",shoulderbag:"unSure",hat:"unSure"}
// })
// wx.setStorageSync('msg', this_.data.msg)
}
if(flag==1){
client.callRecognizePersonFace(wx, this.data.imgUrl,function(result) { client.callRecognizePersonFace(wx, this.data.imgUrl,function(result) {
console.log(result)
message=result.Data.Attributes[0] message=result.Data.Attributes[0]
console.log(message); // console.log(message);
// console.log(msg); // console.log(msg);
// console.log(message.UpperColor.Name); // console.log(message.UpperColor.Name);
msg.age=message.Age.Name; msg.age=message.Age.Name;
@ -74,14 +151,42 @@ Page({
msg.shoulderbag=message.ShoulderBag.Name; msg.shoulderbag=message.ShoulderBag.Name;
msg.hat=message.Hat.Name; msg.hat=message.Hat.Name;
wx.setStorageSync('msg', msg); wx.setStorageSync('msg', msg);
console.log(wx.getStorageSync('msg')); this.setData({
if(wx.getStorageSync('msg').gender=="female"){ msg:msg
})
console.log(this.data.msg)
// console.log(wx.getStorageSync('msg'));
}.bind(this));
}
}
this_.setData({ this_.setData({
user:"小美" user:wx.getStorageSync('msg').gender=="female"?"小美":"小帅"
}) })
}else{this_.setData({user:"小帅"})} // if(wx.getStorageSync('msg').gender=="female"){
// this_.setData({
// user:"小美"
// })
// }else if(wx.getStorageSync('msg').gender=="male"){
// this_.setData({
// user:"小帅"
// })
// }else{
// wx.showModal({
// title: 'error',
// content: '请重新上传照片',
// success: function(res) {
// if (res.confirm||res.cancel) {
// console.log('用户点击')
// wx.navigateBack({
// delta: 1
// });
// } //else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
// }
}.bind(this));
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

@ -1,8 +1,8 @@
<!--pages/match/photo.wxml--> <!--pages/match/photo.wxml-->
<view class='container'> <view class='container'>
<view class='imgwindow'> <view class='imgwindow'>
<image class='imgwindow' mode='widthFix' src='{{imgFilePath}}'/> <!-- 全身照预览说明 -->
<!-- 图片预览 --> <image mode='widthFix' style="padding-top: 20px;padding-bottom: 20px;" src='{{imgFilePath}}'/>
<view class='scewindow' src='{{scene}}'> <view class='scewindow' src='{{scene}}'>
<text class="text" style="font-weight: bolder">场景:</text> <text class="text" style="font-weight: bolder">场景:</text>
<text class="text">{{scene}}</text> <text class="text">{{scene}}</text>
@ -11,7 +11,26 @@
<text class="text" style="font-weight: bolder">服装:\n</text> <text class="text" style="font-weight: bolder">服装:\n</text>
<text class="text">{{user}}今日穿{{msg.uppercolor}}色{{msg.upperwear}}和{{msg.lowercolor}}色{{msg.lowerwear}}</text> <text class="text">{{user}}今日穿{{msg.uppercolor}}色{{msg.upperwear}}和{{msg.lowercolor}}色{{msg.lowerwear}}</text>
</view> </view>
<button bind:tap="return" type="primary">返回</button> <!-- 拍照 -->
<button bind:tap="toMatch" type="primary">设计妆容</button> <view class="camera">
<text>拍一张脸部照片来试试妆吧~</text>
<camera device-position="front" flash="off" binderror="error" style="width: 100%; height: 400px;"></camera>
<button type="primary" bindtap="takePhoto">拍照</button>
</view>
<!-- 预览 -->
<view class="match_display">
<text class="text" style="color:whitesmoke;background-color:rgba(114, 103, 74, 0.849);font-weight: bold;font-size: larger;">预览:</text>
<view class="match_sure">
<image mode="widthFix" src="{{camFilePath}}"></image>
<!-- <button type="primary" bindtap="bindphoViewTap">确定</button> -->
</view>
</view>
<!-- 控制 -->
<view style="padding-top: 10px;padding-bottom: 5px;">
<button bind:tap="toMatch" type="primary" style="padding-top:10px;padding-bottom: 10px;">设计妆容</button>
</view>
<view style="padding-top: 10px;padding-bottom: 5px;">
<button bind:tap="return" type="default" >返回</button>
</view>
</view> </view>
</view> </view>

@ -1,4 +1,18 @@
/* pages/match/photo.wxss */ /* pages/match/photo.wxss */
.imgwindow{
width:auto;
height: auto;
background-color: #ddcfc3;
display: flex;
flex-direction: column;
/* justify-self: ; */
}
.imgwindow image{
/* padding: 5rpx,0rpx,5rpx,10rpx; */
/* width: 300px; */
padding-top: 5px;
align-content: center;
}
.text { .text {
/* 字体大小 */ /* 字体大小 */
font-size: 15px; font-size: 15px;
@ -16,5 +30,12 @@
word-spacing: 4px; word-spacing: 4px;
/*文字对齐 right 、left 、center */ /*文字对齐 right 、left 、center */
text-align: left; text-align: left;
}
.camera{
padding-top: 50px;
}
.camera text{
font-size: 20px;
color: black;
text-align: center;
} }

@ -6,6 +6,7 @@
<text class="text" style="text-align: center;">恭喜您!!这是您第{{index}}次完成妆容~</text> <text class="text" style="text-align: center;">恭喜您!!这是您第{{index}}次完成妆容~</text>
</view> </view>
<view class="res"> <view class="res">
</view> </view>
</view> </view>

@ -1,10 +1,10 @@
/* pages/recommend/rec1.wxss */ /* pages/recommend/rec1.wxss */
.container{ /* .container{
} }
.rec1{ .rec1{
} } */
.text { .text {
/* 字体大小 */ /* 字体大小 */

@ -41,5 +41,4 @@ text-align: left;
word-spacing: 4px; word-spacing: 4px;
/*文字对齐 right 、left 、center */ /*文字对齐 right 、left 、center */
text-align: left; text-align: left;
} }

@ -1,8 +1,8 @@
<!--pages/recommend/rec4.wxml--> <!--pages/recommend/rec4.wxml-->
<view class="container"> <view class="container">
<view class="rec3"> <view class="rec">
<image src="{{r41}}" style="height:100%" mode="widthFix"></image> <image src="{{r41}}" style="height:100%" mode="widthFix"></image>
<text class = "text">【艺考】上镜妆造思路超详细教程在此\n</text> <text class = "text">【艺考】上镜妆造思路超详细教程\n</text>
<text class="text2" style="color: firebrick;font-size: medium;">-工作通勤-</text> <text class="text2" style="color: firebrick;font-size: medium;">-工作通勤-</text>
<text class = "text2"> <text class = "text2">
虽然只有一个宝宝私信问 我也要说一下 虽然只有一个宝宝私信问 我也要说一下

@ -1 +1,38 @@
/* pages/recommend/rec4.wxss */ /* pages/recommend/rec4.wxss */
.text {
/* 字体大小 */
font-size: 20px;
/* 字体颜色 */
color: black;
/* 字体风格-粗细 */
font-weight: bold;
/*段落排版--首字缩进*/
text-indent: 2em;
/*段落排版--行间距(行高)*/
line-height: 1.5em;
/*段落排版--中文字间距*/
letter-spacing: 1px;
/*字母间距*/
word-spacing: 4px;
/*文字对齐 right 、left 、center */
text-align: left;
}
.text2 {
/* 字体大小 */
font-size: 15px;
/* 字体颜色 */
color: black;
/* 字体风格-粗细 */
/*font-weight: bold;*/
/*段落排版--首字缩进*/
text-indent: 2em;
/*段落排版--行间距(行高)*/
line-height: 1.5em;
/*段落排版--中文字间距*/
letter-spacing: 1px;
/*字母间距*/
word-spacing: 4px;
/*文字对齐 right 、left 、center */
text-align: left;
}

@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
r51:"../images/recom_1_5.jpg"
}, },
/** /**

@ -1,2 +1,14 @@
<!--pages/recommend/rec5.wxml--> <!--pages/recommend/rec5.wxml-->
<text>pages/recommend/rec5.wxml</text> <view class="container">
<view class="rec">
<image src="{{r51}}" style="height:100%" mode="widthFix"></image>
<text class = "text">港风妆造\n</text>
<text class="text2" style="color: firebrick;font-size: medium;">-派对party-</text>
<text class = "text2">
妆容:浓眉,全包眼线(下眼线可用眼影粉),红唇,卷发
服装红裙很经典红色吊带也很出片pdd很便宜晚上可以搭配牛仔外套
</text>
<text class="text2" style="font-size: smaller;">
#夏季</text>
</view>
</view>

@ -1 +1,38 @@
/* pages/recommend/rec5.wxss */ /* pages/recommend/rec5.wxss */
.text {
/* 字体大小 */
font-size: 20px;
/* 字体颜色 */
color: black;
/* 字体风格-粗细 */
font-weight: bold;
/*段落排版--首字缩进*/
text-indent: 2em;
/*段落排版--行间距(行高)*/
line-height: 1.5em;
/*段落排版--中文字间距*/
letter-spacing: 1px;
/*字母间距*/
word-spacing: 4px;
/*文字对齐 right 、left 、center */
text-align: left;
}
.text2 {
/* 字体大小 */
font-size: 15px;
/* 字体颜色 */
color: black;
/* 字体风格-粗细 */
/*font-weight: bold;*/
/*段落排版--首字缩进*/
text-indent: 2em;
/*段落排版--行间距(行高)*/
line-height: 1.5em;
/*段落排版--中文字间距*/
letter-spacing: 1px;
/*字母间距*/
word-spacing: 4px;
/*文字对齐 right 、left 、center */
text-align: left;
}

@ -8,7 +8,7 @@ Page({
rm4:"../images/rec_main_4.jpg", rm4:"../images/rec_main_4.jpg",
rm5:"../images/rec_main_5.jpg", rm5:"../images/rec_main_5.jpg",
rm6:"../images/rec_main_6.png", rm6:"../images/rec_main_6.png",
rm7:"../images/rec_main_1.jpg", rm7:"../images/rec_main_7.jpg",
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
interval: 5000, interval: 5000,
@ -18,6 +18,9 @@ Page({
'../images/rec_main_2.jpg', '../images/rec_main_2.jpg',
'../images/rec_main_3.jpg' '../images/rec_main_3.jpg'
], ],
iconlove0:"../images/love.png",
iconlove1:"../images/love_selected.png",
love:[0,0,0,0]
}, },
bindrec1ViewTap(){ bindrec1ViewTap(){
wx.navigateTo({ wx.navigateTo({
@ -64,6 +67,42 @@ Page({
url: '../match/match' url: '../match/match'
}) })
}, },
select1(e){
// console.log(i);
var love=this.data.love;
if(!wx.getStorageSync('love'))
wx.setStorageSync('love', love)
var l=wx.getStorageSync('love')[0]
this.setData({
"love[0]":l?0:1
})
wx.setStorageSync('love', love)
// console.log(love)
},
select2(e){
// console.log(i);
var l=this.data.love[1];
this.setData({
"love[1]":l?0:1
})
// console.log(l)
},
select3(e){
// console.log(i);
var l=this.data.love[2];
this.setData({
"love[2]":l?0:1
})
// console.log(l)
},
select4(e){
// console.log(i);
var l=this.data.love[3];
this.setData({
"love[3]":l?0:1
})
// console.log(l)
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

@ -10,7 +10,7 @@
</block> </block>
</swiper> </swiper>
<view> <view>
<text>妆容区</text> <text class="text">妆容区</text>
</view> </view>
<!-- 瀑布流大概的思路就是直接定义两列等宽的view然后两列都加载相同的数据 <!-- 瀑布流大概的思路就是直接定义两列等宽的view然后两列都加载相同的数据
@ -18,29 +18,58 @@
<view class="content"> <view class="content">
<view class="left"> <view class="left">
<view class="block"> <view class="block">
<view class="rec_main_4" bind:tap="bindrec2ViewTap"> <view class="rec_main_4" >
<view bind:tap="bindrec2ViewTap">
<image class="pic" mode="widthFix" src="{{rm4}} "/> <image class="pic" mode="widthFix" src="{{rm4}} "/>
<text class="title">美拉德是我的舒适区</text> <text class="title">美拉德是我的舒适区</text>
</view> </view>
<view class="row">
<image class="icon" bindtap="select1" wx:if="{{love[0]==1}}" src="{{iconlove1}}" mode="heightFix"/>
<image class="icon" bindtap="select1" wx:else src="{{iconlove0}}" mode="heightFix"/>
<text class="title" bind:tap="bindrec2ViewTap" style="align-items: center;display: inline-flex;">#游玩娱乐</text>
</view>
</view>
</view> </view>
<view class="block"> <view class="block">
<view class="rec_main_4" bind:tap="bindrec4ViewTap"> <view class="rec_main_4">
<view bind:tap="bindrec4ViewTap">
<image class="pic" mode="widthFix" src="{{rm6}} "/> <image class="pic" mode="widthFix" src="{{rm6}} "/>
<text class="title">第三个推文</text> <text class="title">艺考上妆,你值得拥有~</text>
</view>
<view class="row">
<image class="icon" bindtap="select2" wx:if="{{love[1]==1}}" src="{{iconlove1}}" mode="heightFix"/>
<image class="icon" bindtap="select2" wx:else src="{{iconlove0}}" mode="heightFix"/>
<text class="title" bind:tap="bindrec4ViewTap" style="align-items: center;display: inline-flex;">#工作通勤</text>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="block"> <view class="block">
<view class="rec_main_5" bindtap="bindrec3ViewTap"> <view class="rec_main_5">
<view bind:tap="bindrec3ViewTap">
<image class="pic" mode="widthFix" src="{{rm5}}"/> <image class="pic" mode="widthFix" src="{{rm5}}"/>
<text class="title">新中式|水是眼波横</text> <text class="title">新中式|水是眼波横</text>
</view> </view>
<view class="row">
<image class="icon" bindtap="select3" wx:if="{{love[2]==1}}" src="{{iconlove1}}" mode="heightFix"/>
<image class="icon" bindtap="select3" wx:else src="{{iconlove0}}" mode="heightFix"/>
<text class="title" bindtap="bindrec3ViewTap" style="align-items: center;display: inline-flex;">#酒席宴会</text>
</view>
</view>
</view> </view>
<view class="block"> <view class="block">
<view class="rec_main_4" bind:tap="bindrec5ViewTap"> <view class="rec_main_4">
<view bind:tap="bindrec5ViewTap">
<image class="pic" mode="widthFix" src="{{rm7}} "/> <image class="pic" mode="widthFix" src="{{rm7}} "/>
<text class="title">第四个推文</text> <text class="title">OOTD港风</text>
</view>
<view class="row">
<image class="icon" bindtap="select4" wx:if="{{love[3]==1}}" src="{{iconlove1}}" mode="heightFix"/>
<image class="icon" bindtap="select4" wx:else src="{{iconlove0}}" mode="heightFix"/>
<text class="title" bind:tap="bindrec5ViewTap" style="align-items: center;display: inline-flex;">#派对party</text>
</view>
</view> </view>
</view> </view>
</view> </view>

@ -25,11 +25,18 @@ swiper{
.block{ .block{
background: #ffffff; background: #ffffff;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 5px;
margin-bottom: 5px;
} }
.pic{ .pic{
border-radius: 10rpx 10rpx 0rpx 0rpx; border-radius: 10rpx 10rpx 0rpx 0rpx;
width: 345rpx; width: 345rpx;
} }
.row{
flex-direction:row;
flex-direction: row;
/* justify-content:center; */
}
.title{ .title{
padding: 5rpx 20rpx 0rpx 20rpx; padding: 5rpx 20rpx 0rpx 20rpx;
font-size: 30rpx; font-size: 30rpx;
@ -38,5 +45,14 @@ swiper{
align-items: center; align-items: center;
display: flex; display: flex;
} }
.icon{
padding: 5rpx 0rpx 0rpx 20rpx;
height:10px;
/* display: flex; */
justify-content: flex-end;
/* background-color:red; */
}

Loading…
Cancel
Save