search
HomeWeChat AppletMini Program DevelopmentExample sharing of WeChat applet implementing process progress function

WeChat mini program can be said to be very popular. I am currently working on a WeChat mini program and need to implement a process progress function. This article mainly shares with you the implementation of process progress function in WeChat mini program. I hope it can help everyone. The diagram style is as follows Surface:

Example sharing of WeChat applet implementing process progress function

Requirements:

  1. Unfinished gray dots indicate

  2. Complete settings are made using blue dots

  3. The current status is represented by small dots with an outer ring

    It is relatively simple to implement. To implement the idea, use a list Implementation, the style of each item in the list is as shown below

    Example sharing of WeChat applet implementing process progress function

    The drawing using win10 drawing board is not good-looking

    The meaning of the picture is that there is something in front of each item A line has a circle in the middle and a line behind it. The reason for this is that the text below needs to be centered under the circle. If no text is needed, it would be simpler to have a circle followed by a straight line.

According to the above picture, the html layout is as follows

   <view>
      <view>
        <view>
          <view></view>
          <image></image>
          <view></view>
        </view>
        <text>{{item.name}}</text>
      </view>
    </view>

OK The list definitely needs an array. The array is as follows

processData: [{
      name: '提交工单',
      start: '#fff',
      end: '#EFF3F6',
      icon: '../../img/process_1.png'
    },
    {
      name: '已接单',
      start: '#EFF3F6',
      end: '#EFF3F6',
      icon: '../../img/process_1.png'
    },
    {
      name: '开始维修',
      start: '#EFF3F6',
      end: '#EFF3F6',
      icon: '../../img/process_1.png'
    },
    {
      name: '维修结束',
      start: '#EFF3F6',
      end: '#EFF3F6',
      icon: '../../img/process_1.png'
    },
    {
      name: '已确认',
      start: '#EFF3F6',
      end: '#fff',
      icon: '../../img/process_1.png'
    }],
  },

According to the item picture above, we will see that if it is displayed directly, there will be an extra line on both sides. How to remove these two lines? It is very simple. Just make the background color of the parent container the same as the first color. La.

Change the background of the parent layout to white, then control the color of the front line segment in the first item in the list to white, and the color of the back line segment in the last item to white. This way it looks like the line segments on both sides have been removed

When the data changes, we only need to change the properties of the objects in the array. It is better to use the following as a reference

//进度条的状态
  setPeocessIcon: function () {
    var index = 0//记录状态为1的最后的位置
    var processArr = this.data.processData
    // console.log("progress", this.data.detailData.progress)
    for (var i = 0; i <p> </p><p>In the data of the above code, state is used to represent completion and incompleteness. We set the completed ones to blue and the unfinished ones to gray. </p><p>Use index to record whether it is the current point (the current point is the last one completed by state). </p><p>The code in the final css is also very simple</p><pre class="brush:php;toolbar:false">.order_process {
  display: flex;
  flex-wrap: nowrap;
  padding: 10rpx 10rpx 20rpx 10rpx;
  background-color: #fff;
}

.process_wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
}

.process {
  display: flex;
  align-items: center;
  width: 100%;
}

.process_icon {
  width: 50rpx;
  height: 50rpx;
}

.process_line {
  background: #eff3f6;
  flex: 1;
  height: 5rpx;
}

.process_name {
  font-size: 24rpx;
}

Related recommendations:

Introduction to the method of displaying the process progress bar by combining JS and HTML

Use CSS to implement the process progress bar with arrows

How to implement the progress bar function of h5 timer

The above is the detailed content of Example sharing of WeChat applet implementing process progress function. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor