From 822d50753cb98305c7c69a3590f4eebf2ec540d5 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Fri, 16 Nov 2018 19:49:04 +0800 Subject: [PATCH] =?UTF-8?q?chore[renard-wx]:=20=E6=B8=85=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renard-wx/app.json | 5 - renard-wx/pages/auth/login/login.js | 90 ------- renard-wx/pages/auth/login/login.wxml | 25 -- renard-wx/pages/auth/register/register.js | 174 ------------- renard-wx/pages/auth/register/register.json | 3 - renard-wx/pages/auth/register/register.wxml | 35 --- renard-wx/pages/auth/register/register.wxss | 69 ----- renard-wx/pages/auth/reset/reset.js | 151 ----------- renard-wx/pages/auth/reset/reset.json | 3 - renard-wx/pages/auth/reset/reset.wxml | 30 --- renard-wx/pages/auth/reset/reset.wxss | 68 ----- renard-wx/pages/topicComment/topicComment.js | 116 --------- .../pages/topicComment/topicComment.json | 3 - .../pages/topicComment/topicComment.wxml | 22 -- .../pages/topicComment/topicComment.wxss | 108 -------- .../topicCommentPost/topicCommentPost.js | 179 ------------- .../topicCommentPost/topicCommentPost.json | 3 - .../topicCommentPost/topicCommentPost.wxml | 55 ---- .../topicCommentPost/topicCommentPost.wxss | 246 ------------------ renard-wx/pages/topicDetail/topicDetail.js | 33 +-- renard-wx/pages/topicDetail/topicDetail.wxml | 31 --- .../pages/ucenter/footprint/footprint.js | 129 --------- .../pages/ucenter/footprint/footprint.json | 3 - .../pages/ucenter/footprint/footprint.wxml | 23 -- .../pages/ucenter/footprint/footprint.wxss | 125 --------- 25 files changed, 1 insertion(+), 1728 deletions(-) delete mode 100644 renard-wx/pages/auth/register/register.js delete mode 100644 renard-wx/pages/auth/register/register.json delete mode 100644 renard-wx/pages/auth/register/register.wxml delete mode 100644 renard-wx/pages/auth/register/register.wxss delete mode 100644 renard-wx/pages/auth/reset/reset.js delete mode 100644 renard-wx/pages/auth/reset/reset.json delete mode 100644 renard-wx/pages/auth/reset/reset.wxml delete mode 100644 renard-wx/pages/auth/reset/reset.wxss delete mode 100644 renard-wx/pages/topicComment/topicComment.js delete mode 100644 renard-wx/pages/topicComment/topicComment.json delete mode 100644 renard-wx/pages/topicComment/topicComment.wxml delete mode 100644 renard-wx/pages/topicComment/topicComment.wxss delete mode 100644 renard-wx/pages/topicCommentPost/topicCommentPost.js delete mode 100644 renard-wx/pages/topicCommentPost/topicCommentPost.json delete mode 100644 renard-wx/pages/topicCommentPost/topicCommentPost.wxml delete mode 100644 renard-wx/pages/topicCommentPost/topicCommentPost.wxss delete mode 100644 renard-wx/pages/ucenter/footprint/footprint.js delete mode 100644 renard-wx/pages/ucenter/footprint/footprint.json delete mode 100644 renard-wx/pages/ucenter/footprint/footprint.wxml delete mode 100644 renard-wx/pages/ucenter/footprint/footprint.wxss diff --git a/renard-wx/app.json b/renard-wx/app.json index f242c823..106db2de 100644 --- a/renard-wx/app.json +++ b/renard-wx/app.json @@ -7,21 +7,16 @@ "pages/ucenter/index/index", "pages/ucenter/address/address", "pages/ucenter/addressAdd/addressAdd", - "pages/ucenter/footprint/footprint", "pages/ucenter/order/order", "pages/ucenter/orderDetail/orderDetail", "pages/ucenter/coupon/coupon", "pages/ucenter/collect/collect", "pages/auth/login/login", - "pages/auth/register/register", - "pages/auth/reset/reset", "pages/payResult/payResult", "pages/comment/comment", "pages/commentPost/commentPost", "pages/topic/topic", - "pages/topicComment/topicComment", "pages/topicDetail/topicDetail", - "pages/topicCommentPost/topicCommentPost", "pages/brand/brand", "pages/brandDetail/brandDetail", "pages/search/search", diff --git a/renard-wx/pages/auth/login/login.js b/renard-wx/pages/auth/login/login.js index a64a2d2f..36592482 100644 --- a/renard-wx/pages/auth/login/login.js +++ b/renard-wx/pages/auth/login/login.js @@ -5,10 +5,6 @@ var user = require('../../../utils/user.js'); var app = getApp(); Page({ data: { - username: '', - password: '', - code: '', - loginErrorCount: 0 }, onLoad: function (options) { // 页面初始化 options为页面跳转所带来的参数 @@ -50,91 +46,5 @@ Page({ }); }); - }, - accountLogin: function () { - var that = this; - - if (this.data.password.length < 1 || this.data.username.length < 1) { - wx.showModal({ - title: '错误信息', - content: '请输入用户名和密码', - showCancel: false - }); - return false; - } - - wx.request({ - url: api.AuthLoginByAccount, - data: { - username: that.data.username, - password: that.data.password - }, - method: 'POST', - header: { - 'content-type': 'application/json' - }, - success: function (res) { - if (res.data.errno == 0){ - that.setData({ - loginErrorCount: 0 - }); - app.globalData.hasLogin = true; - wx.setStorageSync('userInfo', res.data.data.userInfo); - wx.setStorage({ - key:"token", - data: res.data.data.token, - success: function(){ - wx.switchTab({ - url: '/pages/ucenter/index/index' - }); - } - }); - } - else{ - that.setData({ - loginErrorCount: that.data.loginErrorCount + 1 - }); - app.globalData.hasLogin = false; - util.showErrorToast('账户登录失败'); - } - } - }); - }, - bindUsernameInput: function (e) { - - this.setData({ - username: e.detail.value - }); - }, - bindPasswordInput: function (e) { - - this.setData({ - password: e.detail.value - }); - }, - bindCodeInput: function (e) { - - this.setData({ - code: e.detail.value - }); - }, - clearInput: function (e) { - switch (e.currentTarget.id) { - case 'clear-username': - this.setData({ - username: '' - }); - break; - case 'clear-password': - this.setData({ - password: '' - }); - break; - case 'clear-code': - this.setData({ - code: '' - }); - break; - } } }) \ No newline at end of file diff --git a/renard-wx/pages/auth/login/login.wxml b/renard-wx/pages/auth/login/login.wxml index cc4f3796..f433e106 100644 --- a/renard-wx/pages/auth/login/login.wxml +++ b/renard-wx/pages/auth/login/login.wxml @@ -1,31 +1,6 @@ - - diff --git a/renard-wx/pages/auth/register/register.js b/renard-wx/pages/auth/register/register.js deleted file mode 100644 index cb0681ab..00000000 --- a/renard-wx/pages/auth/register/register.js +++ /dev/null @@ -1,174 +0,0 @@ -var api = require('../../../config/api.js'); -var check = require('../../../utils/check.js'); - -var app = getApp(); -Page({ - data: { - username: '', - password: '', - confirmPassword: '', - mobile: '', - code: '' - }, - onLoad: function (options) { - // 页面初始化 options为页面跳转所带来的参数 - // 页面渲染完成 - - }, - onReady: function () { - - }, - onShow: function () { - // 页面显示 - - }, - onHide: function () { - // 页面隐藏 - - }, - onUnload: function () { - // 页面关闭 - - }, - sendCode: function () { - wx.showModal({ - title: '注意', - content: '由于目前不支持手机短信发送,因此验证码任意值都可以', - showCancel: false - }); - }, - startRegister: function () { - var that = this; - - if (this.data.password.length < 3 || this.data.username.length < 3) { - wx.showModal({ - title: '错误信息', - content: '用户名和密码不得少于3位', - showCancel: false - }); - return false; - } - - if (this.data.password != this.data.confirmPassword) { - wx.showModal({ - title: '错误信息', - content: '确认密码不一致', - showCancel: false - }); - return false; - } - - if (this.data.mobile.length == 0 || this.data.code.length == 0) { - wx.showModal({ - title: '错误信息', - content: '手机号和验证码不能为空', - showCancel: false - }); - return false; - } - - if (!check.isValidPhone(this.data.mobile)) { - wx.showModal({ - title: '错误信息', - content: '手机号输入不正确', - showCancel: false - }); - return false; - } - - wx.request({ - url: api.AuthRegister, - data: { - username: that.data.username, - password: that.data.password, - mobile: that.data.mobile, - code: that.data.code - }, - method: 'POST', - header: { - 'content-type': 'application/json' - }, - success: function (res) { - if (res.data.errno == 0) { - app.globalData.hasLogin = true; - wx.setStorageSync('userInfo', res.data.data.userInfo); - wx.setStorage({ - key: "token", - data: res.data.data.token, - success: function () { - wx.switchTab({ - url: '/pages/ucenter/index/index' - }); - } - }); - } - else{ - wx.showModal({ - title: '错误信息', - content: res.data.errmsg, - showCancel: false - }); - } - } - }); - }, - bindUsernameInput: function (e) { - - this.setData({ - username: e.detail.value - }); - }, - bindPasswordInput: function (e) { - - this.setData({ - password: e.detail.value - }); - }, - bindConfirmPasswordInput: function (e) { - - this.setData({ - confirmPassword: e.detail.value - }); - }, - bindMobileInput: function (e) { - - this.setData({ - mobile: e.detail.value - }); - }, - bindCodeInput: function (e) { - - this.setData({ - code: e.detail.value - }); - }, - clearInput: function (e) { - switch (e.currentTarget.id) { - case 'clear-username': - this.setData({ - username: '' - }); - break; - case 'clear-password': - this.setData({ - password: '' - }); - break; - case 'clear-confirm-password': - this.setData({ - confirmPassword: '' - }); - break; - case 'clear-mobile': - this.setData({ - mobile: '' - }); - break; - case 'clear-code': - this.setData({ - code: '' - }); - break; - } - } -}) \ No newline at end of file diff --git a/renard-wx/pages/auth/register/register.json b/renard-wx/pages/auth/register/register.json deleted file mode 100644 index 3de30889..00000000 --- a/renard-wx/pages/auth/register/register.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "注册" -} \ No newline at end of file diff --git a/renard-wx/pages/auth/register/register.wxml b/renard-wx/pages/auth/register/register.wxml deleted file mode 100644 index 5d245aea..00000000 --- a/renard-wx/pages/auth/register/register.wxml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 获取验证码 - - - - - - \ No newline at end of file diff --git a/renard-wx/pages/auth/register/register.wxss b/renard-wx/pages/auth/register/register.wxss deleted file mode 100644 index bd1d7f28..00000000 --- a/renard-wx/pages/auth/register/register.wxss +++ /dev/null @@ -1,69 +0,0 @@ -.form-box{ - width: 100%; - height: auto; - overflow: hidden; - padding: 0 40rpx; - margin-top: 96rpx; - background: #fff; -} - -.form-item{ - position: relative; - background: #fff; - height: 96rpx; - border-bottom: 1px solid #a78845; -} - -.form-item .username, .form-item .password, .form-item .mobile, .form-item .code{ - position: absolute; - top: 26rpx; - left: 0; - display: block; - width: 100%; - height: 44rpx; - background: #fff; - color: #a78845; - font-size: 30rpx; -} - -.form-item-code{ - margin-top:32rpx; - height: auto; - overflow: hidden; - width: 100%; -} - -.form-item-code .form-item{ - float: left; - width: 350rpx; -} - -.form-item-code .code-btn{ - float: right; - padding: 20rpx 40rpx; - border: 1px solid #d9d9d9; - color: #a78845; - border-radius: 10rpx; -} - -.form-item .clear{ - position: absolute; - top: 26rpx; - right: 18rpx; - z-index: 2; - display: block; - background: #fff; - height: 44rpx; - width: 44rpx; -} - -.register-btn{ - margin: 60rpx 0 40rpx 0; - height: 96rpx; - line-height: 96rpx; - color: #a78845; - font-size: 30rpx; - width: 100%; - background: #b4282d; - border-radius: 6rpx; -} \ No newline at end of file diff --git a/renard-wx/pages/auth/reset/reset.js b/renard-wx/pages/auth/reset/reset.js deleted file mode 100644 index 0c3a6904..00000000 --- a/renard-wx/pages/auth/reset/reset.js +++ /dev/null @@ -1,151 +0,0 @@ -var api = require('../../../config/api.js'); -var check = require('../../../utils/check.js'); - -var app = getApp(); -Page({ - data: { - mobile: '', - code: '', - password: '', - confirmPassword: '' - }, - onLoad: function (options) { - // 页面初始化 options为页面跳转所带来的参数 - // 页面渲染完成 - - }, - onReady: function () { - - }, - onShow: function () { - // 页面显示 - - }, - onHide: function () { - // 页面隐藏 - - }, - onUnload: function () { - // 页面关闭 - - }, - sendCode: function () { - wx.showModal({ - title: '注意', - content: '由于目前不支持手机短信发送,因此验证码任意值都可以', - showCancel: false - }); - }, - startReset: function(){ - var that = this; - - if (this.data.mobile.length == 0 || this.data.code.length == 0) { - wx.showModal({ - title: '错误信息', - content: '手机号和验证码不能为空', - showCancel: false - }); - return false; - } - - if (!check.isValidPhone(this.data.mobile)) { - wx.showModal({ - title: '错误信息', - content: '手机号输入不正确', - showCancel: false - }); - return false; - } - - if (this.data.password.length < 3) { - wx.showModal({ - title: '错误信息', - content: '用户名和密码不得少于3位', - showCancel: false - }); - return false; - } - - if (this.data.password != this.data.confirmPassword) { - wx.showModal({ - title: '错误信息', - content: '确认密码不一致', - showCancel: false - }); - return false; - } - - wx.request({ - url: api.AuthReset, - data: { - mobile: that.data.mobile, - code: that.data.code, - password: that.data.password - }, - method: 'POST', - header: { - 'content-type': 'application/json' - }, - success: function (res) { - if (res.data.errno == 0) { - wx.navigateBack(); - } - else{ - wx.showModal({ - title: '密码重置失败', - content: res.data.errmsg, - showCancel: false - }); - } - } - }); - }, - bindPasswordInput: function (e) { - - this.setData({ - password: e.detail.value - }); - }, - bindConfirmPasswordInput: function (e) { - - this.setData({ - confirmPassword: e.detail.value - }); - }, - bindMobileInput: function (e) { - - this.setData({ - mobile: e.detail.value - }); - }, - bindCodeInput: function(e){ - - this.setData({ - code: e.detail.value - }); - }, - clearInput: function(e){ - switch (e.currentTarget.id){ - case 'clear-password': - this.setData({ - password: '' - }); - break; - case 'clear-confirm-password': - this.setData({ - confirmPassword: '' - }); - break; - case 'clear-mobile': - this.setData({ - mobile: '' - }); - break; - case 'clear-code': - this.setData({ - code: '' - }); - break; - } - } -}) \ No newline at end of file diff --git a/renard-wx/pages/auth/reset/reset.json b/renard-wx/pages/auth/reset/reset.json deleted file mode 100644 index 1292cd1b..00000000 --- a/renard-wx/pages/auth/reset/reset.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "密码重置" -} \ No newline at end of file diff --git a/renard-wx/pages/auth/reset/reset.wxml b/renard-wx/pages/auth/reset/reset.wxml deleted file mode 100644 index 35f29cf3..00000000 --- a/renard-wx/pages/auth/reset/reset.wxml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - 获取验证码 - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/renard-wx/pages/auth/reset/reset.wxss b/renard-wx/pages/auth/reset/reset.wxss deleted file mode 100644 index 94fca0b8..00000000 --- a/renard-wx/pages/auth/reset/reset.wxss +++ /dev/null @@ -1,68 +0,0 @@ -.form-box{ - width: 100%; - height: auto; - overflow: hidden; - padding: 0 40rpx; - margin-top: 96rpx; - background: #fff; -} - -.form-item{ - position: relative; - background: #fff; - height: 96rpx; - border-bottom: 1px solid #d9d9d9; -} - -.form-item .mobile, .form-item .password, .form-item .code{ - position: absolute; - top: 26rpx; - left: 0; - display: block; - width: 100%; - height: 44rpx; - background: #fff; - color: #333; - font-size: 30rpx; -} - -.form-item-code{ - margin-top:32rpx; - height: auto; - overflow: hidden; - width: 100%; -} - -.form-item-code .form-item{ - float: left; - width: 350rpx; -} - -.form-item-code .code-btn{ - float: right; - padding: 20rpx 40rpx; - border: 1px solid #d9d9d9; - border-radius: 10rpx; -} - -.form-item .clear{ - position: absolute; - top: 26rpx; - right: 18rpx; - z-index: 2; - display: block; - background: #fff; - height: 44rpx; - width: 44rpx; -} - -.reset-btn{ - margin: 60rpx 0 40rpx 0; - height: 96rpx; - line-height: 96rpx; - color: #fff; - font-size: 30rpx; - width: 100%; - background: #b4282d; - border-radius: 6rpx; -} \ No newline at end of file diff --git a/renard-wx/pages/topicComment/topicComment.js b/renard-wx/pages/topicComment/topicComment.js deleted file mode 100644 index d03cf5c8..00000000 --- a/renard-wx/pages/topicComment/topicComment.js +++ /dev/null @@ -1,116 +0,0 @@ -var app = getApp(); -var util = require('../../utils/util.js'); - -var api = require('../../config/api.js'); - -Page({ - data: { - comments: [], - allCommentList: [], - picCommentList: [], - type: 0, - valueId: 0, - showType: 0, - allCount: 0, - hasPicCount: 0, - allPage: 1, - picPage: 1, - size: 20 - }, - getCommentCount: function () { - let that = this; - util.request(api.CommentCount, { valueId: that.data.valueId, type: that.data.type}).then(function (res) { - if (res.errno === 0) { - - that.setData({ - allCount: res.data.allCount, - hasPicCount: res.data.hasPicCount - }); - } - }); - }, - getCommentList: function(){ - let that = this; - util.request(api.CommentList, { - valueId: that.data.valueId, - type: that.data.type, - size: that.data.size, - page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), - showType: that.data.showType - }).then(function (res) { - if (res.errno === 0) { - - if (that.data.showType == 0) { - that.setData({ - allCommentList: that.data.allCommentList.concat(res.data.data), - allPage: res.data.currentPage, - comments: that.data.allCommentList.concat(res.data.data) - }); - } else { - that.setData({ - picCommentList: that.data.picCommentList.concat(res.data.data), - picPage: res.data.currentPage, - comments: that.data.picCommentList.concat(res.data.data) - }); - } - } - }); - }, - onLoad: function (options) { - // 页面初始化 options为页面跳转所带来的参数 - this.setData({ - type: options.type, - valueId: options.valueId - }); - this.getCommentCount(); - this.getCommentList(); - }, - onReady: function () { - // 页面渲染完成 - - }, - onShow: function () { - // 页面显示 - - }, - onHide: function () { - // 页面隐藏 - - }, - onUnload: function () { - // 页面关闭 - - }, - switchTab: function () { - this.setData({ - showType: this.data.showType == 1 ? 0 :1 - }); - - this.getCommentList(); - }, - onReachBottom: function(){ - console.log('onPullDownRefresh'); - if ( this.data.showType == 0) { - - if (this.data.allCount / this.data.size < this.data.allPage) { - return false; - } - - this.setData({ - 'allPage' : this.data.allPage + 1 - }); - } else { - if (this.data.hasPicCount / this.data.size < this.data.picPage) { - return false; - } - - this.setData({ - 'picPage': this.data.picPage + 1 - }); - } - - - - this.getCommentList(); - } -}) \ No newline at end of file diff --git a/renard-wx/pages/topicComment/topicComment.json b/renard-wx/pages/topicComment/topicComment.json deleted file mode 100644 index eee523f9..00000000 --- a/renard-wx/pages/topicComment/topicComment.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "评论" -} \ No newline at end of file diff --git a/renard-wx/pages/topicComment/topicComment.wxml b/renard-wx/pages/topicComment/topicComment.wxml deleted file mode 100644 index 89d3cf9b..00000000 --- a/renard-wx/pages/topicComment/topicComment.wxml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - {{item.userInfo.nickName}} - - {{item.addTime}} - - {{item.content}} - - - - - - - - \ No newline at end of file diff --git a/renard-wx/pages/topicComment/topicComment.wxss b/renard-wx/pages/topicComment/topicComment.wxss deleted file mode 100644 index 76f2a1d0..00000000 --- a/renard-wx/pages/topicComment/topicComment.wxss +++ /dev/null @@ -1,108 +0,0 @@ -.comments{ - width: 100%; - height: auto; - padding-left:30rpx; - background: #fff; - margin: 20rpx 0; -} - -.comments .b{ - height: auto; - width: 720rpx; -} - -.comments .b.no-h{ - margin-top: 0; -} - -.comments .item{ - height: auto; - width: 720rpx; - overflow: hidden; - border-bottom: 1px solid #d9d9d9; - padding-bottom: 25rpx; -} - -.comments .info{ - height: 127rpx; - width: 100%; - padding: 33rpx 0 27rpx 0; -} - -.comments .user{ - float: left; - width: auto; - height: 67rpx; - line-height: 67rpx; - font-size: 0; -} - -.comments .user image{ - float: left; - width: 67rpx; - height: 67rpx; - margin-right: 17rpx; - border-radius: 50%; -} - -.comments .user text{ - display: inline-block; - width: auto; - height: 66rpx; - overflow: hidden; - font-size: 29rpx; - line-height: 66rpx; -} - -.comments .time{ - display: block; - float: right; - width: auto; - height: 67rpx; - line-height: 67rpx; - color: #7f7f7f; - font-size: 25rpx; - margin-right: 30rpx; -} - -.comments .comment{ - width: 720rpx; - padding-right: 30rpx; - line-height: 45.8rpx; - font-size: 29rpx; - margin-bottom: 16rpx; -} - -.comments .imgs{ - width: 720rpx; - height: 150rpx; - margin-bottom: 25rpx; -} - -.comments .imgs .img{ - height: 150rpx; - width: 150rpx; - margin-right: 28rpx; -} - -.comments .customer-service{ - width: 690rpx; - height: auto; - overflow: hidden; - margin-top: 23rpx; - background: rgba(0,0,0,.03); - padding: 21rpx; -} - - -.comments .customer-service .u{ - font-size: 24rpx; - color: #333; - line-height: 37.5rpx; -} - -.comments .customer-service .c{ - font-size: 24rpx; - color: #999; - line-height: 37.5rpx; -} \ No newline at end of file diff --git a/renard-wx/pages/topicCommentPost/topicCommentPost.js b/renard-wx/pages/topicCommentPost/topicCommentPost.js deleted file mode 100644 index d463749e..00000000 --- a/renard-wx/pages/topicCommentPost/topicCommentPost.js +++ /dev/null @@ -1,179 +0,0 @@ -// 上传组件 基于https://github.com/Tencent/weui-wxss/tree/master/src/example/uploader -var app = getApp(); -var util = require('../../utils/util.js'); -var api = require('../../config/api.js'); -Page({ - data: { - valueId: 0, - topic: {}, - content: '', - stars: [0, 1, 2, 3, 4], - star: 5, - starText: '十分满意', - hasPicture: false, - picUrls: [], - files: [] - }, - chooseImage: function (e) { - if (this.data.files.length >= 5) { - util.showErrorToast('只能上传五张图片') - return false; - } - - var that = this; - wx.chooseImage({ - count: 1, - sizeType: ['original', 'compressed'], - sourceType: ['album', 'camera'], - success: function (res) { - that.setData({ - files: that.data.files.concat(res.tempFilePaths) - }); - that.upload(res); - } - }) - }, - upload: function (res) { - var that = this; - const uploadTask = wx.uploadFile({ - url: api.StorageUpload, - filePath: res.tempFilePaths[0], - name: 'file', - success: function (res) { - var _res = JSON.parse(res.data); - if (_res.errno === 0) { - var url = _res.data.url - that.data.picUrls.push(url) - that.setData({ - hasPicture: true, - picUrls: that.data.picUrls - }) - } - }, - fail: function (e) { - wx.showModal({ - title: '错误', - content: '上传失败', - showCancel: false - }) - }, - }) - - uploadTask.onProgressUpdate((res) => { - console.log('上传进度', res.progress) - console.log('已经上传的数据长度', res.totalBytesSent) - console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend) - }) - - }, - previewImage: function (e) { - wx.previewImage({ - current: e.currentTarget.id, // 当前显示图片的http链接 - urls: this.data.files // 需要预览的图片http链接列表 - }) - }, - selectRater: function (e) { - var star = e.currentTarget.dataset.star + 1; - var starText; - if (star == 1) { - starText = '很差'; - } - else if (star == 2) { - starText = '不太满意'; - } - else if (star == 3) { - starText = '满意'; - } - else if (star == 4) { - starText = '比较满意'; - } - else { - starText = '十分满意' - } - this.setData({ - star: star, - starText: starText - }) - - }, - onLoad: function (options) { - if (parseInt(options.type) !== 1){ - return; - } - - var that = this; - that.setData({ - valueId: options.valueId - }); - this.getTopic(); - }, - getTopic: function () { - let that = this; - util.request(api.TopicDetail, { id: that.data.valueId }).then(function (res) { - if (res.errno === 0) { - - that.setData({ - topic: res.data, - }); - - } - }); - }, - onClose: function () { - wx.navigateBack(); - }, - onPost: function () { - let that = this; - - if (!this.data.content) { - util.showErrorToast('请填写评论') - return false; - } - - util.request(api.CommentPost, { - type: 1, - valueId: that.data.valueId, - content: that.data.content, - star: that.data.star, - hasPicture: that.data.hasPicture, - picUrls: that.data.picUrls - }, 'POST').then(function (res) { - if (res.errno === 0) { - wx.showToast({ - title: '评论成功', - complete: function () { - wx.navigateBack(); - } - }) - } - }); - }, - bindInputValue(event) { - - let value = event.detail.value; - - //判断是否超过140个字符 - if (value && value.length > 140) { - return false; - } - - this.setData({ - content: event.detail.value, - }) - }, - onReady: function () { - - }, - onShow: function () { - // 页面显示 - - }, - onHide: function () { - // 页面隐藏 - - }, - onUnload: function () { - // 页面关闭 - - } -}) \ No newline at end of file diff --git a/renard-wx/pages/topicCommentPost/topicCommentPost.json b/renard-wx/pages/topicCommentPost/topicCommentPost.json deleted file mode 100644 index eee523f9..00000000 --- a/renard-wx/pages/topicCommentPost/topicCommentPost.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "评论" -} \ No newline at end of file diff --git a/renard-wx/pages/topicCommentPost/topicCommentPost.wxml b/renard-wx/pages/topicCommentPost/topicCommentPost.wxml deleted file mode 100644 index db6f2acb..00000000 --- a/renard-wx/pages/topicCommentPost/topicCommentPost.wxml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - {{topic.title}} - - {{topic.subtitle}} - - - - 评分 - - - - - {{starText}} - - -