In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how web realizes the check of bulk purchase and displays the total number at the same time. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
When making bulk purchases, we need to click on the goods we need, and then click on bulk purchases.
With each click, the total quantity and amount will be calculated immediately below.
The main code is as follows:
1Jing 2 figure shows the background setting administrative permissions, check the code when. Can be skipped.
{$vc ['classname']} {$vo.title} $(function () {$("# selected") .click (function () {("input [name =' rules []']") .each (function () {$(this) .prop ('checked', true);});}) ("# cancel") .click (function () {$("input [name = 'rules []']") .each (function () {$(this) .prop ('checked', false);});})
-
This is a bulk purchase.
{$key+1} {$vo.username} {$vo.num} {$vo.addtime | date= "Y-m-d H:i:s", #} {$vo.pricenum} Buy $("# checkall") .click (function () {$("input [name = 'oid []']") .each (function () {this.checked = true;})) Docal ();}); $("# checkallno") .click (function () {$("input [name = 'oid []']") .each (function () {this.checked = false;}); $('# total_pv'). Html ('0'); $('# total_dg'). Html ('0');}) / / calculate function docal () {var formData = $('# ajaxForm') .serialize () / / jQuery.post (url,data,success (data, textStatus, jqXHR), dataType) $.ajax ({type: 'POST', url: "{: U (' Points/docal')}", data: formData, dataType: 'json' Success: function (re) {if (re.code = = 1) {/ / returns the total quantity Total amount / / layer.alert (re.cal.num) $('# total_pv') .html (re.cal.num); $('# total_dg') .html (re.cal.usedgcash);}}, error:function () {layer.alert ('error');}}) Return false;} / / when the selection box is selected by the click. Change (function () {/ * alert ($(this) .attr ("id")); alert ($(this). Val ()); * / docal ();}); $(".action") .click (function () {var buyLink=$ (this) .attr ("link"), $this = $(this) Layer.confirm ('are you sure you want to buy it?' , {title:' operation prompt'}, function (index) {$.post (buyLink,function (data) {if (data.code = 1) {layer.alert (data.message, function () {_ window.location.reload ();});} else {layer.alert (data.message) }}); layer.close (index);});})
Mainly this change has been looking for it for a long time.
This is the end of this article on "how to achieve bulk purchase check while displaying totals at the same time". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.