uni-app Getting Started Tutorial

Official website

https://uniapp.dcloud.io/

Install SCSS/SASS compilation plugin and import

Installation address: https://ext.dcloud.net.cn/search?q=sass
insert image description here
insert image description here
Then you can start building the project

Project construction

tool

HbuilderX:https://dcloud.io/hbuilderx.html

Create project

insert image description here
Click Create to create success

Project structure

insert image description here

Configure and develop WeChat applet

[Step 1:] Configure the WeChat developer tool path

Tools -> Settings -> Run Configurations
insert image description here

[Step 2:] Configure the AppID corresponding to the WeChat applet

manifest.json—"WeChat applet configuration
insert image description here

[Step 3:] Open the WeChat applet service port (in the WeChat developer tool)

Settings -> Security Settings
insert image description here

[Step 4:] Implement the case and run the project

Create page

Choose to use scss page
insert image description here
to create 4 pages, cart, cate, home, my

Create icon file

Put it under static static resources
insert image description here

configure pages.json

{
    
    
	"pages": [{
    
    
		"path": "pages/home/home",
		"style": {
    
    
			"navigationBarTitleText": "uni-app"
		}
	}    ,{
    
    
            "path" : "pages/cart/cart",
            "style" :                                                                                    
            {
    
    
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
            
        }
        ,{
    
    
            "path" : "pages/cate/cate",
            "style" :                                                                                    
            {
    
    
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
            
        }
        ,{
    
    
            "path" : "pages/my/my",
            "style" :                                                                                    
            {
    
    
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
            
        }
    ],
	"globalStyle": {
    
    
		"navigationBarTextStyle": "black",
		"navigationBarTitleText": "uni-app",
		"navigationBarBackgroundColor": "#F8F8F8",
		"backgroundColor": "#F8F8F8",
		"app-plus": {
    
    
			"background": "#efeff4"
		}
	},
	"tabBar": {
    
    
	    "list": [
	      {
    
    
	      "pagePath": "pages/home/home",
	      "text": "首页",
	      "iconPath": "static/icons/home.png",
	      "selectedIconPath": "static/icons/home-o.png"
	      },
	      {
    
    
	        "pagePath": "pages/cate/cate",
	        "text": "分类",
	        "iconPath": "static/icons/category.png",
	        "selectedIconPath": "static/icons/category-o.png"
	      },
	      {
    
    
	        "pagePath": "pages/cart/cart",
	        "text": "购物车",
	        "iconPath": "static/icons/cart.png",
	        "selectedIconPath": "static/icons/cart-o.png"
	      },
	      {
    
    
	        "pagePath": "pages/my/my",
	        "text": "我的",
	        "iconPath": "static/icons/my.png",
	        "selectedIconPath": "static/icons/my-o.png"
	      }
	  ]
	  }
}


run

insert image description here
insert image description here
run successfully~

Guess you like

Origin blog.csdn.net/m_xiaozhilei/article/details/124192703