| | |
| | | import { getShopDetail } from '../../api/index' |
| | | import { getShopDetail,loadShopList } from '../../api/index' |
| | | // pages/store/index.js |
| | | Page({ |
| | | |
| | |
| | | */ |
| | | data: { |
| | | shopId: null, |
| | | shopInfo:{} |
| | | }, |
| | | shopInfo:{}, |
| | | shopList:[] |
| | | },buo |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options.shopId) |
| | | this.setData({shopId:options.shopId}) |
| | | // this.loadShopList() |
| | | // this.setData({shopId:options.shopId}) |
| | | }, |
| | | getShopInfo(id){ |
| | | |
| | | getShopDetail(id).then(res => { |
| | | loadShopList(params) { |
| | | loadShopList({}).then(res => { |
| | | if(res.data &&res.data){ |
| | | const t = ''; |
| | | res.data.forEach(item => { |
| | | if(item.seqNameList && item.seqNameList.length){ |
| | | const tindex =0; |
| | | item.seqNameList.forEach(element => { |
| | | if(tindex>0){ |
| | | t =t+"、" |
| | | } |
| | | t = t+ element; |
| | | tindex++; |
| | | }); |
| | | } |
| | | item.seqNameInfo = t; |
| | | }); |
| | | } |
| | | this.setData({ |
| | | shopList: res.data || [] |
| | | }) |
| | | }) |
| | | }, |
| | | getShopInfo(id){ |
| | | getShopDetail(id).then(res => { |
| | | if(res.data && res.data.seqNameList){ |
| | | const t = ''; |
| | | const tindex =0; |
| | |
| | | }) |
| | | }, |
| | | handleEdit(e) { |
| | | const {shopInfo} = this.data |
| | | const objString = JSON.stringify(shopInfo); |
| | | // const {shopInfo} = this.data |
| | | const objString = JSON.stringify(e.target.dataset.index); |
| | | console.log(objString) |
| | | wx.navigateTo({ |
| | | url: '/pages/store/info?data='+objString , |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | this.getShopInfo(this.data.shopId) |
| | | // this.getShopInfo(this.data.shopId) |
| | | this.loadShopList() |
| | | }, |
| | | |
| | | /** |