├── README.md ├── 微信客户端 ├── app.js ├── app.json ├── app.wxss ├── pages │ ├── index │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── random_configuration │ │ ├── random_configuration.js │ │ ├── random_configuration.json │ │ ├── random_configuration.wxml │ │ └── random_configuration.wxss │ ├── recommedation │ │ ├── recommedation.js │ │ ├── recommedation.json │ │ ├── recommedation.wxml │ │ └── recommedation.wxss │ ├── recommedation_configuration │ │ ├── recommedation_configuration.js │ │ ├── recommedation_configuration.json │ │ ├── recommedation_configuration.wxml │ │ └── recommedation_configuration.wxss │ ├── select │ │ ├── select.js │ │ ├── select.json │ │ ├── select.wxml │ │ └── select.wxss │ └── upload │ │ ├── upload.js │ │ ├── upload.json │ │ ├── upload.wxml │ │ └── upload.wxss ├── project.config.json └── utils │ └── util.js ├── 服务端 ├── .DS_Store ├── .idea │ ├── misc.xml │ ├── modules.xml │ ├── workspace.xml │ └── 推荐系统.iml ├── Music_Recommendation.csv ├── Music_Recommendation_Random.csv ├── Readme.md ├── __pycache__ │ ├── apriori.cpython-36.pyc │ ├── config.cpython-36.pyc │ ├── recommendation.cpython-36.pyc │ └── utils.cpython-36.pyc ├── apriori.py ├── client.py ├── config.py ├── recommendation.py ├── server.py ├── uploads │ └── Music_Recommendation.csv └── utils.py ├── 演示视屏.mp4 └── 项目结构图.png /README.md: -------------------------------------------------------------------------------- 1 | # 项目名称 2 | 基于Apriori算法的音乐推荐系统 3 | 4 | # 项目简介 5 | 该系统由服务端和微信客户端两部分组成,服务端基于Apriori算法。 6 | 训练关联规则模型(Apriori)以查找过去一段时间用户所听音乐类 7 | 型的最相关项.该算法将大多数用户的产品偏好关联起来,并可用于生 8 | 成音乐类型推荐。 9 | 10 | # 项目结构图 11 | ![Image text](https://github.com/JunhaoCheng/Recommendation-System/blob/master/项目结构图.png) 12 | 13 | # 项目部署 14 | 1、修改服务端config.py文件 15 | 2、运行服务端server.py文件 16 | 3、修改微信客户端服务器域名配置 17 | 4、运行微信客户端 18 | 19 | # 项目演示视屏 20 | https://github.com/JunhaoCheng/Recommendation-System/blob/master/演示视屏.mp4 21 | -------------------------------------------------------------------------------- /微信客户端/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function () { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | // 获取用户信息 16 | wx.getSetting({ 17 | success: res => { 18 | if (res.authSetting['scope.userInfo']) { 19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 20 | wx.getUserInfo({ 21 | success: res => { 22 | // 可以将 res 发送给后台解码出 unionId 23 | this.globalData.userInfo = res.userInfo 24 | 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | if (this.userInfoReadyCallback) { 28 | this.userInfoReadyCallback(res) 29 | } 30 | } 31 | }) 32 | } 33 | } 34 | }) 35 | }, 36 | globalData: { 37 | userInfo: null, 38 | recommend_configuration: {}, 39 | random_configuration: {}, 40 | result: {} 41 | } 42 | }) -------------------------------------------------------------------------------- /微信客户端/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "pages/index/index", 4 | "pages/recommedation_configuration/recommedation_configuration", 5 | "pages/select/select", 6 | "pages/upload/upload", 7 | "pages/random_configuration/random_configuration", 8 | "pages/recommedation/recommedation" 9 | ], 10 | "window":{ 11 | "backgroundTextStyle":"light", 12 | "navigationBarBackgroundColor": "#00BFFF", 13 | "navigationBarTitleText": "音乐类型推荐系统", 14 | "navigationBarTextStyle":"white" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /微信客户端/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | -------------------------------------------------------------------------------- /微信客户端/pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | motto: 'Hello World', 8 | userInfo: {}, 9 | hasUserInfo: false, 10 | canIUse: wx.canIUse('button.open-type.getUserInfo') 11 | }, 12 | //事件处理函数 13 | bindViewTap: function() { 14 | wx.navigateTo({ 15 | url: '../recommedation_configuration/recommedation_configuration' 16 | }) 17 | }, 18 | onLoad: function () { 19 | if (app.globalData.userInfo) { 20 | this.setData({ 21 | userInfo: app.globalData.userInfo, 22 | hasUserInfo: true 23 | }) 24 | } else if (this.data.canIUse){ 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | app.userInfoReadyCallback = res => { 28 | this.setData({ 29 | userInfo: res.userInfo, 30 | hasUserInfo: true 31 | }) 32 | } 33 | } else { 34 | // 在没有 open-type=getUserInfo 版本的兼容处理 35 | wx.getUserInfo({ 36 | success: res => { 37 | app.globalData.userInfo = res.userInfo 38 | this.setData({ 39 | userInfo: res.userInfo, 40 | hasUserInfo: true 41 | }) 42 | } 43 | }) 44 | } 45 | }, 46 | getUserInfo: function(e) { 47 | console.log(e) 48 | app.globalData.userInfo = e.detail.userInfo 49 | this.setData({ 50 | userInfo: e.detail.userInfo, 51 | hasUserInfo: true 52 | }) 53 | } 54 | }) 55 | -------------------------------------------------------------------------------- /微信客户端/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /微信客户端/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{userInfo.nickName}} 8 | 9 | 10 | 11 | {{motto}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /微信客户端/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | page { 3 | background: #00BFFF; 4 | } 5 | 6 | .userinfo { 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | } 11 | 12 | .userinfo-avatar { 13 | width: 128rpx; 14 | height: 128rpx; 15 | margin: 20rpx; 16 | border-radius: 50%; 17 | } 18 | 19 | .userinfo-nickname { 20 | color: #aaa; 21 | } 22 | 23 | .usermotto { 24 | margin-top: 200px; 25 | color: #FAFFF0 26 | } 27 | 28 | .button { 29 | width: 360rpx; 30 | height: 90rpx; 31 | margin: 40rpx; 32 | background-color: rgb(252, 126, 67); 33 | color: white; 34 | border-radius: 98rpx; 35 | background: bg_red; 36 | } -------------------------------------------------------------------------------- /微信客户端/pages/random_configuration/random_configuration.js: -------------------------------------------------------------------------------- 1 | // pages/random_configuration/random_configuration.js 2 | const app = getApp() 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | 17 | }, 18 | 19 | /** 20 | *确认按钮函数,保存数据, 21 | *跳转界面 22 | */ 23 | confirm: function (e) { 24 | //保存数据 25 | var val = e.detail.value 26 | console.log(val) 27 | app.globalData.random_configuration = val 28 | 29 | //获取随机生成文件参数配置 30 | var random_configuration = app.globalData.random_configuration 31 | //获取推荐参数配置 32 | var recommend_configuration = app.globalData.recommend_configuration 33 | //参数配置 34 | var configuration = {} 35 | for (var k in random_configuration) { 36 | configuration[k] = random_configuration[k] 37 | } 38 | for (var k in recommend_configuration) { 39 | configuration[k] = recommend_configuration[k] 40 | } 41 | console.log(configuration) 42 | 43 | wx.showLoading({ 44 | title: '处理中,请耐心等待', 45 | mask: true 46 | }) 47 | //请求接口处理并以json格式返回结果 48 | wx.request({ 49 | url: 'https://www.ponma.cn:5000/random', // 接口地址 50 | data: configuration, 51 | header: { 52 | 'content-type': 'application/json' // 默认值 53 | }, 54 | success(res) { 55 | console.log(res.data) 56 | //保存结果 57 | app.globalData.result = res.data 58 | wx.hideLoading() 59 | 60 | //界面跳转 61 | wx.navigateTo({ 62 | url: '/pages/recommedation/recommedation' 63 | }) 64 | }, 65 | fail(err) { 66 | wx.hideLoading() 67 | wx.showToast({ 68 | title: '处理失败', 69 | icon: 'none', 70 | duration: 2000 71 | }) 72 | } 73 | }) 74 | }, 75 | 76 | /** 77 | * 生命周期函数--监听页面初次渲染完成 78 | */ 79 | onReady: function () { 80 | 81 | }, 82 | 83 | /** 84 | * 生命周期函数--监听页面显示 85 | */ 86 | onShow: function () { 87 | 88 | }, 89 | 90 | /** 91 | * 生命周期函数--监听页面隐藏 92 | */ 93 | onHide: function () { 94 | 95 | }, 96 | 97 | /** 98 | * 生命周期函数--监听页面卸载 99 | */ 100 | onUnload: function () { 101 | 102 | }, 103 | 104 | /** 105 | * 页面相关事件处理函数--监听用户下拉动作 106 | */ 107 | onPullDownRefresh: function () { 108 | 109 | }, 110 | 111 | /** 112 | * 页面上拉触底事件的处理函数 113 | */ 114 | onReachBottom: function () { 115 | 116 | }, 117 | 118 | /** 119 | * 用户点击右上角分享 120 | */ 121 | onShareAppMessage: function () { 122 | 123 | } 124 | }) -------------------------------------------------------------------------------- /微信客户端/pages/random_configuration/random_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /微信客户端/pages/random_configuration/random_configuration.wxml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 生成文件参数设置 6 | 7 | 8 | 文件中记录的个数 9 | 10 | 12 | 13 | 14 | 每条记录拥有音乐类型的最大个数 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /微信客户端/pages/random_configuration/random_configuration.wxss: -------------------------------------------------------------------------------- 1 | /* pages/random_configuration/random_configuration.wxss */ 2 | page { 3 | background: #00BFFF; 4 | height: 100%; 5 | } 6 | 7 | .button { 8 | width: 250rpx; 9 | height: 90rpx; 10 | marigin:0rpx auto; 11 | background-color: rgb(252, 126, 67); 12 | color: white; 13 | border-radius: 98rpx; 14 | background: bg_red; 15 | } 16 | 17 | .section{ 18 | margin-top: 5px; 19 | margin-left: 20px; 20 | margin-right: 20px; 21 | height: 35px; 22 | border: 2px solid red; 23 | border-radius: 25px; 24 | } 25 | .input{ 26 | padding-left: 10px; 27 | height: 30px; 28 | } 29 | 30 | .title { 31 | margin-bottom: 20px; 32 | display: flex; 33 | align-items: center; 34 | justify-content: center; 35 | } 36 | 37 | .name { 38 | color: #FAFFF0; 39 | font-size: 50rpx; 40 | } 41 | 42 | .view-Name { 43 | color: #FFDEAD; 44 | font-size: 40rpx; 45 | display: flex; 46 | align-items: center; 47 | justify-content: center; 48 | } 49 | 50 | .view { 51 | margin: 40rpx; 52 | } 53 | -------------------------------------------------------------------------------- /微信客户端/pages/recommedation/recommedation.js: -------------------------------------------------------------------------------- 1 | // pages/recommedation/recommedation.js 2 | const app = getApp() 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | result: app.globalData.result 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | //把结果转为文本形式 17 | var results = app.globalData.result 18 | var res = '' 19 | for (var k in results) { 20 | res += k + '\n' + results[k] + '\n\n' 21 | } 22 | this.setData({result : res}) 23 | }, 24 | 25 | /** 26 | * 生命周期函数--监听页面初次渲染完成 27 | */ 28 | onReady: function () { 29 | 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面显示 34 | */ 35 | onShow: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面隐藏 41 | */ 42 | onHide: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面卸载 48 | */ 49 | onUnload: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 页面相关事件处理函数--监听用户下拉动作 55 | */ 56 | onPullDownRefresh: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 页面上拉触底事件的处理函数 62 | */ 63 | onReachBottom: function () { 64 | 65 | }, 66 | 67 | /** 68 | * 用户点击右上角分享 69 | */ 70 | onShareAppMessage: function () { 71 | 72 | } 73 | }) -------------------------------------------------------------------------------- /微信客户端/pages/recommedation/recommedation.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /微信客户端/pages/recommedation/recommedation.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 推荐结果 4 | 5 | {{result}} -------------------------------------------------------------------------------- /微信客户端/pages/recommedation/recommedation.wxss: -------------------------------------------------------------------------------- 1 | /* pages/recommedation/recommedation.wxss */ 2 | page { 3 | background: #00BFFF; 4 | height: 100%; 5 | } 6 | 7 | .title { 8 | margin-bottom: 20rpx; 9 | display: flex; 10 | align-items: center; 11 | justify-content: center; 12 | } 13 | 14 | .name { 15 | color: #FAFFF0; 16 | font-size: 50rpx; 17 | } 18 | 19 | .view-Name { 20 | color: #FFDEAD; 21 | font-size: 40rpx; 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } -------------------------------------------------------------------------------- /微信客户端/pages/recommedation_configuration/recommedation_configuration.js: -------------------------------------------------------------------------------- 1 | // pages/recommedation_configuration/recommedation_configuration.js 2 | const app = getApp() 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | 17 | }, 18 | 19 | /** 20 | *确认按钮函数,保存数据, 21 | *跳转界面 22 | */ 23 | confirm: function (e) { 24 | //保存数据 25 | var val = e.detail.value 26 | console.log(val) 27 | app.globalData.recommend_configuration = val 28 | 29 | //界面跳转 30 | wx.navigateTo({ 31 | url: '/pages/select/select' 32 | }) 33 | }, 34 | 35 | /** 36 | * 生命周期函数--监听页面初次渲染完成 37 | */ 38 | onReady: function () { 39 | 40 | }, 41 | 42 | /** 43 | * 生命周期函数--监听页面显示 44 | */ 45 | onShow: function () { 46 | 47 | }, 48 | 49 | /** 50 | * 生命周期函数--监听页面隐藏 51 | */ 52 | onHide: function () { 53 | 54 | }, 55 | 56 | /** 57 | * 生命周期函数--监听页面卸载 58 | */ 59 | onUnload: function () { 60 | 61 | }, 62 | 63 | /** 64 | * 页面相关事件处理函数--监听用户下拉动作 65 | */ 66 | onPullDownRefresh: function () { 67 | 68 | }, 69 | 70 | /** 71 | * 页面上拉触底事件的处理函数 72 | */ 73 | onReachBottom: function () { 74 | 75 | }, 76 | 77 | /** 78 | * 用户点击右上角分享 79 | */ 80 | onShareAppMessage: function () { 81 | 82 | } 83 | }) -------------------------------------------------------------------------------- /微信客户端/pages/recommedation_configuration/recommedation_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } 4 | 5 | -------------------------------------------------------------------------------- /微信客户端/pages/recommedation_configuration/recommedation_configuration.wxml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 推荐参数设置 6 | 7 | 8 | 最小关系支持度值(support) 9 | 10 | 12 | 13 | 14 | 最小关系置信度值(confidence) 15 | 16 | 18 | 19 | 20 | 最小关系提升度值(lift) 21 | 22 | 24 | 25 | 26 | 关系最大长度(max_length) 27 | 28 | 30 | 31 | 32 | 推荐个数 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 |
-------------------------------------------------------------------------------- /微信客户端/pages/recommedation_configuration/recommedation_configuration.wxss: -------------------------------------------------------------------------------- 1 | /* pages/recommedation_configuration/recommedation_configuration.wxss */ 2 | page { 3 | background: #00BFFF; 4 | height: 100%; 5 | } 6 | 7 | .button { 8 | width: 250rpx; 9 | height: 90rpx; 10 | marigin:0rpx auto; 11 | background-color: rgb(252, 126, 67); 12 | color: white; 13 | border-radius: 98rpx; 14 | background: bg_red; 15 | } 16 | 17 | .section{ 18 | margin-top: 5px; 19 | margin-left: 20px; 20 | margin-right: 20px; 21 | height: 35px; 22 | border: 2px solid red; 23 | border-radius: 25px; 24 | } 25 | .input{ 26 | padding-left: 10px; 27 | height: 30px; 28 | } 29 | 30 | .title { 31 | margin-bottom: 20px; 32 | display: flex; 33 | align-items: center; 34 | justify-content: center; 35 | } 36 | 37 | .name { 38 | color: #FAFFF0; 39 | font-size: 50rpx; 40 | } 41 | 42 | .container_cn { 43 | height: 100%; 44 | display: flex; 45 | flex-direction: column; 46 | align-items: center; 47 | justify-content: space-between; 48 | box-sizing: border-box; 49 | } 50 | 51 | .view-Name { 52 | color: #FFDEAD; 53 | font-size: 40rpx; 54 | display: flex; 55 | align-items: center; 56 | justify-content: center; 57 | } 58 | 59 | .view { 60 | margin: 40rpx; 61 | } 62 | -------------------------------------------------------------------------------- /微信客户端/pages/select/select.js: -------------------------------------------------------------------------------- 1 | // pages/select/select.js 2 | const app = getApp() 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | 17 | }, 18 | 19 | /** 20 | * 跳转到随机生成文件界面 21 | */ 22 | random_file: function () { 23 | //界面跳转 24 | //界面跳转 25 | wx.navigateTo({ 26 | url: '/pages/random_configuration/random_configuration' 27 | }) 28 | }, 29 | 30 | /** 31 | * 跳转到自定义文件上传界面 32 | */ 33 | custom_file: function () { 34 | //界面跳转 35 | wx.navigateTo({ 36 | url: '/pages/upload/upload' 37 | }) 38 | }, 39 | 40 | /** 41 | * 生命周期函数--监听页面初次渲染完成 42 | */ 43 | onReady: function () { 44 | 45 | }, 46 | 47 | /** 48 | * 生命周期函数--监听页面显示 49 | */ 50 | onShow: function () { 51 | 52 | }, 53 | 54 | /** 55 | * 生命周期函数--监听页面隐藏 56 | */ 57 | onHide: function () { 58 | 59 | }, 60 | 61 | /** 62 | * 生命周期函数--监听页面卸载 63 | */ 64 | onUnload: function () { 65 | 66 | }, 67 | 68 | /** 69 | * 页面相关事件处理函数--监听用户下拉动作 70 | */ 71 | onPullDownRefresh: function () { 72 | 73 | }, 74 | 75 | /** 76 | * 页面上拉触底事件的处理函数 77 | */ 78 | onReachBottom: function () { 79 | 80 | }, 81 | 82 | /** 83 | * 用户点击右上角分享 84 | */ 85 | onShareAppMessage: function () { 86 | 87 | } 88 | }) -------------------------------------------------------------------------------- /微信客户端/pages/select/select.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /微信客户端/pages/select/select.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /微信客户端/pages/select/select.wxss: -------------------------------------------------------------------------------- 1 | /* pages/select/select.wxss */ 2 | page { 3 | background: #00BFFF; 4 | height: 100%; 5 | } 6 | 7 | /* 按下变颜色 */ 8 | .hover { 9 | background: rgb(236, 179, 156); 10 | } 11 | 12 | .button { 13 | width: 400rpx; 14 | height: 100rpx; 15 | margin: 10rpx; 16 | background-color: rgb(252, 126, 67); 17 | color: white; 18 | border-radius: 98rpx; 19 | background: bg_red; 20 | } 21 | 22 | .container_cn { 23 | height: 100%; 24 | display: flex; 25 | flex-direction: column; 26 | align-items: center; 27 | justify-content: space-between; 28 | padding: 450rpx 0; 29 | box-sizing: border-box; 30 | } -------------------------------------------------------------------------------- /微信客户端/pages/upload/upload.js: -------------------------------------------------------------------------------- 1 | // pages/upload/upload.js 2 | const app = getApp() 3 | Page({ 4 | 5 | /** 6 | * 页面的初始数据 7 | */ 8 | data: { 9 | 10 | }, 11 | 12 | /** 13 | * 生命周期函数--监听页面加载 14 | */ 15 | onLoad: function (options) { 16 | 17 | }, 18 | 19 | /** 20 | * 上传文件按钮函数, 21 | * 上传文件并返回结果, 22 | * 跳转到recommedation界面展示结果 23 | */ 24 | upload_file: function () { 25 | //获取推荐参数配置 26 | var recommend_configuration = app.globalData.recommend_configuration 27 | console.log(recommend_configuration) 28 | 29 | //目前微信还未开放上传文本等文件的能力 30 | wx.showToast({ 31 | title: '正在开发,请耐心等待', 32 | icon: 'none', 33 | duration: 2000 34 | }) 35 | }, 36 | 37 | /** 38 | * 生命周期函数--监听页面初次渲染完成 39 | */ 40 | onReady: function () { 41 | 42 | }, 43 | 44 | /** 45 | * 生命周期函数--监听页面显示 46 | */ 47 | onShow: function () { 48 | 49 | }, 50 | 51 | /** 52 | * 生命周期函数--监听页面隐藏 53 | */ 54 | onHide: function () { 55 | 56 | }, 57 | 58 | /** 59 | * 生命周期函数--监听页面卸载 60 | */ 61 | onUnload: function () { 62 | 63 | }, 64 | 65 | /** 66 | * 页面相关事件处理函数--监听用户下拉动作 67 | */ 68 | onPullDownRefresh: function () { 69 | 70 | }, 71 | 72 | /** 73 | * 页面上拉触底事件的处理函数 74 | */ 75 | onReachBottom: function () { 76 | 77 | }, 78 | 79 | /** 80 | * 用户点击右上角分享 81 | */ 82 | onShareAppMessage: function () { 83 | 84 | } 85 | }) -------------------------------------------------------------------------------- /微信客户端/pages/upload/upload.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /微信客户端/pages/upload/upload.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /微信客户端/pages/upload/upload.wxss: -------------------------------------------------------------------------------- 1 | /* pages/upload/upload.wxss */ 2 | page { 3 | background: #00BFFF; 4 | height: 100%; 5 | } 6 | 7 | /* 按下变颜色 */ 8 | .hover { 9 | background: rgb(236, 179, 156); 10 | } 11 | 12 | .button { 13 | width: 400rpx; 14 | height: 100rpx; 15 | margin: 10rpx; 16 | background-color: rgb(252, 126, 67); 17 | color: white; 18 | border-radius: 98rpx; 19 | background: bg_red; 20 | } -------------------------------------------------------------------------------- /微信客户端/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true, 12 | "autoAudits": false 13 | }, 14 | "compileType": "miniprogram", 15 | "libVersion": "2.6.6", 16 | "appid": "wxfa929dd31067ae5c", 17 | "projectname": "RecommendationSystem", 18 | "debugOptions": { 19 | "hidedInDevtools": [] 20 | }, 21 | "isGameTourist": false, 22 | "condition": { 23 | "search": { 24 | "current": -1, 25 | "list": [] 26 | }, 27 | "conversation": { 28 | "current": -1, 29 | "list": [] 30 | }, 31 | "game": { 32 | "currentL": -1, 33 | "list": [] 34 | }, 35 | "miniprogram": { 36 | "current": -1, 37 | "list": [] 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /微信客户端/utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | -------------------------------------------------------------------------------- /服务端/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daimuuc/Recommendation-System/0cc9905f25c3a31a5f2768273dd59a3acfdfac1e/服务端/.DS_Store -------------------------------------------------------------------------------- /服务端/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /服务端/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /服务端/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 | 71 | 72 | load_transactions 73 | dump_as_json 74 | dump_as_two_item_tsv 75 | TransactionManager 76 | 77 | 78 | 79 | 94 | 95 | 96 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 |