├── app.js ├── app.json ├── app.wxss ├── image ├── 11.png ├── 12.png ├── 31.png ├── 32.png ├── 41.png ├── 42.png ├── 549c9d9ca5d8a.png ├── Noline.png ├── email.png ├── loading.gif ├── logo.png ├── map.png ├── pl.png ├── tel.png ├── time.png ├── upic.png └── weixin.png ├── pages ├── ._.DS_Store ├── about │ ├── about.js │ ├── about.json │ ├── about.wxml │ └── about.wxss ├── add │ ├── add.js │ ├── add.json │ ├── add.wxml │ └── add.wxss ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── listData.wxml ├── lianx │ ├── lianx.js │ ├── lianx.json │ ├── lianx.wxml │ └── lianx.wxss ├── mobile │ ├── mobile.js │ ├── mobile.json │ ├── mobile.wxml │ └── mobile.wxss ├── ulist │ ├── list-a.wxml │ ├── ulist.js │ ├── ulist.json │ ├── ulist.wxml │ └── ulist.wxss ├── user │ ├── user.js │ ├── user.json │ ├── user.wxml │ └── user.wxss └── view │ ├── view.js │ ├── view.json │ ├── view.wxml │ └── view.wxss ├── project.config.json ├── readme.md ├── sitemap.json ├── template └── loading.wxml └── utils ├── bmap-wx.js ├── network.js └── util.js /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | globalData:{ 4 | apiHost:'https://mhxj.jqyish.top/shiwu/', 5 | imgHost:'https://mhxj.jqyish.top/', 6 | userInfo: null 7 | }, 8 | 9 | //监听小程序初始化,当小程序初始化完成时会触发发,且全局只触发一次 10 | onLaunch: function() { 11 | //console.log('app----------------执行'); 12 | //调用API从本地缓存中获取数据 13 | //var logs = wx.getStorageSync('logs') || [] 14 | //logs.unshift(Date.now()) 15 | //wx.setStorageSync('logs', logs) 16 | }, 17 | //用户自定义的全局数据,可以通过var app = getApp()获取app实例,再通过app.globalData.userInfo获取数据 18 | getUserInfo: function(cb) { 19 | var that = this 20 | if (this.globalData.userInfo) { 21 | typeof cb == "function" && cb(this.globalData.userInfo) 22 | } else { 23 | //调用登录接口 24 | wx.getUserInfo({ 25 | withCredentials: false, 26 | success: function(res) { 27 | that.globalData.userInfo = res.userInfo 28 | typeof cb == "function" && cb(that.globalData.userInfo) 29 | } 30 | }) 31 | } 32 | } 33 | }) 34 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/add/add", 5 | "pages/mobile/mobile", 6 | "pages/view/view", 7 | "pages/user/user", 8 | "pages/ulist/ulist", 9 | "pages/about/about", 10 | "pages/lianx/lianx" 11 | ], 12 | "window": { 13 | "navigationBarTextStyle": "white", 14 | "navigationBarTitleText": "附近失物认领", 15 | "navigationBarBackgroundColor": "#00AC2C", 16 | "backgroundColor": "#EEEEEE", 17 | "enablePullDownRefresh": true, 18 | "backgroundTextStyle": "dark" 19 | }, 20 | "tabBar": { 21 | "color": "#b7b7b7", 22 | "selectedColor": "#00AC2C", 23 | "borderStyle": "white", 24 | "backgroundColor": "#f5f5f5", 25 | "list": [ 26 | { 27 | "pagePath": "pages/index/index", 28 | "iconPath": "image/12.png", 29 | "selectedIconPath": "image/11.png", 30 | "text": "首页" 31 | }, 32 | { 33 | "pagePath": "pages/add/add", 34 | "iconPath": "image/32.png", 35 | "selectedIconPath": "image/31.png", 36 | "text": "发布" 37 | }, 38 | { 39 | "pagePath": "pages/user/user", 40 | "iconPath": "image/42.png", 41 | "selectedIconPath": "image/41.png", 42 | "text": "个人" 43 | } 44 | ] 45 | }, 46 | "networkTimeout": { 47 | "request": 10000 48 | }, 49 | "sitemapLocation": "sitemap.json", 50 | "permission": { 51 | "scope.userLocation": { 52 | "desc": "你的位置信息将用于小程序位置接口的效果展示" 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /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: 0 0; 9 | box-sizing: border-box; 10 | font-size: 32rpx; 11 | } 12 | .footer{ 13 | width: 100%; font-size: 12px; 14 | text-align: center; 15 | color: #C6C6C6; 16 | padding-top: 30rpx 17 | } 18 | .navigator-hover{ 19 | background: none 20 | } 21 | -------------------------------------------------------------------------------- /image/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/11.png -------------------------------------------------------------------------------- /image/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/12.png -------------------------------------------------------------------------------- /image/31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/31.png -------------------------------------------------------------------------------- /image/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/32.png -------------------------------------------------------------------------------- /image/41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/41.png -------------------------------------------------------------------------------- /image/42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/42.png -------------------------------------------------------------------------------- /image/549c9d9ca5d8a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/549c9d9ca5d8a.png -------------------------------------------------------------------------------- /image/Noline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/Noline.png -------------------------------------------------------------------------------- /image/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/email.png -------------------------------------------------------------------------------- /image/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/loading.gif -------------------------------------------------------------------------------- /image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/logo.png -------------------------------------------------------------------------------- /image/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/map.png -------------------------------------------------------------------------------- /image/pl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/pl.png -------------------------------------------------------------------------------- /image/tel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/tel.png -------------------------------------------------------------------------------- /image/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/time.png -------------------------------------------------------------------------------- /image/upic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/upic.png -------------------------------------------------------------------------------- /image/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/image/weixin.png -------------------------------------------------------------------------------- /pages/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melodyne/laf-wx/2423bd953fad469950f1255135d812fb42afd6fb/pages/._.DS_Store -------------------------------------------------------------------------------- /pages/about/about.js: -------------------------------------------------------------------------------- 1 | 2 | Page({ 3 | 4 | data: { 5 | loadingHide: true, 6 | loadingText: "加载中" 7 | }, 8 | 9 | onLoad: function (options) { 10 | var that = this; 11 | that.setData({ loadingHide: false }); 12 | setTimeout(function () { 13 | that.setData({ loadingHide: true }); 14 | }, 1000) 15 | } 16 | }) -------------------------------------------------------------------------------- /pages/about/about.json: -------------------------------------------------------------------------------- 1 | { 2 | "enablePullDownRefresh": false 3 | } -------------------------------------------------------------------------------- /pages/about/about.wxml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 山西互联创想科技有限公司是一家致力于互联网产品设计、开发、销售为一体的公司。 8 | 9 | 10 | 公司一贯注重高新技术的不断探索与提升,凭借优秀的研发团队,丰富的行业经验积累,自行研发出多款实用性很强的互联网产品。对诸多企业的信息化建设,从运营、管理、到盈利起到了不容忽视的作用。 11 | 12 | 13 | 截止目前,据不完全统计,我们的产品在互联网上已经突破了数万次的下载与安装量。不论是从产品自身的建设、或者是从产品的售前和售后服务等,我们都对其进行 严格把关,从而获得了良好的用户口碑与相当优秀的客户好评率,同时也积累了相当一部分的忠实客户。这也是我们飞速发展的一个重要原因,同时也是我们的宗旨和荣誉。 14 | 15 | 16 | -------------------------------------------------------------------------------- /pages/about/about.wxss: -------------------------------------------------------------------------------- 1 | /* pages/view/view.wxss */ 2 | .viewNr{ 3 | width: 84%; 4 | display: block; 5 | margin: 0 8%; 6 | padding: 24rpx 0; 7 | color: #333 8 | } 9 | .viewNr text{ 10 | width: 100%; 11 | display: block; 12 | text-indent: 25px; 13 | } -------------------------------------------------------------------------------- /pages/add/add.js: -------------------------------------------------------------------------------- 1 | var bmap = require('../../utils/bmap-wx.js'); 2 | const API_URL = getApp().globalData.apiHost; 3 | var wxMarkerData = []; 4 | Page({ 5 | data: { 6 | ak:"TpuxEYW71E4KUKiukAvfBHackibmfa6E", 7 | markers: [], 8 | longitude:'', 9 | latitude:'', 10 | address:'获取中...', 11 | index: 0, 12 | date: '2017-01-01', 13 | isChecked: true, 14 | isChecksd: false, 15 | labels:"丢失日期", 16 | openid: 0, 17 | imglist: [], 18 | item: '../../image/upic.png', 19 | loading: false, 20 | disabled: false, 21 | loadingHide: true, 22 | loadingText: "位置获取中", 23 | content:'' 24 | }, 25 | 26 | bindDateChange: function (e) { 27 | this.setData({ 28 | date: e.detail.value 29 | }) 30 | }, 31 | 32 | diushi:function(){ 33 | this.setData({ 34 | isChecksd: false, 35 | isChecked: true, 36 | labels:"丢失日期" 37 | }) 38 | }, 39 | 40 | jiandao: function () { 41 | this.setData({ 42 | isChecked: false, 43 | isChecksd: true, 44 | labels: "捡到日期" 45 | }) 46 | }, 47 | 48 | formSubmit: function (e) { 49 | var that = this; 50 | var imglist = that.data.imglist; 51 | var formData = e.detail.value; 52 | var content = e.detail.value.content; 53 | var isChecked = that.data.isChecked; 54 | var isChecksd = that.data.isChecksd; 55 | if (isChecked == true){ 56 | var rid = 0; 57 | }else if (isChecksd == true) { 58 | var rid = 1; 59 | } 60 | var openid = that.data.openid; 61 | if (content.length === 0){ 62 | wx.showToast({ 63 | title: '描述没填写', 64 | icon: 'loading', 65 | duration: 2000 66 | }) 67 | }else{ 68 | wx.showToast({ 69 | title: '请稍后', 70 | icon: 'loading', 71 | duration: 4000 72 | }) 73 | wx.request({ 74 | url: API_URL + 'addData/rid/' + rid + '/openid/' + openid, 75 | data: formData, 76 | header: { 77 | 'Content-Type': 'application/json' 78 | }, 79 | method: 'GET', 80 | success: function (res) { 81 | var aid = res.data; 82 | if (imglist != '') { 83 | for (var i = 0; i < imglist.length; i++) { 84 | wx.uploadFile({ 85 | url: API_URL + 'upload/pid/' + aid, 86 | filePath: imglist[0], 87 | name: 'files', 88 | formData: { 89 | 'pid': aid 90 | }, 91 | method: 'GET', 92 | header: { 93 | 'Content-Type': 'application/json' 94 | }, 95 | success: function (res) { 96 | if (i >= imglist.length) { 97 | wx.showToast({ 98 | title: '发布成功', 99 | icon: 'success', 100 | duration: 3000 101 | }) 102 | that.setData({ 103 | imglist: [], 104 | loading: true, 105 | disabled: true 106 | }) 107 | setTimeout(function () { 108 | wx.switchTab({ 109 | url: '../index/index', 110 | }) 111 | }, 2000) 112 | } 113 | } 114 | }) 115 | } 116 | 117 | }else { 118 | wx.showToast({ 119 | title: '发布成功', 120 | icon: 'success', 121 | duration: 3000 122 | }) 123 | that.setData({ 124 | loading: true, 125 | disabled: true 126 | }) 127 | setTimeout(function () { 128 | wx.switchTab({ 129 | url: '../index/index', 130 | }) 131 | }, 2000) 132 | } 133 | } 134 | }) 135 | } 136 | }, 137 | 138 | upsUid: function(e){ 139 | var openid = e.data; 140 | wx.request({ 141 | url: API_URL + 'seachUser/openid/' + openid, 142 | header: { 143 | 'content-type': 'application/json' 144 | }, 145 | success: function (res) { 146 | if(res.data != 0){ 147 | wx.navigateTo({ 148 | url: '../mobile/mobile', 149 | }) 150 | } 151 | } 152 | }) 153 | }, 154 | 155 | onLoad:function(){ 156 | this.getBaiduMap(); 157 | }, 158 | 159 | onShow: function(){ 160 | var that = this; 161 | that.setData({ 162 | disabled: false, 163 | loading: false, 164 | content:'' 165 | }) 166 | wx.login({ 167 | success: function (loginCode) { 168 | wx.request({ 169 | url: API_URL + 'GetOpenid/code/' + loginCode.code, 170 | header: { 171 | 'content-type': 'application/json' 172 | }, 173 | success: function (res) { 174 | that.upsUid(res); 175 | that.setData({ 176 | openid: res.data 177 | }) 178 | } 179 | }) 180 | } 181 | }) 182 | 183 | }, 184 | 185 | checkimg: function () { 186 | self = this 187 | wx.chooseImage({ 188 | count: 1, 189 | sizeType: ['original', 'compressed'], 190 | sourceType: ['album', 'camera'], 191 | success: function (res) { 192 | var tempFilePaths = res.tempFilePaths 193 | self.setData({ 194 | imglist: tempFilePaths 195 | }) 196 | } 197 | }) 198 | }, 199 | 200 | clearGps: function(){ 201 | this.getBaiduMap(); 202 | }, 203 | getBaiduMap: function (){ 204 | var that = this; 205 | that.setData({ loadingHide: false }); 206 | var BMap = new bmap.BMapWX({ 207 | ak: that.data.ak 208 | }); 209 | var fail = function(data) { 210 | var errMsg = data.errMsg; 211 | if(errMsg == 'getLocation:fail auth deny'){ 212 | that.setData({ 213 | latitude: 0, 214 | longitude: 0, 215 | address:'火星网友一枚' 216 | }) 217 | }else{ 218 | that.setData({ 219 | latitude: 0, 220 | longitude: 0, 221 | address:'火星网友一枚' 222 | }) 223 | } 224 | setTimeout(function () { 225 | that.setData({ loadingHide: true }); 226 | }, 1000) 227 | }; 228 | var success = function(data) { 229 | wxMarkerData = data.wxMarkerData; 230 | that.setData({ 231 | markers: wxMarkerData, 232 | latitude: wxMarkerData[0].latitude, 233 | longitude: wxMarkerData[0].longitude, 234 | address: wxMarkerData[0].address, 235 | }); 236 | setTimeout(function () { 237 | that.setData({ loadingHide: true }); 238 | }, 1000) 239 | }; 240 | BMap.regeocoding({ 241 | fail: fail, 242 | success: success 243 | }); 244 | } 245 | 246 | }) -------------------------------------------------------------------------------- /pages/add/add.json: -------------------------------------------------------------------------------- 1 | { 2 | "enablePullDownRefresh": false 3 | } -------------------------------------------------------------------------------- /pages/add/add.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 【注】当前所发信息将覆盖周边50公里范围 11 | 【意】全太原市附近小程序基本都可以看到 12 | 【啦】违法广告信息将会被管理员永久禁言 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {{address}} 28 | 29 | 30 | 31 | 32 |