|
@@ -29,31 +29,13 @@ var shoppingCart = new Vue({
|
|
|
getCartLists: function () {
|
|
|
var _self = this;
|
|
|
if(this.userId ===0){return;}
|
|
|
- $.getJSON("/cart/list",{userId: this.userId}).done(function (r) {
|
|
|
+ tokenAjax("get", "/shoppingCart/list", {userId: this.userId},function (r) {
|
|
|
if (r.code === 0 && r.data) {
|
|
|
_self.listData = r.data.list;
|
|
|
_self.invalidData = r.data.invalid;
|
|
|
_self.totalSize = r.data.totalSize;
|
|
|
_self.totalCount = r.data.totalCount;
|
|
|
_self.totalPrice = r.data.totalPrice;
|
|
|
- var prosPrice =0;
|
|
|
- var productIdArr = [];
|
|
|
- var newArr=[]
|
|
|
- _self.listData.forEach(function(item,index){
|
|
|
- _self.cartList=item.cartList;
|
|
|
- if(item.count==item.cartList.length){
|
|
|
- _self.totalPeice(item);
|
|
|
- }
|
|
|
- // _self.cartList.map(function (pros) {
|
|
|
- // // 0公开价格 1不公开价格 2仅对会员机构公开
|
|
|
- // if (pros.priceFlag !== 1) {
|
|
|
- // productIdArr.push(pros.id);
|
|
|
- // newArr.push(pros)
|
|
|
- // }
|
|
|
- // });
|
|
|
- })
|
|
|
- // setProductPrice(newArr, productIdArr.join(","), _self.userId, function () {});
|
|
|
-
|
|
|
}
|
|
|
_self.listLoading = false;
|
|
|
});
|