切换导航条
此项目
正在载入...
登录
miniprogram
/
bar
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
乔蒙蒙
2019-03-13 18:06:53 +0800
提交
35fbce986b94c679842707c54c3dcdb36f3fc79c
1 个父辈
1f98e1af
对接接口
隐藏空白字符变更
内嵌
并排对比
正在显示
10 个修改的文件
包含
548 行增加
和
436 行删除
app.js
app.json
pages/index/index.js
pages/index/index.wxml
pages/kaishi/kaishi.js
pages/kaishi/kaishi.wxml
pages/login/login.js
pages/login/login.wxml
pages/merchant/login/login.wxml
pages/merchant/login/login.wxss
app.js
查看文件 @
35fbce9
...
...
@@ -103,6 +103,7 @@ App({
return
dateObj
;
},
globalData
:
{
userInfo
:
null
userInfo
:
null
,
imgUrl
:
'http://qiniu.conyou-zj.com/'
}
})
\ No newline at end of file
...
...
app.json
查看文件 @
35fbce9
{
"pages"
:
[
"pages/kaishi/kaishi"
,
"pages/index/index"
,
"pages/merchant/login/login"
,
"pages/merchant/account/account"
,
"pages/merchant/tixian/tixian"
,
"pages/merchant/tixian2/tixian2"
,
"pages/merchant/account_info/account_info"
,
"pages/merchant/account_manage/account_manage"
,
"pages/merchant/merchant_center/merchant_center"
,
"pages/merchant/merchant_register/merchant_register"
,
"pages/merchant/merchant_addgoods/merchant_addgoods"
,
"pages/merchant/add_combo/add_combo"
,
"pages/merchant/add_kazuo/add_kazuo"
,
"pages/merchant/one_add/one_add"
,
"pages/merchant/my_order/my_order"
,
"pages/merchant/pay_detail/pay_detail"
,
"pages/merchant/goodslist/goodslist"
,
"pages/merchant/merchant_index/merchant_index"
,
"pages/merchant/merchant_imgs/merchant_imgs"
,
"pages/my/my"
,
"pages/client_pay/client_pay"
,
"pages/apply_yes/apply_yes"
,
"pages/my_account/my_account"
,
"pages/choose_time/choose_time"
,
"pages/true_approve/true_approve"
,
"pages/location/location"
,
"pages/form/form"
,
"pages/plaza/plaza"
,
"pages/more_imgs/more_imgs"
,
"pages/facility/facility"
,
"pages/tuangou/tuanguo"
,
"pages/taocan_detail/taocan_detail"
,
"pages/my_order/my_order"
,
"pages/my_zhudui/my_zhudui"
,
"pages/evaluate/evaluate"
,
"pages/bar_detail/bar_detail"
,
"pages/my_class/my_class"
,
"pages/img_txt/img_txt"
,
"pages/start/start"
,
"pages/zudui_pay/zudui_pay"
,
"pages/share/share"
,
"pages/merchant/register/register"
,
"pages/merchant/register_yes/register_yes"
,
"pages/merchant/scan/scan"
,
"pages/merchant/merchant_registerinfo/merchant_registerinfo"
,
"pages/merchant/account_list/account_list"
,
"pages/merchant/edit_account/edit_account"
,
"pages/merchant/merchant_share/merchant_share"
,
"pages/merchant/merchant_explain/merchant_explain"
,
"pages/merchant/merchant_activity/merchant_activity"
,
"pages/merchant/merchant_info/merchant_info"
,
"pages/merchant/user_agree/user_agree"
,
"pages/my_zhuduidetail/my_zhuduidetail"
,
"pages/my_orderdetai/my_orderdetail"
,
"pages/login/login"
,
"pages/my_ordersuccess/my_ordersuccess"
],
"window"
:
{
"backgroundTextStyle"
:
"light"
,
"navigationBarBackgroundColor"
:
"#031A2F"
,
"navigationBarTitleText"
:
"友从"
,
"navigationBarTextStyle"
:
"white"
},
"tabBar"
:
{
"color"
:
"#CCCCCC"
,
"selectedColor"
:
"#fff"
,
"backgroundColor"
:
"#011125"
,
"list"
:
[
{
"pagePath"
:
"pages/index/index"
,
"text"
:
"首页"
,
"iconPath"
:
"imgs/icon2.png"
,
"selectedIconPath"
:
"imgs/icon22.png"
},
{
"pagePath"
:
"pages/plaza/plaza"
,
"text"
:
"广场"
,
"iconPath"
:
"imgs/icon1.png"
,
"selectedIconPath"
:
"imgs/icon11.png"
},
{
"pagePath"
:
"pages/my/my"
,
"text"
:
"我的"
,
"iconPath"
:
"imgs/icon3.png"
,
"selectedIconPath"
:
"imgs/icon33.png"
}
]
}
"pages"
:
[
"pages/kaishi/kaishi"
,
"pages/index/index"
,
"pages/merchant/login/login"
,
"pages/merchant/account/account"
,
"pages/merchant/tixian/tixian"
,
"pages/merchant/tixian2/tixian2"
,
"pages/merchant/account_info/account_info"
,
"pages/merchant/account_manage/account_manage"
,
"pages/merchant/merchant_center/merchant_center"
,
"pages/merchant/merchant_register/merchant_register"
,
"pages/merchant/merchant_addgoods/merchant_addgoods"
,
"pages/merchant/add_combo/add_combo"
,
"pages/merchant/add_kazuo/add_kazuo"
,
"pages/merchant/one_add/one_add"
,
"pages/merchant/my_order/my_order"
,
"pages/merchant/pay_detail/pay_detail"
,
"pages/merchant/goodslist/goodslist"
,
"pages/merchant/merchant_index/merchant_index"
,
"pages/merchant/merchant_imgs/merchant_imgs"
,
"pages/my/my"
,
"pages/client_pay/client_pay"
,
"pages/apply_yes/apply_yes"
,
"pages/my_account/my_account"
,
"pages/choose_time/choose_time"
,
"pages/true_approve/true_approve"
,
"pages/location/location"
,
"pages/form/form"
,
"pages/plaza/plaza"
,
"pages/more_imgs/more_imgs"
,
"pages/facility/facility"
,
"pages/tuangou/tuanguo"
,
"pages/taocan_detail/taocan_detail"
,
"pages/my_order/my_order"
,
"pages/my_zhudui/my_zhudui"
,
"pages/evaluate/evaluate"
,
"pages/bar_detail/bar_detail"
,
"pages/my_class/my_class"
,
"pages/img_txt/img_txt"
,
"pages/start/start"
,
"pages/zudui_pay/zudui_pay"
,
"pages/share/share"
,
"pages/merchant/register/register"
,
"pages/merchant/register_yes/register_yes"
,
"pages/merchant/scan/scan"
,
"pages/merchant/merchant_registerinfo/merchant_registerinfo"
,
"pages/merchant/account_list/account_list"
,
"pages/merchant/edit_account/edit_account"
,
"pages/merchant/merchant_share/merchant_share"
,
"pages/merchant/merchant_explain/merchant_explain"
,
"pages/merchant/merchant_activity/merchant_activity"
,
"pages/merchant/merchant_info/merchant_info"
,
"pages/merchant/user_agree/user_agree"
,
"pages/my_zhuduidetail/my_zhuduidetail"
,
"pages/my_orderdetai/my_orderdetail"
,
"pages/login/login"
,
"pages/my_ordersuccess/my_ordersuccess"
],
"window"
:
{
"backgroundTextStyle"
:
"light"
,
"navigationBarBackgroundColor"
:
"#031A2F"
,
"navigationBarTitleText"
:
"友从"
,
"navigationBarTextStyle"
:
"white"
},
"tabBar"
:
{
"color"
:
"#CCCCCC"
,
"selectedColor"
:
"#fff"
,
"backgroundColor"
:
"#011125"
,
"list"
:
[
{
"pagePath"
:
"pages/index/index"
,
"text"
:
"首页"
,
"iconPath"
:
"imgs/icon2.png"
,
"selectedIconPath"
:
"imgs/icon22.png"
},
{
"pagePath"
:
"pages/plaza/plaza"
,
"text"
:
"广场"
,
"iconPath"
:
"imgs/icon1.png"
,
"selectedIconPath"
:
"imgs/icon11.png"
},
{
"pagePath"
:
"pages/my/my"
,
"text"
:
"我的"
,
"iconPath"
:
"imgs/icon3.png"
,
"selectedIconPath"
:
"imgs/icon33.png"
}
]
}
}
\ No newline at end of file
...
...
pages/index/index.js
查看文件 @
35fbce9
//index.js
const
app
=
getApp
();
Page
({
/**
* 页面的初始数据
*/
data
:
{
rankstate
:
0
//0综合,1距离,2销量,3筛选
},
setrankstate
(
e
){
this
.
setData
({
rankstate
:
e
.
currentTarget
.
dataset
.
rankstate
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
}
})
/**
* 页面的初始数据
*/
data
:
{
imgUrl
:
app
.
globalData
.
imgUrl
,
rankstate
:
0
,
//0综合,1距离,2销量,3筛选
},
setrankstate
(
e
)
{
this
.
setData
({
rankstate
:
e
.
currentTarget
.
dataset
.
rankstate
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
}
})
\ No newline at end of file
...
...
pages/index/index.wxml
查看文件 @
35fbce9
<!--index.wxml-->
<navigator class='index_img' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<image src='../../../imgs/dianoufengmian@3x.png'></image>
</navigator >
<image src='{{imgUrl}}dianoufengmian@3x.png'></image>
</navigator>
<view class='index_class'>
<navigator class='index_classcell' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>品质团购</view>
<view class='index_classcellsub'>Quality group purchase</view>
</navigator>
<navigator class='index_classcell index_classcell1' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>热门团购</view>
<view class='index_classcellsub'>Hot group buying</view>
</navigator>
<navigator class='index_classcell index_classcell2' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>限量抢购</view>
<view class='index_classcellsub'>Limited purchase</view>
</navigator>
<navigator class='index_classcell' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>品质团购</view>
<view class='index_classcellsub'>Quality group purchase</view>
</navigator>
<navigator class='index_classcell index_classcell1' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>热门团购</view>
<view class='index_classcellsub'>Hot group buying</view>
</navigator>
<navigator class='index_classcell index_classcell2' hover-class='navigator_hover' url='/pages/tuangou/tuanguo'>
<view>限量抢购</view>
<view class='index_classcellsub'>Limited purchase</view>
</navigator>
</view>
<view class='index_title'>热门酒吧</view>
<view class='plaza_nav'>
<view class="plaza_navitem {{rankstate==0?'navitem_active':''}}" data-rankstate='0' bindtap='setrankstate' >
<view class=' plaza_navitemimg iconfont icon-fenlei-'></view>
<view>综合排序</view>
</view>
<view class="plaza_navitem {{rankstate==1?'navitem_active':''}}" data-rankstate='1' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-qunfengdingwei'></view>
<view>距离最近</view>
</view>
<view class="plaza_navitem {{rankstate==2?'navitem_active':''}}" data-rankstate='2' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-paixing'></view>
<view>销量最好</view>
</view>
<view class="plaza_navitem {{rankstate==3?'navitem_active':''}}" data-rankstate='3' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-sousuo'></view>
<view>筛选</view>
</view>
<view class="plaza_navitem {{rankstate==0?'navitem_active':''}}" data-rankstate='0' bindtap='setrankstate'>
<view class=' plaza_navitemimg iconfont icon-fenlei-'></view>
<view>综合排序</view>
</view>
<view class="plaza_navitem {{rankstate==1?'navitem_active':''}}" data-rankstate='1' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-qunfengdingwei'></view>
<view>距离最近</view>
</view>
<view class="plaza_navitem {{rankstate==2?'navitem_active':''}}" data-rankstate='2' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-paixing'></view>
<view>销量最好</view>
</view>
<view class="plaza_navitem {{rankstate==3?'navitem_active':''}}" data-rankstate='3' bindtap='setrankstate'>
<view class='plaza_navitemimg iconfont icon-sousuo'></view>
<view>筛选</view>
</view>
</view>
<view class='formbox plazabox'>
<navigator class='order_img plaza_img' hover-class='navigator_hover' url='/pages/bar_detail/bar_detail'>
<view class='order_imgtxt'>
<view class='order_imgtxttitle'>夜色酒吧</view>
<view class='order_imgtxtsubtitle'>[主题酒吧]</view>
</view>
<view class='order_imgtime'>月售120单</view>
<image src='../../../imgs/dianoufengmian@3x.png'></image>
</navigator>
<view class='formitem'>
<view class='formitem_rigth form_nimi'>
<view class='formitem_rigth_jian'> <text class='jian_txt'> 减</text>
</view>
满1000减300 满1500减500 满2000减800
</view>
</view>
<navigator class='order_img plaza_img' hover-class='navigator_hover' url='/pages/bar_detail/bar_detail'>
<view class='order_imgtxt'>
<view class='order_imgtxttitle'>夜色酒吧</view>
<view class='order_imgtxtsubtitle'>[主题酒吧]</view>
</view>
<view class='order_imgtime'>月售120单</view>
<image src='{{imgUrl}}dianoufengmian@3x.png'></image>
</navigator>
<view class='formitem'>
<view class='formitem_rigth form_nimi'>
<view class='formitem_rigth_jian'>
<text class='jian_txt'> 减</text>
</view>
满1000减300 满1500减500 满2000减800
</view>
</view>
</view>
\ No newline at end of file
...
...
pages/kaishi/kaishi.js
查看文件 @
35fbce9
...
...
@@ -7,9 +7,9 @@ Page({
*/
data
:
{
imgUrls
:
[
'../../imgs/lunbo1@3x.png'
,
'../../imgs/lunbo2@3x.png'
,
'../../imgs/lunbo3@3x.png'
app
.
globalData
.
imgUrl
+
'lunbo1@3x.png'
,
app
.
globalData
.
imgUrl
+
'lunbo2@3x.png'
,
app
.
globalData
.
imgUrl
+
'lunbo3@3x.png'
],
indexs
:
0
,
color
:
'#cccccc'
,
...
...
@@ -17,7 +17,8 @@ Page({
autoplay
:
true
,
activecolor
:
'#ffffff'
,
interval
:
5000
,
duration
:
1000
duration
:
1000
,
imgUrl
:
app
.
globalData
.
imgUrl
},
start
(
e
)
{
...
...
@@ -32,9 +33,9 @@ Page({
code
:
s
.
code
}
app
.
post
(
url
,
param
).
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
e
);
that
.
login
(
res
.
data
.
openid
,
res
.
data
.
session_key
,
e
.
detail
.
encryptedData
,
e
.
detail
.
iv
,
e
.
detail
.
rawData
,
e
.
detail
.
signature
);
// console.log(res);
// console.log(e);
that
.
login
(
res
.
data
.
openid
,
res
.
data
.
session_key
,
e
.
detail
.
encryptedData
,
e
.
detail
.
iv
);
}).
catch
((
errMsg
)
=>
{
console
.
log
(
errMsg
);
})
...
...
@@ -42,47 +43,67 @@ Page({
}
});
},
login
(
openid
,
session_key
,
encrypted_data
,
iv
,
r
,
s
)
{
login
(
openid
,
session_key
,
encrypted_data
,
iv
)
{
let
that
=
this
;
let
param
=
{
openid
:
openid
,
session_key
:
session_key
,
encrypted_data
:
encrypted_data
,
iv
:
iv
,
rawData
:
r
,
signature
:
s
}
let
url
=
'wxapp/public/login'
;
// wx.navigateTo({
// url: '/pages/login/login',
// success: function (res) { },
// fail: function (res) { },
// complete: function (res) { },
// })
app
.
post
(
url
,
param
).
then
((
res
)
=>
{
console
.
log
(
res
)
wx
.
setStorageSync
(
'token'
,
res
.
data
.
token
);
let
u
=
"wxapp/public/isMobile"
;
let
header
=
{
"XX-Token"
:
res
.
data
.
token
}
let
data
=
{
type
:
1
wx
.
checkSession
({
success
:
function
()
{
console
.
log
(
'未过期'
);
//session_key 未过期,并且在本生命周期一直有效
let
param
=
{
openid
:
openid
,
session_key
:
session_key
,
encrypted_data
:
encrypted_data
,
iv
:
iv
,
}
let
url
=
'wxapp/public/login'
;
app
.
post
(
url
,
param
).
then
((
res
)
=>
{
// console.log(res)
wx
.
setStorageSync
(
'token'
,
res
.
data
.
token
);
let
u
=
"wxapp/public/isMobile"
;
let
header
=
{
"XX-Token"
:
res
.
data
.
token
}
let
data
=
{
type
:
1
}
app
.
post
(
u
,
data
,
header
).
then
((
r
)
=>
{
console
.
log
(
r
);
if
(
r
.
data
.
is_mobile
==
2
)
{
wx
.
redirectTo
({
url
:
'/pages/login/login'
,
success
:
function
(
res
)
{
},
fail
:
function
(
res
)
{
},
complete
:
function
(
res
)
{
},
})
}
else
if
(
r
.
data
.
is_mobile
==
1
)
{
wx
.
redirectTo
({
url
:
'/pages/index/index'
,
success
:
function
(
res
)
{
},
fail
:
function
(
res
)
{
},
complete
:
function
(
res
)
{
},
})
}
}).
catch
((
err
)
=>
{
})
// wx.navigateTo({
// url: '/pages/login/login',
// success: function (res) { },
// fail: function (res) { },
// complete: function (res) { },
// })
}).
catch
((
errMsg
)
=>
{
console
.
log
(
errMsg
);
})
},
fail
:
function
()
{
console
.
log
(
'session_key 已经失效'
);
// session_key 已经失效,需要重新执行登录流程
that
.
start
()
//重新登录
}
app
.
post
(
u
,
data
,
header
).
then
((
r
)
=>
{
console
.
log
(
r
)
}).
catch
((
err
)
=>
{
})
// wx.navigateTo({
// url: '/pages/login/login',
// success: function (res) { },
// fail: function (res) { },
// complete: function (res) { },
// })
}).
catch
((
errMsg
)
=>
{
console
.
log
(
errMsg
);
})
},
changeindexs
(
e
)
{
this
.
setData
({
...
...
pages/kaishi/kaishi.wxml
查看文件 @
35fbce9
...
...
@@ -8,14 +8,14 @@
</block>
<swiper-item>
<view class='start_main'>
<image src='
../../imgs/
yonghushouyedenglubiejing@3x.png'></image>
<image src='
{{imgUrl}}
yonghushouyedenglubiejing@3x.png'></image>
<view class='head_txt'>
<view class='head_title'>从友</view>
<view>From·Friends</view>
<view class='head_subtitle'>让娱乐更简单</view>
</view>
<view class='logo'>
<image src='
../../imgs/
qdongtupian@3x.png'></image>
<image src='
{{imgUrl}}
qdongtupian@3x.png'></image>
</view>
</view>
<view class='start_btnbox'>
...
...
pages/login/login.js
查看文件 @
35fbce9
// pages/login/login.js
const
app
=
getApp
();
Page
({
/**
* 页面的初始数据
*/
data
:
{
timer
:
''
,
//定时器名字
codetxt
:
'输入验证码'
,
downsec
:
'60'
,
//倒计时初始值
},
//倒计时
downsec
()
{
let
that
=
this
;
let
downsec
=
that
.
data
.
downsec
;
if
(
downsec
==
'60'
)
that
.
setData
({
timer
:
setInterval
(
function
()
{
//这里把setInterval赋值给变量名为timer的变量
//每隔一秒countDownNum就减一,实现同步
downsec
--
;
//然后把countDownNum存进data,好让用户知道时间在倒计着
that
.
setData
({
downsec
:
downsec
,
codetxt
:
downsec
+
's'
})
//在倒计时还未到0时,这中间可以做其他的事情,按项目需求来
if
(
downsec
==
0
)
{
that
.
setData
({
downsec
:
'60'
,
codetxt
:
'获取验证码'
})
//这里特别要注意,计时器是始终一直在走的,如果你的时间为0,那么就要关掉定时器!不然相当耗性能
//因为timer是存在data里面的,所以在关掉时,也要在data里取出后再关闭
clearInterval
(
that
.
data
.
timer
);
//关闭定时器之后,可作其他处理codes go here
}
},
1000
)
})
},
goindex
(){
wx
.
switchTab
({
url
:
'/pages/index/index'
,})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 页面的初始数据
*/
data
:
{
timer
:
''
,
//定时器名字
codetxt
:
'获取验证码'
,
downsec
:
60
,
//倒计时初始值
mobile
:
""
,
code
:
""
,
imgUrl
:
app
.
globalData
.
imgUrl
},
//倒计时
downsec
()
{
let
that
=
this
;
let
downsec
=
that
.
data
.
downsec
;
if
(
that
.
data
.
mobile
==
""
)
{
wx
.
showToast
({
title
:
'请输入手机号!'
,
icon
:
'none'
,
duration
:
1300
})
return
false
;
}
if
(
that
.
data
.
mobile
.
length
!=
11
)
{
wx
.
showToast
({
title
:
'手机号长度有误!'
,
icon
:
'none'
,
duration
:
1300
})
return
false
;
}
var
myreg
=
/^
(((
13
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
18
[
0-9
]{1})
|
(
17
[
0-9
]{1}))
+
\d{8})
$/
;
if
(
!
myreg
.
test
(
that
.
data
.
mobile
))
{
wx
.
showToast
({
title
:
'请输入正确的手机号!'
,
icon
:
'none'
,
duration
:
1300
})
return
false
;
}
let
u
=
"wxapp/public/getCode"
;
let
data
=
{
mobile
:
that
.
data
.
mobile
}
app
.
post
(
u
,
data
).
then
((
r
)
=>
{
console
.
log
(
r
);
if
(
r
.
code
==
20000
)
{
if
(
downsec
==
60
)
that
.
setData
({
timer
:
setInterval
(
function
()
{
//这里把setInterval赋值给变量名为timer的变量
//每隔一秒countDownNum就减一,实现同步
downsec
--
;
//然后把countDownNum存进data,好让用户知道时间在倒计着
that
.
setData
({
downsec
:
downsec
,
codetxt
:
downsec
+
's'
})
//在倒计时还未到0时,这中间可以做其他的事情,按项目需求来
if
(
downsec
==
0
)
{
that
.
setData
({
downsec
:
'60'
,
codetxt
:
'获取验证码'
})
//这里特别要注意,计时器是始终一直在走的,如果你的时间为0,那么就要关掉定时器!不然相当耗性能
//因为timer是存在data里面的,所以在关掉时,也要在data里取出后再关闭
clearInterval
(
that
.
data
.
timer
);
//关闭定时器之后,可作其他处理codes go here
}
},
1000
)
})
}
}).
catch
((
err
)
=>
{
})
},
// 手机号同步到data
bindMobile
(
e
)
{
this
.
setData
({
mobile
:
e
.
detail
.
value
.
replace
(
/
\s
+/g
,
''
)
})
},
// 验证码同步到data
codeFun
(
e
)
{
this
.
setData
({
code
:
e
.
detail
.
value
.
replace
(
/
\s
+/g
,
''
)
})
},
// 进入首页
goindex
()
{
let
t
=
this
;
let
data
=
{
mobile
:
t
.
data
.
mobile
,
code
:
t
.
data
.
code
,
type
:
1
}
let
u
=
"wxapp/public/lineMobile"
;
let
header
=
{
"XX-Token"
:
wx
.
getStorageSync
(
"token"
)
}
app
.
post
(
u
,
data
,
header
).
then
((
r
)
=>
{
console
.
log
(
r
);
// wx.switchTab({
// url: '/pages/index/index',
// })
}).
catch
((
err
)
=>
{
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
}
}
})
\ No newline at end of file
...
...
pages/login/login.wxml
查看文件 @
35fbce9
<!--pages/login/login.wxml-->
<view class='my_content'>
<image src='../../../imgs/denglubviejing@3x.png'></image>
<view class='login_box'>
<view class='input_item'>
<input placeholder='绑定手机' placeholder-class='input_place'></input>
</view>
<view class='input_item'>
<input placeholder='输入手机号' placeholder-class='input_place'></input>
</view>
<view class='input_item code'>
<input placeholder='绑定手机' placeholder-class='input_place'></input>
<view class='code_txt' bindtap='downsec'>{{codetxt}}</view>
</view>
<view class='agree'>
<text class='iconfont icon-duigou'></text> 已阅读
<navigator class='agree_txt'url='/pages/img_txt/img_txt' hover-class="none">《用户注册协议》</navigator>
</view>
<view class='goindex' bindtap='goindex'>
<view class='goindex_txt' >进入首页</view>
</view>
</view>
<image src='{{imgUrl}}denglubviejing@3x.png'></image>
<view class='login_box'>
<view class='input_item'>
绑定手机
<!-- <input placeholder='绑定手机' placeholder-class='input_place'></input> -->
</view>
<view class='input_item'>
<input placeholder='输入手机号' type='number' maxlength='11' bindinput='bindMobile' placeholder-class='input_place'></input>
</view>
<view class='input_item code'>
<input placeholder='输入验证码' type='number' bindinput='codeFun' placeholder-class='input_place'></input>
<view class='code_txt' bindtap='downsec'>{{codetxt}}</view>
</view>
<view class='agree'>
<text class='iconfont icon-duigou'></text> 已阅读
<navigator class='agree_txt' url='/pages/img_txt/img_txt' hover-class="none">《用户注册协议》</navigator>
</view>
<view class='goindex' bindtap='goindex'>
<view class='goindex_txt'>进入首页</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
...
...
pages/merchant/login/login.wxml
查看文件 @
35fbce9
...
...
@@ -3,7 +3,7 @@
<image src='../../../imgs/shenaghudenglubeijing@3x.png'></image>
<view class='login_box'>
<view class='input_item'>
<input placeholder='绑定手机' placeholder-class='input_place'></input>
<input placeholder='绑定手机'
readonly="readonly"
placeholder-class='input_place'></input>
</view>
<view class='input_item'>
<input placeholder='输入手机号' placeholder-class='input_place'></input>
...
...
pages/merchant/login/login.wxss
查看文件 @
35fbce9
/* pages/login/login.wxss */
page{
background: #010938;
page {
background: #010938;
}
.login_box{
position: absolute;
top:0;
left:50%;
transform: translateX(-50%);
overflow-y: scroll;
height: 100%;
width:530rpx;
margin: 170rpx auto 0 auto;
color:#fff;
font-size:28rpx;
.login_box {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
/* overflow-y: scroll; */
height: 100%;
width: 530rpx;
margin: 170rpx auto 0 auto;
color: #fff;
font-size: 28rpx;
}
.input_item{
padding:16rpx 0;
border-bottom:1rpx solid #fff;
margin: 0 0 26rpx 0;
.input_item {
padding: 16rpx 0;
border-bottom: 1rpx solid #fff;
margin: 0 0 26rpx 0;
}
.input_place{
color:#fff;
font-size: 28rpx;
.input_place {
color: #fff;
font-size: 28rpx;
}
.code{
display: flex;
justify-content: space-between;
align-items: center;
.code {
display: flex;
justify-content: space-between;
align-items: center;
}
.code input{
width:60%;
.code input {
width: 60%;
}
.code_txt{
display: flex;
align-items: center;
justify-content: center;
padding:2rpx 10rpx;
box-sizing: border-box;
width:178rpx;
height: 44rpx;
border:1rpx solid #fff;
border-radius: 10rpx;
.code_txt {
display: flex;
align-items: center;
justify-content: center;
padding: 5rpx 10rpx 7rpx;
box-sizing: border-box;
width: 178rpx;
height: 44rpx;
border: 1rpx solid #fff;
border-radius: 10rpx;
}
.agree{
display: flex;
justify-content: center;
align-items: center;
.agree {
display: flex;
justify-content: center;
align-items: center;
}
.agree_txt{
color:#009FE8;
.agree_txt {
color: #009fe8;
}
.agree .iconfont{
display: inline-block;
border:1rpx solid rgba(255,255,255,0.7);
color:rgba(255,255,255,0.7);
margin: 0 13rpx 0 0;
font-size:20rpx;
border-radius: 33%;
.agree .iconfont {
display: inline-block;
border: 1rpx solid rgba(255, 255, 255, 0.7);
color: rgba(255, 255, 255, 0.7);
margin: 0 13rpx 0 0;
font-size: 20rpx;
border-radius: 33%;
}
.goindex {
position: fixed;
padding: 27rpx 0;
bottom: 300rpx;
left: 50%;
transform: translateX(-50%);
width: 530rpx;
display: flex;
justify-items: center;
justify-content: center;
border-top: 1rpx solid #fff;
border-bottom: 1rpx solid #fff;
}
.goindex{
position: fixed;
padding:27rpx 0;
bottom:300rpx;
left:50%;
transform: translateX(-50%);
width: 530rpx;
display: flex;
justify-items: center;
justify-content: center;
border-top:1rpx solid #fff;
border-bottom:1rpx solid #fff;
.goindex_txt {
padding: 4rpx 20rpx;
background: rgba(255, 255, 255, 0.7);
border-radius: 10rpx;
color: rgba(255, 255, 255, 0.7);
}
.goindex_txt{
padding:4rpx 20rpx;
background: rgba(255,255,255,0.7);
border-radius: 10rpx;
color:rgba(255,255,255,0.7);
.goindex_txt::active {
opacity: 0.7;
}
.goindex_txt::active{
opacity: 0.7;
}
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论