Commit 6fcb6878 by jscat

nyx weapp: 功能更新

1. 订单数据过滤
// 订单处理, 添加到订单项的条件
// 1. 商品中某一类别的quantity>=1,
// 2. defaultStatus==1
parent 8fb78561
// pages/my/my-orders/my-orders.js // pages/my/my-orders/my-orders.js
...@@ -357,6 +357,20 @@ Page({ ...@@ -357,6 +357,20 @@ Page({
var _this = this; var _this = this;
var strUrl = config.order_add_url var strUrl = config.order_add_url
config.debug == 1?console.log("===uploadOrder strUrl "+strUrl):"" config.debug == 1?console.log("===uploadOrder strUrl "+strUrl):""
// 订单处理, 添加到订单项的条件
// 1. 商品中某一类别的quantity>=1,
// 2. defaultStatus==1
var items = _this.data.orderItems
var orderItems = []
for(var i=0; i<items.length;i++)
{
if(items[i].quantity >= 1 && items[i].defaultStatus == 1)
{
orderItems.push(items[i])
}
}
wx.request({ wx.request({
url: strUrl, url: strUrl,
method: 'POST', method: 'POST',
...@@ -366,7 +380,7 @@ Page({ ...@@ -366,7 +380,7 @@ Page({
productImage: _this.__data__.orderInfo['product_image'], productImage: _this.__data__.orderInfo['product_image'],
totalPrice: _this.data.totalPrice, totalPrice: _this.data.totalPrice,
totalCount: _this.data.totalCount, totalCount: _this.data.totalCount,
orderItemString: JSON.stringify(_this.data.orderItems), orderItemString: JSON.stringify(orderItems),
}, },
header: { header: {
'content-type': 'application/x-www-form-urlencoded', 'content-type': 'application/x-www-form-urlencoded',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论