12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- const app = getApp()
- Page({
-
- data: {
- },
-
- onLoad(options) {
- if(!wx.getStorageSync('userInfo')){
- wx.navigateTo({
- url: '/pages/login/login',
- })
- }
- let defaultStore = {}
- if (options.defaultStore) {
- defaultStore = JSON.parse(options.defaultStore)
- }
- if (Object.keys(defaultStore).length == 0) {
- defaultStore = app.globalData.storeData
- }
- this.setData({
- defaultStore: defaultStore
- })
- },
-
- onReady() {
- },
-
- onShow() {
- },
-
- onHide() {
- },
-
- onUnload() {
- },
-
- onPullDownRefresh() {
- },
-
- onReachBottom() {
- },
-
- onShareAppMessage() {
- },
- toStore() {
- let store = this.data.defaultStore
- let latitude = parseFloat(store.latitude)
- let longitude = parseFloat(store.longitude)
- wx.openLocation({
- latitude: parseFloat(store.latitude),
- longitude: parseFloat(store.longitude),
- name: store.belong_region
- })
- }
- })
|