Commit 2e325e8d378763f8f2b68e27820fe2c906820c0f

Authored by vking
1 parent 22137811

global layout get formid

... ... @@ -128,6 +128,9 @@
"desc": "你的位置信息用于获得离你最近的餐厅"
}
},
"usingComponents":{
"layout":"/components/layout"
},
"debug": true,
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
// components/layout.js
Component({
properties:{
},
data:{
},
methods:{
formSubmit: function(e) {
console.log('layout.formids',e.detail.formId)
if("the formId is a mock one"!=e.detail.formId){
let formids=wx.getStorageSync('formids') || [];
formids.push(e.detail.formId);
formids=[...new Set(formids)];
wx.setStorage({key:'formids',data:formids});
}
},
},
attached(){
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/layout.wxml-->
<form bindsubmit="formSubmit" report-submit class="layout">
<button formType="submit" class="button"
hover-class="none">
<view class="fixed"><slot></slot></view>
</button>
</form>
... ...
/* components/layout.wxss */
.layout {
display: inline-block;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: inherit;
text-align: left;
text-decoration: none;
line-height: inherit;
-webkit-tap-highlight-color: transparent;
color: inherit;
width: 100%;
position: relative;
}
.layout .button{
display: inline-block;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
font-size: inherit;
text-align: left;
text-decoration: none;
line-height: inherit;
-webkit-tap-highlight-color: #000;
color: inherit;
width: 100%;
position: relative;
}
.layout .button .fixed{
position:relative;
z-index: 9999;
width: 100%;
}
.layout .button:before,.layout .button:after{
border-width: 0;
}
\ No newline at end of file
... ...
<!--pages/reserve/detail.wxml-->
<layout>
<nav>{{seller.sellername}}</nav>
<!-- 包间预定 -->
<!-- 包间预定 -->
<view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}">
<view class="tabs-item flex-vc" bindtap="switchTabs" data-act="detail">
<view class="tabs-item-text {{activeTab=='detail'?'active':''}}">餐厅详情</view>
... ... @@ -217,4 +218,5 @@
date="{{reserveDate}}" bindselecttime="selecttime"></dur>
<view class="hasFullHouse Semibold flex-vc" wx:if="{{hasFullHouse}}">{{fullHouseMsg}}</view>
</view>
</view>
\ No newline at end of file
</view>
</layout>
\ No newline at end of file
... ...