Commit b75ed768 authored by pengguangpu's avatar pengguangpu

完善首页&功能中心页逻辑;

parent 4ac6e92e
{ {
"pages": [ "pages": [
"pages/pay_result/pay_result",
"pages/functioncenter/functioncenter",
"pages/login/login", "pages/login/login",
"pages/functioncenter/functioncenter",
"pages/pay_result/pay_result",
"pages/home/home",
"pages/logs/logs", "pages/logs/logs",
"pages/refund/refund", "pages/refund/refund",
"pages/balance/balance", "pages/balance/balance",
"pages/operation_waiting/operation_waiting", "pages/operation_waiting/operation_waiting",
"pages/home/home",
"pages/index/index" "pages/index/index"
], ],
"window": { "window": {
......
...@@ -6,14 +6,36 @@ Page({ ...@@ -6,14 +6,36 @@ Page({
*/ */
data: { data: {
aboutSysDialogShow:false, aboutSysDialogShow:false,
aboutSysDialogButtons:[{text:'确定'}] aboutSysDialogButtons:[{text:'确定'}],
localAccountInfo:null,
merchantId:'',
storeName:'',
storeId:'',
snNo:'',
miniProgramId:'',
versionCode:''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
try{
this.setData({
localAccountInfo:wx.getStorageSync('localAccountInfo')
})
console.log(this.data.localAccountInfo)
var localAccountInfoTemp = this.data.localAccountInfo
this.setData({
merchantId:localAccountInfoTemp.store.hhMerchant,
storeId:localAccountInfoTemp.store.storeId,
storeName:localAccountInfoTemp.store.storeName,
versionCode:getApp().globalData.version
})
}catch(ex){
console.log(ex)
}
}, },
/** /**
......
...@@ -11,27 +11,27 @@ ...@@ -11,27 +11,27 @@
<view class="operation_layout"> <view class="operation_layout">
<!--refund--> <!--refund-->
<view class="operation_item" style="margin-top:60rpx;padding-left:80rpx;" bindtap="onRefundClicked"> <view class="operation_item" style="margin-top:60rpx;padding-left:80rpx;" bindtap="onRefundClicked">
<image style="width:72rpx;height:72rpx;background-color:black;"></image> <image style="width:72rpx;height:72rpx;" src="../../images/icon_refund.png"></image>
<text style="color:black;font-size:32rpx;margin-left:20rpx;">退款</text> <text style="color:black;font-size:32rpx;margin-left:20rpx;">退款</text>
<image style="width:30rpx;height:30rpx;background-color:black;margin-left:auto;margin-right:150rpx;"></image> <image mode="heightFix" style="width:30rpx;height:30rpx;margin-left:auto;margin-right:150rpx;" src="../../images/icon_arrow.png"></image>
</view> </view>
<!--line--> <!--line-->
<view class="line"/> <view class="line"/>
<!--setting--> <!--setting-->
<view class="operation_item" style="padding-left:80rpx;" bindtap="onSettingClicked"> <view class="operation_item" style="padding-left:80rpx;" bindtap="onSettingClicked">
<image style="width:72rpx;height:72rpx;background-color:black;"></image> <image style="width:72rpx;height:72rpx;" src="../../images/icon_setting.png"></image>
<text style="color:black;font-size:32rpx;margin-left:20rpx;">系统设置</text> <text style="color:black;font-size:32rpx;margin-left:20rpx;">系统设置</text>
<image style="width:30rpx;height:30rpx;background-color:black;margin-left:auto;margin-right:150rpx;"></image> <image style="width:30rpx;height:30rpx;margin-left:auto;margin-right:150rpx;" mode="heightFix" src="../../images/icon_arrow.png"></image>
</view> </view>
<!--line--> <!--line-->
<view class="line"/> <view class="line"/>
<!--about sys--> <!--about sys-->
<view class="operation_item" style="padding-left:80rpx;" bindtap="onAboutSysClicked"> <view class="operation_item" style="padding-left:80rpx;" bindtap="onAboutSysClicked">
<image style="width:72rpx;height:72rpx;background-color:black;"></image> <image style="width:72rpx;height:72rpx;" src="../../images/icon_about_sys.png"></image>
<text style="color:black;font-size:32rpx;margin-left:20rpx;">关于系统</text> <text style="color:black;font-size:32rpx;margin-left:20rpx;">关于系统</text>
<image style="width:30rpx;height:30rpx;background-color:black;margin-left:auto;margin-right:150rpx;"></image> <image style="width:30rpx;height:30rpx;margin-left:auto;margin-right:150rpx;" src="../../images/icon_arrow.png" mode="heightFix"></image>
</view> </view>
<!--line--> <!--line-->
<view class="line"/> <view class="line"/>
...@@ -46,33 +46,33 @@ ...@@ -46,33 +46,33 @@
<mp-dialog title="关于系统" show="{{aboutSysDialogShow}}" buttons="{{aboutSysDialogButtons}}" bindbuttontap="onAboutSysDialogClicked"> <mp-dialog title="关于系统" show="{{aboutSysDialogShow}}" buttons="{{aboutSysDialogButtons}}" bindbuttontap="onAboutSysDialogClicked">
<view class="about_sys_dialog"> <view class="about_sys_dialog">
<view style="display:flex;direction:row;width:100%;margin-top:40rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:40rpx;">
<text style="color:#788192;">商户</text> <text style="color:#788192;">商户</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{merchantId}}</text>
</view> </view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">门店</text> <text style="color:#788192;">门店</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{storeName}}</text>
</view> </view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">门店号</text> <text style="color:#788192;">门店号</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{storeId}}</text>
</view> </view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">SN码</text> <text style="color:#788192;">SN码</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{snNo}}</text>
</view> </view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">小程序</text> <text style="color:#788192;">小程序</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{miniProgramId}}</text>
</view> </view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;"> <view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<text style="color:#788192;">版本号</text> <text style="color:#788192;">版本号</text>
<text style="flex:1;text-align:right;color:black;">--------</text> <text style="flex:1;text-align:right;color:black;">{{versionCode}}</text>
</view> </view>
</view> </view>
</mp-dialog> </mp-dialog>
......
...@@ -8,6 +8,9 @@ Page({ ...@@ -8,6 +8,9 @@ Page({
welcomeUrl:"http://hh-oss-picture.miyapay.com/box/e710f5d9866d4b927eb6dcc1e21d5295.png", welcomeUrl:"http://hh-oss-picture.miyapay.com/box/e710f5d9866d4b927eb6dcc1e21d5295.png",
miyaLogo:'http://hh-oss-picture.miyapay.com/box/8f9a536c1d12437ad5942bbc36aaa365.png', miyaLogo:'http://hh-oss-picture.miyapay.com/box/8f9a536c1d12437ad5942bbc36aaa365.png',
wechatPay:'http://hh-oss-picture.miyapay.com/box/246455ca047365502eb87abbd8592013.png', wechatPay:'http://hh-oss-picture.miyapay.com/box/246455ca047365502eb87abbd8592013.png',
isShowDialog:false,
verifyDialogButtons:[{text:'确定'}],
password:''
}, },
/** /**
...@@ -65,6 +68,44 @@ Page({ ...@@ -65,6 +68,44 @@ Page({
}, },
onLogoLongClicked:function(){
if(this.data.isShowDialog==false){
this.setData({
isShowDialog:true
})
}else{
this.setData({
isShowDialog:false
})
}
},
onPasswordInput:function(e){
this.setData({
password:e.detail.value
})
},
onVerifyDialogClicked:function(){
//验证密码
var loginInfo = wx.getStorageSync('loginInfo')
if(loginInfo.password == this.data.password){
this.setData({
isShowDialog:false,
password:""
})
wx.navigateTo({
url: '/pages/functioncenter/functioncenter',
})
}else{
wx.showToast({
title: '密码错误',
icon:'none',
duration: 1000
})
}
},
/** /**
* 跳转待支付页面 * 跳转待支付页面
*/ */
......
{ {
"usingComponents": {} "usingComponents": {
"mp-dialog": "/miniprogram_npm/weui-miniprogram/dialog/dialog"
}
} }
\ No newline at end of file
<!--pages/home.wxml--> <!--pages/home.wxml-->
<view class="container" style="justify-content:flex-start" bindtap="goToPay"> <view class="container" style="justify-content:flex-start;" >
<image class="operation-position" src="{{welcomeUrl}}"/> <image class="operation-position" style="background-color:black;" src="{{welcomeUrl}}"/>
<image class="miya-logo" src="{{miyaLogo}}"/> <image class="miya-logo" src="{{miyaLogo}}" bindlongpress="onLogoLongClicked"/>
<view class="btn-container"> <view class="btn-container" bindtap="goToPay">
<view class="btn-topay" /> <view class="btn-topay"/>
<image class="wechat-pay" src="{{wechatPay}}"/> <image class="wechat-pay" src="{{wechatPay}}"/>
</view> </view>
<mp-dialog title="身份验证" show="{{isShowDialog}}" buttons="{{verifyDialogButtons}}" bindbuttontap="onVerifyDialogClicked">
<view class="verifyDialog">
<input value="{{password}}" type="password" style="font-size:32rpx;width:100%;margin-top:60rpx;" bindinput="onPasswordInput" placeholder="输入密码"/>
<!--line-->
<view style="background-color:gray;width:100%;height:1rpx;"/>
</view>
</mp-dialog>
</view> </view>
...@@ -37,4 +37,12 @@ ...@@ -37,4 +37,12 @@
margin-left: 100rpx; margin-left: 100rpx;
margin-right: 100rpx; margin-right: 100rpx;
position: absolute; position: absolute;
}
.verifyDialog{
display: flex;
flex-direction: column;
width: 100%;
height:100%;
justify-content: center;
} }
\ No newline at end of file
...@@ -112,9 +112,10 @@ Page({ ...@@ -112,9 +112,10 @@ Page({
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
wx.setStorageSync('accountInfo', params) wx.setStorageSync('loginInfo', params)
//登录信息 =》 全局变量 //登录信息 =》 全局变量
getApp().globalData.localAccountInfo = res.data; getApp().globalData.localAccountInfo = res.data;
wx.setStorageSync('localAccountInfo', res.data.data)
wx.redirectTo({ wx.redirectTo({
url: '/pages/home/home', url: '/pages/home/home',
}) })
...@@ -152,7 +153,7 @@ Page({ ...@@ -152,7 +153,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
var accountInfo = wx.getStorageSync('accountInfo') || [] var accountInfo = wx.getStorageSync('loginInfo') || []
if(accountInfo != null){ if(accountInfo != null){
this.setData({ this.setData({
account:accountInfo.username, account:accountInfo.username,
......
...@@ -136,7 +136,7 @@ Page({ ...@@ -136,7 +136,7 @@ Page({
onReOpClicked:throttle(1000,function(){ onReOpClicked:throttle(1000,function(){
if(this.data.type==0){ if(this.data.type==0){
//重新支付 //重新支付
wx.navigateBack()
}else{ }else{
wx.navigateTo({ wx.navigateTo({
url: '/pages/refund/refund', url: '/pages/refund/refund',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment