The [master] branch is the classic version, and [v2_map_index] is the map homepage version (note that the map displays the developer's data. You have not purchased equipment, so it is empty)
Plug-in used to develop electric vehicle/electric bicycle charging WeChat applet. Developers can directly call the plug-in function in their own programs to perform all charging operations, including startup, billing, payment, monitoring, etc. without the need for additional software. development. This plug-in only supports hardware equipment produced by Xiaoniu New Energy Company, including car AC charging piles, car DC charging piles, one-to-twelve bicycle charging piles and other products. ©Shenzhen Xiaoniu New Energy Co., Ltd. 2018
Main WeChat mini program : a WeChat mini program with its own brand developed by partners Mavericks New Energy plug-in : a plug-in developed by Mavericks New Energy Company that can be directly referenced in the main WeChat mini program Mavericks New Energy charging pile: developed by Xiaoniu Hardware equipment developed by Niu New Energy Company, including car charging piles and bicycle charging piles Main program APPID: The main WeChat applet APPID applied by partners to Tencent Charging plug-in APPID: The plug-in APPID applied by Mavericks to Tencent, namely: wx5a3782a4284eacc4
http://file.woniuev.cn/xndemo.zip http://file.woniuev.cn/xndemo_map.zip If you want to have your own charging APP as quickly as possible, you only need to use the source code above. The following chapters are all about the application of the source code. With the source code, no explanation is needed. The WeChat mini program name application needs to be similar to the company name.
There is the file qrcodemaker1.js in the tools directory of the source code. Follow the above figure to create a QR code.
To call the plug-in interface, the main WeChat applet needs to be initialized first:
var xnplugin = requirePlugin("xnplugin");
Used to check whether the charging user has logged in to the plug-in. If not, you can use the button in 2.3 to log in, or you can click to log in on the Mavericks New Energy plug-in page.
var xnplugin = requirePlugin("xnplugin");
var vserInfo = xnplugin.getVserInfo();
if (vserInfo==false){
console.log('用户没有登陆插件');
}else{
console.log('用户绑定的手机号', vserInfo.usermobile);
}
Exit the plug-in login status:
xnplugin.setVserInfo(false);
List of useful fields in the return value of xnplugin.getVserInfo(): vserInfo.usermobile: Customer’s mobile phone number, which cannot be charged if it is empty vserInfo.openid: Customer’s OPENID, which cannot be empty vserInfo.balance: account balance with two decimal places vserInfo.balanum : Numeric account balance vserInfo.pakingid: Charging pile number being used for parking (car) vserInfo.reghours: Number of hours registered so far
Directly reference the login button in the main WeChat applet , without having to log in on the Mavericks New Energy plug-in page, for a better user experience.
<loginbtn
customtype="primary"
customtitle="立即登陆插件"
customstyle="font-size:1.5em;color:green;" />
The actual effect of the above code on a blank page:
Since the plug-in page jump is introduced, and this is a function only available in the latest version, the WeChat program must be the latest version. The main WeChat applet should pay attention to checking and guiding customers to update.
<evcar />
<evcar optid="{{qrscandcode}}"/>
<evcar optid="{{mycode}}"/>
All three of the above syntaxes are acceptable. optid represents the electric pile number obtained from the caller's main WeChat applet . It can be obtained by scanning the QR code or by other methods (such as input, click connection, etc.)
<biker />
<biker optid="{{qrscandcode}}"/>
<biker optid="{{mycode}}"/>
All three of the above syntaxes are acceptable. Optid represents the electric pile number obtained from the caller's main WeChat applet . It can be obtained by scanning the QR code or by other methods (such as input, click connection, etc.)
There is no need to reference other plug-ins listed here unless necessary, because the main entry of the plug-in (biker/evcar) already contains references and jumps to these plug-ins. The main WeChat applet only needs to reference the biker and evcar pages.
<recharge hasback="0" />
This customer account can be recharged. The recharge amount directly enters the operator's payment channel and is directly managed by the operator. The recharge account displays the current balance of the WeChat applet. The current account balance can only be consumed at the electricity piles owned by this operator.
<chistory hasback="0" />
The date, amount, and source of each recharge are recorded in detail, and refunds can be made for the last recharge.
<bhistory hasback="0" />
Detailed records include the date of charging each bicycle, the number of the electric pile/socket, the amount of charging, the duration and the charging power.
<ahistory hasback="0" />
Detailed records include the date of each car charging, the electric pile number, the charging capacity, and the charging amount.
<mybill hasback="0" />
Car charging is automatically deducted by default, but if there is an overtime fee, manual settlement is required. This is the payment page. Electric bicycle charging is automatically deducted, and charging cannot be started if the balance is less than 5 yuan (automatic full charging). Both bicycle charging and car charging have a balance monitoring and testing mechanism, and the power will be automatically cut off when the balance is used up (there may be a slight negative number).
<bindphone hasback="0" />
The page for binding and unbinding mobile phones. Customers must bind their mobile phones to charge. It cannot be charged after being unbundled. Binding a mobile phone requires verification via SMS verification code.
<feecard hasback="0" />
This feature is added at the discretion of the operating partner. Operators can generate a batch of virtual recharge cards with specified denominations in the operation management background, and can send the activation codes of the virtual recharge cards to designated users through mobile phone text messages. After receiving the activation codes, users can fill in and activate this virtual recharge card in this function. Recharge the card and save the amount in your recharge account. The operator decides on its own the denomination and charges of this virtual card, which is implemented offline. (Application scenario: Buy a car and get a charging card, rent a car and get a charging pile.)
The bicycle charging and car charging Mavericks new energy plug-in pages have a built-in QR code scanning function. The built-in QR code scanning function allows customers to scan the QR code directly without leaving this page. This code scanning function supports QR codes of interface B (mini program code, unlimited) and interface C (QR code, limited quantity). For specific reference: https://developers.weixin.qq.com/miniprogram/dev /api/qrcode.html In order to maintain uniform scanning, the main WeChat applet has the following suggestions: The bicycle charging page is named xmain/biker.wxml, and the car charging page is named xmain/evcar.wxml. Type B QR code parameters: {'scene':'10000','page':'xmain/biker','width':430} {'scene':'10002','page':'xmain/evcar','width':430} Type C QR code parameters: {'path':'xmain/biker?chgid=190','width':430} {'path':'xmain/evcar?chgid=100180','width':430} Important: After the QR code is generated, scan each code once on the electric pile details page (charging page) of the APP.
No matter which plug-in, you can add additional elements after it is introduced into the main program, usually adding buttons, links, pictures, etc. at the end of the plug-in page. If the component added to the page does not want to be appended to the end, you can use (position:absolute) to achieve arbitrary position positioning. Partners can add more functions to their main WeChat mini program to facilitate localized services or personalized applications. Finally, the partner's own functional page is developed, put online, and delivered for use. About the API for map display: xnplugin.getChargerMap(leftlng, rightlng, botlat, toplat, carbk, callback); leftlng, botlat: screen southwest coordinates (WGS84 format) rightlng, toplat: screen northeast coordinates carbk: 0 shows all sites, 1 only Displays bicycle charging stations, 2 only displays car charging stations, and 3 only displays DC charging stations callback(markers): Returns an array of site markers. xnplugin.getChargersInSite(siteid, callback); siteid: Display the electric piles of the specified charging station (display all) callback(chargers): Return the electric pile array of this site About the map full screen: The sample source code does not have the map full screen function, such as If you need a full-screen map, please contact us to provide sample source code.
The source code of the charging software is free to download and use, and you can modify it at will. Customers do not own the code and cannot declare copyright. The source code of the charging software is provided free of charge, and customers can modify it themselves. Once the charging software is modified, it has nothing to do with Mavericks New Energy. The deliverables provided by Mavericks to customers are limited to the Mavericks New Energy Plug-in and this interface document. Mavericks is responsible for long-term upgrades and maintenance of the Mavericks New Energy Plug-in and does not accept customer customization. Xiaoniu Company is willing to assist customers to change the mini program to use the customer's own name and own LOGO. It does not accept other modifications, but customers can add/modify any content by themselves. The added/modified parts are owned by others. The copyright of the Xiaoniu New Energy WeChat applet plug-in belongs to © Shenzhen Xiaoniu New Energy Co., Ltd. Customers can use it for free, and customers are not allowed to engage in illegal activities such as plagiarism and reverse engineering. The copyright of Xiaoniu New Energy hardware equipment belongs to © Shenzhen Xiaoniu New Energy Co., Ltd. Customers have the property rights and usage rights after purchasing, but they are not allowed to plagiarize, reverse engineer and other illegal activities. Once discovered, the company reserves the right to file lawsuits against offenders.
Small batch purchases do not accept any form of customization, and will be shipped at the original factory price, and price negotiation is refused. For mass customization and cooperation, please contact your account manager.
(Copy link to browser) https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-8421736029.2.46547307JNgzUk&id=565433890730
(Copy link to browser) https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-8421736029.6.46547307JNgzUk&id=565156191735