Commit b6172359 by 高淑倩

blurNum

parent 115c2666
...@@ -48,7 +48,8 @@ wxService.page({ ...@@ -48,7 +48,8 @@ wxService.page({
refundAmount: 0, refundAmount: 0,
checkedColor: 'rgb(203, 60, 60)', checkedColor: 'rgb(203, 60, 60)',
pics: [], pics: [],
id: '' id: '',
returnOrder: 0
}, },
submitRefund() { submitRefund() {
var selectGoods = this.data.cartList.filter(item => item.checked) var selectGoods = this.data.cartList.filter(item => item.checked)
...@@ -194,7 +195,7 @@ wxService.page({ ...@@ -194,7 +195,7 @@ wxService.page({
this.setData({ this.setData({
cartList: cartList cartList: cartList
}, () => { }, () => {
// this.getReturnPrice() this.getReturnPrice()
// this.editOk(cartList[e]) //调用完成 // this.editOk(cartList[e]) //调用完成
}) })
}, },
...@@ -210,33 +211,55 @@ wxService.page({ ...@@ -210,33 +211,55 @@ wxService.page({
this.setData({ this.setData({
cartList: cartList cartList: cartList
}, () => { }, () => {
this.getReturnPrice()
}) })
}, },
inputNum: function (e) { // 输入数量 blurNum: function (e) { // 输入数量
debugger
var newNum = e.detail.value var newNum = e.detail.value
var order = this.data.cartList var cartList = this.data.cartList
var index = e.currentTarget.dataset.index var index = e.currentTarget.dataset.index
var refundNum = order[index].count var refundNum = cartList[index].count
console.log('inputNum', index, newNum, refundNum)
if (newNum === '' || newNum === '0') { if (newNum === '' || newNum === '0') {
newNum = 1 newNum = 1
} else { } else {
newNum = parseInt(newNum) newNum = parseInt(newNum)
if (newNum > refundNum) { if (newNum > refundNum) {
newNum = refundNum newNum = refundNum
} else {
newNum = newNum
} }
} }
order[index].count = refundNum cartList[index].count = newNum
this.setData({ this.setData({
order: order cartList: cartList
}, () => { }, () => {
// this.getReturnPrice() console.log('blurNum', cartList[index], index, newNum, refundNum)
this.getReturnPrice()
})
},
getReturnPrice() {
var cartList = this.data.cartList
var returnPrice = 0
for (let i = 0; i < cartList.length; i++) {
if (cartList[i].checked) {
returnPrice += cartList[i].price * (cartList[i].count ? cartList[i].count : 1)
}
}
console.log('cartList', cartList, returnPrice)
this.setData({
// returnOrder:
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -257,7 +280,7 @@ wxService.page({ ...@@ -257,7 +280,7 @@ wxService.page({
onShow: function () { onShow: function () {
const { params } = this.options const { params } = this.options
let detail = JSON.parse(params) let detail = JSON.parse(params)
console.log("detail", detail) console.log("detail", detail)
// item.checked // item.checked
detail.skuVOList.forEach(item => { detail.skuVOList.forEach(item => {
item.checked = false item.checked = false
...@@ -272,7 +295,27 @@ console.log("detail", detail) ...@@ -272,7 +295,27 @@ console.log("detail", detail)
this.getReasonList() this.getReasonList()
}) })
}, },
reFundPreview() {
// /refund/buyer/preview
const params = {
refundCreateDto: {}
}
// wx.showLoading({
// title: '加载中',
// mask: true
// })
// wxService.post(`/sale/refund/buyer/preview`).then(res => {
// if (res) {
// const { result, data } = res.data
// if (result == 0) {
// wx.hideLoading()
// } else {
// }
// }
// })
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
class="pro-num-edit-input" class="pro-num-edit-input"
type="number" type="number"
data-index="{{index}}" data-index="{{index}}"
bindinput="inputNum" bindblur="blurNum"
value="{{item.count}}" value="{{item.count}}"
/> />
<button class="add-num" data-index="{{index}}" catchtap="addNum">+</button> <button class="add-num" data-index="{{index}}" catchtap="addNum">+</button>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 25, "current": 24,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -183,10 +183,10 @@ ...@@ -183,10 +183,10 @@
"scene": null "scene": null
}, },
{ {
"id": 23, "id": 22,
"name": "退单详情", "name": "退单详情",
"pathName": "pages/refundDetail/refundDetail", "pathName": "pages/refundDetail/refundDetail",
"query": "id=614542180811411456", "query": "id=625052614006149120",
"scene": null "scene": null
}, },
{ {
...@@ -197,10 +197,10 @@ ...@@ -197,10 +197,10 @@
"scene": null "scene": null
}, },
{ {
"id": 25, "id": 24,
"name": "订单详情", "name": "订单详情",
"pathName": "pages/orderDetail/orderDetail", "pathName": "pages/orderDetail/orderDetail",
"query": "id=616360692727025664", "query": "id=625052614006149120",
"scene": null "scene": null
}, },
{ {
......
<!--subPackage/page/pages/myReleaseDetail.wxml--> <!--subPackage/page/pages/myReleaseDetail.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" /> <wxs src="../../../../wxs/utils.wxs" module="utils" />
<view class="release-detail"> <view class="release-detail">
<!-- <view class="detail-img"> <!-- <view class="detail-img">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment