Commit f5f34e51 by songbingqi

调整结算页面部分字段

parent c9598a8f
......@@ -76,6 +76,7 @@ export default {
const years = date.getFullYear()
const month = date.getMonth()+1
const days = date.getDate()
return years+'.'+month+'.'+days
}
},
......@@ -142,10 +143,11 @@ export default {
this.userInfo.id = id
this.canEditBirthday = !birthday
if(!birthday){
this.userInfo.birthday = Date.parse(createTime)
this.userInfo.birthday = new Date(createTime.replace(/-/g,'/')).valueOf()
}else{
this.userInfo.birthday = Date.parse(birthday)
this.userInfo.birthday = new Date(birthday.replace(/-/g,'/')).valueOf()
}
this.userInfo.avatarUrl = avatarUrl
this.userInfo.sex = sex?sex?1:0:gender
this.userInfo.name = userName?userName:nickName
......
......@@ -61,7 +61,7 @@
<div class="goods_text">
<div class="goods_name">
<div class="name">{{ item.goodsName }}</div>
<div class="price">¥{{ Utils.isInteger(item.realAmount) }}</div>
<div class="price">¥{{ Utils.isInteger(item.unitPrice) }}</div>
</div>
<div class="goods_psce">
<div class="psce_name">
......@@ -80,7 +80,7 @@
<div class="coupon" v-if="orderInfo.couponAmount">
<div class="title">HOOLOO券</div>
<div class="num-action">
<span class="price">-¥{{orderInfo.couponAmount}}</span>
<span class="price">-¥{{String(orderInfo.couponAmount).replace("-","")}}</span>
</div>
</div>
......@@ -88,7 +88,7 @@
<div class="size">{{ totalNum }}件商品</div>
<div class="price">
<span class="paid_in">实付</span>
<span class="money"><text class="money_logo"></text>{{ Utils.isInteger(orderInfo.amount) }}</span>
<span class="money"><text class="money_logo"></text>{{ Utils.isInteger(orderInfo.paidAmount) }}</span>
</div>
</div>
</div>
......@@ -289,7 +289,7 @@ export default {
title: '确认退款',
success: (res) => {
if (res.confirm) {
Order.orderRefund({ orderId: this.orderInfo.id, refundAmount: this.orderInfo.amount }).then(res => {
Order.orderRefund({ orderId: this.orderInfo.id, refundAmount: this.orderInfo.paidAmount }).then(res => {
this.initData()
})
} else if (res.cancel) {
......
......@@ -28,6 +28,7 @@
</template>
<script>
import order from '@/request/order'
export default {
data() {
return {
......@@ -70,8 +71,14 @@ export default {
}else{
this.newList = this.list
}
this.getRefundInfo()
},
methods:{
async getRefundInfo(){
let orderId = uni.getStorageSync('orderId');
const { data } = await order.getRefundInfo(orderId);
console.log(data)
},
watchMore(){
if(this.flag){
this.newList = [...this.list].splice(0,4)
......
......@@ -124,6 +124,16 @@ export default {
.catch((err) => {
// uni.showToast({ title: '服务器错误', icon: 'none' })
console.log('服务器错误');
});
});
},
// 获取退款详情
getRefundInfo(params) {
return uni.$u.http
.get(`/system/refund/list/${params}`)
.then((res) => res)
.catch((err) => {
// uni.showToast({ title: '服务器错误', icon: 'none' })
console.log('服务器错误');
});
}
};
......@@ -6,7 +6,7 @@ import { $EventBus } from './EventBus';
export default {
// 组装提交订单数据
AssemblyOrder(shopData, totalPrice, totalNum, buyType, shopCarInfo) {
if (shopCarInfo && totalPrice > 0 && totalNum > 0) {
if (shopCarInfo && totalNum > 0) {
let orderDetails = [];
for (let i = 0; i < shopCarInfo.length; i++) {
let item = shopCarInfo[i];
......@@ -161,11 +161,6 @@ export default {
}
},
isInteger(value) {
const val = Number(value)
if(val%1 === 0){
return parseInt(val)
}else{
return val.toFixed(1)
}
return parseFloat(Number(value).toFixed(2))
}
};
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