Commit d18cb77aeeeb241d9d0094324c6ca837f485ce9f

Authored by wangfan
1 parent ccb30006

manager-invitation

... ... @@ -3,6 +3,7 @@ import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
import PubSub from '../../utils/PubSub'
Page({
/**
... ... @@ -43,6 +44,20 @@ Page({
tpl:this.tpl,
options:options,
})
PubSub.on(
'quick',
data=>{
console.log('quick.msg',data)
this.setData({
[`form.sid`]:data.id,
[`form.name`]:data.name,
[`form.addr`]:data.address,
[`form.latitude`]:data.lat,
[`form.longitude`]:data.long,
})
this.checkHasSubmit();
}
)
},
initData(options){
if(options.rid){
... ...
... ... @@ -7,7 +7,7 @@
<input value="{{form.name}}" bindinput="input"
data-key="name"
placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
<view class="quick">快速选择</view>
<formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids>
</view>
<view class="item flex-ll">
<picker
... ...
... ... @@ -2,6 +2,7 @@
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
Page({
/**
... ... @@ -14,8 +15,9 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
options:{},
onLoad: function (options) {
this.options=options
},
/**
... ... @@ -66,8 +68,16 @@ Page({
sellerEditor(e){
let i=util.attr(e,'index');
let sel=this.data.sellers[i];
wx.navigateTo({
url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel)
})
if(this.options.hasQuick){
PubSub.emit(
'quick',
sel
)
wx.navigateBack();
}else{
wx.navigateTo({
url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel)
})
}
},
})
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
<view style="background-color: #F5F5F5;height: 2rpx;width: 100%;"></view>
<view class="pages">
<block wx:for="{{sellers}}" wx:key="sellers.key">
<formids url="/pages/manager-invitation/setting/seller-editor" bindclick="sellerEditor" data-index="{{index}}">
<formids bindclick="sellerEditor" data-index="{{index}}">
<view class="seller {{item.is_default==1?'active':''}}">
<view class="name">{{item.name}}</view>
<view class="addr">{{item.address}}</view>
... ...