Showing
4 changed files
with
31 additions
and
6 deletions
| @@ -3,6 +3,7 @@ import util from '../../utils/util'; | @@ -3,6 +3,7 @@ import util from '../../utils/util'; | ||
| 3 | import App from '../../utils/api'; | 3 | import App from '../../utils/api'; |
| 4 | import TP from '../../utils/tpls'; | 4 | import TP from '../../utils/tpls'; |
| 5 | const {regeneratorRuntime} = global | 5 | const {regeneratorRuntime} = global |
| 6 | +import PubSub from '../../utils/PubSub' | ||
| 6 | Page({ | 7 | Page({ |
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| @@ -43,6 +44,20 @@ Page({ | @@ -43,6 +44,20 @@ Page({ | ||
| 43 | tpl:this.tpl, | 44 | tpl:this.tpl, |
| 44 | options:options, | 45 | options:options, |
| 45 | }) | 46 | }) |
| 47 | + PubSub.on( | ||
| 48 | + 'quick', | ||
| 49 | + data=>{ | ||
| 50 | + console.log('quick.msg',data) | ||
| 51 | + this.setData({ | ||
| 52 | + [`form.sid`]:data.id, | ||
| 53 | + [`form.name`]:data.name, | ||
| 54 | + [`form.addr`]:data.address, | ||
| 55 | + [`form.latitude`]:data.lat, | ||
| 56 | + [`form.longitude`]:data.long, | ||
| 57 | + }) | ||
| 58 | + this.checkHasSubmit(); | ||
| 59 | + } | ||
| 60 | + ) | ||
| 46 | }, | 61 | }, |
| 47 | initData(options){ | 62 | initData(options){ |
| 48 | if(options.rid){ | 63 | if(options.rid){ |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | <input value="{{form.name}}" bindinput="input" | 7 | <input value="{{form.name}}" bindinput="input" |
| 8 | data-key="name" | 8 | data-key="name" |
| 9 | placeholder="请输入店铺名称" placeholder-class="placeholder-class"/> | 9 | placeholder="请输入店铺名称" placeholder-class="placeholder-class"/> |
| 10 | - <view class="quick">快速选择</view> | 10 | + <formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids> |
| 11 | </view> | 11 | </view> |
| 12 | <view class="item flex-ll"> | 12 | <view class="item flex-ll"> |
| 13 | <picker | 13 | <picker |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import util from '../../../utils/util'; | 2 | import util from '../../../utils/util'; |
| 3 | import App from '../../../utils/api'; | 3 | import App from '../../../utils/api'; |
| 4 | const {regeneratorRuntime} = global | 4 | const {regeneratorRuntime} = global |
| 5 | +import PubSub from '../../../utils/PubSub' | ||
| 5 | Page({ | 6 | Page({ |
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| @@ -14,8 +15,9 @@ Page({ | @@ -14,8 +15,9 @@ Page({ | ||
| 14 | /** | 15 | /** |
| 15 | * 生命周期函数--监听页面加载 | 16 | * 生命周期函数--监听页面加载 |
| 16 | */ | 17 | */ |
| 18 | + options:{}, | ||
| 17 | onLoad: function (options) { | 19 | onLoad: function (options) { |
| 18 | - | 20 | + this.options=options |
| 19 | }, | 21 | }, |
| 20 | 22 | ||
| 21 | /** | 23 | /** |
| @@ -66,8 +68,16 @@ Page({ | @@ -66,8 +68,16 @@ Page({ | ||
| 66 | sellerEditor(e){ | 68 | sellerEditor(e){ |
| 67 | let i=util.attr(e,'index'); | 69 | let i=util.attr(e,'index'); |
| 68 | let sel=this.data.sellers[i]; | 70 | let sel=this.data.sellers[i]; |
| 69 | - wx.navigateTo({ | ||
| 70 | - url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel) | ||
| 71 | - }) | 71 | + if(this.options.hasQuick){ |
| 72 | + PubSub.emit( | ||
| 73 | + 'quick', | ||
| 74 | + sel | ||
| 75 | + ) | ||
| 76 | + wx.navigateBack(); | ||
| 77 | + }else{ | ||
| 78 | + wx.navigateTo({ | ||
| 79 | + url:'/pages/manager-invitation/setting/seller-editor?seller='+JSON.stringify(sel) | ||
| 80 | + }) | ||
| 81 | + } | ||
| 72 | }, | 82 | }, |
| 73 | }) | 83 | }) |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <view style="background-color: #F5F5F5;height: 2rpx;width: 100%;"></view> | 3 | <view style="background-color: #F5F5F5;height: 2rpx;width: 100%;"></view> |
| 4 | <view class="pages"> | 4 | <view class="pages"> |
| 5 | <block wx:for="{{sellers}}" wx:key="sellers.key"> | 5 | <block wx:for="{{sellers}}" wx:key="sellers.key"> |
| 6 | - <formids url="/pages/manager-invitation/setting/seller-editor" bindclick="sellerEditor" data-index="{{index}}"> | 6 | + <formids bindclick="sellerEditor" data-index="{{index}}"> |
| 7 | <view class="seller {{item.is_default==1?'active':''}}"> | 7 | <view class="seller {{item.is_default==1?'active':''}}"> |
| 8 | <view class="name">{{item.name}}</view> | 8 | <view class="name">{{item.name}}</view> |
| 9 | <view class="addr">{{item.address}}</view> | 9 | <view class="addr">{{item.address}}</view> |
-
Please register or login to post a comment