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
20b97ec8
Commit
20b97ec8
authored
Nov 16, 2018
by
Junling Bu
Browse files
chore[litemall-wx]: 使用微信开发者工具的格式化代码
parent
822d5075
Changes
102
Show whitespace changes
Inline
Side-by-side
litemall-wx/app.js
View file @
20b97ec8
...
@@ -3,13 +3,13 @@ var api = require('./config/api.js');
...
@@ -3,13 +3,13 @@ var api = require('./config/api.js');
var
user
=
require
(
'
./utils/user.js
'
);
var
user
=
require
(
'
./utils/user.js
'
);
App
({
App
({
onLaunch
:
function
()
{
onLaunch
:
function
()
{
const
updateManager
=
wx
.
getUpdateManager
();
const
updateManager
=
wx
.
getUpdateManager
();
wx
.
getUpdateManager
().
onUpdateReady
(
function
()
{
wx
.
getUpdateManager
().
onUpdateReady
(
function
()
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
更新提示
'
,
title
:
'
更新提示
'
,
content
:
'
新版本已经准备好,是否重启应用?
'
,
content
:
'
新版本已经准备好,是否重启应用?
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager
.
applyUpdate
()
updateManager
.
applyUpdate
()
...
@@ -18,7 +18,7 @@ App({
...
@@ -18,7 +18,7 @@ App({
})
})
})
})
},
},
onShow
:
function
(
options
)
{
onShow
:
function
(
options
)
{
user
.
checkLogin
().
then
(
res
=>
{
user
.
checkLogin
().
then
(
res
=>
{
this
.
globalData
.
hasLogin
=
true
;
this
.
globalData
.
hasLogin
=
true
;
}).
catch
(()
=>
{
}).
catch
(()
=>
{
...
...
litemall-wx/app.json
View file @
20b97ec8
litemall-wx/app.wxss
View file @
20b97ec8
/**app.wxss**/
/**app.wxss**/
.container {
.container {
box-sizing: border-box;
box-sizing: border-box;
background-color: #f4f4f4;
background-color: #f4f4f4;
font-family: PingFangSC-Light,helvetica,'Heiti SC';
font-family: PingFangSC-Light,
helvetica,
'Heiti SC';
}
}
view,image,text,navigator{
view,
image,
text,
navigator
{
box-sizing: border-box;
box-sizing: border-box;
padding:0;
padding: 0;
margin:0;
margin: 0;
}
}
view,text{
view,
text
{
font-family: PingFangSC-Light,helvetica,'Heiti SC';
font-family: PingFangSC-Light,
helvetica,
'Heiti SC';
font-size: 29rpx;
font-size: 29rpx;
color: #333;
color: #333;
}
}
litemall-wx/config/api.js
View file @
20b97ec8
// 以下是业务服务器API地址
// 以下是业务服务器API地址
// 本机开发时使用
// 本机开发时使用
var
WxApiRoot
=
'
http://localhost:8080/wx/
'
;
var
WxApiRoot
=
'
http://localhost:8080/wx/
'
;
// 局域网测试使用
// 局域网测试使用
// var WxApiRoot = 'http://192.168.0.101:8080/wx/';
// var WxApiRoot = 'http://192.168.0.101:8080/wx/';
// 云平台部署时使用
// 云平台部署时使用
...
...
litemall-wx/pages/auth/accountLogin/accountLogin.js
View file @
20b97ec8
...
@@ -10,26 +10,26 @@ Page({
...
@@ -10,26 +10,26 @@ Page({
code
:
''
,
code
:
''
,
loginErrorCount
:
0
loginErrorCount
:
0
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
// 页面渲染完成
},
},
onReady
:
function
()
{
onReady
:
function
()
{
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
},
},
accountLogin
:
function
()
{
accountLogin
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
this
.
data
.
password
.
length
<
1
||
this
.
data
.
username
.
length
<
1
)
{
if
(
this
.
data
.
password
.
length
<
1
||
this
.
data
.
username
.
length
<
1
)
{
...
@@ -51,24 +51,23 @@ Page({
...
@@ -51,24 +51,23 @@ Page({
header
:
{
header
:
{
'
content-type
'
:
'
application/json
'
'
content-type
'
:
'
application/json
'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
.
errno
==
0
){
if
(
res
.
data
.
errno
==
0
)
{
that
.
setData
({
that
.
setData
({
loginErrorCount
:
0
loginErrorCount
:
0
});
});
app
.
globalData
.
hasLogin
=
true
;
app
.
globalData
.
hasLogin
=
true
;
wx
.
setStorageSync
(
'
userInfo
'
,
res
.
data
.
data
.
userInfo
);
wx
.
setStorageSync
(
'
userInfo
'
,
res
.
data
.
data
.
userInfo
);
wx
.
setStorage
({
wx
.
setStorage
({
key
:
"
token
"
,
key
:
"
token
"
,
data
:
res
.
data
.
data
.
token
,
data
:
res
.
data
.
data
.
token
,
success
:
function
(){
success
:
function
()
{
wx
.
switchTab
({
wx
.
switchTab
({
url
:
'
/pages/ucenter/index/index
'
url
:
'
/pages/ucenter/index/index
'
});
});
}
}
});
});
}
}
else
{
else
{
that
.
setData
({
that
.
setData
({
loginErrorCount
:
that
.
data
.
loginErrorCount
+
1
loginErrorCount
:
that
.
data
.
loginErrorCount
+
1
});
});
...
@@ -78,25 +77,25 @@ Page({
...
@@ -78,25 +77,25 @@ Page({
}
}
});
});
},
},
bindUsernameInput
:
function
(
e
)
{
bindUsernameInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
username
:
e
.
detail
.
value
username
:
e
.
detail
.
value
});
});
},
},
bindPasswordInput
:
function
(
e
)
{
bindPasswordInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
password
:
e
.
detail
.
value
password
:
e
.
detail
.
value
});
});
},
},
bindCodeInput
:
function
(
e
)
{
bindCodeInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
code
:
e
.
detail
.
value
code
:
e
.
detail
.
value
});
});
},
},
clearInput
:
function
(
e
)
{
clearInput
:
function
(
e
)
{
switch
(
e
.
currentTarget
.
id
)
{
switch
(
e
.
currentTarget
.
id
)
{
case
'
clear-username
'
:
case
'
clear-username
'
:
this
.
setData
({
this
.
setData
({
...
...
litemall-wx/pages/auth/login/login.js
View file @
20b97ec8
...
@@ -4,27 +4,27 @@ var user = require('../../../utils/user.js');
...
@@ -4,27 +4,27 @@ var user = require('../../../utils/user.js');
var
app
=
getApp
();
var
app
=
getApp
();
Page
({
Page
({
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
// 页面渲染完成
},
},
onReady
:
function
()
{
onReady
:
function
()
{
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
},
},
wxLogin
:
function
(
e
)
{
wxLogin
:
function
(
e
)
{
if
(
e
.
detail
.
userInfo
==
undefined
){
if
(
e
.
detail
.
userInfo
==
undefined
)
{
app
.
globalData
.
hasLogin
=
false
;
app
.
globalData
.
hasLogin
=
false
;
util
.
showErrorToast
(
'
微信登录失败
'
);
util
.
showErrorToast
(
'
微信登录失败
'
);
return
;
return
;
...
@@ -45,7 +45,9 @@ Page({
...
@@ -45,7 +45,9 @@ Page({
});
});
},
},
accountLogin
:
function
()
{
accountLogin
:
function
()
{
wx
.
navigateTo
({
url
:
"
/pages/auth/accountLogin/accountLogin
"
});
wx
.
navigateTo
({
url
:
"
/pages/auth/accountLogin/accountLogin
"
});
}
}
})
})
\ No newline at end of file
litemall-wx/pages/auth/login/login.wxml
View file @
20b97ec8
litemall-wx/pages/auth/register/register.js
View file @
20b97ec8
var
api
=
require
(
'
../../../config/api.js
'
);
var
api
=
require
(
'
../../../config/api.js
'
);
var
check
=
require
(
'
../../../utils/check.js
'
);
var
check
=
require
(
'
../../../utils/check.js
'
);
...
@@ -11,27 +10,27 @@ Page({
...
@@ -11,27 +10,27 @@ Page({
mobile
:
''
,
mobile
:
''
,
code
:
''
code
:
''
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
// 页面渲染完成
},
},
onReady
:
function
()
{
onReady
:
function
()
{
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
},
},
sendCode
:
function
()
{
sendCode
:
function
()
{
let
that
=
this
;
let
that
=
this
;
if
(
this
.
data
.
mobile
.
length
==
0
)
{
if
(
this
.
data
.
mobile
.
length
==
0
)
{
...
@@ -61,15 +60,14 @@ Page({
...
@@ -61,15 +60,14 @@ Page({
header
:
{
header
:
{
'
content-type
'
:
'
application/json
'
'
content-type
'
:
'
application/json
'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
.
errno
==
0
)
{
if
(
res
.
data
.
errno
==
0
)
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
发送成功
'
,
title
:
'
发送成功
'
,
content
:
'
验证码已发送
'
,
content
:
'
验证码已发送
'
,
showCancel
:
false
showCancel
:
false
});
});
}
}
else
{
else
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
错误信息
'
,
title
:
'
错误信息
'
,
content
:
res
.
data
.
errmsg
,
content
:
res
.
data
.
errmsg
,
...
@@ -79,7 +77,7 @@ Page({
...
@@ -79,7 +77,7 @@ Page({
}
}
});
});
},
},
requestRegister
:
function
(
wxCode
)
{
requestRegister
:
function
(
wxCode
)
{
let
that
=
this
;
let
that
=
this
;
wx
.
request
({
wx
.
request
({
url
:
api
.
AuthRegister
,
url
:
api
.
AuthRegister
,
...
@@ -94,21 +92,20 @@ Page({
...
@@ -94,21 +92,20 @@ Page({
header
:
{
header
:
{
'
content-type
'
:
'
application/json
'
'
content-type
'
:
'
application/json
'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
.
errno
==
0
)
{
if
(
res
.
data
.
errno
==
0
)
{
app
.
globalData
.
hasLogin
=
true
;
app
.
globalData
.
hasLogin
=
true
;
wx
.
setStorageSync
(
'
userInfo
'
,
res
.
data
.
data
.
userInfo
);
wx
.
setStorageSync
(
'
userInfo
'
,
res
.
data
.
data
.
userInfo
);
wx
.
setStorage
({
wx
.
setStorage
({
key
:
"
token
"
,
key
:
"
token
"
,
data
:
res
.
data
.
data
.
token
,
data
:
res
.
data
.
data
.
token
,
success
:
function
()
{
success
:
function
()
{
wx
.
switchTab
({
wx
.
switchTab
({
url
:
'
/pages/ucenter/index/index
'
url
:
'
/pages/ucenter/index/index
'
});
});
}
}
});
});
}
}
else
{
else
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
错误信息
'
,
title
:
'
错误信息
'
,
content
:
res
.
data
.
errmsg
,
content
:
res
.
data
.
errmsg
,
...
@@ -118,7 +115,7 @@ Page({
...
@@ -118,7 +115,7 @@ Page({
}
}
});
});
},
},
startRegister
:
function
()
{
startRegister
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
this
.
data
.
password
.
length
<
6
||
this
.
data
.
username
.
length
<
6
)
{
if
(
this
.
data
.
password
.
length
<
6
||
this
.
data
.
username
.
length
<
6
)
{
...
@@ -158,7 +155,7 @@ Page({
...
@@ -158,7 +155,7 @@ Page({
}
}
wx
.
login
({
wx
.
login
({
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
!
res
.
code
)
{
if
(
!
res
.
code
)
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
错误信息
'
,
title
:
'
错误信息
'
,
...
@@ -171,37 +168,37 @@ Page({
...
@@ -171,37 +168,37 @@ Page({
}
}
});
});
},
},
bindUsernameInput
:
function
(
e
)
{
bindUsernameInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
username
:
e
.
detail
.
value
username
:
e
.
detail
.
value
});
});
},
},
bindPasswordInput
:
function
(
e
)
{
bindPasswordInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
password
:
e
.
detail
.
value
password
:
e
.
detail
.
value
});
});
},
},
bindConfirmPasswordInput
:
function
(
e
)
{
bindConfirmPasswordInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
confirmPassword
:
e
.
detail
.
value
confirmPassword
:
e
.
detail
.
value
});
});
},
},
bindMobileInput
:
function
(
e
)
{
bindMobileInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
mobile
:
e
.
detail
.
value
mobile
:
e
.
detail
.
value
});
});
},
},
bindCodeInput
:
function
(
e
)
{
bindCodeInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
code
:
e
.
detail
.
value
code
:
e
.
detail
.
value
});
});
},
},
clearInput
:
function
(
e
)
{
clearInput
:
function
(
e
)
{
switch
(
e
.
currentTarget
.
id
)
{
switch
(
e
.
currentTarget
.
id
)
{
case
'
clear-username
'
:
case
'
clear-username
'
:
this
.
setData
({
this
.
setData
({
...
...
litemall-wx/pages/auth/register/register.wxml
View file @
20b97ec8
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
</view>
</view>
<view class="form-item">
<view class="form-item">
<input class="password" value="{{password}}" password bindinput="bindPasswordInput" placeholder="密码"/>
<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>
<image class="clear" id="clear-password" wx:if="{{ password.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
</view>
<view class="form-item">
<view class="form-item">
<input class="password" value="{{confirmPassword}}" password bindinput="bindConfirmPasswordInput" placeholder="确认密码"/>
<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>
<image class="clear" id="clear-confirm-password" wx:if="{{ confirmPassword.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
</view>
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
<image wx:if="{{ mobile.length > 0 }}" id="clear-mobile" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
<image wx:if="{{ mobile.length > 0 }}" id="clear-mobile" class="clear" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
</view>
<view class="form-item-code"
>
<view class="form-item-code">
<view class="form-item code-item">
<view class="form-item code-item">
<input class="code" value="{{code}}" bindinput="bindCodeInput" placeholder="验证码"/>
<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>
<image class="clear" id="clear-code" wx:if="{{ code.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearInput"></image>
</view>
</view>
<view class="code-btn" bindtap="sendCode">获取验证码</view>
<view class="code-btn" bindtap="sendCode">获取验证码</view>
...
...
litemall-wx/pages/auth/register/register.wxss
View file @
20b97ec8
.form-box{
.form-box
{
width: 100%;
width: 100%;
height: auto;
height: auto;
overflow: hidden;
overflow: hidden;
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
background: #fff;
background: #fff;
}
}
.form-item{
.form-item
{
position: relative;
position: relative;
background: #fff;
background: #fff;
height: 96rpx;
height: 96rpx;
border-bottom: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
}
}
.form-item .username, .form-item .password, .form-item .mobile, .form-item .code{
.form-item .username, .form-item .password, .form-item .mobile, .form-item .code
{
position: absolute;
position: absolute;
top: 26rpx;
top: 26rpx;
left: 0;
left: 0;
...
@@ -26,19 +26,19 @@
...
@@ -26,19 +26,19 @@
font-size: 30rpx;
font-size: 30rpx;
}
}
.form-item-code{
.form-item-code
{
margin-top:32rpx;
margin-top:
32rpx;
height: auto;
height: auto;
overflow: hidden;
overflow: hidden;
width: 100%;
width: 100%;
}
}
.form-item-code .form-item{
.form-item-code .form-item
{
float: left;
float: left;
width: 350rpx;
width: 350rpx;
}
}
.form-item-code .code-btn{
.form-item-code .code-btn
{
float: right;
float: right;
padding: 20rpx 40rpx;
padding: 20rpx 40rpx;
border: 1px solid #d9d9d9;
border: 1px solid #d9d9d9;
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
background: green;
background: green;
}
}
.form-item .clear{
.form-item .clear
{
position: absolute;
position: absolute;
top: 26rpx;
top: 26rpx;
right: 18rpx;
right: 18rpx;
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
width: 44rpx;
width: 44rpx;
}
}
.register-btn{
.register-btn
{
margin: 60rpx 0 40rpx 0;
margin: 60rpx 0 40rpx 0;
height: 96rpx;
height: 96rpx;
line-height: 96rpx;
line-height: 96rpx;
...
...
litemall-wx/pages/auth/reset/reset.js
View file @
20b97ec8
...
@@ -9,28 +9,28 @@ Page({
...
@@ -9,28 +9,28 @@ Page({
password
:
''
,
password
:
''
,
confirmPassword
:
''
confirmPassword
:
''
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
// 页面渲染完成
// 页面渲染完成
},
},
onReady
:
function
()
{
onReady
:
function
()
{
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
},
},
sendCode
:
function
()
{
sendCode
:
function
()
{
let
that
=
this
;
let
that
=
this
;
wx
.
request
({
wx
.
request
({
url
:
api
.
AuthRegisterCaptcha
,
url
:
api
.
AuthRegisterCaptcha
,
...
@@ -41,15 +41,14 @@ Page({
...
@@ -41,15 +41,14 @@ Page({
header
:
{
header
:
{
'
content-type
'
:
'
application/json
'
'
content-type
'
:
'
application/json
'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
.
errno
==
0
)
{
if
(
res
.
data
.
errno
==
0
)
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
发送成功
'
,
title
:
'
发送成功
'
,
content
:
'
验证码已发送
'
,
content
:
'
验证码已发送
'
,
showCancel
:
false
showCancel
:
false
});
});
}
}
else
{
else
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
错误信息
'
,
title
:
'
错误信息
'
,
content
:
res
.
data
.
errmsg
,
content
:
res
.
data
.
errmsg
,
...
@@ -59,7 +58,7 @@ Page({
...
@@ -59,7 +58,7 @@ Page({
}
}
});
});
},
},
startReset
:
function
(){
startReset
:
function
()
{
var
that
=
this
;
var
that
=
this
;
if
(
this
.
data
.
mobile
.
length
==
0
||
this
.
data
.
code
.
length
==
0
)
{
if
(
this
.
data
.
mobile
.
length
==
0
||
this
.
data
.
code
.
length
==
0
)
{
...
@@ -109,11 +108,10 @@ Page({
...
@@ -109,11 +108,10 @@ Page({
header
:
{
header
:
{
'
content-type
'
:
'
application/json
'
'
content-type
'
:
'
application/json
'
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
data
.
errno
==
0
)
{
if
(
res
.
data
.
errno
==
0
)
{
wx
.
navigateBack
();
wx
.
navigateBack
();
}
}
else
{
else
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
密码重置失败
'
,
title
:
'
密码重置失败
'
,
content
:
res
.
data
.
errmsg
,
content
:
res
.
data
.
errmsg
,
...
@@ -123,32 +121,32 @@ Page({
...
@@ -123,32 +121,32 @@ Page({
}
}
});
});
},
},
bindPasswordInput
:
function
(
e
)
{
bindPasswordInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
password
:
e
.
detail
.
value
password
:
e
.
detail
.
value
});
});
},
},
bindConfirmPasswordInput
:
function
(
e
)
{
bindConfirmPasswordInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
confirmPassword
:
e
.
detail
.
value
confirmPassword
:
e
.
detail
.
value
});
});
},
},
bindMobileInput
:
function
(
e
)
{
bindMobileInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
mobile
:
e
.
detail
.
value
mobile
:
e
.
detail
.
value
});
});
},
},
bindCodeInput
:
function
(
e
){
bindCodeInput
:
function
(
e
)
{
this
.
setData
({
this
.
setData
({
code
:
e
.
detail
.
value
code
:
e
.
detail
.
value
});
});
},
},
clearInput
:
function
(
e
){
clearInput
:
function
(
e
)
{
switch
(
e
.
currentTarget
.
id
){
switch
(
e
.
currentTarget
.
id
)
{
case
'
clear-password
'
:
case
'
clear-password
'
:
this
.
setData
({
this
.
setData
({
password
:
''
password
:
''
...
...
litemall-wx/pages/auth/reset/reset.wxss
View file @
20b97ec8
.form-box{
.form-box
{
width: 100%;
width: 100%;
height: auto;
height: auto;
overflow: hidden;
overflow: hidden;
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
background: #fff;
background: #fff;
}
}
.form-item{
.form-item
{
position: relative;
position: relative;
background: #fff;
background: #fff;
height: 96rpx;
height: 96rpx;
border-bottom: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
}
}
.form-item .mobile, .form-item .password, .form-item .code{
.form-item .mobile, .form-item .password, .form-item .code
{
position: absolute;
position: absolute;
top: 26rpx;
top: 26rpx;
left: 0;
left: 0;
...
@@ -26,26 +26,26 @@
...
@@ -26,26 +26,26 @@
font-size: 30rpx;
font-size: 30rpx;
}
}
.form-item-code{
.form-item-code
{
margin-top:32rpx;
margin-top:
32rpx;
height: auto;
height: auto;
overflow: hidden;
overflow: hidden;
width: 100%;
width: 100%;
}
}
.form-item-code .form-item{
.form-item-code .form-item
{
float: left;
float: left;
width: 350rpx;
width: 350rpx;
}
}
.form-item-code .code-btn{
.form-item-code .code-btn
{
float: right;
float: right;
padding: 20rpx 40rpx;
padding: 20rpx 40rpx;
border: 1px solid #d9d9d9;
border: 1px solid #d9d9d9;
border-radius: 10rpx;
border-radius: 10rpx;
}
}
.form-item .clear{
.form-item .clear
{
position: absolute;
position: absolute;
top: 26rpx;
top: 26rpx;
right: 18rpx;
right: 18rpx;
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
width: 44rpx;
width: 44rpx;
}
}
.reset-btn{
.reset-btn
{
margin: 60rpx 0 40rpx 0;
margin: 60rpx 0 40rpx 0;
height: 96rpx;
height: 96rpx;
line-height: 96rpx;
line-height: 96rpx;
...
...
litemall-wx/pages/brand/brand.js
View file @
20b97ec8
...
@@ -8,16 +8,19 @@ Page({
...
@@ -8,16 +8,19 @@ Page({
size
:
10
,
size
:
10
,
totalPages
:
1
totalPages
:
1
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
this
.
getBrandList
();
this
.
getBrandList
();
},
},
getBrandList
:
function
()
{
getBrandList
:
function
()
{
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'
加载中...
'
,
title
:
'
加载中...
'
,
});
});
let
that
=
this
;
let
that
=
this
;
util
.
request
(
api
.
BrandList
,
{
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
BrandList
,
{
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
that
.
setData
({
brandList
:
that
.
data
.
brandList
.
concat
(
res
.
data
.
brandList
),
brandList
:
that
.
data
.
brandList
.
concat
(
res
.
data
.
brandList
),
...
@@ -27,7 +30,7 @@ Page({
...
@@ -27,7 +30,7 @@ Page({
wx
.
hideLoading
();
wx
.
hideLoading
();
});
});
},
},
onReachBottom
(){
onReachBottom
()
{
if
(
this
.
data
.
totalPages
>
this
.
data
.
page
)
{
if
(
this
.
data
.
totalPages
>
this
.
data
.
page
)
{
this
.
setData
({
this
.
setData
({
page
:
this
.
data
.
page
+
1
page
:
this
.
data
.
page
+
1
...
@@ -38,18 +41,18 @@ Page({
...
@@ -38,18 +41,18 @@ Page({
this
.
getBrandList
();
this
.
getBrandList
();
},
},
onReady
:
function
()
{
onReady
:
function
()
{
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
}
}
...
...
litemall-wx/pages/brand/brand.wxml
View file @
20b97ec8
<view class="container">
<view class="container">
<view class="brand-list"
>
<view class="brand-list">
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="img-bg">
<view class="img-bg">
<image src="{{item.picUrl}}" background-size="cover"></image>
<image src="{{item.picUrl}}" background-size="cover"></image>
</view>
</view>
<view class="txt-box">
<view class="txt-box">
<view class="line">
<view class="line">
<text class="name"
>{{item.name}}</text>
<text class="name">{{item.name}}</text>
<text class="s">|</text>
<text class="s">|</text>
<text class="price">{{item.floorPrice}}元起</text>
<text class="price">{{item.floorPrice}}元起</text>
</view>
</view>
</view>
</view>
</navigator
>
</navigator>
</view>
</view>
</view>
</view>
\ No newline at end of file
litemall-wx/pages/brand/brand.wxss
View file @
20b97ec8
.brand-list .item{
.brand-list .item
{
display: block;
display: block;
width: 750rpx;
width: 750rpx;
height: 416rpx;
height: 416rpx;
...
@@ -6,32 +6,32 @@
...
@@ -6,32 +6,32 @@
margin-bottom: 4rpx;
margin-bottom: 4rpx;
}
}
.brand-list .item .img-bg{
.brand-list .item .img-bg
{
position: absolute;
position: absolute;
left:0;
left:
0;
top:0;
top:
0;
z-index: 0;
z-index: 0;
width: 750rpx;
width: 750rpx;
height: 417rpx;
height: 417rpx;
overflow: hidden;
overflow: hidden;
}
}
.brand-list .item .img-bg image{
.brand-list .item .img-bg image
{
width: 750rpx;
width: 750rpx;
height: 416rpx;
height: 416rpx;
}
}
.brand-list .item .txt-box{
.brand-list .item .txt-box
{
position: absolute;
position: absolute;
left:0;
left:
0;
top:0;
top:
0;
display: table;
display: table;
z-index: 0;
z-index: 0;
width: 750rpx;
width: 750rpx;
height: 417rpx;
height: 417rpx;
}
}
.brand-list .item .line{
.brand-list .item .line
{
display: table-cell;
display: table-cell;
vertical-align: middle;
vertical-align: middle;
text-align: center;
text-align: center;
...
@@ -39,14 +39,14 @@
...
@@ -39,14 +39,14 @@
line-height: 63rpx;
line-height: 63rpx;
}
}
.brand-list .item .line text{
.brand-list .item .line text
{
font-size: 35rpx;
font-size: 35rpx;
font-weight: 700;
font-weight: 700;
text-shadow: 1rpx 1rpx rgba(0,0,0,.32);
text-shadow: 1rpx 1rpx rgba(0,
0,
0,
0
.32);
color: #fff;
color: #fff;
}
}
.brand-list .item .line .s{
.brand-list .item .line .s
{
padding: 0 10rpx;
padding: 0 10rpx;
font-size: 40rpx;
font-size: 40rpx;
}
}
litemall-wx/pages/brandDetail/brandDetail.js
View file @
20b97ec8
...
@@ -12,7 +12,7 @@ Page({
...
@@ -12,7 +12,7 @@ Page({
page
:
1
,
page
:
1
,
size
:
100
size
:
100
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
var
that
=
this
;
var
that
=
this
;
that
.
setData
({
that
.
setData
({
...
@@ -20,9 +20,11 @@ Page({
...
@@ -20,9 +20,11 @@ Page({
});
});
this
.
getBrand
();
this
.
getBrand
();
},
},
getBrand
:
function
()
{
getBrand
:
function
()
{
let
that
=
this
;
let
that
=
this
;
util
.
request
(
api
.
BrandDetail
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
BrandDetail
,
{
id
:
that
.
data
.
id
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
that
.
setData
({
brand
:
res
.
data
.
brand
brand
:
res
.
data
.
brand
...
@@ -35,8 +37,12 @@ Page({
...
@@ -35,8 +37,12 @@ Page({
getGoodsList
()
{
getGoodsList
()
{
var
that
=
this
;
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
brandId
:
that
.
data
.
id
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
})
util
.
request
(
api
.
GoodsList
,
{
.
then
(
function
(
res
)
{
brandId
:
that
.
data
.
id
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
})
.
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
that
.
setData
({
goodsList
:
res
.
data
.
goodsList
goodsList
:
res
.
data
.
goodsList
...
@@ -44,19 +50,19 @@ Page({
...
@@ -44,19 +50,19 @@ Page({
}
}
});
});
},
},
onReady
:
function
()
{
onReady
:
function
()
{
// 页面渲染完成
// 页面渲染完成
},
},
onShow
:
function
()
{
onShow
:
function
()
{
// 页面显示
// 页面显示
},
},
onHide
:
function
()
{
onHide
:
function
()
{
// 页面隐藏
// 页面隐藏
},
},
onUnload
:
function
()
{
onUnload
:
function
()
{
// 页面关闭
// 页面关闭
}
}
...
...
litemall-wx/pages/brandDetail/brandDetail.wxml
View file @
20b97ec8
litemall-wx/pages/brandDetail/brandDetail.wxss
View file @
20b97ec8
page{
page
{
background: #f4f4f4;
background: #f4f4f4;
}
}
.brand-info .name{
.brand-info .name {
width: 100%;
width: 100%;
height: 290rpx;
height: 290rpx;
position: relative;
position: relative;
}
}
.brand-info .img{
.brand-info .img
{
position: absolute;
position: absolute;
top:0;
top:
0;
left:0;
left:
0;
width: 100%;
width: 100%;
height: 290rpx;
height: 290rpx;
}
}
.brand-info .info-box{
.brand-info .info-box
{
position: absolute;
position: absolute;
top:0;
top:
0;
left:0;
left:
0;
width: 100%;
width: 100%;
height: 290rpx;
height: 290rpx;
text-align: center;
text-align: center;
...
@@ -27,18 +28,18 @@ page{
...
@@ -27,18 +28,18 @@ page{
align-items: center;
align-items: center;
}
}
.brand-info .info{
.brand-info .info
{
display: block;
display: block;
}
}
.brand-info .txt{
.brand-info .txt
{
display: block;
display: block;
height: 37.5rpx;
height: 37.5rpx;
font-size: 37.5rpx;
font-size: 37.5rpx;
color: #fff;
color: #fff;
}
}
.brand-info .line{
.brand-info .line
{
margin: 0 auto;
margin: 0 auto;
margin-top: 16rpx;
margin-top: 16rpx;
display: block;
display: block;
...
@@ -47,7 +48,7 @@ page{
...
@@ -47,7 +48,7 @@ page{
background: #fff;
background: #fff;
}
}
.brand-info .desc{
.brand-info .desc
{
background: #fff;
background: #fff;
width: 100%;
width: 100%;
height: auto;
height: auto;
...
@@ -59,7 +60,7 @@ page{
...
@@ -59,7 +60,7 @@ page{
text-align: center;
text-align: center;
}
}
.cate-item .b{
.cate-item .b
{
width: 750rpx;
width: 750rpx;
height: auto;
height: auto;
overflow: hidden;
overflow: hidden;
...
@@ -67,7 +68,7 @@ page{
...
@@ -67,7 +68,7 @@ page{
margin-top: 20rpx;
margin-top: 20rpx;
}
}
.cate-item .b .item{
.cate-item .b .item
{
float: left;
float: left;
background: #fff;
background: #fff;
width: 375rpx;
width: 375rpx;
...
@@ -78,17 +79,17 @@ page{
...
@@ -78,17 +79,17 @@ page{
text-align: center;
text-align: center;
}
}
.cate-item .b .item-b{
.cate-item .b .item-b
{
border-right: 1rpx solid #f4f4f4;
border-right: 1rpx solid #f4f4f4;
}
}
.cate-item .item .img{
.cate-item .item .img
{
margin-top: 10rpx;
margin-top: 10rpx;
width: 302rpx;
width: 302rpx;
height: 302rpx;
height: 302rpx;
}
}
.cate-item .item .name{
.cate-item .item .name
{
display: block;
display: block;
width: 365.625rpx;
width: 365.625rpx;
height: 35rpx;
height: 35rpx;
...
@@ -100,7 +101,7 @@ page{
...
@@ -100,7 +101,7 @@ page{
color: #333;
color: #333;
}
}
.cate-item .item .price{
.cate-item .item .price
{
display: block;
display: block;
width: 365.625rpx;
width: 365.625rpx;
height: 30rpx;
height: 30rpx;
...
...
litemall-wx/pages/cart/cart.js
View file @
20b97ec8
litemall-wx/pages/cart/cart.wxml
View file @
20b97ec8
Prev
1
2
3
4
5
6
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