Method, device, equipment and medium for controlling the side menu bar of a mini program
By initializing and receiving gesture touch commands to control the expansion and closing of the mini-program side menu bar, the problem of lack of side menu bar operation in the mini-program is solved, and the user experience and interactivity are improved.
Patent Information
- Application Number
- CN201910532102.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-19
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-09-16
AI Technical Summary
Existing mini-programs lack a way to expand and close the side menu bar, resulting in insufficient user interaction experience.
By initializing the side menu bar parameters, receiving gesture touch instructions, and controlling the expansion and closing of the side menu bar according to the menu bar extraction distance and gesture movement distance parameters.
The mini program can flexibly expand and close the side menu bar according to user gestures, improving user experience and humanized interaction.
Smart Images

Figure CN110362248B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and specifically to a method, device, electronic device, and computer-readable storage medium for controlling a side menu bar of a mini-program. Background Art
[0002] With the development of mobile Internet, the scale of mini-program applications is getting larger and larger, so there will be more and more requirements for interaction. For example, the implementation of a sliding side menu bar. Currently, there is no way to implement a side menu bar in mini-programs. Therefore, how to expand and close the sidebar in mini-programs has become a technical problem that needs to be solved urgently. Summary of the Invention
[0003] The purpose of the present disclosure is to provide a method, device, electronic device and computer-readable storage medium for controlling a mini-program side menu bar, which can solve at least one of the above problems.
[0004] According to an embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for controlling a side menu bar of a mini-program, comprising:
[0005] Initializing the side menu bar parameters with the fixed end of the side menu bar as the origin, the side menu bar parameters including the menu bar extraction distance parameter and the gesture movement distance parameter;
[0006] receiving a gesture touch instruction, and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the gesture touch instruction;
[0007] The expansion and / or closing instructions of the side menu bar are executed according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter.
[0008] Optionally, initializing the side menu bar parameters with the fixed end of the side menu bar as the origin includes:
[0009] Create a side menu bar root element with the fixed end of the side menu bar as the origin;
[0010] The position attribute, size attribute, menu bar extraction distance parameter and gesture movement distance parameter of the side menu bar are preset under the root element, and a touch callback function is bound to the root element.
[0011] Optionally, the receiving a touch gesture instruction and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction includes:
[0012] A gesture touch instruction is received, the touch callback function is determined based on the gesture touch instruction, and the menu bar extraction distance parameter and / or the gesture movement distance parameter is updated according to the touch callback function.
[0013] Optionally, the receiving of the touch gesture instruction, determining the touch callback function based on the touch gesture instruction, and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch callback function, then includes:
[0014] Determine whether the updated gesture movement distance parameter is less than the negative menu bar width value;
[0015] If yes, the menu bar extraction distance parameter is set to the negative width value of the menu bar, and the side menu bar is expanded;
[0016] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0017] Optionally, setting the menu bar extraction distance parameter as the updated gesture movement distance parameter includes:
[0018] Determining whether the menu bar extraction distance parameter is less than a first fixed value, and an absolute value of the first fixed value is less than the menu bar width value;
[0019] If yes, then set the menu bar extraction distance parameter to the negative width of the menu bar;
[0020] Otherwise, the menu bar extraction distance parameter is set to 0.
[0021] Optionally, the receiving of the touch gesture instruction, determining the touch callback function based on the touch gesture instruction, and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch callback function, then includes:
[0022] Determine whether the updated gesture movement distance parameter is greater than the menu bar width value;
[0023] If yes, set the menu bar extraction distance parameter to 0;
[0024] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0025] Optionally, setting the menu bar extraction distance parameter as the updated gesture movement distance parameter includes:
[0026] Determining whether the menu bar extraction distance parameter is greater than a second set value, and the absolute value of the second set value is less than the menu bar width value;
[0027] If yes, set the menu bar extraction distance parameter to 0;
[0028] Otherwise, the menu bar extraction distance parameter is set to the negative width value of the menu bar.
[0029] Optionally, executing the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter includes:
[0030] Setting the menu bar extraction distance parameter to the negative width of the menu bar, and expanding the side menu bar; and / or
[0031] The menu bar extraction distance parameter is set to 0, and the side menu bar is closed.
[0032] According to an embodiment of the present disclosure, in a second aspect, the present disclosure provides a device for controlling a side menu bar of a mini-program, comprising:
[0033] an initialization unit, configured to initialize the side menu bar parameters with the fixed end of the side menu bar as an origin, wherein the side menu bar parameters include a menu bar extraction distance parameter and a gesture movement distance parameter;
[0034] an updating unit, configured to receive a touch gesture instruction and update the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction;
[0035] An execution unit is used to execute the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter.
[0036] According to an embodiment of the present disclosure, in a third aspect, the present disclosure provides an electronic device, comprising a processor and a memory, wherein the memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, any method step described in the first aspect is implemented.
[0037] According to an embodiment of the present disclosure, in a fourth aspect, the present disclosure provides a computer-readable storage medium, characterized in that computer program instructions are stored therein, and the computer program instructions implement any method steps described in the first aspect when called and executed by a processor.
[0038] Compared with the prior art, the embodiments of the present disclosure have the following advantages:
[0039] The disclosed embodiment improves the technical indicators of the mini-program page, allowing the mini-program to flexibly expand and close the side menu bar according to the user's gesture actions, greatly improving the user experience of the mini-program. As a result, the mini-program not only meets user needs in terms of usage functions, but also provides a more user-friendly gesture experience, thereby enhancing the application value of the mini-program. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 A flowchart of a method for controlling a side menu bar of a mini-program provided by an embodiment of the present disclosure;
[0042] Figure 2 A schematic diagram of the execution flow of a method for controlling a mini-program side menu bar according to an embodiment of the present disclosure;
[0043] Figure 3 A schematic diagram of the structure of a control device for a mini-program side menu bar provided in one embodiment of the present disclosure;
[0044] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0046] The terms used in the embodiments of the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit the present disclosure. The singular forms "a," "the," and "the" used in the embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. "A plurality" generally includes at least two, but does not exclude the inclusion of at least one.
[0047] It should be understood that the term "and / or" as used herein is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0048] It should be understood that although the terms "first," "second," "third," etc. may be used to describe technical names in the embodiments of the present disclosure, these technical names should not be limited to these terms. These terms are only used to distinguish the technical names. For example, without departing from the scope of the embodiments of the present disclosure, the first verification signature may also be referred to as the second verification signature, and similarly, the second verification signature may also be referred to as the first verification signature.
[0049] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0050] It should also be noted that the terms "include," "comprises," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the product or system comprising the element.
[0051] In addition, the step sequence in the following embodiments is only an example and not a strict limitation.
[0052] like Figure 1 As shown, the general implementation process of the present disclosure is shown. Specifically, according to the implementation of the present disclosure, in the first aspect, the present disclosure provides a method for controlling the side menu bar of a mini-program, and the control method includes expanding / closing the side menu bar of the mini-program, and specifically includes the following steps:
[0053] Step S102: accepting a touch command, the mini-program is activated.
[0054] The mini program is an application that can be used without downloading and installing. When using it, the user only needs to click the mini program icon or load it while using another program (such as WeChat).
[0055] The activation may be any conventional activation method, including but not limited to a single click or double click of a mouse, a single click or double click of a finger, etc. There is no specific limitation on the method of the touch instruction.
[0056] Step S104: initializing the side menu bar parameters with the fixed end of the side menu bar as the origin, wherein the side menu bar parameters include a menu bar extraction distance parameter and a gesture movement distance parameter.
[0057] The side can be any side of the mini program, including the left, right, top and bottom. In order to accurately describe the solution, the embodiment of this disclosure takes the right side as an example.
[0058] The definition of the origin is to accurately obtain the touch point position parameters. The origin position determined in the embodiment of the present disclosure is not limited, but it is preferred to facilitate the interpretation of the parameters.
[0059] Optionally, initializing the side menu bar parameters with the fixed end of the side menu bar as the origin includes:
[0060] Create a side menu bar root element with the fixed end of the side menu bar as the origin;
[0061] The position attribute, size attribute, menu bar extraction distance parameter and gesture movement distance parameter of the side menu bar are preset under the root element, and a touch callback function is bound to the root element.
[0062] like Figure 2 As shown in the specific example, create a <view>Tag, as the root element of the side menu bar. Set its style position to absolute, so that the element is absolutely positioned, with the upper left corner of the parent element as the origin. Set its style, width to 300px, height to 100%, so that the element is the same size as the parent element, that is, the same size as the page. Set its style, left to 100%, so that the element will be aligned on the left with 100% of its own width, that is, the element will move to the right by its own width. Set its style, transform to translateX (-menuOut pixels), so that the element will move menuOut pixels to the left.
[0063] Initialize the variable menuOut to 0, which represents the distance the menu bar is pulled out. Initialize the variable userMove to 0, which represents the distance the user's finger moves.
[0064] The following three callback functions are bound to the root node: touchstart (finger touch action starts), touchmove (finger moves after touch), touchend (finger touch ends). The callback functions are used to give the state value of the finger's moving position change through the finger's touch.
[0065] Step S106: receiving a touch gesture instruction, and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction.
[0066] Optionally, the receiving a touch gesture instruction and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction includes:
[0067] A gesture touch instruction is received, the touch callback function is determined based on the gesture touch instruction, and the menu bar extraction distance parameter and / or the gesture movement distance parameter is updated according to the touch callback function.
[0068] In an optional implementation manner, for expanding the sidebar, the specific steps include:
[0069] Determine whether the updated gesture movement distance parameter is less than the negative menu bar width value;
[0070] If yes, the menu bar extraction distance parameter is set to the negative width value of the menu bar, and the side menu bar is expanded;
[0071] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0072] Optionally, setting the menu bar extraction distance parameter as the updated gesture movement distance parameter includes:
[0073] Determining whether the menu bar extraction distance parameter is less than a first fixed value, and an absolute value of the first fixed value is less than the menu bar width value;
[0074] If yes, the menu bar extraction distance parameter is set to the negative width value of the menu bar, and the side menu bar is expanded;
[0075] Otherwise, the menu bar extraction distance parameter is set to 0, and the side menu bar is closed.
[0076] like Figure 2 As shown, specifically, in the touchstart callback function, the value of clientX of the finger is obtained from the callback parameters and stored in the variable startX.
[0077] In the touchmove callback function, obtain the finger's clientX value from the callback parameter and store it in the variable moveX. Then set userMove to moveX - startX. Check whether userMove is less than the negative of the menu bar width. If so, the user's finger slid beyond the menu's width. Set menuOut to the negative of the menu bar width, that is, -300. Otherwise, set menuOut to userMove.
[0078] In the touchend callback function, determine whether menuOut is less than a certain value, for example, -150. If it is, set menuOut to the negative width of the menu bar, that is, -300. If not, set menuOut to 0, that is, the menu bar is retracted.
[0079] In another optional specific implementation, closing the sidebar includes the following method steps:
[0080] Determine whether the updated gesture movement distance parameter is greater than the menu bar width value;
[0081] If yes, the menu bar extraction distance parameter is set to 0, and the side menu bar is closed;
[0082] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0083] Specifically, in the touchstart callback function, the clientX value of the finger is obtained from the callback parameters and stored in the variable startX.
[0084] In the touchmove callback function, obtain the finger's clientX value from the callback parameter and store it in the variable moveX. Then set userMove to moveX - startX. Check whether userMove is greater than the menu bar width. If so, the user's finger slid beyond the menu's width, and set menuOut to 0. Otherwise, set menuOut to userMove.
[0085] In the touchend callback function, check whether menuOut is greater than a certain value, for example, 150. If so, set menuOut to 0, which means the menu bar is retracted. Otherwise, set menuOut to the negative width of the menu bar, that is, -300, and the menu bar remains expanded.
[0086] Step S108: executing the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter.
[0087] The menu bar extraction distance parameter is set to the negative menu bar width value, such as -300, and the side menu bar is expanded; and / or the menu bar extraction distance parameter is set to 0, and the side menu bar is closed.
[0088] The disclosed embodiment improves the technical indicators of the mini-program page, allowing the mini-program to flexibly expand and close the side menu bar according to the user's gesture actions, greatly improving the user experience of the mini-program. As a result, the mini-program not only meets user needs in terms of usage functions, but also provides a more user-friendly gesture experience, thereby enhancing the application value of the mini-program.
[0089] Example 2
[0090] like Figure 3 As shown, a schematic diagram of the control device structure of the mini-program side menu bar of an embodiment of the present disclosure is given. This embodiment is used to implement the method described in Example 1, and the description of the same structure, function, and effect can be found in Example 1, which will not be repeated here.
[0091] Specifically, according to an embodiment of the present disclosure, in a second aspect, the present disclosure provides a device for controlling a side menu bar of a mini-program, including an initialization unit 302, an update unit 304, and an execution unit 306, specifically as follows:
[0092] An initialization unit 302 is configured to initialize the side menu bar parameters with the fixed end of the side menu bar as an origin, wherein the side menu bar parameters include a menu bar extraction distance parameter and a gesture movement distance parameter;
[0093] An updating unit 304 is configured to receive a touch gesture instruction and update the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction;
[0094] The execution unit 306 is configured to execute the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter.
[0095] Optionally, the initialization unit 302 is further used to:
[0096] Create a side menu bar root element with the fixed end of the side menu bar as the origin;
[0097] The position attribute, size attribute, menu bar extraction distance parameter and gesture movement distance parameter of the side menu bar are preset under the root element, and a touch callback function is bound to the root element.
[0098] Optionally, the updating unit 304 is further configured to:
[0099] A gesture touch instruction is received, the touch callback function is determined based on the gesture touch instruction, and the menu bar extraction distance parameter and / or the gesture movement distance parameter is updated according to the touch callback function.
[0100] During the sidebar expansion process, the updating unit 304 is used to:
[0101] Determine whether the updated gesture movement distance parameter is less than the negative menu bar width value;
[0102] If yes, then set the menu bar extraction distance parameter to the negative width of the menu bar;
[0103] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0104] Optionally, setting the menu bar extraction distance parameter as the updated gesture movement distance parameter includes:
[0105] Determining whether the menu bar extraction distance parameter is less than a first fixed value, and an absolute value of the first fixed value is less than the menu bar width value;
[0106] If yes, then set the menu bar extraction distance parameter to the negative width of the menu bar;
[0107] Otherwise, the menu bar extraction distance parameter is set to 0.
[0108] During the sidebar closing process, the updating unit 304 is used to:
[0109] Determine whether the updated gesture movement distance parameter is greater than the menu bar width value;
[0110] If yes, set the menu bar extraction distance parameter to 0;
[0111] Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
[0112] Optionally, setting the menu bar extraction distance parameter as the updated gesture movement distance parameter includes:
[0113] Determining whether the menu bar extraction distance parameter is greater than a second set value, and the absolute value of the second set value is less than the menu bar width value;
[0114] If yes, set the menu bar extraction distance parameter to 0;
[0115] Otherwise, the menu bar extraction distance parameter is set to the negative width value of the menu bar.
[0116] The execution unit 306 is used to:
[0117] Setting the menu bar extraction distance parameter to the negative width of the menu bar, and expanding the side menu bar; and / or
[0118] The menu bar extraction distance parameter is set to 0, and the side menu bar is closed.
[0119] The disclosed embodiment improves the technical indicators of the mini-program page, allowing the mini-program to flexibly expand and close the side menu bar according to the user's gesture actions, greatly improving the user experience of the mini-program. As a result, the mini-program not only meets user needs in terms of usage functions, but also provides a more user-friendly gesture experience, thereby enhancing the application value of the mini-program.
[0120] Example 3
[0121] According to an embodiment of the present disclosure, in a third aspect, the present disclosure provides an electronic device, comprising a processor and a memory, wherein the memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, any method step described in the first aspect is implemented.
[0122] Example 4
[0123] According to an embodiment of the present disclosure, in a fourth aspect, the present disclosure provides a computer-readable storage medium, characterized in that computer program instructions are stored therein, and the computer program instructions implement any method steps described in the first aspect when called and executed by a processor.
[0124] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0125] like Figure 4 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0126] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0127] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0128] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0129] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0130] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; and accepts the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.
[0131] Alternatively, the computer-readable medium carries one or more programs, which, when executed by the electronic device, causes the electronic device to: accept a node evaluation request including at least two Internet Protocol addresses; select an Internet Protocol address from the at least two Internet Protocol addresses; and return the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.
[0132] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0133] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units described in the embodiments of the present disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."< / view>
Claims
1. A method for controlling a side menu bar of a mini-program, characterized in that: include: Initializing the side menu bar parameters with the fixed end of the side menu bar as the origin, the side menu bar parameters including the menu bar extraction distance parameter and the gesture movement distance parameter; receiving a gesture touch instruction, and updating the menu bar extraction distance parameter and the gesture movement distance parameter according to the gesture touch instruction; Determine whether the updated gesture movement distance parameter is less than the negative menu bar width value; If yes, then set the menu bar extraction distance parameter to the negative width of the menu bar; Otherwise, setting the menu bar extraction distance parameter to the updated gesture movement distance parameter, and determining whether the menu bar extraction distance parameter is less than a first fixed value, and an absolute value of the first fixed value is less than the menu bar width value; If yes, set the menu bar extraction distance parameter to the negative width of the menu bar; otherwise, set the menu bar extraction distance parameter to 0; The expansion and / or closing instructions of the side menu bar are executed according to the updated menu bar extraction distance parameter and gesture movement distance parameter.
2. The method according to claim 1, characterized in that The step of initializing the side menu bar parameters with the fixed end of the side menu bar as the origin includes: Create a side menu bar root element with the fixed end of the side menu bar as the origin; The position attribute, size attribute, menu bar extraction distance parameter and gesture movement distance parameter of the side menu bar are preset under the root element, and a touch callback function is bound to the root element.
3. The method according to claim 2, characterized in that The receiving the touch gesture instruction and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction includes: A gesture touch instruction is received, the touch callback function is determined based on the gesture touch instruction, and the menu bar extraction distance parameter and / or the gesture movement distance parameter is updated according to the touch callback function.
4. The method according to claim 3, characterized in that The step of receiving a touch gesture instruction, determining the touch callback function based on the touch gesture instruction, and updating the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch callback function may then include: Determine whether the updated gesture movement distance parameter is greater than the menu bar width value; If yes, set the menu bar extraction distance parameter to 0; Otherwise, the menu bar extraction distance parameter is set to the updated gesture movement distance parameter.
5. The method according to claim 4, characterized in that The step of setting the menu bar extraction distance parameter to the updated gesture movement distance parameter includes: Determining whether the menu bar extraction distance parameter is greater than a second set value, and the absolute value of the second set value is less than the menu bar width value; If yes, set the menu bar extraction distance parameter to 0; Otherwise, the menu bar extraction distance parameter is set to the negative width value of the menu bar.
6. The method according to any one of claims 4-5, characterized in that: The executing the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter includes: Setting the menu bar extraction distance parameter to the negative width of the menu bar, and expanding the side menu bar; and / or The menu bar extraction distance parameter is set to 0, and the side menu bar is closed.
7. A control device for a side menu bar of a mini-program, characterized in that: include: an initialization unit, configured to initialize the side menu bar parameters with the fixed end of the side menu bar as an origin, wherein the side menu bar parameters include a menu bar extraction distance parameter and a gesture movement distance parameter; an updating unit, configured to receive a touch gesture instruction, update the menu bar extraction distance parameter and / or the gesture movement distance parameter according to the touch gesture instruction; determine whether the updated gesture movement distance parameter is less than a negative menu bar width value; if so, set the menu bar extraction distance parameter to the negative menu bar width value; otherwise, set the menu bar extraction distance parameter to the updated gesture movement distance parameter, and determine whether the menu bar extraction distance parameter is less than a first fixed value, the absolute value of the first fixed value being less than the menu bar width value; If yes, set the menu bar extraction distance parameter to the negative width of the menu bar; otherwise, set the menu bar extraction distance parameter to 0; An execution unit is used to execute the expansion and / or closing instruction of the side menu bar according to the updated menu bar extraction distance parameter and / or gesture movement distance parameter.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, the method steps described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that Computer program instructions are stored, and when the computer program instructions are called and executed by a processor, the method steps of any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Operating mode for supporting sidebar to quickly access file system by mobile terminal
CN102063429A
Sidebar menu display method and apparatus, and terminal
CN104169856A
Sidebar display method and device
CN105224181A
Task management interface management method and device and mobile terminal
CN107102793A
Method and device for switching pages through small program gestures, electronic equipment and storage medium
CN109828807A