|
@@ -7,17 +7,13 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="top-row">
|
|
<view class="top-row">
|
|
|
<view class="info-item">
|
|
<view class="info-item">
|
|
|
- <image
|
|
|
|
|
- class="logo"
|
|
|
|
|
- src="https://img.huaml.com/uploads/12358/202005/29/de74c55596d304b85e79154958e8bf57_small.jpeg"
|
|
|
|
|
- alt="商品图"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <image class="logo" :src="customInfo.smallAvatar"/>
|
|
|
<text class="name">
|
|
<text class="name">
|
|
|
- {{ option.name || "" }}
|
|
|
|
|
|
|
+ {{ customInfo.name || "" }}
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="price-item">
|
|
<view class="price-item">
|
|
|
- {{ option.debtAmount || "" }}
|
|
|
|
|
|
|
+ {{ totalAmount || "" }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -46,17 +42,12 @@
|
|
|
<view class="info-view">
|
|
<view class="info-view">
|
|
|
已选 <text class="price">{{ selectList.length }}</text> 笔,
|
|
已选 <text class="price">{{ selectList.length }}</text> 笔,
|
|
|
<text class="unit">¥</text>
|
|
<text class="unit">¥</text>
|
|
|
- <text class="price">{{ totalAmount }}</text>
|
|
|
|
|
|
|
+ <text class="price">{{ selectTotalAmount }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<view class="btn-view" v-if="isBatch">
|
|
<view class="btn-view" v-if="isBatch">
|
|
|
- <button
|
|
|
|
|
- :class="['admin-button-com', selectList.length == 0 ? 'disable' : 'blue']"
|
|
|
|
|
- :disabled="selectList.length == 0"
|
|
|
|
|
- @click="batchEvent"
|
|
|
|
|
- >
|
|
|
|
|
- 批量收款
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <button :class="['admin-button-com', 'disable']" @click="isBatch = false"> 取消</button>
|
|
|
|
|
+ <button :class="['admin-button-com', 'blue']" @click="batchEvent" >收款</button>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="btn-view" v-else>
|
|
<view class="btn-view" v-else>
|
|
|
<button class="admin-button-com blue" @click="isBatch = true">
|
|
<button class="admin-button-com blue" @click="isBatch = true">
|
|
@@ -69,7 +60,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import DetailsItem from "./detailsItem";
|
|
import DetailsItem from "./detailsItem";
|
|
|
-import { getOrderDebtListApi } from "@/api/arrears/index";
|
|
|
|
|
|
|
+import { getOrderDebtListApi,clearOrderApi } from "@/api/arrears/index";
|
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -77,6 +68,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
isBatch: false,
|
|
isBatch: false,
|
|
|
|
|
+ customInfo: "",
|
|
|
totalAmount: "",
|
|
totalAmount: "",
|
|
|
num: "",
|
|
num: "",
|
|
|
detailsList: [],
|
|
detailsList: [],
|
|
@@ -88,6 +80,11 @@ export default {
|
|
|
uni.stopPullDownRefresh();
|
|
uni.stopPullDownRefresh();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ onLoad(){
|
|
|
|
|
+ this.initData().then(res => {
|
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
computed: {
|
|
computed: {
|
|
|
selectList() {
|
|
selectList() {
|
|
|
let list = [];
|
|
let list = [];
|
|
@@ -98,7 +95,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(list)
|
|
|
return list;
|
|
return list;
|
|
|
|
|
+ },
|
|
|
|
|
+ selectTotalAmount() {
|
|
|
|
|
+ let amount = 0;
|
|
|
|
|
+ if (this.detailsList) {
|
|
|
|
|
+ for (const item of this.detailsList) {
|
|
|
|
|
+ if (item.checked) {
|
|
|
|
|
+ amount=amount+Number(item.actPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return amount;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -106,8 +115,9 @@ export default {
|
|
|
try {
|
|
try {
|
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
|
const {
|
|
const {
|
|
|
- data: { num, totalAmount, list }
|
|
|
|
|
|
|
+ data: { customInfo, num, totalAmount, list }
|
|
|
} = await getOrderDebtListApi(this.option.id);
|
|
} = await getOrderDebtListApi(this.option.id);
|
|
|
|
|
+ this.customInfo = customInfo;
|
|
|
this.totalAmount = totalAmount;
|
|
this.totalAmount = totalAmount;
|
|
|
this.num = num;
|
|
this.num = num;
|
|
|
this.detailsList = list.map(ele => {
|
|
this.detailsList = list.map(ele => {
|
|
@@ -123,33 +133,50 @@ export default {
|
|
|
},
|
|
},
|
|
|
checkItemEvent(item) {
|
|
checkItemEvent(item) {
|
|
|
for (let index = 0; index < this.detailsList.length; index++) {
|
|
for (let index = 0; index < this.detailsList.length; index++) {
|
|
|
- const element = this.detailsList[index];
|
|
|
|
|
- if (element == item) {
|
|
|
|
|
|
|
+ const element = this.detailsList[index].id;
|
|
|
|
|
+ if (element == item.id) {
|
|
|
//id相等选中
|
|
//id相等选中
|
|
|
|
|
+
|
|
|
this.$set(this.detailsList, index, {
|
|
this.$set(this.detailsList, index, {
|
|
|
- ...element,
|
|
|
|
|
- checked: !element.checked
|
|
|
|
|
|
|
+ ...this.detailsList[index],
|
|
|
|
|
+ checked: !this.detailsList[index].checked
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async batchEvent() {
|
|
|
|
|
|
|
+ batchEvent() {
|
|
|
try {
|
|
try {
|
|
|
if (this.$util.isEmpty(this.selectList)) {
|
|
if (this.$util.isEmpty(this.selectList)) {
|
|
|
this.$msg("请还款选择订单");
|
|
this.$msg("请还款选择订单");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let ids = this.selectList.map(ele => {
|
|
let ids = this.selectList.map(ele => {
|
|
|
- return ele.id;
|
|
|
|
|
|
|
+ return {id:ele.id};
|
|
|
});
|
|
});
|
|
|
- const { data } = await clearOrderApi(JSON.stringify(ids));
|
|
|
|
|
- wexinPay(data, this.paySuccess, this.payFail);
|
|
|
|
|
|
|
+ let parameter = {
|
|
|
|
|
+ id:JSON.stringify(ids),
|
|
|
|
|
+ customId:this.customInfo.id,
|
|
|
|
|
+ }
|
|
|
|
|
+ let self = this;
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '确定已收款?',
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ self.paySuccess(parameter)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // const { data } = await clearOrderApi(parameter);
|
|
|
|
|
+ // wexinPay(data, this.paySuccess, this.payFail);
|
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
|
},
|
|
},
|
|
|
// 支付成功
|
|
// 支付成功
|
|
|
- paySuccess() {
|
|
|
|
|
- this.$util.pageTo(1);
|
|
|
|
|
|
|
+ async paySuccess(parameter) {
|
|
|
|
|
+ await clearOrderApi(parameter);
|
|
|
|
|
+ uni.navigateTo({url:'/common/pageSuccess?title=收款成功'});
|
|
|
|
|
+ // this.$util.pageTo(1);
|
|
|
},
|
|
},
|
|
|
payFail() {
|
|
payFail() {
|
|
|
this.$msg("支付没有成功");
|
|
this.$msg("支付没有成功");
|
|
@@ -206,13 +233,15 @@ export default {
|
|
|
padding-bottom: 50upx;
|
|
padding-bottom: 50upx;
|
|
|
}
|
|
}
|
|
|
.bar-view {
|
|
.bar-view {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ bottom: 0;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
padding: 0 30upx;
|
|
padding: 0 30upx;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100upx;
|
|
height: 100upx;
|
|
|
-
|
|
|
|
|
|
|
+ background: #fff;
|
|
|
box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
|
|
box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
|
|
|
.info-view {
|
|
.info-view {
|
|
|
display: flex;
|
|
display: flex;
|