From 297d06ad8ca8817ee2f96158a9465ab236f3c413 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Fri, 3 Jul 2020 16:51:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 7 +++++-- pages/book/book.js | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app.json b/app.json index d4c96db..b84ac9e 100644 --- a/app.json +++ b/app.json @@ -2,16 +2,19 @@ "pages": [ "pages/venue/venue", "pages/index/index", + "pages/center/center", + "pages/broadcastList/broadcastList", + "pages/orderDetail/orderDetail", + "pages/myVenueOrder/myVenueOrder", + "pages/book/book", "pages/broadcast/broadcast", "pages/activityDialog/activityDialog", "pages/teamDetail/teamDetail", - "pages/center/center", "pages/volunteerRegister/volunteerRegister", "pages/volunteer/volunteer", "pages/heritage/heritage", "pages/broadcastDetail/broadcastDetail", "pages/venueDetail/venueDetail", - "pages/book/book", "pages/register/register", "pages/login/login", "pages/newVolunteerActivity/newVolunteerActivity", diff --git a/pages/book/book.js b/pages/book/book.js index 6a7c503..cc6d72d 100644 --- a/pages/book/book.js +++ b/pages/book/book.js @@ -8,6 +8,7 @@ Page({ * 页面的初始数据 */ data: { + token: '', checkOrder: false, venuesInfoId: '', selectVenuesProject:'', @@ -26,7 +27,39 @@ Page({ //保存 saveBookingInfo: function(){ - console.log(this.data.phoneNumber); + var self = this; + if(self.data.mySelectItem.length == 0){ + wx.showToast({ + title: '请先选择您的预订信息', + icon: 'none', + }) + return false; + } + if(self.data.phoneNumber == ''){ + wx.showToast({ + title: '请填写手机号', + icon: 'none', + }) + return false; + } + if(self.data.smsCode == ''){ + wx.showToast({ + title: '请填写验证码', + icon: 'none', + }) + return false; + } + var param = { + smsCode : self.data.smsCode, + phoneNumber : self.data.phoneNumber, + venuesProjectId : self.data.selectVenuesProject, + bookingItemList : self.data.mySelectItem + } + app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[]), param, {headers : {token:self.data.token}}, function(code,data){ + console.log(data); + },function(code,data){ + + }); }, /** @@ -236,6 +269,14 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data + }) + } + }) this.setData({ venuesInfoId: options.venuesInfoId }); From c5f090f002420b3e9df7d2f1752c2da99494002d Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Tue, 7 Jul 2020 15:56:13 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BF=9D=E5=AD=98=E5=8F=8A=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/book/book.js | 83 ++++++++++++++++++++++--- pages/book/book.wxml | 5 +- pages/book/book.wxss | 14 +++++ pages/index/index.js | 141 +------------------------------------------ 4 files changed, 91 insertions(+), 152 deletions(-) diff --git a/pages/book/book.js b/pages/book/book.js index 514ef5c..e6dc48f 100644 --- a/pages/book/book.js +++ b/pages/book/book.js @@ -9,7 +9,10 @@ Page({ */ data: { token: '', + timer: '', + gotCode: false, checkOrder: false, + restTime:120, venuesInfoId: '', selectVenuesProject:'', venuesProjectList: [], @@ -35,11 +38,7 @@ Page({ }) return false; } - if(self.data.phoneNumber == ''){ - wx.showToast({ - title: '请填写手机号', - icon: 'none', - }) + if(!self.checkPhoneNumber()){ return false; } if(self.data.smsCode == ''){ @@ -55,10 +54,19 @@ Page({ venuesProjectId : self.data.selectVenuesProject, bookingItemList : self.data.mySelectItem } - app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[]), param, {headers : {token:self.data.token}}, function(code,data){ - console.log(data); + app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[app.venueUrl]), param, {headers : {token:self.data.token}}, function(code,data){ + if(code == 200){ + wx.showToast({ + title: '预订成功', + }); + setTimeout( () =>{ + wx.navigateBack({ + delta: 1, + }) + },1500); + } },function(code,data){ - + app.dialog.msg(data.msg); }); }, @@ -250,9 +258,64 @@ Page({ }) }, - //获取验证码 - getSmsCoce:function (){ + checkPhoneNumber: function(){ + if(this.data.phoneNumber == ''){ + wx.showToast({ + title: '请填写手机号', + icon: 'none', + }) + return false; + } + if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.data.phoneNumber)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 1500 + }) + return false; + } + return true; + }, + //获取验证码 + getSmsCoce: function (){ + var self = this; + if(!self.checkPhoneNumber()){ + return false; + } + console.log('go'); + app.restAjax.get(app.restAjax.path('{venueUrl}/api/sms/getverificationcode/' + self.data.phoneNumber, [app.venueUrl]), {}, null, + function (code, data) { + if (code == 200) { + console.log(data) + self.setData({ + gotCode: true + }) + self.data.timer = setInterval(function () { + var cur = self.data.restTime - 1 + console.log(cur) + if (cur == 0) { + clearInterval(self.data.timer) + self.setData({ + restTime: 120, + gotCode: false + }) + } else { + self.setData({ + restTime: cur + }) + } + }, 1000) + } + }, + function (code, data) { + console.log(data) + wx.showToast({ + title: data.msg, + icon: 'none', + duration: 1500 + }) + }) }, doCheckOrder: function () { diff --git a/pages/book/book.wxml b/pages/book/book.wxml index d4b1bee..92ec643 100644 --- a/pages/book/book.wxml +++ b/pages/book/book.wxml @@ -42,8 +42,9 @@ 验证码: - - 获取验证码 + + 获取验证码 + {{restTime}} diff --git a/pages/book/book.wxss b/pages/book/book.wxss index 88da7cc..aa0b16d 100644 --- a/pages/book/book.wxss +++ b/pages/book/book.wxss @@ -220,4 +220,18 @@ .top{ background: #9F1512; color: #fff; +} +.get-code, .got-code{ + font-size: 28rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + width: 28%; + line-height: 55rpx; + text-align: center; + border-radius: 10rpx; +} +.got-code{ + background: #fff; + color: #4a4d52; + border: 1px solid #eaeaea; } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index f1f0e99..c3a68b2 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -4,11 +4,6 @@ Page({ * 页面的初始数据 */ data: { - randomName: '', - showPhone: true, - gotCode: false, - restTime: 10, - timer: '', indicatorDots: true, autoplay: true, token: '', @@ -31,8 +26,7 @@ Page({ live: { liveUrl: app.liveUrl, liveList: [] - }, - usercenterUrl: app.usercenterUrl + } }, doLogin: function () { var self = this; @@ -65,9 +59,6 @@ Page({ page: 1, rows: 5 }, null, function(code, data) { - for(var i = 0, item; item = data.rows[i++];) { - item.cover = item.libraryCover.split(',')[0]; - } self.setData({ 'library.bannerLibrary': data.rows }); @@ -127,11 +118,6 @@ Page({ app.dialog.msg(data.msg); }); }, - goCultureDetail: function(event) { - wx.navigateTo({ - url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId, - }) - }, goNewsDetail: function (event) { wx.navigateTo({ url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl, @@ -172,130 +158,6 @@ Page({ url: '../heritage/heritage', }) }, - // 获取输入的手机号 - phoneNum: function (res) { - this.setData({ - phone: res.detail.value - }) - console.log(this.data.phone) - }, - // 校验手机号 - testPhone: function () { - var self = this - if (self.data.phone) { - if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) { - wx.showToast({ - title: '请输入正确的手机号', - icon: 'none', - duration: 1500 - }) - } else { - self.getCode() - } - } else { - wx.showToast({ - title: '手机号不能为空', - icon: 'none', - duration: 1500 - }) - } - }, - // 获取验证码 - getCode: function () { - var self = this - app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null, - function (code, data) { - if (code == 200) { - console.log(data) - self.setData({ - gotCode: true - }) - self.data.timer = setInterval(function () { - var cur = self.data.restTime - 1 - console.log(cur) - if (cur == 0) { - clearInterval(self.data.timer) - self.setData({ - restTime: 120, - gotCode: false - }) - } else { - self.setData({ - restTime: cur - }) - } - }, 1000) - } - }, - function (code, data) { - console.log(data) - wx.showToast({ - title: data.msg, - icon: 'none', - duration: 1500 - }) - } ) - }, - // 提交绑定手机 - submitPhone: function () { - var self = this - app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), { - phone: self.data.phone, - verificationCode: self.data.code - }, { - headers: { - token: self.data.token - } - }, function (code, data) { - console.log(data) - wx.setStorageSync('token', data.data); - wx.setStorageSync('isRandomUsername', 0) - clearInterval(self.data.timer) - self.setData({ - showPhone: false, - restTime: 120 - }) - self.getUserInfo() - }, function (code, data) { - console.log(data) - }) - }, - // 验证码 - inputCode: function (e) { - this.setData({ - code: e.detail.value - }) - }, - // 判断用户是否为随机名称 - isRandomName: function () { - var self = this - wx.getStorage({ - key: 'isRandomUsername', - success: function (res) { - if (res.data == 1) { - wx.hideTabBar() - self.setData({ - randomName: true - }) - } - } - }) - }, - // 获取用户信息 - getUserInfo: function () { - var self = this - app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, { - headers: { - token: self.data.token - } - }, function (code, data) { - self.setData({ - userInfo: data - }) - }, function (code, data) { - console.log(data) - }) - }, /** * 生命周期函数--监听页面加载 */ @@ -307,7 +169,6 @@ Page({ self.doGetLiveList(); self.doGetVenueList(); self.doGetActivityList(); - self.isRandomName(); }, /** From 6e8735eb37cf4b826b919dd150f20b0fee6edec9 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Thu, 9 Jul 2020 13:05:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=9C=8B=E5=8F=8B?= =?UTF-8?q?=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/delete-photo.png | Bin 0 -> 1396 bytes images/friend.png | Bin 0 -> 1187 bytes images/new.png | Bin 0 -> 174 bytes images/order.png | Bin 0 -> 513 bytes pages/center/center.js | 16 +++ pages/center/center.wxml | 8 ++ pages/center/center.wxss | 1 + pages/friendCircle/friendCircle.js | 10 ++ pages/friendCircle/friendCircle.wxml | 4 + pages/friendCircle/friendCircle.wxss | 19 +++ pages/myFriendCircle/myFriendCircle.js | 116 ++++++++++++++++++ pages/myFriendCircle/myFriendCircle.json | 3 + pages/myFriendCircle/myFriendCircle.wxml | 54 +++++++++ pages/myFriendCircle/myFriendCircle.wxss | 68 +++++++++++ pages/newFriendCircle/newFriendCircle.js | 130 +++++++++++++++++++++ pages/newFriendCircle/newFriendCircle.json | 3 + pages/newFriendCircle/newFriendCircle.wxml | 30 +++++ pages/newFriendCircle/newFriendCircle.wxss | 79 +++++++++++++ 18 files changed, 541 insertions(+) create mode 100644 images/delete-photo.png create mode 100644 images/friend.png create mode 100644 images/new.png create mode 100644 images/order.png create mode 100644 pages/myFriendCircle/myFriendCircle.js create mode 100644 pages/myFriendCircle/myFriendCircle.json create mode 100644 pages/myFriendCircle/myFriendCircle.wxml create mode 100644 pages/myFriendCircle/myFriendCircle.wxss create mode 100644 pages/newFriendCircle/newFriendCircle.js create mode 100644 pages/newFriendCircle/newFriendCircle.json create mode 100644 pages/newFriendCircle/newFriendCircle.wxml create mode 100644 pages/newFriendCircle/newFriendCircle.wxss diff --git a/images/delete-photo.png b/images/delete-photo.png new file mode 100644 index 0000000000000000000000000000000000000000..db02a2fafb781d9111d0d84365579a8c66de8eaf GIT binary patch literal 1396 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`f(~1RD^r68eAMwS&*t9 zlvv ztM~P_^2{qPNz6-5^>ndS0-B(gnVDkcX5wsNWaj2#>1t|jXz1$b=w{&TYG!I~WMW`o zZervN)9aF-T$-DjR|3v4~Pj*wm=R%;iu*SQ+p9GS--MkOJQJOeBtTh7*cU- z&oo;DW=E0Z_wzi0W(FQRE-5c;BxU@?X!0~C!KqfqdV-u?ofn%VFIl!Qz$M$|e9y5C zo-XMnCW|M{xO1ysPh7j~alsy?@}0Hct9Sq3{{F3DR$}St>OT!ou64~G4=P@gBLV)W#&#KtwwerAdL=haItNNBzMX_LSG=9_}M zix${DkWZJ3`^ze`Ek3;_u2CjpTKzRm24NR%&fS|Xaxk1-+Ltb};N%})1@${uJF_QC z%F6EU%zgXJSD@#hyZJN2$c6g1{15HCd~ogI;A2V`4?e%+xNnQa^qjVGpXHMm{VB>m z@6$E?boavZx4ZcZ+^$Z^W1GwE{k`F_oI^@x0zn|45T6NpMW8)G}CVrN~ zUV9o|ZGLujue#Hd)P@gRc|`MxvFvOWqs|Nyv)lw{mT`x1?pW7V=*DyV>CgX}Wjh?ZdHMRv-pgTe~DWM4fCFcPR literal 0 HcmV?d00001 diff --git a/images/friend.png b/images/friend.png new file mode 100644 index 0000000000000000000000000000000000000000..7e05fbb7fe91c2ecf5ab0ad8ff63a86c9e6e1cc6 GIT binary patch literal 1187 zcmV;U1YG-xP)R`B3q?V7IHn;Ja`il?wBsF09g5D~@0ic#bAM9haF*$`bnNOYqFBZ<*n zKQ=)#)kclD9`xWxh|z4K2cwchL@z3lfWl7q^kffSg4<83d%AZ%`fDs07^>f^|F2%v zd;OX)z_3koIn&~5fbIrxYuj}Jzy$nwbqsGG(HB6^O&s^+wIs!I6-Ft5#p2mzi4=qdoymg7yO z`6L2N0+(GQ#VZVKjU5^LEZ3V*QrG|<$%I$}SfTBRaf0FRNjjE3fVvPjPzlo@tV$4> zvK((*N%0PV^{Eg&0FfPYX?e|c&vyEC0kp+uLAWtBWK1(vx4BuF9bD(20 zRh1O40vPY|%K`|p1dmy+_jbqwz^)8m$2@c#z_kMa07OTvM)SdXMeHX=ysLH^>MRH@ zVZ!(uKHaO+I{;A9m|XDBlW_$8pK!mIlExl@ zp3MS?#C2h-I^O+cn_@c?4itp=SnoE=R#n6c@cnPvg{bQYV)2SN%8Uotr(4K2%WpC9 zrUC%D;?Ww)ymCb^KqOu_jrWM?A#JPYNJ;S-fV*-43X8`O(l{Ai!bn_6p#W54EyfuQ za4zQp4lLfj*a1L?cw+U`02cuar$itSS5nO8oqeyrlEz7&>6E_hsv-`8u^~xA18}Bz z#rPDAVasW)EO1X^lf$N%48*1J20)Le_%5UY1Ut8-_=15u0iGKaAUp=4E32-sY2#-N z@LflDqYcBbSHuZ$^hO*Uz&6D`COnZ7wa-aO<0*jlwhf~*KMmmaC1;)k^X{T;mXhU{ z0Dd~}$cSl%!amRcDc-p$z6asvZs!nysI;o;c)PL|wxxKHft`8c!E@q?_PZdw1PEHJ{Z-d{Ql}@tazM>+^PqE8 z$J-VF92pt8V$r{J9-x%Px&hjPVS5&&Dcv(5#BW2T#Wm~Z7tSw5Anbq-7KuQ|<$Tj} zT3eRVwHO8yZ>}|3Ghrk;hAqWZS0@}lON>DHlyJyucpJOZHWTEy<#=l%i!K1&j$dtx zWBna*20*w{&?71-deXNCgz*de7^`{SuZaM9GPyI(1<{lZ>?aR$Jb%yg{QZ0i4o#($$88}|fITCxBD002ovPDHLkV1k&8 BGhP4y literal 0 HcmV?d00001 diff --git a/images/new.png b/images/new.png new file mode 100644 index 0000000000000000000000000000000000000000..540f1d7ae5e3d93f4fde77d84a7dcad8510cda3d GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJQcoAhkO=qW6p4fb76-l=Pk7s~ zZr!@S3dg5UooX5Mh|^2vgZwLoO=lTisz(=xhhJa8?B<+c!U7~_v@&eTDPOQ8M&0Q> zbsMTUNK~~GB9kvl%*KRyVD5h O00vK2KbLh*2~7ZU);#L~ literal 0 HcmV?d00001 diff --git a/images/order.png b/images/order.png new file mode 100644 index 0000000000000000000000000000000000000000..3298720ed6db9c8358d1403c6743d3220d8362fc GIT binary patch literal 513 zcmV+c0{;DpP)ljfF1&jjfed8Wjo>UqXBg3dBS!t!!=MtFEFXFwZDW8_&exF1;+Vq#00F)gsCzxkKrJQ9aa$#sTM^=E_&reIyii!~ zLhmIrxWSD~6w5YOPCXO&6fN-2d0IA@FfgIIt*aNlzp%O@7C5CX^S2z?W zS%Hv2SeY@fqHy6m-((6J0I)=ad6NjWsw-|t3bYFRGWcU55&*!}VMpwc0Q%2xkvCAORZ4z^_*`*C zjr2#nZ0MjO9sMh!0_s1*<5`ftlnk^tC0G+Hh=l=k9 z3V_Po=WL{p+KyJX;m&Bc8PPLGJ(KnV`WkLa6`h)2h{_s2*|pR600000NkvXXu0mjf D 常用功能 + + + 我的发布 + + + + 我的订单 + 我的报名 diff --git a/pages/center/center.wxss b/pages/center/center.wxss index c4d5a4a..db089b3 100644 --- a/pages/center/center.wxss +++ b/pages/center/center.wxss @@ -55,6 +55,7 @@ text-align: center; padding: 0 15rpx; box-sizing: border-box; + margin-bottom: 15rpx; } .main-box image{ width: 65rpx; diff --git a/pages/friendCircle/friendCircle.js b/pages/friendCircle/friendCircle.js index 7dbc9e1..3232d7a 100644 --- a/pages/friendCircle/friendCircle.js +++ b/pages/friendCircle/friendCircle.js @@ -53,6 +53,16 @@ Page({ wx.hideLoading(); }); }, + newFriendCircle: function () { + wx.navigateTo({ + url: '../newFriendCircle/newFriendCircle', + }) + }, + toMyFriendCircle: function () { + wx.navigateTo({ + url: '../myFriendCircle/myFriendCircle', + }) + }, /** * 生命周期函数--监听页面加载 */ diff --git a/pages/friendCircle/friendCircle.wxml b/pages/friendCircle/friendCircle.wxml index a193577..f2c197e 100644 --- a/pages/friendCircle/friendCircle.wxml +++ b/pages/friendCircle/friendCircle.wxml @@ -48,4 +48,8 @@ {{item.gmtCreate}} + + + 发布 + 我的 \ No newline at end of file diff --git a/pages/friendCircle/friendCircle.wxss b/pages/friendCircle/friendCircle.wxss index 00bff95..d41c2c7 100644 --- a/pages/friendCircle/friendCircle.wxss +++ b/pages/friendCircle/friendCircle.wxss @@ -49,4 +49,23 @@ } .video video{ width: 100%; +} +.new-friend-circle{ + position: fixed; + right: 30rpx; + bottom: 30rpx; +} +.box{ + width: 100rpx; + height: 100rpx; + display: flex; + justify-content: center; + align-items: center; + background: #9F1512; + color: #fff; + font-size: 32rpx; + border-radius: 50%; +} +.new{ + margin-bottom: 10rpx; } \ No newline at end of file diff --git a/pages/myFriendCircle/myFriendCircle.js b/pages/myFriendCircle/myFriendCircle.js new file mode 100644 index 0000000..bba010c --- /dev/null +++ b/pages/myFriendCircle/myFriendCircle.js @@ -0,0 +1,116 @@ +// pages/friendCircle/friendCircle.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + usercenterUrl: app.usercenterUrl, + socialUrl: app.socialUrl, + momentsList: [], + currentPage: 1, + rows: 20 + }, + doGetMomentsList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{socialUrl}/app/moments/listpagemomentsofpublicrelease', [self.data.socialUrl]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + for(var i = 0, item; item = data.rows[i++];) { + if(item.type === 'photo') { + var photos = item.photos.split(','); + var photoArray = []; + for(var j = 0, jItem; jItem = photos[j++];) { + if(jItem.length != 0) { + photoArray.push(jItem); + } + } + item.photoArray = photoArray; + } + } + var momentsArray; + if(page <= 1) { + momentsArray = data.rows; + } else { + momentsArray = self.data.news.newsList; + momentsArray = momentsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + momentsList: momentsArray + }) + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + newFriendCircle: function () { + wx.navigateTo({ + url: '../newFriendCircle/newFriendCircle', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.doGetMomentsList(1); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.doGetMomentsList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.doGetMomentsList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/myFriendCircle/myFriendCircle.json b/pages/myFriendCircle/myFriendCircle.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/myFriendCircle/myFriendCircle.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/myFriendCircle/myFriendCircle.wxml b/pages/myFriendCircle/myFriendCircle.wxml new file mode 100644 index 0000000..15dfbad --- /dev/null +++ b/pages/myFriendCircle/myFriendCircle.wxml @@ -0,0 +1,54 @@ + + + + + + + {{item.creatorName}} + {{item.content}} + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + 发布 + \ No newline at end of file diff --git a/pages/myFriendCircle/myFriendCircle.wxss b/pages/myFriendCircle/myFriendCircle.wxss new file mode 100644 index 0000000..5b9cd19 --- /dev/null +++ b/pages/myFriendCircle/myFriendCircle.wxss @@ -0,0 +1,68 @@ +.friend-circle{ + padding: 15rpx 30rpx; + border-bottom: 1px solid #DEDEDE; +} +.friend-circle:last-child { + border-bottom: none; +} +.friend-circle-box{ + display: flex; + justify-content: space-between; + padding-bottom: 10rpx; +} + +.avatar{ + width: 8%; +} +.avatar image{ + width: 100%; + height: 50rpx; + border-radius: 50rpx; +} +.content{ + width: 90%; +} +.name{ + font-size: 30rpx; + color: #949494; +} +.text{ + font-size: 32rpx; + color: #000; + margin: 10rpx 0; +} +.date{ + font-size: 28rpx; + color: #949494; +} +.photo-one image{ + width: 100%; +} +.photo-more image{ + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 10rpx; +} +.photo-more image:nth-child(3n){ + margin-right: 0; +} +.video video{ + width: 100%; +} +.new-friend-circle{ + position: fixed; + right: 30rpx; + bottom: 30rpx; +} +.box{ + width: 100rpx; + height: 100rpx; + display: flex; + justify-content: center; + align-items: center; + background: #9F1512; + color: #fff; + font-size: 32rpx; + border-radius: 50%; +} \ No newline at end of file diff --git a/pages/newFriendCircle/newFriendCircle.js b/pages/newFriendCircle/newFriendCircle.js new file mode 100644 index 0000000..743ed1c --- /dev/null +++ b/pages/newFriendCircle/newFriendCircle.js @@ -0,0 +1,130 @@ +// pages/newFriendCircle/newFriendCircle.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + showAdd: true, + selectedType: '', + selectedList: [], + isPublic: '' //朋友圈是否公开 + }, + changepublic: function (e) { + this.setData({ + isPublic: e.detail.value + }) + }, + selectContent: function () { + var self = this + wx.chooseMedia({ + count: 9 - self.data.selectedList.length, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + success: function (res) { + console.log(res) + if (res.type == 'image') { + self.setData({ + selectedType: res.type, + selectedList: self.data.selectedList.concat(res.tempFiles) + }) + } else { + self.setData({ + selectedType: res.type, + selectedList: self.data.selectedList.concat(res.tempFiles) + }) + } + self.isShowAdd() + console.log(self.data.selectedList) + } + }) + }, + deletePhoto: function (e) { + var self = this + var now = e.currentTarget.dataset.idx + var result = self.data.selectedList + result.splice(now, 1) + this.setData({ + selectedList: result + }) + self.isShowAdd('delete') + }, + isShowAdd: function (from) { + if (this.data.selectedType == 'image') { + if (this.data.selectedList.length < 9) { + this.setData({ + showAdd: true + }) + } else { + this.setData({ + showAdd: false + }) + } + } else { + if (from) { + this.setData({ + showAdd: true + }) + } else { + this.setData({ + showAdd: false + }) + } + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/newFriendCircle/newFriendCircle.json b/pages/newFriendCircle/newFriendCircle.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/newFriendCircle/newFriendCircle.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/newFriendCircle/newFriendCircle.wxml b/pages/newFriendCircle/newFriendCircle.wxml new file mode 100644 index 0000000..154553e --- /dev/null +++ b/pages/newFriendCircle/newFriendCircle.wxml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + 是否公开: + + 公开 + 不公开 + + + + + 发布 + \ No newline at end of file diff --git a/pages/newFriendCircle/newFriendCircle.wxss b/pages/newFriendCircle/newFriendCircle.wxss new file mode 100644 index 0000000..18d657f --- /dev/null +++ b/pages/newFriendCircle/newFriendCircle.wxss @@ -0,0 +1,79 @@ +.new-friend-circle{ + padding: 30rpx; + margin-bottom: 100rpx; +} +.text{ + width: 100%; + height: 250rpx; + margin-bottom: 30rpx; +} +.text textarea{ + width: 100%; + height: 100%; + border: 1px solid #DEDEDE; + padding: 15rpx; + box-sizing: border-box; + font-size: 32rpx; +} +.add{ + width: 32%; + height: 200rpx; + background: #DEDEDE; + display: inline-flex; + justify-content: center; + align-items: center; + vertical-align: top; +} +.add image{ + width: 100rpx; + height: 100rpx; +} +.is-public{ + margin-top: 20rpx; + font-size: 30rpx; +} +.is-public radio-group{ + display: inline-block; +} +.is-public radio-group radio{ + margin-right: 20rpx; +} +.photo{ + display: inline-block; + width: 32%; + height: 200rpx; + margin-right: 2%; + position: relative; + margin-bottom: 20rpx; +} +.photo:nth-child(3n){ + margin-right: 0; +} +.photo image{ + width: 100%; + height: 100%; +} +.photo image.delete{ + width: 30rpx; + height: 30rpx; + position: absolute; + top: -15rpx; + right: -15rpx; +} +.type-box, .type-box video{ + width: 100%; + height: 100%; +} +.submit{ + position: fixed; + left: 0; + right: 0; + bottom: 0; + background: #9F1512; + height: 100rpx; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 32rpx; +} \ No newline at end of file From af044d1e4e6ee40aa899bb0ac361cd01b9c81767 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Thu, 9 Jul 2020 13:45:12 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?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/book/book.js | 7 +++++-- pages/center/center.js | 8 ++++++++ pages/center/center.wxml | 4 ++++ pages/order/order.js | 41 +++++++++++++++++++++++++++++++++++++++- pages/order/order.wxml | 29 ++++++++-------------------- 5 files changed, 65 insertions(+), 24 deletions(-) diff --git a/pages/book/book.js b/pages/book/book.js index e6dc48f..1c2ce8f 100644 --- a/pages/book/book.js +++ b/pages/book/book.js @@ -54,6 +54,9 @@ Page({ venuesProjectId : self.data.selectVenuesProject, bookingItemList : self.data.mySelectItem } + wx.showLoading({ + title: '请稍等', + }); app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[app.venueUrl]), param, {headers : {token:self.data.token}}, function(code,data){ if(code == 200){ wx.showToast({ @@ -67,6 +70,8 @@ Page({ } },function(code,data){ app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); }); }, @@ -283,7 +288,6 @@ Page({ if(!self.checkPhoneNumber()){ return false; } - console.log('go'); app.restAjax.get(app.restAjax.path('{venueUrl}/api/sms/getverificationcode/' + self.data.phoneNumber, [app.venueUrl]), {}, null, function (code, data) { if (code == 200) { @@ -309,7 +313,6 @@ Page({ } }, function (code, data) { - console.log(data) wx.showToast({ title: data.msg, icon: 'none', diff --git a/pages/center/center.js b/pages/center/center.js index 98033a9..46584e4 100644 --- a/pages/center/center.js +++ b/pages/center/center.js @@ -104,6 +104,14 @@ Page({ }, }) }, + /** + * 跳转到我的预订列表 + */ + toMyOrder: function() { + wx.navigateTo({ + url: '../order/order', + }) + }, /** * 跳转到我的志愿团队页面 */ diff --git a/pages/center/center.wxml b/pages/center/center.wxml index 6f06c29..2c7dbbd 100644 --- a/pages/center/center.wxml +++ b/pages/center/center.wxml @@ -11,6 +11,10 @@ 常用功能 + + + 我的预订 + 我的报名 diff --git a/pages/order/order.js b/pages/order/order.js index 8e1eeab..375b0a6 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -1,3 +1,4 @@ +var app = getApp(); // pages/order/order.js Page({ @@ -5,14 +6,52 @@ Page({ * 页面的初始数据 */ data: { + venueUrl : app.venueUrl, + imgRoute : '/route/file/downloadfile/true/', + token: '', + orderList:[], + page: 1, + rows: 10, + total: 0 + }, + //查询订单列表 + listOrderList: function() { + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/listpagemyticket', [app.venueUrl]), + {page: self.data.page,rows: self.data.rows}, {headers:{token : self.data.token}}, + function (code, data) { + data.rows.forEach(element => { + element.venuePanorama = element.venuePanorama.split(',')[0] + }); + self.setData({ + orderList: data.rows, + page: data.page, + total: data.total + }); + console.log(self.data.orderList); + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data + }) + this.listOrderList(); + } + }) }, /** diff --git a/pages/order/order.wxml b/pages/order/order.wxml index 5c54771..f8235c3 100644 --- a/pages/order/order.wxml +++ b/pages/order/order.wxml @@ -1,30 +1,17 @@ - + - + - 场馆场馆场馆场馆 - 篮球 + {{item.venuesName}} + {{item.projectName}} - 订单编号:01010101 - 下单时间:2020-01-01 - ¥15元 - - - - - - - - - 场馆场馆场馆场馆 - 篮球 - - 订单编号:01010101 - 下单时间:2020-01-01 - ¥15元 + 订单编号:{{item.serial}} + 下单时间:{{item.gmtCreate}} + ¥15元 + ¥{{item.price}}元 \ No newline at end of file From c058795ec733317698af8be13e502c8bebf42dbb Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Thu, 9 Jul 2020 19:19:23 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/order.wxml | 1 + pages/order/order.wxss | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pages/order/order.wxml b/pages/order/order.wxml index f8235c3..5024ecf 100644 --- a/pages/order/order.wxml +++ b/pages/order/order.wxml @@ -12,6 +12,7 @@ 下单时间:{{item.gmtCreate}} ¥15元 ¥{{item.price}}元 + 已过期 \ No newline at end of file diff --git a/pages/order/order.wxss b/pages/order/order.wxss index 039dc3a..bba20db 100644 --- a/pages/order/order.wxss +++ b/pages/order/order.wxss @@ -45,4 +45,11 @@ .price{ font-size: 32rpx; color:#9F1512; +} +.status{ + display: inline-block; + padding: 0 10rpx; + background: #DEDEDE; + color: #FFF; + font-size: 30rpx; } \ No newline at end of file From 3656764d80b5f1d0417300ee1e29ba691458e2e4 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Thu, 9 Jul 2020 23:40:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=92=8C=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/order.js | 14 +++- pages/order/order.wxml | 15 ++-- pages/orderDetail/orderDetail.js | 107 ++++++++++++++++++++++++++++- pages/orderDetail/orderDetail.wxml | 67 ++++++------------ 4 files changed, 148 insertions(+), 55 deletions(-) diff --git a/pages/order/order.js b/pages/order/order.js index 375b0a6..f19e0c9 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -30,7 +30,6 @@ Page({ page: data.page, total: data.total }); - console.log(self.data.orderList); }, function (code, data) { app.dialog.msg(data.msg); @@ -39,6 +38,17 @@ Page({ }) }, + //订单详情页 + toOrderDetail: function(options){ + var groundBookingId = options.currentTarget.dataset.id; + if(!groundBookingId){ + return false; + } + wx.navigateTo({ + url: '../orderDetail/orderDetail?groundBookingId=' + groundBookingId, + }) + }, + /** * 生命周期函数--监听页面加载 */ @@ -86,14 +96,12 @@ Page({ * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { - }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - }, /** diff --git a/pages/order/order.wxml b/pages/order/order.wxml index 5024ecf..a7e5539 100644 --- a/pages/order/order.wxml +++ b/pages/order/order.wxml @@ -1,5 +1,5 @@ - + @@ -10,9 +10,16 @@ 订单编号:{{item.serial}} 下单时间:{{item.gmtCreate}} - ¥15元 - ¥{{item.price}}元 - 已过期 + + ¥15元 + ¥{{item.price}}元 + + + 已取消 + + + 已过期 + \ No newline at end of file diff --git a/pages/orderDetail/orderDetail.js b/pages/orderDetail/orderDetail.js index 1fbd268..276c389 100644 --- a/pages/orderDetail/orderDetail.js +++ b/pages/orderDetail/orderDetail.js @@ -1,3 +1,4 @@ +var app = getApp(); // pages/orderDetail/orderDetail.js Page({ @@ -5,14 +6,118 @@ Page({ * 页面的初始数据 */ data: { + venueUrl : app.venueUrl, + imgRoute : '/route/file/downloadfile/true/', + token:'', + groundBookingId: '', + serial: '', + venuesName: '', + projectName: '', + venuePanorama: '', + gmtCreate: '', + price: '', + itemList:[], + cancelType: false, + }, + + //查询订单详情 + getDetail: function(){ + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/getmyticketdetail/{groundBookingId}', [app.venueUrl,self.data.groundBookingId]), + {}, {headers:{token : self.data.token}}, + function (code, data) { + self.setData({ + serial: data.data.serial, + venuesName: data.data.venuesName, + projectName: data.data.projectName, + venuePanorama: data.data.venuePanorama.split(',')[0], + gmtCreate: data.data.gmtCreate.substring(0,19), + itemList: data.data.itemDTOList, + cancelType: false + }) + var totalPrice = 0; + self.data.itemList.forEach(element => { + if(element.orderType != '1'){ + totalPrice += Number(element.price); + } + if(element.orderType == '0'){ + self.setData({ + cancelType: true + }) + } + }); + self.setData({ + price: totalPrice + }) + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + }, + //取消预订场次 + cancelItem: function(options){ + var self = this; + var bookingItemId = options.currentTarget.dataset.id; + var unCancelNum = 0; + self.data.itemList.forEach(element => { + if(element.orderType == '0'){ + unCancelNum++; + } + }); + //取消一个 + if(unCancelNum > 1){ + app.dialog.loading('请稍等'); + app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticketitem/{groundBookingId}/{bookingItemId}', + [app.venueUrl,self.data.groundBookingId,bookingItemId]), {}, {headers:{token : self.data.token}}, + function (code, data) { + self.getDetail(); + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + } + //取消全部 + if(unCancelNum <= 1){ + self.cancelAll(); + } + }, + + //全部取消 + cancelAll: function(){ + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticket/{groundBookingId}', + [app.venueUrl,self.data.groundBookingId]), {}, {headers:{token : self.data.token}}, + function (code, data) { + self.getDetail(); + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data, + groundBookingId: options.groundBookingId + }) + this.getDetail(); + } + }) }, /** diff --git a/pages/orderDetail/orderDetail.wxml b/pages/orderDetail/orderDetail.wxml index ec46aab..0839f96 100644 --- a/pages/orderDetail/orderDetail.wxml +++ b/pages/orderDetail/orderDetail.wxml @@ -1,67 +1,40 @@ - + - 场馆 + {{venuesName}} - 订单编号:123456789 + 订单编号:{{serial}} - 下单时间:10:10:10 + 下单时间:{{gmtCreate}} - - 价  格:15元 + + 价  格: - + + + 价  格: {{price}}元 - 预定详情 + {{projectName}}-预定详情 - + - 2020-01-01 - 12:00-13:00 + {{item.bookingOrderDate}} + {{item.timeStr}}-{{item.timeEnd}} - 场地1 - 15元 - 取消预定 - - - - - 2020-01-01 - 12:00-13:00 - - - 场地1 - 15元 - 已过期 - - - - - 2020-01-01 - 12:00-13:00 - - - 场地1 - 15元 - 已取消 - - - - - 2020-01-01 - 12:00-13:00 - - - 场地1 - 15元 - 取消预定 + {{item.groundName}} + 免费 + {{item.price}}元 + 取消预定 + 已取消 + 已过期 -全部取消 \ No newline at end of file +全部取消 \ No newline at end of file