当前位置:网站首页>Uni app wechat applet - Mall (4) - merchants
Uni app wechat applet - Mall (4) - merchants
2022-07-19 01:31:00 【Xu xiaoshuo】
The last article introduced the content of the mall homepage , The home page of the mall is also the home page of the default applet , It mainly introduces the types of commodities and commodity display . This article will introduce some information about businesses , The specific content has not been improved , Just show different categories of businesses , There is no specific content introduction to the business , The follow-up will gradually improve , Then update the content of this chapter
The effect is shown below :

The specific code is as follows :
<template>
<view class="shopContent">
<view class="header">
<van-row>
<!-- Search box -->
<van-col span="24">
<van-search :value="searchValue" shape="round" placeholder=" Please enter search keywords " show-action @change="onChange" @search="onSearch" />
</van-col>
</van-row>
</view>
<view class="nav">
<van-tree-select
:items="shopList"
:main-active-index.sync="mainActive"
:active-id="activeId"
@click-nav="onNavClick"
@click-item="onClickItem"
>
<template slot="content">
</template>
</van-tree-select>
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchValue: '',
// List of shops
shopList:[],
mainActive:0,
activeId:0,
}
},
onLoad() {
// Obtain shop information
this.getShopData();
},
methods: {
/* Search for onChange */
onChange(e) {
this.value = e.detail
},
/* Search for onSearch */
onSearch() {
},
// Obtain shop information
getShopData(){
var data = {
"shops": [{
"activeId": 0,
"text": " All shops ",
"children":[{
"id":1,
"text":" The daily optimal fresh 0",
},
{
"id":2,
"text":" Fruit shop 0",
},
{
"id":3,
"text":" Don't give up your clothes 0",
}]
},
{
"activeId":1,
"text": " Popularity ranking ",
"children":[{
"id":11,
"text":" The daily optimal fresh 1",
},
{
"id":12,
"text":" Fruit shop 1",
},
{
"id":13,
"text":" Don't give up your clothes 1",
}]
},
{
"activeId": 2,
"text": " Rating ranking ",
"children":[{
"id":21,
"text":" The daily optimal fresh 2",
},
{
"id":22,
"text":" Fruit shop 2",
},
{
"id":23,
"text":" Don't give up your clothes 2",
}]
},
]
};
this.shopList = data.shops
console.log(this.shopList)
},
// Left navigation click event
onNavClick({ detail = {} }) {
console.log(detail.index)
this.mainActive = detail.index
},
// Select the event on the right
onClickItem({detail = {} }){
console.log(detail)
}
}
}
</script>
<style>
.shopContent{
width: 100%;
height: 100%;
margin: 0 ;
}
.header{
width: 100%;
height: 20%;
}
.nav{
width: 100%;
height: 80%;
}
.van-tree-select{
height: 100% !important;
}
.van-tree-select__content{
-webkit-flex: 3!important;
flex: 3!important;
}
</style>
Although the page is relatively simple , There are few functions , But the specific business process is still implemented , In the future, I will improve this function module in detail , Add the details page of the merchant, etc
This page mainly uses Vant Weapp Medium van-tree-select Components , Category selection , To realize the classification of different types of stores .
This chapter will be written here first , If there is any deficiency , Still hope more , thank you ~
边栏推荐
- C Programming Language(2nd Edition)--读书笔记--1.5.1
- uni 阻止按钮多次点击 按钮多次点击
- Eye of depth III - (6)] mathematics: matrix diagonalization and quadratic form 1
- markdown编辑器语法——文字颜色、大小、字体与背景色的设置(转载)
- The C Programming Language 2nd --笔记--6.7
- 列表懒加载和图片懒加载
- Day14 view set and route
- How to modify the color of a line of text in the elemtnui table (elemtnui table modifies the color of a line of text)
- uni-app微信公众号(4)——地址管理页面
- [GFCTF 2021]Baby_ Cve-2021-41773 on the web
猜你喜欢

JS intercepts the first few digits of the string or the last few digits of the string

深度之眼三——(3)】 数学:矩阵特征值与特征向量1

当 std::bind 遇上 this
![Record buuctf [netding Cup 2018] unfinish1 problem solving ideas](/img/29/6cf1eb89f1cbe087438645668ce103.png)
Record buuctf [netding Cup 2018] unfinish1 problem solving ideas

From catf1ag two-hour AK match pwn/attack killing, summarize the common command guide of emergency response

Oracle database enables archive log mode and archive log deletion and generation frequency

【ElenmentUI el-date-picker日期选择器,结束时间不得早于开始时间,且只能选择距开始时间指定天数的日期】

Recording multiple environments at a time leads to code bugs

页面布局——三栏布局解决方式

Oracle database 12C parameter files (SPFILE and pfile)
随机推荐
物联网开发基础
深度之眼三——(7,8)】数学:矩阵对角化及二次型2.3
(6) Test command
(八)Shell函数
Oracle database enables archive log mode and archive log deletion and generation frequency
js获取一个文件名的后缀格式
深度之眼三——(3)】 數學:矩陣特征值與特征向量1
mock平台的使用说明
JS replaces a character in the string, and JS modifies the specified character in the string
自己封裝的風格化的開關卡片組件
promise
使用leaflet仿原神提瓦特大地图制作日记
The C Programming Language(2nd)--笔记--1.9
uni 阻止按钮多次点击 按钮多次点击
es6 map提取数组对象
JSX syntax
页面布局——三栏布局解决方式
深度之眼三——(7)】数学:svd分解的应用
当 std::bind 遇上 this
使用bat自动执行cmd命令(多个命令或单个命令)