Commit b75ed768 authored by pengguangpu's avatar pengguangpu

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

parent 4ac6e92e
{
"pages": [
"pages/pay_result/pay_result",
"pages/functioncenter/functioncenter",
"pages/login/login",
"pages/functioncenter/functioncenter",
"pages/pay_result/pay_result",
"pages/home/home",
"pages/logs/logs",
"pages/refund/refund",
"pages/balance/balance",
"pages/operation_waiting/operation_waiting",
"pages/home/home",
"pages/index/index"
],
"window": {
......
......@@ -6,14 +6,36 @@ Page({
*/
data: {
aboutSysDialogShow:false,
aboutSysDialogButtons:[{text:'确定'}]
aboutSysDialogButtons:[{text:'确定'}],
localAccountInfo:null,
merchantId:'',
storeName:'',
storeId:'',
snNo:'',
miniProgramId:'',
versionCode:''
},
/**
* 生命周期函数--监听页面加载
*/
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 @@
<view class="operation_layout">
<!--refund-->
<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>
<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>
<!--line-->
<view class="line"/>
<!--setting-->
<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>
<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>
<!--line-->
<view class="line"/>
<!--about sys-->
<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>
<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>
<!--line-->
<view class="line"/>
......@@ -46,33 +46,33 @@
<mp-dialog title="关于系统" show="{{aboutSysDialogShow}}" buttons="{{aboutSysDialogButtons}}" bindbuttontap="onAboutSysDialogClicked">
<view class="about_sys_dialog">
<view style="display:flex;direction:row;width:100%;margin-top:40rpx;">
<text style="color:#788192;">商户</text>
<text style="flex:1;text-align:right;color:black;">--------</text>
<text style="color:#788192;">商户</text>
<text style="flex:1;text-align:right;color:black;">{{merchantId}}</text>
</view>
<view style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<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 style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<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 style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<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 style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<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 style="display:flex;direction:row;width:100%;margin-top:20rpx;">
<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>
</mp-dialog>
......
......@@ -8,6 +8,9 @@ Page({
welcomeUrl:"http://hh-oss-picture.miyapay.com/box/e710f5d9866d4b927eb6dcc1e21d5295.png",
miyaLogo:'http://hh-oss-picture.miyapay.com/box/8f9a536c1d12437ad5942bbc36aaa365.png',
wechatPay:'http://hh-oss-picture.miyapay.com/box/246455ca047365502eb87abbd8592013.png',
isShowDialog:false,
verifyDialogButtons:[{text:'确定'}],
password:''
},
/**
......@@ -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-->
<view class="container" style="justify-content:flex-start" bindtap="goToPay">
<image class="operation-position" src="{{welcomeUrl}}"/>
<image class="miya-logo" src="{{miyaLogo}}"/>
<view class="container" style="justify-content:flex-start;" >
<image class="operation-position" style="background-color:black;" src="{{welcomeUrl}}"/>
<image class="miya-logo" src="{{miyaLogo}}" bindlongpress="onLogoLongClicked"/>
<view class="btn-container">
<view class="btn-topay" />
<view class="btn-container" bindtap="goToPay">
<view class="btn-topay"/>
<image class="wechat-pay" src="{{wechatPay}}"/>
</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>
......@@ -37,4 +37,12 @@
margin-left: 100rpx;
margin-right: 100rpx;
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({
icon: 'success',
duration: 2000
})
wx.setStorageSync('accountInfo', params)
wx.setStorageSync('loginInfo', params)
//登录信息 =》 全局变量
getApp().globalData.localAccountInfo = res.data;
wx.setStorageSync('localAccountInfo', res.data.data)
wx.redirectTo({
url: '/pages/home/home',
})
......@@ -152,7 +153,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
var accountInfo = wx.getStorageSync('accountInfo') || []
var accountInfo = wx.getStorageSync('loginInfo') || []
if(accountInfo != null){
this.setData({
account:accountInfo.username,
......
......@@ -136,7 +136,7 @@ Page({
onReOpClicked:throttle(1000,function(){
if(this.data.type==0){
//重新支付
wx.navigateBack()
}else{
wx.navigateTo({
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