Commit f5f34e51 by songbingqi

调整结算页面部分字段

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