Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
822d5075
Commit
822d5075
authored
Nov 16, 2018
by
Junling Bu
Browse files
chore[renard-wx]: 清理代码,删除不必要的组件。
parent
5a981060
Changes
25
Hide whitespace changes
Inline
Side-by-side
renard-wx/app.json
View file @
822d5075
...
...
@@ -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"
,
...
...
renard-wx/pages/auth/login/login.js
View file @
822d5075
...
...
@@ -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
renard-wx/pages/auth/login/login.wxml
View file @
822d5075
<view class="container">
<view class="form-box">
<!-- <view class="form-item">
<input class="username" value="{{username}}" bindinput="bindUsernameInput" placeholder="账号"/>
<image wx:if="{{ username.length > 0 }}" id="clear-username" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item">
<input class="password" value="{{password}}" password bindinput="bindPasswordInput" placeholder="密码"/>
<image class="clear" id="clear-password" wx:if="{{ password.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item-code" wx-if="{{loginErrorCount >= 3}}">
<view class="form-item code-item">
<input class="code" value="{{code}}" bindinput="bindCodeInput" placeholder="验证码"/>
<image class="clear" id="clear-code" wx:if="{{ code.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<image class="code-img" src="https://dl.reg.163.com/cp?pd=yanxuan_web&pkid=SkeBZeG&random=1489903563234"></image>
</view>
<button type="default" class="login-btn" bindtap="accountLogin">账号登录</button>
<view class="form-item-text">
<navigator url="/pages/auth/register/register" class="register">注册账号</navigator>
<navigator url="/pages/auth/reset/reset" class="reset">忘记密码</navigator>
</view> -->
<button type="primary" open-type="getUserInfo" class="login-btn" bindgetuserinfo="wxLogin">微信直接登录</button>
</view>
...
...
renard-wx/pages/auth/register/register.js
deleted
100644 → 0
View file @
5a981060
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
renard-wx/pages/auth/register/register.json
deleted
100644 → 0
View file @
5a981060
{
"navigationBarTitleText"
:
"注册"
}
\ No newline at end of file
renard-wx/pages/auth/register/register.wxml
deleted
100644 → 0
View file @
5a981060
<view class="container">
<view class="form-box">
<view class="form-item">
<input class="username" value="{{username}}" bindinput="bindUsernameInput" placeholder="用户名" auto-focus/>
<image wx:if="{{ username.length > 0 }}" id="clear-username" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item">
<input class="password" value="{{password}}" password bindinput="bindPasswordInput" placeholder="密码"/>
<image class="clear" id="clear-password" wx:if="{{ password.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item">
<input class="password" value="{{confirmPassword}}" password bindinput="bindConfirmPasswordInput" placeholder="确认密码"/>
<image class="clear" id="clear-confirm-password" wx:if="{{ confirmPassword.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item">
<input class="mobile" value="{{mobile}}" bindinput="bindMobileInput" placeholder="手机号" />
<image wx:if="{{ mobile.length > 0 }}" id="clear-mobile" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item-code" >
<view class="form-item code-item">
<input class="code" value="{{code}}" bindinput="bindCodeInput" placeholder="验证码"/>
<image class="clear" id="clear-code" wx:if="{{ code.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="code-btn" bindtap="sendCode">获取验证码</view>
</view>
<button type="default" class="register-btn" bindtap="startRegister">注册</button>
</view>
</view>
\ No newline at end of file
renard-wx/pages/auth/register/register.wxss
deleted
100644 → 0
View file @
5a981060
.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
renard-wx/pages/auth/reset/reset.js
deleted
100644 → 0
View file @
5a981060
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
renard-wx/pages/auth/reset/reset.json
deleted
100644 → 0
View file @
5a981060
{
"navigationBarTitleText"
:
"密码重置"
}
\ No newline at end of file
renard-wx/pages/auth/reset/reset.wxml
deleted
100644 → 0
View file @
5a981060
<view class="container">
<view class="form-box">
<view class="form-item">
<input class="mobile" value="{{mobile}}" bindinput="bindMobileInput" placeholder="手机号" />
<image wx:if="{{ mobile.length > 0 }}" id="clear-mobile" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item-code">
<view class="form-item code-item">
<input class="code" value="{{code}}" bindinput="bindCodeInput" placeholder="验证码" />
<image class="clear" id="clear-code" wx:if="{{ code.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="code-btn" bindtap="sendCode">获取验证码</view>
</view>
<view class="form-item">
<input class="password" value="{{password}}" password bindinput="bindPasswordInput" placeholder="密码" />
<image class="clear" id="clear-password" wx:if="{{ password.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<view class="form-item">
<input class="password" value="{{confirmPassword}}" password bindinput="bindConfirmPasswordInput" placeholder="确认密码" />
<image class="clear" id="clear-confirm-password" wx:if="{{ confirmPassword.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
<button type="default" class="reset-btn" bindtap="startReset">密码重置</button>
</view>
</view>
\ No newline at end of file
renard-wx/pages/auth/reset/reset.wxss
deleted
100644 → 0
View file @
5a981060
.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
renard-wx/pages/topicComment/topicComment.js
deleted
100644 → 0
View file @
5a981060
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
renard-wx/pages/topicComment/topicComment.json
deleted
100644 → 0
View file @
5a981060
{
"navigationBarTitleText"
:
"评论"
}
\ No newline at end of file
renard-wx/pages/topicComment/topicComment.wxml
deleted
100644 → 0
View file @
5a981060
<view class="comments">
<view class="b">
<view class="item" wx:for="{{comments}}" wx:key="id">
<view class="info">
<view class="user">
<image src="{{item.userInfo.avatarUrl}}"></image>
<text>{{item.userInfo.nickName}}</text>
</view>
<view class="time">{{item.addTime}}</view>
</view>
<view class="comment">{{item.content}}</view>
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="id" wx:for-item="pitem" src="{{pitem.picUrl}}"></image>
</view>
<!--<view class="customer-service" wx:if="{{item.commentReplyVO}}">
<text class="u">小选回复:</text>
<text class="c">{{item.commentReplyVO.replyContent}}</text>
</view>-->
</view>
</view>
</view>
\ No newline at end of file
renard-wx/pages/topicComment/topicComment.wxss
deleted
100644 → 0
View file @
5a981060
.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
renard-wx/pages/topicCommentPost/topicCommentPost.js
deleted
100644 → 0
View file @
5a981060
// 上传组件 基于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
renard-wx/pages/topicCommentPost/topicCommentPost.json
deleted
100644 → 0
View file @
5a981060
{
"navigationBarTitleText"
:
"评论"
}
\ No newline at end of file
renard-wx/pages/topicCommentPost/topicCommentPost.wxml
deleted
100644 → 0
View file @
5a981060
<view class="container">
<view class="post-comment">
<view class="goods">
<view class="img">
<image src="{{topic.picUrl}}"></image>
</view>
<view class="info">
<view class="t">
<text class="name">{{topic.title}}</text>
</view>
<view class="attr">{{topic.subtitle}}</view>
</view>
</view>
<view class="rater">
<text class="rater-title">评分</text>
<block wx:for="{{stars}}" wx:key="*this" wx:for-item="item">
<image src="/static/images/icon_collect_checked.png" bindtap="selectRater" data-star="{{item}}" wx:if="{{item < star}}"></image>
<image src="/static/images/icon_collect.png" bindtap="selectRater" data-star="{{item}}" wx:else></image>
</block>
<text class="rater-desc">{{starText}}</text>
</view>
<view class="input-box">
<textarea class="content" focus="true" bindinput="bindInputValue" maxlength="140" placeholder="留言经过筛选后,对所有人可见" />
<text class="count">{{140 - content.length}}</text>
</view>
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">图片上传</view>
<view class="weui-uploader__info">{{picUrls.length}}/{{files.length}}</view>
</view>
<view class="weui-uploader__bd">
<view class="weui-uploader__files" id="uploaderFiles">
<block wx:for="{{files}}" wx:key="*this">
<view class="weui-uploader__file" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
</view>
<!-- <view class="weui-uploader__file weui-uploader__file_status" bindtap="previewImage" id="{{item}}">
<image class="weui-uploader__img" src="{{item}}" mode="aspectFill" />
<view class="weui-uploader__file-content">50%</view>
</view> -->
</block>
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="chooseImage"></view>
</view>
</view>
</view>
</view>
<view class="btns">
<view class="close" bindtap="onClose">取消</view>
<view class="post" bindtap="onPost">发表</view>
</view>
</view>
</view>
\ No newline at end of file
renard-wx/pages/topicCommentPost/topicCommentPost.wxss
deleted
100644 → 0
View file @
5a981060
page, .container {
height: 100%;
background: #f4f4f4;
}
.post-comment {
width: 750rpx;
height: auto;
overflow: hidden;
padding: 30rpx;
background: #fff;
}
.post-comment .goods {
display: flex;
align-items: center;
height: 199rpx;
margin-left: 31.25rpx;
}
.post-comment .goods .img {
height: 145.83rpx;
width: 145.83rpx;
background: #f4f4f4;
}
.post-comment .goods .img image {
height: 145.83rpx;
width: 145.83rpx;
}
.post-comment .goods .info {
height: 145.83rpx;
flex: 1;
padding-left: 20rpx;
}
.post-comment .goods .name {
margin-top: 30rpx;
display: block;
height: 44rpx;
line-height: 44rpx;
color: #333;
font-size: 30rpx;
}
.post-comment .goods .number {
display: block;
height: 37rpx;
line-height: 37rpx;
color: #666;
font-size: 25rpx;
}
.post-comment .goods .status {
width: 105rpx;
color: #b4282d;
font-size: 25rpx;
}
.post-comment .rater {
display: flex;
flex-direction: row;
height: 55rpx;
}
.post-comment .rater .rater-title {
font-size: 29rpx;
padding-right: 10rpx;
}
.post-comment .rater image {
padding-left: 5rpx;
height: 50rpx;
width: 50rpx;
}
.post-comment .rater .rater-desc {
font-size: 29rpx;
padding-left: 10rpx;
}
.post-comment .input-box {
height: 337.5rpx;
width: 690rpx;
position: relative;
background: #fff;
}
.post-comment .input-box .content {
position: absolute;
top: 0;
left: 0;
display: block;
background: #fff;
font-size: 29rpx;
border: 5px solid #f4f4f4;
height: 300rpx;
width: 650rpx;
padding: 20rpx;
}
.post-comment .input-box .count {
position: absolute;
bottom: 20rpx;
right: 20rpx;
display: block;
height: 30rpx;
width: 50rpx;
font-size: 29rpx;
color: #999;
}
.post-comment .btns {
height: 108rpx;
}
.post-comment .close {
float: left;
height: 108rpx;
line-height: 108rpx;
text-align: left;
color: #666;
padding: 0 30rpx;
}
.post-comment .post {
float: right;
height: 108rpx;
line-height: 108rpx;
text-align: right;
padding: 0 30rpx;
}
.weui-uploader {
margin-top: 50rpx;
}
.weui-uploader__hd {
display: -webkit-box;
display: -webkit-flex;
display: flex;
padding-bottom: 10px;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.weui-uploader__title {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.weui-uploader__info {
color: #b2b2b2;
}
.weui-uploader__bd {
margin-bottom: -4px;
margin-right: -9px;
overflow: hidden;
}
.weui-uploader__file {
float: left;
margin-right: 9px;
margin-bottom: 9px;
}
.weui-uploader__img {
display: block;
width: 79px;
height: 79px;
}
.weui-uploader__file_status {
position: relative;
}
.weui-uploader__file_status:before {
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
}
.weui-uploader__file-content {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #fff;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 77px;
height: 77px;
border: 1px solid #d9d9d9;
}
.weui-uploader__input-box:after, .weui-uploader__input-box:before {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.weui-uploader__input-box:before {
width: 2px;
height: 39.5px;
}
.weui-uploader__input-box:after {
width: 39.5px;
height: 2px;
}
.weui-uploader__input-box:active {
border-color: #999;
}
.weui-uploader__input-box:active:after, .weui-uploader__input-box:active:before {
background-color: #999;
}
.weui-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
renard-wx/pages/topicDetail/topicDetail.js
View file @
822d5075
...
...
@@ -7,9 +7,7 @@ Page({
data
:
{
id
:
0
,
topic
:
{},
topicList
:
[],
commentCount
:
0
,
commentList
:
[]
topicList
:
[]
},
onShareAppMessage
:
function
()
{
...
...
@@ -50,35 +48,6 @@ Page({
}
});
},
getCommentList
()
{
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
id
,
type
:
1
,
showType
:
0
,
page
:
1
,
size
:
5
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
commentList
:
res
.
data
.
data
,
commentCount
:
res
.
data
.
count
});
}
});
},
postComment
()
{
if
(
!
app
.
globalData
.
hasLogin
)
{
wx
.
navigateTo
({
url
:
"
/pages/auth/login/login
"
});
}
else
{
wx
.
navigateTo
({
url
:
'
/pages/topicCommentPost/topicCommentPost?valueId=
'
+
this
.
data
.
id
+
'
&type=1
'
,
})
}
},
onReady
:
function
()
{
},
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment