Commit b6172359 by 高淑倩

blurNum

parent 115c2666
......@@ -48,7 +48,8 @@ wxService.page({
refundAmount: 0,
checkedColor: 'rgb(203, 60, 60)',
pics: [],
id: ''
id: '',
returnOrder: 0
},
submitRefund() {
var selectGoods = this.data.cartList.filter(item => item.checked)
......@@ -194,7 +195,7 @@ wxService.page({
this.setData({
cartList: cartList
}, () => {
// this.getReturnPrice()
this.getReturnPrice()
// this.editOk(cartList[e]) //调用完成
})
},
......@@ -210,33 +211,55 @@ wxService.page({
this.setData({
cartList: cartList
}, () => {
this.getReturnPrice()
})
},
inputNum: function (e) { // 输入数量
blurNum: function (e) { // 输入数量
debugger
var newNum = e.detail.value
var order = this.data.cartList
var cartList = this.data.cartList
var index = e.currentTarget.dataset.index
var refundNum = order[index].count
console.log('inputNum', index, newNum, refundNum)
var refundNum = cartList[index].count
if (newNum === '' || newNum === '0') {
newNum = 1
} else {
newNum = parseInt(newNum)
if (newNum > refundNum) {
newNum = refundNum
} else {
newNum = newNum
}
}
order[index].count = refundNum
cartList[index].count = newNum
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({
onShow: function () {
const { params } = this.options
let detail = JSON.parse(params)
console.log("detail", detail)
console.log("detail", detail)
// item.checked
detail.skuVOList.forEach(item => {
item.checked = false
......@@ -272,7 +295,27 @@ console.log("detail", detail)
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 @@
class="pro-num-edit-input"
type="number"
data-index="{{index}}"
bindinput="inputNum"
bindblur="blurNum"
value="{{item.count}}"
/>
<button class="add-num" data-index="{{index}}" catchtap="addNum">+</button>
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 25,
"current": 24,
"list": [
{
"id": -1,
......@@ -183,10 +183,10 @@
"scene": null
},
{
"id": 23,
"id": 22,
"name": "退单详情",
"pathName": "pages/refundDetail/refundDetail",
"query": "id=614542180811411456",
"query": "id=625052614006149120",
"scene": null
},
{
......@@ -197,10 +197,10 @@
"scene": null
},
{
"id": 25,
"id": 24,
"name": "订单详情",
"pathName": "pages/orderDetail/orderDetail",
"query": "id=616360692727025664",
"query": "id=625052614006149120",
"scene": null
},
{
......
<!--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="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