受欢迎的博客标签

1.建立目录

E:\iAspNetCoreMiniProgram\src\iAspNetCoreStocksoMiniProgramClound

 

 

2.点击开发工具->云开发->建立环境

 

3.上传云函数

 

4.在程序中app.js设置环境变量

//app.js
App({
  onLaunch: function () {
    
    if (!wx.cloud) {
      console.error('请使用 2.2.3 或以上的基础库以使用云能力')
    } else {
      wx.cloud.init({
        env: 'stockso-debug-0f1d93',// 前往云开发控制台获取环境id,如果使用默认环境则不需要填写
        traceUser: true,
      })
    }

    this.globalData = {}
  }
})

5.修改小程序标题

{
  "pages": [
    "pages/index/index"
    
  ],
  "window": {
    "backgroundColor": "#F6F6F6",
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#F6F6F6",
    "navigationBarTitleText": "股搜网小程序",
    "navigationBarTextStyle": "black"
  }
}

6.启用 weui样式

/**app.wxss**/
@import 'style/weui.wxss';
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
} 

7.加tabbar

图像等以iAspNetCoreStocksoMiniProgramClound\miniprogram为根目录

{
  "pages": [
    "pages/frontend/index/index",
    "pages/frontend/classify/index",
    "pages/frontend/cart/index",
    "pages/frontend/my/index"
  ],
  "window": {
    "backgroundColor": "#F6F6F6",
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#F6F6F6",
    "navigationBarTitleText": "股搜网小程序",
    "navigationBarTextStyle": "black"
  },
  "tabBar": {
    "color": "#999999",
    "selectedColor": "#479de6",
    "borderStyle": "white",
    "backgroundColor": "#fff",
    "list": [
      {
        "pagePath": "pages/frontend/index/index",
        "iconPath": "pages/frontend/images/iconfont-home.png",
        "selectedIconPath": "pages/frontend/images/iconfont-home-active.png",
        "text": "主页"
      },
      {
        "pagePath": "pages/frontend/classify/index",
        "iconPath": "pages/frontend/images/iconfont-list.png",
        "selectedIconPath": "pages/frontend/images/iconfont-list-active.png",
        "text": "分类"
      },
      {
        "pagePath": "pages/frontend/cart/index",
        "iconPath": "pages/frontend/images/iconfont-cart.png",
        "selectedIconPath": "pages/frontend/images/iconfont-cart-active.png",
        "text": "购物车"
      },
      {
        "pagePath": "pages/frontend/my/index",
        "iconPath": "pages/frontend/images/iconfont-user.png",
        "selectedIconPath": "pages/frontend/images/iconfont-user-active.png",
        "text": "我的"
      }
    ]
  }
}