From 338d8446b7e21a8a76d36d12b1599c9faefb4194 Mon Sep 17 00:00:00 2001 From: "yangyouqi@torinosrc.com" Date: Wed, 8 Jan 2020 10:06:36 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consume/consume.wxml | 4 ++-- pages/consume/consume.wxss | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 3e89a06..9564d36 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -41,11 +41,11 @@ - + - +
diff --git a/pages/consume/consume.wxss b/pages/consume/consume.wxss index 49d075f..8698300 100644 --- a/pages/consume/consume.wxss +++ b/pages/consume/consume.wxss @@ -21,7 +21,7 @@ page { display: flex; height: 2.5rem; align-items: center; - border-right: 1rpx solid #aae6f9 + /* border-right: 1rpx solid #aae6f9 */ /* border: 1rpx solid rgba(49, 48, 48, 0.322) */ } .th_show { @@ -115,13 +115,6 @@ page { .section_btn_right{ flex:2; } - - - - - - - .container{ position: absolute; bottom: 0; @@ -154,7 +147,8 @@ page { flex:1; vertical-align:middle; text-align:center; - border:1px solid #fff; + border:0rpx; + /* border:1px solid #fff; */ } .remove{ width:100%; @@ -162,8 +156,9 @@ page { vertical-align:middle; background-color: #FFFFFF; text-align: center; - background-size: 74% 80%; + background-size: 30% 50%; background-image:url(https://be.yangyoki.top:12000/images/consume/icon/delete.png); background-repeat: no-repeat; background-position: center; + } \ No newline at end of file -- Gitee From 5adc32be126953cb05404c81fdb0da07fc5903e1 Mon Sep 17 00:00:00 2001 From: "yangyouqi@torinosrc.com" Date: Wed, 8 Jan 2020 10:41:11 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image/icon/close.png | Bin 0 -> 6939 bytes pages/consume/consume.js | 16 +++++++++++++++- pages/consume/consume.wxml | 16 ++++++++++++++-- pages/consume/consume.wxss | 28 ++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 image/icon/close.png diff --git a/image/icon/close.png b/image/icon/close.png new file mode 100644 index 0000000000000000000000000000000000000000..141794e5edb0550cf3d1f85407c3f2351974a15a GIT binary patch literal 6939 zcma)B&@h3&YN6^f;E_c0mE+UOt(9vz=M^)8xH%Wg z=>c8Re>qA|Pp{jq15ZoWuS{^Z6ggoO3n&n411TO3<`oJ7kk^aW+5q6;z~%jMFfm{S zSdpMB3K9d7z}8rOL2WpI?4x|Vz%dsL@TD}{k&+zkBBr)!=YWAjfGD5=7} z_O67I1d);EjM2w-u%{;%AfqHhG&+dbgIG&b$&;_pZXrkn{}JY;r4ch%UX2}euA-O0jUE*_6(`?h1MP3-qikSOysG#lrV zcN^*&1FU6Hv8yO`jaf3rbVC_N`CkBtL%#n;$#cI{qj6-~t7IF-!Ct4}FiA>JYz!C+ zYgvodr&P;UM2{Cx!mj976!KSKbKvL#?%79-{i!h9<0L+Ohc0@`^@j^xfKbBH_Nl4Y z*7fSvuBD&B^@=kG+fo|m7bz0Q zrZ?!UJds8QSR~nKdZ@xUfPYB>LKeFW7Tsd;V{gV|WKkZx{(A!bS2N(Pic0p!kw3aS zV}b~DB34?hUOQimhhkp1#O&pf{A6z67w{tt>oofO$tccW55KyQL7YkkE+L+oRbj5I zMh}A?g_RJluyvJqZQZKWTyA0!d7>t*F_kJRy#+Je*z-jAaj#f4c7J6iTTG@HP54cR z#z?%!gng8VXH+8d2|w#3abom0fcWWYZnUmN{W((%ldtG)0|3 z5g+0+D={dBZ7xvOkEABySA)mD>By0{JSLai%qyTt`DO+32f|Xozs3P?1viaHJC^+! zcZAw-x{&hL9pKZ7Qf!!qGy|XVcGxEvZb^UdB2RJ8SAD+X=|9oR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s$dbh0%AJTd!bZ|*A**g!tjekI-rBtxVwmS=2^a3a=Xvo*dS%&`) Di;ekr literal 0 HcmV?d00001 diff --git a/pages/consume/consume.js b/pages/consume/consume.js index 7652eb4..1cdc3b8 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -42,7 +42,9 @@ Page({ [{ "value": "1" }, { "value": "2" }, { "value": "3" }], [{ "value": "C" }, { "value": "0" }, { "value": "." }]], current: '0', - loading: false + loading: false, + isShowImage: false, + imagePath: '', }, /** @@ -99,6 +101,13 @@ Page({ * 上传图片 */ uploadFile() { + if(this.data.imagePathList.length > 0) { + this.setData({ + imagePath: this.data.imagePathList[0], + isShowImage:true + }) + return; + } let that = this wx.chooseImage({ count: 2, @@ -398,4 +407,9 @@ Page({ }) }) }, + hideModel() { + this.setData({ + isShowImage:false + }) + } }) \ No newline at end of file diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 9564d36..58af2fd 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -27,7 +27,7 @@
- + @@ -38,6 +38,7 @@ + @@ -51,4 +52,15 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/pages/consume/consume.wxss b/pages/consume/consume.wxss index 8698300..e545000 100644 --- a/pages/consume/consume.wxss +++ b/pages/consume/consume.wxss @@ -161,4 +161,32 @@ page { background-repeat: no-repeat; background-position: center; +} + + +.model { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 10; + color: #333; +} + +.ruleModel { + width: 600rpx; + background-color: #fff; + margin: 120rpx 75rpx; + border-radius: 20rpx; + padding: 20rpx 15rpx; +} + +.close { + width: 80rpx; + height: 80rpx; + position: absolute; + top: 80rpx; + right: 20rpx; } \ No newline at end of file -- Gitee From a2b0db242ca8640265a43b9bae5918058eb3d03a Mon Sep 17 00:00:00 2001 From: "2689725568@qq.com" Date: Wed, 8 Jan 2020 23:35:43 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image/icon/uploadfile.png | Bin 0 -> 2357 bytes pages/consume/consume.js | 108 +++++++++++++----- pages/consume/consume.wxml | 106 +++++++++-------- pages/consume/consume.wxss | 2 +- .../bookkeepingdetail/bookkeepingdetail.js | 42 ++++--- .../bookkeepingdetail/bookkeepingdetail.json | 4 +- .../bookkeepingdetail/bookkeepingdetail.wxml | 20 ++-- pages/index/index.wxml | 2 +- 8 files changed, 187 insertions(+), 97 deletions(-) create mode 100644 image/icon/uploadfile.png diff --git a/image/icon/uploadfile.png b/image/icon/uploadfile.png new file mode 100644 index 0000000000000000000000000000000000000000..d43b09247fa42281f850685588bb974d7d9ddcdf GIT binary patch literal 2357 zcmV-53Ci|~P)oi{ z&rJ0{^GCn;s^0h0HCc%Yjb_BxA7X!ervIHMP z-~B}N`Yd^O1X8cpZw!K9XPe-E0f3u~G4^*{j|)3!14NW~U+yMaS|HDh$R?%Kv*Su) zDQ{+e9{}99Qip*8LBtXLqN-(w7Ga_=K2T~BK9!Nnz zELFn;@j#Y$d;L9R`4!<_Hd<*d{#J3RNLJHOjJP;40y#nnHf-2%D(;IR9EN|c zp$EduuLgjlNn%$jl`|$LCZ0>OTkG?q03-$gauD)CB6_cb-I|&VHIO)tFGa+MT@^&c z%c3ZH$ko1AyGEn2ISj+ZR@*NAPy=D+F9N{LDTKR)h;B$>pV~Bzf%glQLpwm>(n~CU4uCc7$ zNC2^kG#ZTyj4>Z+J|x<|GAmRA0G=SC$I^)6YU|KC8$=Yj#v3UhX_C&vmYHpfOZ*F5 zSXel3dV2bZYnda{LR=Hh!*2in{pXg;Weor?bclB=5nb+rOz)9fWeZys1{J{n@1`55z^KrcJ$Gzdi_pZ=`TJWojQ7qbRcD zZi$Bnk|@#t47Ap75s}{jK*iCe)ohN4&T{edKpa$>o10sI{P^*`B2sfOZ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0mjf0HAKG literal 0 HcmV?d00001 diff --git a/pages/consume/consume.js b/pages/consume/consume.js index 1cdc3b8..034b9a9 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -43,8 +43,8 @@ Page({ [{ "value": "C" }, { "value": "0" }, { "value": "." }]], current: '0', loading: false, - isShowImage: false, - imagePath: '', + isShowImage: false, // 显示图片弹框 + isUploadFile: false, // 判断页面是跳转还是上传图片 }, /** @@ -100,28 +100,29 @@ Page({ /** * 上传图片 */ - uploadFile() { - if(this.data.imagePathList.length > 0) { + uploadFile(event) { + if(this.data.imagePathList.length > 0 && event.currentTarget.dataset.upload == undefined) { this.setData({ - imagePath: this.data.imagePathList[0], isShowImage:true }) return; } - let that = this + let that = this wx.chooseImage({ count: 2, sizeType: ['original','compressed'], success: function (res) { const tempFiles = res.tempFiles; let requestUrl = API.api.uploadFile + '/bookkeeping/bookkeeping' - var imagePathList = [] + var imagePathListObj = that.data.imagePathList for (var i = 0; i < tempFiles.length; i++) { - console.log(res) if (tempFiles[i].size > 1048576) { TOAST.showToastSuccess('图片大于1M') continue; } + that.setData({ + loading:true + }) wx.uploadFile({ url: requestUrl, filePath: tempFiles[i].path, @@ -132,17 +133,72 @@ Page({ success: function (res) { let resData = JSON.parse(res.data) if (resData.code == 200) { - imagePathList.push(resData.data) - if (that.data.imagePathList.length < 2) { - that.data.imagePathList.push(resData.data) - } else{ - that.data.imagePathList[0] = resData.data + switch(imagePathListObj.length) { + case 0: + imagePathListObj.push(resData.data) + break; + default: + imagePathListObj[1] = imagePathListObj[0] + imagePathListObj[0] = resData.data + break; } + that.setData({ + imagePathList: imagePathListObj + }) + TOAST.showToastSuccess('上传成功') } + },complete(){ + that.setData({ + loading:false + }) } }) } - + } + }) + }, + /** + * 上传指定图片 + * @param {*} event + */ + uploadOneFile(event) { + let that = this + wx.chooseImage({ + count: 1, + sizeType: ['original','compressed'], + success: function (res) { + const tempFiles = res.tempFiles[0]; + let requestUrl = API.api.uploadFile + '/bookkeeping/bookkeeping' + var imagePathListObj = that.data.imagePathList + console.log(tempFiles) + if (tempFiles.size > 1048576) { + TOAST.showToastSuccess('图片大于1M') + } + that.setData({ + loading:true + }) + wx.uploadFile({ + url: requestUrl, + filePath: tempFiles.path, + name: 'file', + header: { + "Authorization": wx.getStorageSync('token') + }, + success: function (res) { + let resData = JSON.parse(res.data) + if (resData.code == 200) { + imagePathListObj[event.currentTarget.dataset.index] = resData.data + that.setData({ + imagePathList: imagePathListObj + }) + TOAST.showToastSuccess('上传成功') + } + },complete(){ + that.setData({ + loading:false + }) + } + }) } }) }, @@ -210,31 +266,18 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - console.log(`这里是onshow`) - // 格式化数据信息 - this.setData({ - toatlMoney: 0, - money: 0, - addorDel: '+', - isShow: false, - imagePathList: [] - }) - // 获取消费类型数据,默认值为0 - this.getConsumeType(0); }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { - }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { - }, /** @@ -411,5 +454,16 @@ Page({ this.setData({ isShowImage:false }) + }, + onTabItemTap(item) { + this.setData({ + toatlMoney: 0, + money: 0, + addorDel: '+', + isShow: false, + imagePathList: [] + }) + // 获取消费类型数据,默认值为0 + this.getConsumeType(0); } }) \ No newline at end of file diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 58af2fd..197b8ca 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -1,66 +1,82 @@ - 加载中 + 加载中 - - + + - - - - {{consumeType.name}} - - {{money}} 元 - + + + + {{consumeType.name}} + + {{money}} 元 + - - - - {{item.name}} - - + + + + {{item.name}} + + - - - - - - - - - - - - - - - - - - -
- -
-
-
+ + + + + + + + + + + + + + + + + + +
+ +
+
+
- - + + + + + + + + + + + + + + + + 上传图片 + + + \ No newline at end of file diff --git a/pages/consume/consume.wxss b/pages/consume/consume.wxss index e545000..81dad7c 100644 --- a/pages/consume/consume.wxss +++ b/pages/consume/consume.wxss @@ -171,7 +171,7 @@ page { bottom: 0; left: 0; background-color: rgba(0, 0, 0, 0.5); - z-index: 10; + z-index: 0; color: #333; } diff --git a/pages/index/bookkeepingdetail/bookkeepingdetail.js b/pages/index/bookkeepingdetail/bookkeepingdetail.js index 1d7739b..496da46 100644 --- a/pages/index/bookkeepingdetail/bookkeepingdetail.js +++ b/pages/index/bookkeepingdetail/bookkeepingdetail.js @@ -17,6 +17,7 @@ Page({ markers: [], imageHost: API.api.imageHost, tempFilePaths: '', + loading:false }, /** @@ -96,8 +97,14 @@ Page({ let requestData = this.data.bookkeepingObj requestData.money = Number(requestData.moneyView) * 100; requestData.imageUrl = JSON.stringify(requestData.imageUrl) + this.setData({ + loading:true + }) AJAX.putRequest(requestUrl,requestData).then(response => { - that.updateShowData() + // that.updateShowData() + that.setData({ + loading:false + }) wx.switchTab({ url: '/pages/index/index' }) @@ -109,9 +116,16 @@ Page({ */ deleteData: function() { console.log(`准备删除一条数据`) + let that = this let requestUrl = API.api.bookkeepings + '/' + this.data.bookkeepingObj.id + this.setData({ + loading:true + }) AJAX.delRequest(requestUrl).then(response => { console.log(`删除成功,返回主页面`) + that.setData({ + loading:false + }) wx.switchTab({ url: '/pages/index/index' }) @@ -124,7 +138,7 @@ Page({ let that = this let imagePath = ""; wx.chooseImage({ - count: 2, + count: 1, sizeType: ['original', 'compressed'], success: function(res) { console.log(`获取到list`, res.tempFiles) @@ -138,6 +152,9 @@ Page({ TOAST.showToastSuccess('图片大于1M') continue; } + that.setData({ + loading:true + }) wx.uploadFile({ url: requestUrl, filePath: tempFiles[i].path, @@ -158,20 +175,15 @@ Page({ } else{ bookkeepingObj.imageUrl.push(resData.data) } - - // switch (e.currentTarget.dataset.index) { - // case 1: case '1': - // bookkeepingObj.bigImage1 = resData.data - // break; - // case 2: case '2': - // bookkeepingObj.bigImage2 = resData.data - // break; - // } that.setData({ bookkeepingObj: bookkeepingObj }) } console.log(`bookkeepingObj:`, that.data.bookkeepingObj) + },complete() { + that.setData({ + loading:false + }) } }) } @@ -222,13 +234,17 @@ Page({ getBookkeepingById: function(bookkeepingId) { let that = this; let requestUrl = API.api.bookkeepings + '/' + bookkeepingId; + this.setData({ + loading:true + }) AJAX.getRequest(requestUrl).then(response => { let resultData = response.data resultData.createTimeView = FormatUtil.formatTime(new Date(resultData.createTime)) resultData.moneyView = FormatUtil.formatMoney(resultData.money / 100) resultData.imageUrl = resultData.imageUrl ? JSON.parse(resultData.imageUrl) : [] that.setData({ - bookkeepingObj: resultData + bookkeepingObj: resultData, + loading:false }) // TODO 这里后期加判断,如果位置为空则重新定位还是什么的 通过位置定位信息 that.geocoder(resultData.address + resultData.addressDetail) @@ -259,7 +275,7 @@ Page({ let that = this if (!address) { console.log(`地址为空,不进行操作了!!!!` + address) - retrun; + return; } qqMapWxUtil.geocoder(address).then(response => { that.reverseGeocoder(response.result.location.lat, response.result.location.lng) diff --git a/pages/index/bookkeepingdetail/bookkeepingdetail.json b/pages/index/bookkeepingdetail/bookkeepingdetail.json index 8835af0..f951247 100644 --- a/pages/index/bookkeepingdetail/bookkeepingdetail.json +++ b/pages/index/bookkeepingdetail/bookkeepingdetail.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "i-spin": "../../template/dist/spin/index" + } } \ No newline at end of file diff --git a/pages/index/bookkeepingdetail/bookkeepingdetail.wxml b/pages/index/bookkeepingdetail/bookkeepingdetail.wxml index a012031..558ad22 100644 --- a/pages/index/bookkeepingdetail/bookkeepingdetail.wxml +++ b/pages/index/bookkeepingdetail/bookkeepingdetail.wxml @@ -1,5 +1,9 @@ + + + 加载中 + 消费时间 @@ -18,18 +22,17 @@ 消费记录 + + + - - - 备注 {{bookkeepingObj.remarks}} - @@ -48,24 +51,23 @@ 消费地点 {{bookkeepingObj.address}}{{bookkeepingObj.addressDetail}} - 消费记录 + + + - - - 备注 - diff --git a/pages/index/index.wxml b/pages/index/index.wxml index c33d15e..09de6b9 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -16,7 +16,7 @@
- + {{item.nowDayTime}} 支出 {{item.totalMoney}}元 -- Gitee From 66a043c035d2855c2093668cac390b078e8b916c Mon Sep 17 00:00:00 2001 From: "yangyouqi@torinosrc.com" Date: Thu, 9 Jan 2020 11:20:39 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consume/consume.js | 182 ++++++++++++++++++++++--------------- pages/consume/consume.wxml | 5 +- pages/consume/consume.wxss | 4 + pages/index/index.wxss | 3 + 4 files changed, 119 insertions(+), 75 deletions(-) diff --git a/pages/consume/consume.js b/pages/consume/consume.js index 034b9a9..ee41d8c 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -32,9 +32,9 @@ Page({ // 省 市 区 region: [], // 上传保存的图片 - imagePathList:[], + imagePathList: [], //导航栏显示颜色 - showType:true, + showType: true, // 计算器集合 calculatorList:[ [{ "value": "7" }, { "value": "8" }, { "value": "9" }], @@ -45,20 +45,23 @@ Page({ loading: false, isShowImage: false, // 显示图片弹框 isUploadFile: false, // 判断页面是跳转还是上传图片 + swiperHeight: 450, // 初始化的swiper高度 + imgheights: [], //所有图片的高度 + current: 0,//默认 }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { - console.log(`这里是onLoad`,options) + onLoad: function(options) { + console.log(`这里是onLoad`, options) console.log(`这里是onLoad,地址来哪里` + options.form) console.log(`这里是onLoad,地址来哪里` + options.address) console.log(`这里是onLoad,详情地址来哪里` + options.addressDetail) - if(options.form === 'address') { + if (options.form === 'address') { this.setData({ address: options.address, - addressDetail:options.addressDetail + addressDetail: options.addressDetail }) } else { // 获取到微信地理位置 @@ -72,7 +75,7 @@ Page({ let that = this wx.getLocation({ type: 'gcj02', - success: function (res) { + success: function(res) { // 调用腾讯地图显示位置信息 that.reverseGeocoder(res.latitude, res.longitude) }, @@ -101,17 +104,17 @@ Page({ * 上传图片 */ uploadFile(event) { - if(this.data.imagePathList.length > 0 && event.currentTarget.dataset.upload == undefined) { + if (this.data.imagePathList.length > 0 && event.currentTarget.dataset.upload == undefined) { this.setData({ - isShowImage:true + isShowImage: true }) return; } let that = this wx.chooseImage({ count: 2, - sizeType: ['original','compressed'], - success: function (res) { + sizeType: ['original', 'compressed'], + success: function(res) { const tempFiles = res.tempFiles; let requestUrl = API.api.uploadFile + '/bookkeeping/bookkeeping' var imagePathListObj = that.data.imagePathList @@ -121,7 +124,7 @@ Page({ continue; } that.setData({ - loading:true + loading: true }) wx.uploadFile({ url: requestUrl, @@ -130,16 +133,16 @@ Page({ header: { "Authorization": wx.getStorageSync('token') }, - success: function (res) { + success: function(res) { let resData = JSON.parse(res.data) if (resData.code == 200) { - switch(imagePathListObj.length) { + switch (imagePathListObj.length) { case 0: imagePathListObj.push(resData.data) break; default: imagePathListObj[1] = imagePathListObj[0] - imagePathListObj[0] = resData.data + imagePathListObj[0] = resData.data break; } that.setData({ @@ -147,9 +150,10 @@ Page({ }) TOAST.showToastSuccess('上传成功') } - },complete(){ + }, + complete() { that.setData({ - loading:false + loading: false }) } }) @@ -165,8 +169,8 @@ Page({ let that = this wx.chooseImage({ count: 1, - sizeType: ['original','compressed'], - success: function (res) { + sizeType: ['original', 'compressed'], + success: function(res) { const tempFiles = res.tempFiles[0]; let requestUrl = API.api.uploadFile + '/bookkeeping/bookkeeping' var imagePathListObj = that.data.imagePathList @@ -175,7 +179,7 @@ Page({ TOAST.showToastSuccess('图片大于1M') } that.setData({ - loading:true + loading: true }) wx.uploadFile({ url: requestUrl, @@ -184,18 +188,19 @@ Page({ header: { "Authorization": wx.getStorageSync('token') }, - success: function (res) { + success: function(res) { let resData = JSON.parse(res.data) - if (resData.code == 200) { - imagePathListObj[event.currentTarget.dataset.index] = resData.data + if (resData.code == 200) { + imagePathListObj[event.currentTarget.dataset.index] = resData.data that.setData({ imagePathList: imagePathListObj }) TOAST.showToastSuccess('上传成功') } - },complete(){ + }, + complete() { that.setData({ - loading:false + loading: false }) } }) @@ -213,20 +218,22 @@ Page({ /** * 支出收入类型转换 */ - tabTap: function (event) { + tabTap: function(event) { let showType = event.currentTarget.dataset.type == 1 ? false : true this.setData({ - showType:showType + showType: showType }) this.getConsumeType(event.currentTarget.dataset.type) }, - handleChange({ detail }) { + handleChange({ + detail + }) { this.setData({ current: detail.key }); this.getConsumeType(detail.key) }, - getConsumeType: function (type) { + getConsumeType: function(type) { let that = this; let requestUrl = API.api.consumeTypes + '/type?type=' + type; AJAX.getRequest(requestUrl).then(response => { @@ -239,15 +246,15 @@ Page({ /** * 生命周期函数--监听页面初次渲染完成 */ - onReady: function () { + onReady: function() { }, - submitInfo: function (e) { + submitInfo: function(e) { if (e.detail.formId) { AJAX.saveFormId(e.detail.formId) } }, - btnIcon: function (event) { + btnIcon: function(event) { let that = this console.log('你是不是点击了icon' + JSON.stringify(event.currentTarget.dataset.type)) this.data.consumeTypeList.forEach(item => { @@ -265,71 +272,78 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { - }, + onShow: function() {}, /** * 生命周期函数--监听页面隐藏 */ - onHide: function () { - }, + onHide: function() {}, /** * 生命周期函数--监听页面卸载 */ - onUnload: function () { - }, + onUnload: function() {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function () { + onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ - onReachBottom: function () { + onReachBottom: function() { }, /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function() { }, /** - * 添加数据 - */ + * 添加数据 + */ calculationType(event) { switch (event.currentTarget.dataset.type) { - case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - //常规数字 - this.addMunber(event) - break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + //常规数字 + this.addMunber(event) + break; case '.': - // 添加小数点 - this.addSpot() - break; + // 添加小数点 + this.addSpot() + break; case 'DEL': - // 删除 - this.deleteNumber(event) - break; - case '+': case '-': - // 加减法 - this.addOrDelete(event) - break; - // 归零 + // 删除 + this.deleteNumber(event) + break; + case '+': + case '-': + // 加减法 + this.addOrDelete(event) + break; + // 归零 case 'reset': - this.reset(); - break; + this.reset(); + break; default: console.log(`键盘` + event.currentTarget.dataset.type + `匹配不到对于的类型`) } }, - addMunber: function (event) { + addMunber: function(event) { // 先判断是否有小数点 let message = String(this.data.money); let index = message.lastIndexOf('.'); @@ -347,7 +361,7 @@ Page({ money: message }) }, - deleteNumber: function () { + deleteNumber: function() { let message = this.data.money; if (message != 0 && message != '') { message = message.substring(0, message.length - 1) @@ -358,7 +372,7 @@ Page({ money: message }) }, - addOrDelete: function (event) { + addOrDelete: function(event) { // 判断总金额是否为0 if (this.data.toatlMoney == 0) { this.setData({ @@ -386,7 +400,7 @@ Page({ addorDel: event.currentTarget.dataset.type }) }, - addSpot: function () { + addSpot: function() { let money = this.data.money; let index = money.lastIndexOf('.'); if (index != -1) { @@ -396,7 +410,7 @@ Page({ money: money + '.' }) }, - reset: function () { + reset: function() { this.setData({ money: 0, toatlMoney: 0, @@ -406,14 +420,14 @@ Page({ /** * 保存按钮 */ - saveBookkeeping: function () { + saveBookkeeping: function() { let that = this // 进行loaing - if(this.data.loading) { + if (this.data.loading) { return; } this.setData({ - loading:true + loading: true }) let money = 0; if (this.data.addorDel = '+') { @@ -439,11 +453,11 @@ Page({ requestObj.address = this.data.address; requestObj.addressDetail = this.data.addressDetail; requestObj.imageUrl = JSON.stringify(this.data.imagePathList); - console.log('保存的数据来着',requestObj) + console.log('保存的数据来着', requestObj) let requestUrl = API.api.bookkeepings; AJAX.postRequest(requestUrl, requestObj).then(response => { that.setData({ - loading:false + loading: false }) wx.switchTab({ url: '/pages/index/index' @@ -452,7 +466,7 @@ Page({ }, hideModel() { this.setData({ - isShowImage:false + isShowImage: false }) }, onTabItemTap(item) { @@ -464,6 +478,28 @@ Page({ imagePathList: [] }) // 获取消费类型数据,默认值为0 - this.getConsumeType(0); - } + this.getConsumeType(0); + }, + // 设置高度 + imageLoad: function(e) { //获取图片真实宽度 + var imgwidth = e.detail.width; + var imgheight = e.detail.height; + //宽高比 + var ratio = imgwidth / imgheight; + console.log(imgwidth, imgheight) + //计算的高度值 + var viewHeight = 750 / ratio; + imgheight = viewHeight; + var imgheights = this.data.imgheights; + //把每一张图片的对应的高度记录到数组里 + imgheights[e.target.dataset.index] = imgheight; + this.setData({ + imgheights: imgheights + }) + }, + bindchange: function(e) { + this.setData({ + current: e.detail.current + }) + }, }) \ No newline at end of file diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 197b8ca..129a726 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -67,10 +67,11 @@ - + - + diff --git a/pages/consume/consume.wxss b/pages/consume/consume.wxss index 81dad7c..f80af79 100644 --- a/pages/consume/consume.wxss +++ b/pages/consume/consume.wxss @@ -189,4 +189,8 @@ page { position: absolute; top: 80rpx; right: 20rpx; +} +.swiper-image { + width: 100%; + height: 100%; } \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 12b7aab..f73117d 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -12,6 +12,9 @@ page { height: 300rpx; background: #1E95F1; } +.head view{ + color: #FFFFFFFF; +} .profit { height: 150rpx; display: flex; -- Gitee From f11845f48173bdbab03671a8f84a6634ed967f58 Mon Sep 17 00:00:00 2001 From: "yangyouqi@torinosrc.com" Date: Thu, 9 Jan 2020 13:49:07 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/me/me.js | 32 ++++++++++++++++++++++++++++---- pages/me/me.wxml | 21 ++++----------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/pages/me/me.js b/pages/me/me.js index d4dbddd..adb7bff 100644 --- a/pages/me/me.js +++ b/pages/me/me.js @@ -13,7 +13,8 @@ Page({ tempUserInfo: {}, // 显示用户修改信息 isShow: false, - switch1:false + switch1:false, + loading: false, }, /** @@ -38,13 +39,19 @@ Page({ let that = this let userId = wx.getStorageSync('userId'); let requestUrl = API.api.users + '/' + userId; + this.setData({ + loading:true + }) AJAX.getRequest(requestUrl).then(response => { console.log(response.data) let userInfo = response.data; userInfo.monthBudget = FormatUtil.formatMoney(response.data.monthBudget / 100); + let semdMessageResult = response.data.semdMessage == 1 ? true : false that.setData({ userInfo: userInfo, - isShow: false + isShow: false, + switch1: semdMessageResult, + loading:false }) }) }, @@ -61,6 +68,9 @@ Page({ requestData.nickName = userInfo.nickName requestData.avatarUrl = userInfo.avatarUrl; let requestUrl = API.api.users + '/' + Number(userId); + this.setData({ + loading: true + }) AJAX.putRequest(requestUrl, requestData, false).then(response => { console.log('用户信息更新成功啦') this.getUserInfo() @@ -89,6 +99,9 @@ Page({ let tempUserInfo = this.data.tempUserInfo; let userId = wx.getStorageSync('userId'); let requestUrl = API.api.users + '/' + userId; + this.setData({ + loading: true + }) AJAX.putRequest(requestUrl, tempUserInfo).then(response => { console.log('更新成功!!!!'); that.getUserInfo(); @@ -152,10 +165,21 @@ Page({ */ onChange(event) { const detail = event.detail; - console.log(detail) + let requestData = {} + requestData.semdMessage = detail.value ? 1 : 0 + let userId = wx.getStorageSync('userId'); + let requestUrl = API.api.users + '/' + Number(userId); this.setData({ - 'switch1': detail.value + loading: true }) + AJAX.putRequest(requestUrl, requestData, false).then(response => { + console.log('用户信息更新成功啦') + this.getUserInfo() + }) + // console.log(detail) + // this.setData({ + // 'switch1': detail.value + // }) } }) \ No newline at end of file diff --git a/pages/me/me.wxml b/pages/me/me.wxml index 47d6706..1ba1cca 100644 --- a/pages/me/me.wxml +++ b/pages/me/me.wxml @@ -1,22 +1,9 @@ + + + 加载中 + - - - -- Gitee From 87d3515b56dea2122f0080c5e0568b6519aaebd4 Mon Sep 17 00:00:00 2001 From: "yangyouqi@torinosrc.com" Date: Thu, 9 Jan 2020 13:54:42 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/me/me.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/me/me.js b/pages/me/me.js index adb7bff..14f3b95 100644 --- a/pages/me/me.js +++ b/pages/me/me.js @@ -46,11 +46,11 @@ Page({ console.log(response.data) let userInfo = response.data; userInfo.monthBudget = FormatUtil.formatMoney(response.data.monthBudget / 100); - let semdMessageResult = response.data.semdMessage == 1 ? true : false + let sendMessageResult = response.data.sendMessage == 1 ? true : false that.setData({ userInfo: userInfo, isShow: false, - switch1: semdMessageResult, + switch1: sendMessageResult, loading:false }) }) @@ -166,7 +166,7 @@ Page({ onChange(event) { const detail = event.detail; let requestData = {} - requestData.semdMessage = detail.value ? 1 : 0 + requestData.sendMessage = detail.value ? 1 : 0 let userId = wx.getStorageSync('userId'); let requestUrl = API.api.users + '/' + Number(userId); this.setData({ -- Gitee From 080f308f3c240f59e15e2ba4a06bd5e7590aa6fe Mon Sep 17 00:00:00 2001 From: "2689725568@qq.com" Date: Thu, 9 Jan 2020 22:50:47 +0800 Subject: [PATCH 7/9] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consume/consume.js | 21 +++++++++++++++++++-- pages/consume/consume.wxml | 13 ++++++++----- pages/index/authoriztion/authoriztion.json | 4 +++- pages/index/authoriztion/authoriztion.wxml | 11 +++++++---- pages/index/index.js | 5 +++-- 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/pages/consume/consume.js b/pages/consume/consume.js index ee41d8c..6d4f125 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -48,6 +48,8 @@ Page({ swiperHeight: 450, // 初始化的swiper高度 imgheights: [], //所有图片的高度 current: 0,//默认 + isShowContent: false, // 显示内容弹框 + remarks: '', // 备注 }, /** @@ -63,6 +65,8 @@ Page({ address: options.address, addressDetail: options.addressDetail }) + // 获取消费类型数据,默认值为0 + this.getConsumeType(0); } else { // 获取到微信地理位置 this.getWxLocation() @@ -453,6 +457,7 @@ Page({ requestObj.address = this.data.address; requestObj.addressDetail = this.data.addressDetail; requestObj.imageUrl = JSON.stringify(this.data.imagePathList); + requestObj.remarks = this.data.remarks console.log('保存的数据来着', requestObj) let requestUrl = API.api.bookkeepings; AJAX.postRequest(requestUrl, requestObj).then(response => { @@ -466,7 +471,8 @@ Page({ }, hideModel() { this.setData({ - isShowImage: false + isShowImage: false, + isShowContent:false }) }, onTabItemTap(item) { @@ -475,7 +481,8 @@ Page({ money: 0, addorDel: '+', isShow: false, - imagePathList: [] + imagePathList: [], + current: 0 }) // 获取消费类型数据,默认值为0 this.getConsumeType(0); @@ -502,4 +509,14 @@ Page({ current: e.detail.current }) }, + showContent() { + this.setData({isShowContent: true}) + }, + /** + * 填写备注 + */ + textareaRemark:function(e) { + console.log(`获取到数据了`,e.detail.value) + this.setData({ remarks:e.detail.value }) + }, }) \ No newline at end of file diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 129a726..4c9d2f2 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -31,7 +31,7 @@ - + @@ -55,13 +55,16 @@ - + diff --git a/pages/index/authoriztion/authoriztion.json b/pages/index/authoriztion/authoriztion.json index 8835af0..f951247 100644 --- a/pages/index/authoriztion/authoriztion.json +++ b/pages/index/authoriztion/authoriztion.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "i-spin": "../../template/dist/spin/index" + } } \ No newline at end of file diff --git a/pages/index/authoriztion/authoriztion.wxml b/pages/index/authoriztion/authoriztion.wxml index b40c62e..41b5af9 100644 --- a/pages/index/authoriztion/authoriztion.wxml +++ b/pages/index/authoriztion/authoriztion.wxml @@ -1,16 +1,19 @@ - + + 加载中 + + - + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 3827443..a7e1f81 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -73,7 +73,8 @@ Page({ }) }, getBookkeeping: function() { - if ((this.data.pageNumber * this.data.pageSize) > this.data.totalElements) { + console.log(`pageNumber:` + this.data.pageNumber) + if ((this.data.pageNumber * this.data.pageSize) > this.data.totalElements && this.data.pageNumber != 0) { TOTAS.showToastSuccess("已经加载到底了....") return } @@ -83,7 +84,7 @@ Page({ let pageSize = this.data.pageSize; let requestUrl = API.api.bookkeepings + '?userId=' + userId + '&pageNumber=' + pageNumber + '&pageSize=' + pageSize; AJAX.getRequest(requestUrl).then(response => { - if (response.data.content.length == 0) { + if (response.data.content.length == 0 && this.data.pageNumber != 0) { TOTAS.showToastSuccess("已经加载到底了....") return } -- Gitee From 363e2666d7443c7de98fb0f3097eca0bbacb575c Mon Sep 17 00:00:00 2001 From: "2689725568@qq.com" Date: Sun, 12 Jan 2020 16:58:02 +0800 Subject: [PATCH 8/9] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + app.json | 1 - pages/consume/consume.js | 106 ++++++------- pages/consume/consume.wxml | 6 +- pages/index/authoriztion/authoriztion.js | 171 +++------------------ pages/index/authoriztion/authoriztion.wxml | 18 +-- pages/me/me.js | 7 +- pages/me/me.wxml | 1 - utils/api.js | 10 +- 9 files changed, 97 insertions(+), 224 deletions(-) diff --git a/app.js b/app.js index 15bb1f4..2eff18b 100644 --- a/app.js +++ b/app.js @@ -47,6 +47,7 @@ App({ wx.setStorageSync('openId', response.data.openId) wx.setStorageSync('userId', response.data.id) wx.setStorageSync('token', response.data.token) + wx.setStorageSync('sendMessage', response.data.sendMessage) that.globalData.token = response.data.token } resolve() diff --git a/app.json b/app.json index dddae92..c725798 100644 --- a/app.json +++ b/app.json @@ -6,7 +6,6 @@ "pages/index/address/address", "pages/me/myBill/myBill", "pages/index/bookkeepingdetail/bookkeepingdetail", - "pages/index/index" ], diff --git a/pages/consume/consume.js b/pages/consume/consume.js index 6d4f125..9fe798e 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -9,13 +9,8 @@ Page({ * 页面的初始数据 */ data: { - // 总金额 - toatlMoney: 0, - // 临时金额 + // 金额 money: 0, - // 加减法 - addorDel: '+', - //是否显示加减法 isShow: false, //保存消费类型数据 consumeTypeList: [], @@ -50,6 +45,7 @@ Page({ current: 0,//默认 isShowContent: false, // 显示内容弹框 remarks: '', // 备注 + tmplIds: [API.api.bookkeepingSuccess,API.api.accountingBudget], // 模板id }, /** @@ -334,13 +330,8 @@ Page({ // 删除 this.deleteNumber(event) break; - case '+': - case '-': - // 加减法 - this.addOrDelete(event) - break; // 归零 - case 'reset': + case 'C': this.reset(); break; default: @@ -376,36 +367,9 @@ Page({ money: message }) }, - addOrDelete: function(event) { - // 判断总金额是否为0 - if (this.data.toatlMoney == 0) { - this.setData({ - toatlMoney: Number(this.data.money), - money: 0, - isShow: true, - addorDel: event.currentTarget.dataset.type, - }) - return - } - let toatlMoney = Number(this.data.toatlMoney); - let money = Number(this.data.money); - switch (this.data.addorDel) { - case '+': - toatlMoney += money; - break - case '-': - toatlMoney -= money; - break - } - this.setData({ - isShow: true, - toatlMoney: parseFloat(toatlMoney).toFixed(2), - money: 0, - addorDel: event.currentTarget.dataset.type - }) - }, addSpot: function() { - let money = this.data.money; + let money = this.data.money + ""; + console.log(money) let index = money.lastIndexOf('.'); if (index != -1) { return @@ -417,14 +381,13 @@ Page({ reset: function() { this.setData({ money: 0, - toatlMoney: 0, isShow: false, }) }, /** * 保存按钮 */ - saveBookkeeping: function() { + saveBookkeeping() { let that = this // 进行loaing if (this.data.loading) { @@ -433,14 +396,7 @@ Page({ this.setData({ loading: true }) - let money = 0; - if (this.data.addorDel = '+') { - money = Number(this.data.toatlMoney) + Number(this.data.money); - } else if (this.data.addorDel = '-') { - money = Number(this.data.toatlMoney) - Number(this.data.money); - } else { - money = Number(this.data.toatlMoney) - } + let money = Number(this.data.money); if (money == 0) { TOAST.showToastSuccess('金额不能为0') this.setData({ @@ -448,6 +404,7 @@ Page({ }) return } + // 进行金额转换 money = money * 100; let requestObj = {}; @@ -477,7 +434,6 @@ Page({ }, onTabItemTap(item) { this.setData({ - toatlMoney: 0, money: 0, addorDel: '+', isShow: false, @@ -519,4 +475,50 @@ Page({ console.log(`获取到数据了`,e.detail.value) this.setData({ remarks:e.detail.value }) }, + /** + * 获取一次性订阅信息 + */ + requestSubscribeMessage() { + let that = this; + // 用户想接收到模板消息 + if(wx.getStorageSync('sendMessage') == 0) { + that.saveBookkeeping(); + return; + } + console.log(that.data.tmplIds) + wx.requestSubscribeMessage({ + tmplIds: that.data.tmplIds, + success(success) { + // 保存用户提交信息 + that.saveWxUserSubscribe(success); + }, + fail(error) { + console.error(`调用接口失败`); + }, + complete() { + that.saveBookkeeping() + } + }) + }, + saveWxUserSubscribe(resData) { + let that = this + this.data.tmplIds.forEach(item => { + console.log(`resData[item]` + resData[item]) + let requestObj = {}; + requestObj.userId = wx.getStorageSync('userId'); + if(resData[item] == 'accept') { + requestObj.type = 1; + } else if (resData[item] == 'reject') { + requestObj.type = 0; + } else { + requestObj.type = 2; + } + requestObj.subscribeId = item; + console.log('保存的数据来着', requestObj) + let requestUrl = API.api.wxusersubscribes; + AJAX.postRequest(requestUrl, requestObj).then(response => { + console.log(`保存成功`) + }) + }) + } }) \ No newline at end of file diff --git a/pages/consume/consume.wxml b/pages/consume/consume.wxml index 4c9d2f2..63866c2 100644 --- a/pages/consume/consume.wxml +++ b/pages/consume/consume.wxml @@ -47,9 +47,9 @@ -
- -
+ + +
diff --git a/pages/index/authoriztion/authoriztion.js b/pages/index/authoriztion/authoriztion.js index 54ae350..45e08ca 100644 --- a/pages/index/authoriztion/authoriztion.js +++ b/pages/index/authoriztion/authoriztion.js @@ -14,168 +14,43 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) { + onLoad: function (options) { let that = this; console.log(`当前来到了authoriztion授权页面` + JSON.stringify(app.globalData)) + console.log(`是否有携带参数信息:` + JSON.stringify(options)) if (app.globalData.token && app.globalData.token !== '') { - console.log('获取到token信息了') - // that.handleLogin(); + let form = options.form; + let bookkeepingid = options.bookkeepingid; + let userId = options.userId; + let url = ""; + switch (form) { + case 'bookkeepingDetail': + console.log(`从模板消息进来的~准备跳转到记账详情去`) + url: 'pages/index/bookkeepingdetail/bookkeepingdetail?form=index&bookkeepingid=' + bookkeepingid; + break; + case 'me': + console.log(`从模板消息进来的~准备跳转到我的记录去`) + url: 'pages/me/me?form=authoriztion&userId=' + userId; + break; + default: + console.log(`匹配不到,跳转到主页`) + url: '/pages/index/index' + break; + } wx.switchTab({ - url: '/pages/index/index' + url: url }) } else { console.log('app还未执行完,需要等待执行完毕') - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 // 所以此处加入 callback 以防止这种情况 app.callback = res => { - console.log('执行成功啦!....') - // that.handleLogin(); + console.log('执行成功啦!....') wx.switchTab({ url: '/pages/index/index' }) } } - }, - handleLogin: function() { - let that = this - this.getUserInfo().then(function(response) { - console.log('这个是获取到的数据信息') - if (!response.avatarUrl) { - console.log('没有头像信息,需要校验') - that.setData({ - isHidden: false - }) - } else { - console.log('有头像信息,直接跳过', JSON.stringify(response)); - that.setData({ - isHidden: true - }) - wx.setStorageSync('avatarUrl', response.avatarUrl) - wx.setStorageSync('nickName', response.nickName) - // 判断当前用户头像信息与昵称是否是最新 - that.getSetting().then(userInfo => { - if (wx.getStorageSync('avatarUrl') !== response.avatarUrl) { - console.log('更新用户头像信息') - that.updateUserInfo(response.id, userInfo); - } - }) - wx.switchTab({ - url: '/pages/index/index' - }) - // wx.navigateTo({ - // url: '/pages/domoTest/kyhbTest/kyhbTest' - // }) - } - }) - }, - getSetting: function() { - return new Promise((resolve, reject) => { - wx.getSetting({ - success: res => { - if (res.authSetting['scope.userInfo']) { - // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 - wx.getUserInfo({ - success: res => { - wx.setStorageSync('nickName', res.userInfo.nickName) - wx.setStorageSync('avatarUrl', res.userInfo.avatarUrl) - // 可以将 res 发送给后台解码出 unionId - return resolve(res.userInfo) - } - }) - } else { - return reject() - } - } - }) - }) - }, - getUserInfo: function() { - console.log('准备开始获取数据啦') - return new Promise((resolve, reject) => { - let requestUrl = API.api.users + '/' + wx.getStorageSync('userId'); - AJAX.getRequest(requestUrl,false).then(response => { - resolve(response.data) - }) - }) - - }, - updateUserInfo: function(userId, userInfo) { - // 如果用户没有授权信息,则不作任何操作,等到用户需要在提示 - return new Promise((resolve, reject) => { - let requestData = {} - requestData.nickName = userInfo.nickName - requestData.avatarUrl = userInfo.avatarUrl; - let requestUrl = API.api.users + '/' + Number(userId); - AJAX.postRequest(requestUrl, requestData, false).then(response => { - console.log('用户信息更新成功啦') - resolve(response) - }) - }) - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - console.log('这里又被触发了') - }, - // 判断用户是否进行授权操作 - bindgetuserinfo: function(eventhandle) { - console.log('来到了bindgetUserInfo') - let that = this - console.log(eventhandle) - if (eventhandle.detail.rawData) { - // 获取用户信息成功 - console.log('获取用户信息成功') - let userId = wx.getStorageSync('userId') - that.getSetting().then(userInfo => { - that.updateUserInfo(userId, userInfo).then(response => { - that.onLoad() - }); - }).catch(error => { - console.log('用户未授权') - }) - } - }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function() { - } }) \ No newline at end of file diff --git a/pages/index/authoriztion/authoriztion.wxml b/pages/index/authoriztion/authoriztion.wxml index 41b5af9..15d31d4 100644 --- a/pages/index/authoriztion/authoriztion.wxml +++ b/pages/index/authoriztion/authoriztion.wxml @@ -1,19 +1,3 @@ - - 加载中 - - - - - \ No newline at end of file +
\ No newline at end of file diff --git a/pages/me/me.js b/pages/me/me.js index 14f3b95..adf293a 100644 --- a/pages/me/me.js +++ b/pages/me/me.js @@ -20,7 +20,11 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) {}, + onLoad: function(options) { + if(options.form == 'authoriztion') { + wx.setStorageSync('userId', options.userId) + } + }, /** * 生命周期函数--监听页面初次渲染完成 @@ -53,6 +57,7 @@ Page({ switch1: sendMessageResult, loading:false }) + wx.setStorageSync('sendMessage', response.data.sendMessage) }) }, /** diff --git a/pages/me/me.wxml b/pages/me/me.wxml index 1ba1cca..fe4e1aa 100644 --- a/pages/me/me.wxml +++ b/pages/me/me.wxml @@ -1,4 +1,3 @@ - 加载中 diff --git a/utils/api.js b/utils/api.js index 32d77b0..65119ea 100644 --- a/utils/api.js +++ b/utils/api.js @@ -12,7 +12,12 @@ api.imageHost = 'https://be.yangyoki.top:12000/'; // 配置文件信息 // 腾讯地图key值 api.qqMapKey = 'GSUBZ-UACKQ-NXJ5Z-GL47V-CIVU2-7YB4X'; - +// 记账成功提醒模板消息 +api.bookkeepingSuccess = 'nlD1JNUEtWlHjUiqcNFOYJQBG-akvOSbST0b0aWllOs'; +// 记账预算提醒模板消息 +api.accountingBudget = '9idG4F8CNOaiGOo5EYwqB4wxVx8QXtoSg1HjNMnlM4M'; +//版本更新模板消息 +api.updateVersion = 'e5WNxg6ppcab2LvQTHVPutAlb6BJYAzheIkauWkWS1Q'; //用户接口 api.users = api.baseUrl + '/api/v1/wxusers'; @@ -40,6 +45,9 @@ api.uploadFile = api.baseUrl + '/api/v1/upload' // 瓷砖信息 api.kyhbs = api.baseUrl + '/api/v1/ceramictiles' +// 用户订阅消息 +api.wxusersubscribes = api.baseUrl + '/api/v1/wxusersubscribes' + module.exports = { api: api, } -- Gitee From 92845a0973f0d237a9916eea17a19914d00d97b4 Mon Sep 17 00:00:00 2001 From: "2689725568@qq.com" Date: Sun, 23 Feb 2020 20:29:26 +0800 Subject: [PATCH 9/9] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/consume/consume.js | 13 ++++--- pages/consume/consume.wxss | 2 +- pages/index/authoriztion/authoriztion.js | 36 +++++++++++++------ .../bookkeepingdetail/bookkeepingdetail.js | 2 +- pages/index/index.js | 2 +- pages/me/myBill/myBill.js | 1 - project.config.json | 17 ++++++++- utils/api.js | 8 ++--- utils/qqMapWxUtil.js | 12 ++----- 9 files changed, 59 insertions(+), 34 deletions(-) diff --git a/pages/consume/consume.js b/pages/consume/consume.js index 9fe798e..9601676 100644 --- a/pages/consume/consume.js +++ b/pages/consume/consume.js @@ -61,17 +61,18 @@ Page({ address: options.address, addressDetail: options.addressDetail }) - // 获取消费类型数据,默认值为0 - this.getConsumeType(0); } else { // 获取到微信地理位置 this.getWxLocation() } + // 获取消费类型数据,默认值为0 + this.getConsumeType(0); }, /** * 获取当前位置信息 */ getWxLocation() { + console.log(`我要去获取位置信息`) let that = this wx.getLocation({ type: 'gcj02', @@ -87,6 +88,7 @@ Page({ * longitude:经度 */ reverseGeocoder(latitude, longitude) { + console.log(`reverseGeocoder------latitude:` + latitude + `longitude:` + longitude) let that = this let location = {} location.latitude = latitude; @@ -113,7 +115,7 @@ Page({ let that = this wx.chooseImage({ count: 2, - sizeType: ['original', 'compressed'], + sizeType: ['compressed'], success: function(res) { const tempFiles = res.tempFiles; let requestUrl = API.api.uploadFile + '/bookkeeping/bookkeeping' @@ -438,7 +440,10 @@ Page({ addorDel: '+', isShow: false, imagePathList: [], - current: 0 + current: 0, + isShowImage: false, + isShowContent:false, + loading:false }) // 获取消费类型数据,默认值为0 this.getConsumeType(0); diff --git a/pages/consume/consume.wxss b/pages/consume/consume.wxss index f80af79..4fbfed3 100644 --- a/pages/consume/consume.wxss +++ b/pages/consume/consume.wxss @@ -157,7 +157,7 @@ page { background-color: #FFFFFF; text-align: center; background-size: 30% 50%; - background-image:url(https://be.yangyoki.top:12000/images/consume/icon/delete.png); + background-image:url(https://be.yangyoki.top/images/consume/icon/delete.png); background-repeat: no-repeat; background-position: center; diff --git a/pages/index/authoriztion/authoriztion.js b/pages/index/authoriztion/authoriztion.js index 45e08ca..f77ef7b 100644 --- a/pages/index/authoriztion/authoriztion.js +++ b/pages/index/authoriztion/authoriztion.js @@ -18,26 +18,27 @@ Page({ let that = this; console.log(`当前来到了authoriztion授权页面` + JSON.stringify(app.globalData)) console.log(`是否有携带参数信息:` + JSON.stringify(options)) + let form = options.form; + let bookkeepingid = options.bookkeepingid; + let userId = options.userId; + let url = ""; if (app.globalData.token && app.globalData.token !== '') { - let form = options.form; - let bookkeepingid = options.bookkeepingid; - let userId = options.userId; - let url = ""; switch (form) { case 'bookkeepingDetail': console.log(`从模板消息进来的~准备跳转到记账详情去`) - url: 'pages/index/bookkeepingdetail/bookkeepingdetail?form=index&bookkeepingid=' + bookkeepingid; + url = '/pages/index/bookkeepingdetail/bookkeepingdetail?form=index&bookkeepingid=' + bookkeepingid; break; case 'me': console.log(`从模板消息进来的~准备跳转到我的记录去`) - url: 'pages/me/me?form=authoriztion&userId=' + userId; + url = '/pages/me/me?form=authoriztion&userId=' + userId; break; default: console.log(`匹配不到,跳转到主页`) - url: '/pages/index/index' + url = '/pages/index/index' break; } - wx.switchTab({ + console.log(`url:` + url) + wx.reLaunch({ url: url }) } else { @@ -46,8 +47,23 @@ Page({ // 所以此处加入 callback 以防止这种情况 app.callback = res => { console.log('执行成功啦!....') - wx.switchTab({ - url: '/pages/index/index' + switch (form) { + case 'bookkeepingDetail': + console.log(`从模板消息进来的~准备跳转到记账详情去`) + url = '/pages/index/bookkeepingdetail/bookkeepingdetail?form=index&bookkeepingid=' + bookkeepingid; + break; + case 'me': + console.log(`从模板消息进来的~准备跳转到我的记录去`) + url = '/pages/me/me?form=authoriztion&userId=' + userId; + break; + default: + console.log(`匹配不到,跳转到主页`) + url = '/pages/index/index' + break; + } + console.log(`url:` + url) + wx.reLaunch({ + url: url }) } } diff --git a/pages/index/bookkeepingdetail/bookkeepingdetail.js b/pages/index/bookkeepingdetail/bookkeepingdetail.js index 496da46..ca806ef 100644 --- a/pages/index/bookkeepingdetail/bookkeepingdetail.js +++ b/pages/index/bookkeepingdetail/bookkeepingdetail.js @@ -139,7 +139,7 @@ Page({ let imagePath = ""; wx.chooseImage({ count: 1, - sizeType: ['original', 'compressed'], + sizeType: ['compressed'], success: function(res) { console.log(`获取到list`, res.tempFiles) const tempFiles = res.tempFiles; diff --git a/pages/index/index.js b/pages/index/index.js index a7e1f81..43badb6 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -27,7 +27,7 @@ Page({ /** * 生命周期函数--监听页面初次渲染完成 */ - onReady: function() { + onReady: function() { }, diff --git a/pages/me/myBill/myBill.js b/pages/me/myBill/myBill.js index bf0d816..4bb9107 100644 --- a/pages/me/myBill/myBill.js +++ b/pages/me/myBill/myBill.js @@ -1,6 +1,5 @@ // pages/me/myBill/myBill.js import * as echarts from '../../../template/ec-canvas/echarts'; -var wxCharts = require('../../../utils/wxcharts.js'); const API = require('../../../utils/api.js'); const AJAX = require('../../../utils/ajax.js'); const DateUtils = require('../../../utils/date.js') diff --git a/project.config.json b/project.config.json index fd6005d..483df22 100644 --- a/project.config.json +++ b/project.config.json @@ -23,7 +23,7 @@ } }, "compileType": "miniprogram", - "libVersion": "2.9.1", + "libVersion": "2.9.5", "appid": "wx883b407ed6f14b55", "projectname": "%E6%B6%88%E8%B4%B9%E6%98%8E%E7%BB%86%E5%90%9B", "debugOptions": { @@ -67,6 +67,21 @@ "id": -1, "name": "pages/index/bookkeepingdetail/bookkeepingdetail", "pathName": "pages/index/bookkeepingdetail/bookkeepingdetail", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/consume/consume", + "pathName": "pages/consume/consume", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/index/authoriztion/authoriztion", + "pathName": "pages/index/authoriztion/authoriztion", + "query": "form=bookkeepingDetail&bookkeepingid=296", "scene": null } ] diff --git a/utils/api.js b/utils/api.js index 65119ea..7e123ed 100644 --- a/utils/api.js +++ b/utils/api.js @@ -1,13 +1,9 @@ -let api = { - -}; - - +let api = {}; // TODO:配置接口文档信息 // api.baseUrl = 'http://192.168.1.103:12000'; api.baseUrl = 'https://be.yangyoki.top:12000'; api.imageHostDowm = 'https://be.yangyoki.top:12000'; -api.imageHost = 'https://be.yangyoki.top:12000/'; +api.imageHost = 'https://be.yangyoki.top'; // 配置文件信息 // 腾讯地图key值 diff --git a/utils/qqMapWxUtil.js b/utils/qqMapWxUtil.js index d8a5d1d..bcd2ade 100644 --- a/utils/qqMapWxUtil.js +++ b/utils/qqMapWxUtil.js @@ -11,8 +11,9 @@ function reverseGeocoder(location) { return new Promise(function (resolve, reject) { app.globalData.qqmapsdk.reverseGeocoder({ location: location, + sig:'NjGMnQMAcZczYgicF6ubCPxOuLWhbqR', success: function (skdRes) { - console.log(`请求成功了吗?`,skdRes) + console.log(`请求用户的地址成功了吗?`,skdRes) // 坐标显示 let markers = [] markers.push({ @@ -40,11 +41,6 @@ function reverseGeocoder(location) { responseObj.addressDetail = street_number; // 如业务需求可继续补充数据 resolve(responseObj); - // that.setData({ - // markers: markers, - // address: skdRes.result.address, - // region: region - // }) } }) }) @@ -62,6 +58,7 @@ function geocoder(address) { // 调用腾讯地图进行定位 app.globalData.qqmapsdk.geocoder({ address: address, + sig:'NjGMnQMAcZczYgicF6ubCPxOuLWhbqR', success: function (response) { console.log(`解析成功啦!`, response) resolve(response) @@ -70,9 +67,6 @@ function geocoder(address) { }) } - - - module.exports = { reverseGeocoder: reverseGeocoder, geocoder: geocoder -- Gitee