diff --git a/doc/需求模型_美妆匹配软件系统_郑培萱_.docx b/doc/需求模型_美妆匹配软件系统_郑培萱_.docx index 7460bf2..7f2616a 100644 Binary files a/doc/需求模型_美妆匹配软件系统_郑培萱_.docx and b/doc/需求模型_美妆匹配软件系统_郑培萱_.docx differ diff --git a/src/miniprogram-2/.eslintrc.js b/src/miniprogram-2/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/src/miniprogram-2/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/src/miniprogram-2/app.js b/src/miniprogram-2/app.js new file mode 100644 index 0000000..1ed57c4 --- /dev/null +++ b/src/miniprogram-2/app.js @@ -0,0 +1,19 @@ +// app.js +App({ + onLaunch() { + // 展示本地存储能力 + const logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + + // 登录 + wx.login({ + success: res => { + // 发送 res.code 到后台换取 openId, sessionKey, unionId + } + }) + }, + globalData: { + userInfo: null + } +}) diff --git a/src/miniprogram-2/app.json b/src/miniprogram-2/app.json new file mode 100644 index 0000000..9ef1c02 --- /dev/null +++ b/src/miniprogram-2/app.json @@ -0,0 +1,35 @@ +{ + "@json": ".json配置文件,对项目进行不同级别的配置", + "@appjson": "对项目全局配置", + "@page": "新增页面", + "pages": [ + "pages/index/index", + "pages/logs/logs", + "pages/main/main", + "pages/match/match", + "pages/history/history", + "pages/recommend/recommend", + "pages/setting/setting", + "pages/recommend/rec1" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle": "black" + }, + "style": "v2", + "sitemapLocation": "sitemap.json", + "@list": [ + { + "pagePath": "pages/aa/aa", + "text": "aa" + }, + { + "pagePath": "pages/index/index", + "text": "我的", + "@iconPath": "./pages/images/me.png", + "@selectedIconPath": "./pages/images/me_select.png" + } + ] +} \ No newline at end of file diff --git a/src/miniprogram-2/app.wxss b/src/miniprogram-2/app.wxss new file mode 100644 index 0000000..06c6fc9 --- /dev/null +++ b/src/miniprogram-2/app.wxss @@ -0,0 +1,10 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} diff --git a/src/miniprogram-2/pages/history/history.js b/src/miniprogram-2/pages/history/history.js new file mode 100644 index 0000000..d716243 --- /dev/null +++ b/src/miniprogram-2/pages/history/history.js @@ -0,0 +1,152 @@ +// pages/history/history.js +//document.write("Hello world!");//输出一句话 +//代码块 +// { + //undifined 已声明未赋值的变量 + //alert("hello!");//弹窗显示 + // var a = 123,b="123";//变量 + // a.toString(); + // a += ""; + // Number(a); //NaN + // parseInt(a); //=>str + // console.log(a === b) ; //全等于包含类型等于 ;!==全不等 + /* var today = 1;*/ + // switch(today){ + // case 1:console.log("1");break; + // case 2:console.log("2");break; + // default:console.log("error"); + // } + /*label名字*/ + // outer:for(var i=0;i<3;i++){ + // for(var j=0;j<2;j++){ + // if(j==1 && i==1){ + // break outer; + // } + // console.log("i="+i); + // console.log("j="+j); + // } + // } + //创建对象 +// var person={ +// name:"name", +// age:20, +// eat:function(){ +// alert("hi"); +// this; //window + +// } +// }; +// function eat(){ //函数调用形式 +// var name="he"; +// console.log(this.name);//this=>window(根目录) +// } +// eat() +// var cat={ //对象调用形式 +// age:18, +// sing:function(){ +// console.log(this.age); //调用者 +// } +// } +// function Person(name,age){ //构造函数 +// this.name=name; +// this.age=age; +// this.sayName=function(){ +// console.log("he"); +// } +// } +// var person1 = new Person("a",18); //用new来创建对象 +// console.log(person1); +// // delete person.age; +// for(var key in person){ +// var val = person[key];//循环体内只能用此方法读, +// //.key会处理成['key'],显示没有定义这个值 +// console.log(key+":"+val); +// } +// } +// var fun = function(){//匿名函数 +// console.log("he"); +// } +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + bindmaiViewTap() { + wx.navigateTo({ + url: '../main/main' + }) + }, + bindhisViewTap(){ + wx.navigateTo({ + url: '../history/history' + }) + }, + bindrecViewTap(){ + wx.navigateTo({ + url: '../recommend/recommend' + }) + }, + bindmacViewTap(){ + wx.navigateTo({ + url: '../match/match' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/history/history.json b/src/miniprogram-2/pages/history/history.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/history/history.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/history/history.wxml b/src/miniprogram-2/pages/history/history.wxml new file mode 100644 index 0000000..6552085 --- /dev/null +++ b/src/miniprogram-2/pages/history/history.wxml @@ -0,0 +1,21 @@ + + + + + + + + 首页 + + + 匹配 + + + 历史 + + + 推荐 + + + +pages/history/history.wxml \ No newline at end of file diff --git a/src/miniprogram-2/pages/history/history.wxss b/src/miniprogram-2/pages/history/history.wxss new file mode 100644 index 0000000..e3b28f6 --- /dev/null +++ b/src/miniprogram-2/pages/history/history.wxss @@ -0,0 +1 @@ +/* pages/history/history.wxss */ \ No newline at end of file diff --git a/src/miniprogram-2/pages/images/rec_main_1.jpg b/src/miniprogram-2/pages/images/rec_main_1.jpg new file mode 100644 index 0000000..9a4f5f4 Binary files /dev/null and b/src/miniprogram-2/pages/images/rec_main_1.jpg differ diff --git a/src/miniprogram-2/pages/images/recom_1_1.jpg b/src/miniprogram-2/pages/images/recom_1_1.jpg new file mode 100644 index 0000000..0c701c5 Binary files /dev/null and b/src/miniprogram-2/pages/images/recom_1_1.jpg differ diff --git a/src/miniprogram-2/pages/images/recom_1_2.jpg b/src/miniprogram-2/pages/images/recom_1_2.jpg new file mode 100644 index 0000000..4e88632 Binary files /dev/null and b/src/miniprogram-2/pages/images/recom_1_2.jpg differ diff --git a/src/miniprogram-2/pages/images/recom_1_3.jpg b/src/miniprogram-2/pages/images/recom_1_3.jpg new file mode 100644 index 0000000..6a28ff0 Binary files /dev/null and b/src/miniprogram-2/pages/images/recom_1_3.jpg differ diff --git a/src/miniprogram-2/pages/index/index.js b/src/miniprogram-2/pages/index/index.js new file mode 100644 index 0000000..4825ed6 --- /dev/null +++ b/src/miniprogram-2/pages/index/index.js @@ -0,0 +1,155 @@ +// index.js +// 获取应用实例 +const app = getApp() + +Page({ + data: { + motto: 'Hello World', + userInfo: {}, + hasUserInfo: false, + canIUse: wx.canIUse('button.open-type.getUserInfo'), + canIUseGetUserProfile: false, + canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false + }, + // 事件处理函数 + bindViewTap() { + wx.navigateTo({ + url: '../logs/logs' + }) + }, + bindmaiViewTap() { + wx.navigateTo({ + url: '../main/main' + }) + }, + bindhisViewTap(){ + wx.navigateTo({ + url: '../history/history' + }) + }, + bindrecViewTap(){ + wx.navigateTo({ + url: '../recommend/recommend' + }) + }, + bindmacViewTap(){ + wx.navigateTo({ + url: '../match/match' + }) + }, + onLoad() { + if (wx.getUserProfile) { + this.setData({ + canIUseGetUserProfile: true + }) + } + }, + getUserProfile(e) { + // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + console.log(res) + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + }, + getUserInfo(e) { + // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 + console.log(e) + this.setData({ + userInfo: e.detail.userInfo, + hasUserInfo: true + }) + } +}) + + +// Page({ +// /** +// * 页面的初始数据 +// */ +// data: { +// avatarUrl:"", +// name: "", +// m:"0", +// mySet:[ +// { +// 'name':"我的预约", +// 'img':"../images/预约.png" +// }, +// { +// 'name':"我的收藏", +// 'img':"../images/收藏.png" +// }, +// { +// 'name':"个人设置", +// 'img':"../images/设置.png" +// }, +// ] +// }, +// /** +// * 生命周期函数--监听页面加载 +// */ +// onLoad: function (options) { +// }, +// /** +// * 用户信息获取权限 +// */ +// getUserProfile: function () { +// if(this.data.m==0){ +// wx.getUserProfile({ +// desc: '信息仅作为个人展示', +// success: (res) => { +// console.log('获取成功', res) +// wx.setStorage({ +// data: res.userInfo, +// key: 'userInfo', +// }); +// this.setData({ +// m:1 +// }) +// this.onShow(); +// }}) +// }else{ +// wx.showToast({ +// title: '您已登录啦', +// }) +// } +// }, +// /** +// * 点击我的预约等板块后进行页面跳转 +// */ +// onMySet:function(e){ +// if(e.currentTarget.dataset.type=="个人设置"){ +// wx.navigateTo({ +// url: '/pages/index/setting/setting', +// }) +// } +// else if(e.currentTarget.dataset.type=="我的预约"){ +// wx.navigateTo({ +// url: '/pages/index/want/want', +// }) +// } +// else (e.currentTarget.dataset.type=="我的收藏") +// { +// wx.navigateTo({ +// url: '/pages/index/like/like', +// }) +// } +// }, +// /** +// * 生命周期函数--监听页面显示 +// */ +// onShow: function () { +// var useInfo = wx.getStorageSync('userInfo') +// var that = this; +// that.setData({ +// avatarUrl:useInfo.avatarUrl, +// name:useInfo.nickName, +// }) +// } +// }) diff --git a/src/miniprogram-2/pages/index/index.json b/src/miniprogram-2/pages/index/index.json new file mode 100644 index 0000000..86c6472 --- /dev/null +++ b/src/miniprogram-2/pages/index/index.json @@ -0,0 +1,4 @@ +{ + "@indexjson":"与appjson相同部分会覆盖", + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/index/index.wxml b/src/miniprogram-2/pages/index/index.wxml new file mode 100644 index 0000000..3803b56 --- /dev/null +++ b/src/miniprogram-2/pages/index/index.wxml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + 请使用1.4.4及以上版本基础库 + + + + {{userInfo.nickName}} + + + + {{motto}} + + + + 首页 + + + 匹配 + + + 历史 + + + 推荐 + + + + + + + + + + + + + + diff --git a/src/miniprogram-2/pages/index/index.wxss b/src/miniprogram-2/pages/index/index.wxss new file mode 100644 index 0000000..66bbf28 --- /dev/null +++ b/src/miniprogram-2/pages/index/index.wxss @@ -0,0 +1,138 @@ +/**index.wxss**/ +.userinfo { + display: flex; + flex-direction: column; + align-items: center; + color: #aaa; +} + +.userinfo-avatar { + overflow: hidden; + width: 128rpx; + height: 128rpx; + margin: 20rpx; + border-radius: 50%; +} + +.usermotto { + margin-top: 200px; +} + + +/* pages/index/index.wxss */ + +.mz{ + + font-size:50rpx; + + line-height: 200rpx; + + margin-left: 20rpx; + + color: #FFFFFF; + +} + +.hr{ + + height:16rpx; + + background-color:rgb(202, 202, 202); + +} + +.vv_1{ + + line-height: 100rpx; + + background-color: #ffffff; + + display: flex; + + + +} + + + + + +.vv{ + + background-color: #ebebeb; + + height: 950rpx; + +} + +.xx{ + + + + display: flex; + + flex-direction:row; + + background-color:#32667e; + + line-height: 400rpx; + +} + +.tx{ + + width: 150rpx; + + height: 150rpx; + + border-radius: 40%; + + margin-left:50rpx ; + +} + +.underline{ + + text-decoration:underline; + + font-size: 30rpx; + + color: white; + + text-align: center; + + line-height: 200rpx; + +} + +.hr2{ + + height: 2rpx; + + background-color: rgba(202, 202, 202, 0.856); + +} + +.icon{ + + margin-left:470rpx; + + color: rgba(202, 202, 202) ; + + + +} + +.image1{ + + padding-top:26rpx; + + padding-right:20rpx; + + padding-left: 30rpx; + + width: 50rpx; + + height: 50rpx; + +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/logs/logs.js b/src/miniprogram-2/pages/logs/logs.js new file mode 100644 index 0000000..85f6aac --- /dev/null +++ b/src/miniprogram-2/pages/logs/logs.js @@ -0,0 +1,18 @@ +// logs.js +const util = require('../../utils/util.js') + +Page({ + data: { + logs: [] + }, + onLoad() { + this.setData({ + logs: (wx.getStorageSync('logs') || []).map(log => { + return { + date: util.formatTime(new Date(log)), + timeStamp: log + } + }) + }) + } +}) diff --git a/src/miniprogram-2/pages/logs/logs.json b/src/miniprogram-2/pages/logs/logs.json new file mode 100644 index 0000000..3ee76c1 --- /dev/null +++ b/src/miniprogram-2/pages/logs/logs.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "查看启动日志", + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/logs/logs.wxml b/src/miniprogram-2/pages/logs/logs.wxml new file mode 100644 index 0000000..0b6b645 --- /dev/null +++ b/src/miniprogram-2/pages/logs/logs.wxml @@ -0,0 +1,6 @@ + + + + {{index + 1}}. {{log.date}} + + diff --git a/src/miniprogram-2/pages/logs/logs.wxss b/src/miniprogram-2/pages/logs/logs.wxss new file mode 100644 index 0000000..94d4b88 --- /dev/null +++ b/src/miniprogram-2/pages/logs/logs.wxss @@ -0,0 +1,8 @@ +.log-list { + display: flex; + flex-direction: column; + padding: 40rpx; +} +.log-item { + margin: 10rpx; +} diff --git a/src/miniprogram-2/pages/main/main.js b/src/miniprogram-2/pages/main/main.js new file mode 100644 index 0000000..e208063 --- /dev/null +++ b/src/miniprogram-2/pages/main/main.js @@ -0,0 +1,85 @@ +// pages/main/main.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + bindmaiViewTap() { + wx.navigateTo({ + url: '../main/main' + }) + }, + bindhisViewTap(){ + wx.navigateTo({ + url: '../history/history' + }) + }, + bindrecViewTap(){ + wx.navigateTo({ + url: '../recommend/recommend' + }) + }, + bindmacViewTap(){ + wx.navigateTo({ + url: '../match/match' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/main/main.json b/src/miniprogram-2/pages/main/main.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/main/main.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/main/main.wxml b/src/miniprogram-2/pages/main/main.wxml new file mode 100644 index 0000000..fe4f35a --- /dev/null +++ b/src/miniprogram-2/pages/main/main.wxml @@ -0,0 +1,21 @@ + + + + 主界面 + + + + 首页 + + + 匹配 + + + 历史 + + + 推荐 + + + +pages/main/main.wxml \ No newline at end of file diff --git a/src/miniprogram-2/pages/main/main.wxss b/src/miniprogram-2/pages/main/main.wxss new file mode 100644 index 0000000..ecc2274 --- /dev/null +++ b/src/miniprogram-2/pages/main/main.wxss @@ -0,0 +1 @@ +/* pages/main/main.wxss */ \ No newline at end of file diff --git a/src/miniprogram-2/pages/match/match.js b/src/miniprogram-2/pages/match/match.js new file mode 100644 index 0000000..34b4542 --- /dev/null +++ b/src/miniprogram-2/pages/match/match.js @@ -0,0 +1,66 @@ +// pages/match/match.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/match/match.json b/src/miniprogram-2/pages/match/match.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/match/match.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/match/match.wxml b/src/miniprogram-2/pages/match/match.wxml new file mode 100644 index 0000000..0700633 --- /dev/null +++ b/src/miniprogram-2/pages/match/match.wxml @@ -0,0 +1,21 @@ + + + + + + + + 首页 + + + 匹配 + + + 历史 + + + 推荐 + + + +pages/match/match.wxml \ No newline at end of file diff --git a/src/miniprogram-2/pages/match/match.wxss b/src/miniprogram-2/pages/match/match.wxss new file mode 100644 index 0000000..1f12db5 --- /dev/null +++ b/src/miniprogram-2/pages/match/match.wxss @@ -0,0 +1 @@ +/* pages/match/match.wxss */ \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/rec1.js b/src/miniprogram-2/pages/recommend/rec1.js new file mode 100644 index 0000000..751818e --- /dev/null +++ b/src/miniprogram-2/pages/recommend/rec1.js @@ -0,0 +1,68 @@ +// pages/recommend/rec1.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + r11:"../images/recom_1_1.jpg", + r12:"../images/recom_1_2.jpg", + r13:"../images/recom_1_3.jpg" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/rec1.json b/src/miniprogram-2/pages/recommend/rec1.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/rec1.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/rec1.wxml b/src/miniprogram-2/pages/recommend/rec1.wxml new file mode 100644 index 0000000..d1bf9c7 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/rec1.wxml @@ -0,0 +1,18 @@ + + + + + 今天是一期早八通勤眼妆教程~ +3ce新品的这两盘好甜美夏日呀!!温柔低饱和的调调 +日常不出错的配色,新手友友也可以轻松驾驭 +樱花碎冰 +清冷低饱和嫩粉调~营造温柔粉调眼妆 +指腹蘸取里面的一颗粉棕色膏状眼影,涂抹眼窝 +眼妆就轻松搞定!早八人的福音呀 +西柚冰茶 +元气夏日果汁橘棕调,敲喜欢这个配色 +元气感拉满~轻松营造日常通勤眼妆 +日常又消肿 +快一起学起来叭! + + diff --git a/src/miniprogram-2/pages/recommend/rec1.wxss b/src/miniprogram-2/pages/recommend/rec1.wxss new file mode 100644 index 0000000..97ecb17 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/rec1.wxss @@ -0,0 +1 @@ +/* pages/recommend/rec1.wxss */ \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/recommend.js b/src/miniprogram-2/pages/recommend/recommend.js new file mode 100644 index 0000000..fc46577 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/recommend.js @@ -0,0 +1,90 @@ +// pages/recommend/recommend.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + rm1:"../images/rec_main_1.jpg" + }, + bindrec1ViewTap(){ + wx.navigateTo({ + url:'/pages/recommend/rec1' + }) + }, + bindmaiViewTap() { + wx.navigateTo({ + url: '../main/main' + }) + }, + bindhisViewTap(){ + wx.navigateTo({ + url: '../history/history' + }) + }, + bindrecViewTap(){ + wx.navigateTo({ + url: '../recommend/recommend' + }) + }, + bindmacViewTap(){ + wx.navigateTo({ + url: '../match/match' + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/recommend.json b/src/miniprogram-2/pages/recommend/recommend.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/recommend.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/recommend.wxml b/src/miniprogram-2/pages/recommend/recommend.wxml new file mode 100644 index 0000000..d372443 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/recommend.wxml @@ -0,0 +1,22 @@ + + + + + + + + + + 首页 + + + 匹配 + + + 历史 + + + 推荐 + + + \ No newline at end of file diff --git a/src/miniprogram-2/pages/recommend/recommend.wxss b/src/miniprogram-2/pages/recommend/recommend.wxss new file mode 100644 index 0000000..5ff64c0 --- /dev/null +++ b/src/miniprogram-2/pages/recommend/recommend.wxss @@ -0,0 +1 @@ +/* pages/recommend/recommend.wxss */ \ No newline at end of file diff --git a/src/miniprogram-2/pages/setting/setting.js b/src/miniprogram-2/pages/setting/setting.js new file mode 100644 index 0000000..885d159 --- /dev/null +++ b/src/miniprogram-2/pages/setting/setting.js @@ -0,0 +1,134 @@ +// pages/setting/setting.js +Page({ + /** + * 页面的初始数据 + */ + data: { + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + } +}) + + +// pages/index/setting/setting.js +const util = require('../../../utils/util.js') +Page({ + /** + * 页面的初始数据 + */ + data: { + info:["头像","名称","收货地址","当前版本","关于"], + tx:"", + name:"", + currentDate:util.formatTime(new Date(), '-', false), + phone:"" + }, + bindDateChange: function (e) { + console.log(e.detail.value) + this.setData({ + currentDate:e.detail.value + }) }, + chooseAddress() { + wx.chooseAddress({ + success (res) { + console.log(res.userName) + } + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var useInfo = wx.getStorageSync('userInfo') + var that = this; + that.setData({ + tx:useInfo.avatarUrl, + name:useInfo.nickName,}) + }, + about(){ + wx.navigateTo({ + url: '/pages/index/setting/about/about', + }) + }, + houtai(){ + wx.navigateTo({ + url: '', + }) + }, + version(){ + wx.showToast({ + title: '当前已是最新版本~', + }) + }, + logout:function() { + wx.removeStorage({ + key: 'userInfo', + success (res) { + wx.showModal({ + title: '提示', + content: '真的要退出了吗', + cancelText:'我骗你的', + confirmText:'是的没错', + confirmColor:'#000000', + cancelColor:'#576b95', + success (res) { + if (res.confirm) { + wx.reLaunch({ + url: '/pages/index/index', + }) + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + } + }) + } +}) \ No newline at end of file diff --git a/src/miniprogram-2/pages/setting/setting.json b/src/miniprogram-2/pages/setting/setting.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/miniprogram-2/pages/setting/setting.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/miniprogram-2/pages/setting/setting.wxml b/src/miniprogram-2/pages/setting/setting.wxml new file mode 100644 index 0000000..e78c658 --- /dev/null +++ b/src/miniprogram-2/pages/setting/setting.wxml @@ -0,0 +1,93 @@ + +pages/setting/setting.wxml + + + + + 头像 + + + + + + + + + +昵称 + + {{name}} + + + + + + + +手机号 + + 198****5052 + + + + + +生日 + + + + + + {{currentDate}} + + + + + + + + + + + +收货地址 + + >> + + + + + + + +当前版本 + + v1.0 + + + + + + + +关于 + + >> + + + + + + + +后台登录入口 + + >> + + + + + + + + \ No newline at end of file diff --git a/src/miniprogram-2/pages/setting/setting.wxss b/src/miniprogram-2/pages/setting/setting.wxss new file mode 100644 index 0000000..ea0bfc7 --- /dev/null +++ b/src/miniprogram-2/pages/setting/setting.wxss @@ -0,0 +1,49 @@ +/* pages/setting/setting.wxss */ + +button{ + background-color:rgb(255, 26, 26); + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display:block; + margin:60rpx auto; + font-size: 16px; +} +.hr{ + height: 1rpx; + background-color: rgb(202, 202, 202); +} +.info{ + display: flex; + flex-direction: column; + font-size: 30rpx; + margin-left: 30rpx; + margin-top: 10rpx; +} +.info_more1{ + display:flex; + justify-content: space-between; + padding-bottom: 20rpx; + padding-top: 20rpx; +} +.info_more{ + display:flex; + justify-content: space-between; + padding-bottom: 30rpx; + padding-top: 30rpx; +} +.tx{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; + margin-right: 10rpx; +} +.icon{ + padding-right: 30rpx; + color: rgb(167, 164, 164); +} +.tx1{ + padding-top: 30rpx; +} \ No newline at end of file diff --git a/src/miniprogram-2/project.config.json b/src/miniprogram-2/project.config.json new file mode 100644 index 0000000..cea5706 --- /dev/null +++ b/src/miniprogram-2/project.config.json @@ -0,0 +1,53 @@ +{ + "description": "项目配置文件,个性化配置", + "packOptions": { + "ignore": [], + "include": [] + }, + "@setting": "编译相关的配置", + "setting": { + "bundle": false, + "userConfirmedBundleSwitch": false, + "urlCheck": true, + "scopeDataCheck": false, + "coverView": true, + "es6": true, + "postcss": true, + "compileHotReLoad": false, + "lazyloadPlaceholderEnable": false, + "preloadBackgroundData": false, + "minified": true, + "autoAudits": false, + "newFeature": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "useIsolateContext": true, + "nodeModules": false, + "enhance": true, + "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": true, + "showShadowRootInWxmlPanel": true, + "packNpmManually": false, + "enableEngineNative": false, + "packNpmRelationList": [], + "minifyWXSS": true, + "showES6CompileOption": false, + "minifyWXML": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "compileType": "miniprogram", + "libVersion": "2.19.4", + "@appid": "更换自己的id号", + "appid": "wxa651e940bcc5eead", + "projectname": "miniprogram-92", + "condition": {}, + "editorSetting": { + "tabIndent": "auto", + "tabSize": 2 + } +} \ No newline at end of file diff --git a/src/miniprogram-2/project.private.config.json b/src/miniprogram-2/project.private.config.json new file mode 100644 index 0000000..c6a457d --- /dev/null +++ b/src/miniprogram-2/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "BeautyApplet", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/src/miniprogram-2/sitemap.json b/src/miniprogram-2/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/src/miniprogram-2/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/src/miniprogram-2/utils/util.js b/src/miniprogram-2/utils/util.js new file mode 100644 index 0000000..764bc2c --- /dev/null +++ b/src/miniprogram-2/utils/util.js @@ -0,0 +1,19 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : `0${n}` +} + +module.exports = { + formatTime +}