This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MIT License | |
| // | |
| // Copyright (c) 2019 Simon Lightfoot | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (filter == DishUtils.FILTER_DISTANCE) { | |
| // 距离排序 申请权限 | |
| var context = this | |
| // 检查权限 | |
| wx.getSetting({ | |
| success: (res) => { | |
| if ('scope.userLocation' in res.authSetting) { | |
| // 表示申请过权限 | |
| if (res.authSetting["scope.userLocation"] != true) { | |
| wx.showModal({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_zero_timestamp(self): | |
| cur_timestamp = time.time() | |
| cur_time = time.localtime(cur_timestamp) | |
| zero_time_stamp = cur_timestamp - ( | |
| cur_time.tm_sec + 60 * cur_time.tm_min + 3600 * cur_time.tm_hour) | |
| return zero_time_stamp |