12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- //index.js
- //获取应用实例
- const app = getApp()
- const util = require("../../util/util.js")
- Page({
- data: {
- StatusBar: app.globalData.StatusBar,
- CustomBar: app.globalData.CustomBar,
- CustomRate: app.globalData.CustomRate,
- info:{},
- swiperList:[],
- hot_list:[],
- },
- goCamara: function (el) {
- wx.navigateTo({
- url: '../flower/identify',
- })
- },
- onLoad: function ( ) {
- app.checkLogin( ()=>{
- this.loadData()
- } )
- },
- loadData :function( cb ){
- let that = this
- util.http("base/getActiveAd", {}, function (err, res) {
- if( err == 0){
- that.setData({ swiperList:res})
- }
- cb && cb()
- });
- },
- onShow: function(){
- this.data.info.id || this.loadData( );
- },
- gotoUserInfo: function (e) {
- wx.navigateTo({
- url: `/pages/user/home/myInfo`,
- })
- },
- gotoHistory: function (e) {
- wx.navigateTo({
- url: `/pages/garden/history/index`,
- })
- },
- gotoNearBy: function(e){
- wx.navigateTo({
- url: `/pages/user/map/map`,
- })
- },
- getDetail(e){
- let index = e.currentTarget.dataset.index;
- let id = this.data.hot_list[index].id
- wx.navigateTo({
- url: `/pages/garden/info/info?id=${id}`,
- })
- },
- linkWiki: function (e) {
- let name = e.currentTarget.dataset.name;
- if( !name ) return;
- wx.navigateTo({
- url: `/pages/wiki/info/wikiInfo?name=${name}`,
- })
- },
- gotoWikiList: function(e){
- wx.navigateTo({
- url: `/pages/wiki/index/index`
- })
- },
- gotoVoteList: function(e){
- wx.navigateTo({
- url: `/pages/vote/list/index`,
- })
- },
- onShareAppMessage: function () {
- return {
- title: "识花小助手",
- desc: "",
- imageUrl: "",
- path: '/pages/index/index',
- success: (res) => {
- util.showSuccess("邀请成功");
- },
- fail: (res) => {
- util.showMsg("转发失败");
- }
- }
- }
- })
|