Commit adf71f5db6c0ef218b7b9e1dadb90c98d910f6e4

Authored by wangfan
1 parent 9b7bfc96

nav

... ... @@ -5,7 +5,12 @@ const { regeneratorRuntime } = global
App({
openid:"",
system:{},
shareTicket:"",
onLaunch: async function (opt) {
console.log('onLaunch',opt);
if(opt.shareTicket){
this.shareTicket=opt.shareTicket;
}
this.getSystemInfo();
this.openid=await this.getOpenid();
console.log('this.openid',this.openid);
... ...
... ... @@ -8,10 +8,11 @@
"pages/book/b_desk",
"pages/customer/detail_owner",
"pages/customer/detail_customer",
"pages/customer/list",
"pages/customer/invite"
"pages/customer/invite",
"pages/customer/list"
],
"window": {
"navigationStyle":"custom",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#199095",
"navigationBarTitleText": "点餐商户端",
... ...
// components/nav/nav.js
Component({
/**
* 组件的属性列表
*/
properties: {
backgroundColor:{
type:String,
value:'#ffffff'
},
color:{
type:String,
value:'#000000'
},
hasHome:{
type:Boolean,
value:false
}
},
/**
* 组件的初始数据
*/
data: {
disHome:false,
disBack:false,
},
attached(){
let disBack = false;
let disHome = false;
let pages = getCurrentPages();
console.log('pages.length',pages.length);
if (pages.length > 1) {
disBack = true;
} else {
if (getApp().shareTicket && this.data.hasHome) {
disHome = true;
}
}
this.setData({
statusBarHeight: getApp().system.statusBarHeight,
disHome: disHome,
disBack: disBack,
})
console.log('this.setData',this.data);
},
/**
* 组件的方法列表
*/
methods: {
back(){
wx.navigateBack()
},
home(){
wx.reLaunch({
url:'/pages/customer/index'
})
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/nav/nav.wxml-->
<view class="nav" style="padding-top: {{statusBarHeight*2}}rpx;background-color: {{backgroundColor}};color:{{color}};">
<view class="flex-lr part">
<view class="opt flex-ll">
<view class="back flex-vc" bindtap="back" wx:if="{{disBack}}">
<image class="back-image" src="http://qn.colorcun.com/custom/lite-yd/image/back.png"></image>
</view>
<view class="home flex-vc" bindtap="home" wx:if="{{disHome}}">
<image class="home-image" src="http://qn.colorcun.com/custom/lite-yd/image/home.svg"></image>
</view>
</view>
<view class="title" bindtap="home">
<slot></slot>
</view>
<view class="opt">
<view></view>
</view>
</view>
</view>
... ...
/* components/nav/nav.wxss */
@import "../../app.wxss";
.nav{
font-size: 30rpx;
font-weight: bold;
}
.nav .part{
background-color: #ffffff;
line-height: 68rpx;
height: 68rpx;
margin-top: 10rpx;
text-align: center;
}
.nav .part .title{
width: 100%;
}
.nav .part .opt{
min-width: 188rpx;
}
.nav .part .opt view{
width: 68rpx;
height: 68rpx;
margin-left: 26rpx;
}
.nav .part .opt .back-image{
height: 32rpx;
width: 18rpx;
}
.nav .part .opt .home-image{
height: 34rpx;
width: 36rpx;
}
... ...
... ... @@ -17,6 +17,9 @@ Page({
*/
onLoad: function (options) {
this.id=options.id;
wx.showShareMenu({
withShareTicket: true
})
},
/**
... ...
... ... @@ -4,6 +4,7 @@
"navigationBarTitleText":"订个座儿",
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/customer/list.wxml-->
<nav hasHome>订个座儿</nav>
<view class="page">
<view class="tabs flex-cc">
<view class="item {{0==tabFlag?'active':''}}"
... ...
... ... @@ -74,7 +74,12 @@
"name": "pages/customer/index",
"pathName": "pages/customer/index",
"query": "",
"scene": "1001"
"scene": "1044",
"shareInfo": {
"groupName": "测试模拟群1",
"shareName": "8DEbIRpK4pa9mH_QY2vU4ZUKYPuI97WoQ4BQoFej-Q8@cr4dev",
"shareKey": "PZhnqMlY2TnRuHhATyGeSamVmBQUDXXr_WtjRSddeeFK17UAiOP-HNOdhxiEN7PFub5S1DjAeUl0IXOdW-VDqg~~"
}
},
{
"id": -1,
... ...