更换正式环境,测试修改
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
<view class="u-flex u-m-l-32 u-col-center">
|
||||
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
|
||||
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
|
||||
<up-icon @click="changeItem(item,1)" :color="color.ColorMain" :size="20"
|
||||
<up-icon @click="changeItem(item,1)" :color="$utils.ColorMain" :size="20"
|
||||
name="plus-circle-fill"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
@@ -93,8 +93,9 @@
|
||||
<view style="height: 200rpx;"></view>
|
||||
<view class="fixed-b">
|
||||
<up-button text="确认退款" @click="tuikuanConfirm" shape="circle" type="primary" size="large"
|
||||
:color="color.ColorMain"></up-button>
|
||||
:color="$utils.ColorMain"></up-button>
|
||||
</view>
|
||||
<confirmRefundPopup ref="refundPopup" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -102,8 +103,8 @@
|
||||
<script setup>
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import color from '@/commons/color.js';
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import confirmRefundPopup from './components/confirmRefundPopup.vue';
|
||||
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
import { refundOrder } from '@/http/api/order.js'
|
||||
import { mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||
@@ -132,10 +133,11 @@
|
||||
totalAmount: 0
|
||||
}
|
||||
})
|
||||
const refundPopup = ref(null);
|
||||
|
||||
onLoad((opt) => {
|
||||
orderDetail.info = JSON.parse(opt.orderInfo)
|
||||
orderDetail.goodsList = JSON.parse(opt.goodsList)
|
||||
console.log(orderDetail)
|
||||
option.productId = orderDetail.goodsList[0].productId
|
||||
option.orderId = orderDetail.goodsList[0].orderId
|
||||
})
|
||||
@@ -251,22 +253,23 @@
|
||||
/**
|
||||
* 确认退款
|
||||
*/
|
||||
let params;
|
||||
async function tuikuanConfirm() {
|
||||
const canTuikuan=await hasPermission('允许退款')
|
||||
if(!canTuikuan){
|
||||
return infoBox.showToast('您没有退款权限')
|
||||
return uni.$utils.showToast('您没有退款权限')
|
||||
}
|
||||
if (pageData.tabsIndex != 2&&tuikuanNumber.value <= 0) {
|
||||
return infoBox.showToast('退款商品数量不能为0!')
|
||||
return uni.$utils.showToast('退款商品数量不能为0!')
|
||||
}
|
||||
|
||||
const selTag=tuikuan.list[tuikuan.sel]
|
||||
const noteResult=`${selTag?selTag:''}${note.value?(','+note.value):''}`
|
||||
if (!noteResult) {
|
||||
return infoBox.showToast('请输入或选择退款原因!')
|
||||
return uni.$utils.showToast('请输入或选择退款原因!')
|
||||
}
|
||||
|
||||
let params = {
|
||||
|
||||
params = {
|
||||
orderId: option.orderId,
|
||||
refundReason: noteResult,
|
||||
refundDetails: orderDetail.goodsList.filter(v=>v.number*1).map(v=>{
|
||||
@@ -285,10 +288,21 @@
|
||||
params.refundAmount = pageData.tabsIndex == 1 ? alltuikuanPrice.value : tuikuanPrice.value
|
||||
}
|
||||
if ( pageData.tabsIndex == 2 && params.refundAmount > orderDetail.info.payAmount){
|
||||
return infoBox.showToast('退款金额不能大于付款金额!')
|
||||
return uni.$utils.showToast('退款金额不能大于付款金额!')
|
||||
}
|
||||
if( uni.getStorageSync("shopInfo").isReturnPwd == 1){
|
||||
refundPopup.value.open(params.refundAmount, refundPost);
|
||||
return;
|
||||
}
|
||||
refundPost()
|
||||
}
|
||||
|
||||
async function refundPost (payPassword) {
|
||||
if( payPassword ){
|
||||
params.pwd = payPassword
|
||||
}
|
||||
await refundOrder(params)
|
||||
infoBox.showToast('退款请求提交成功')
|
||||
uni.$utils.showToast('退款请求提交成功')
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({delta:1})
|
||||
},500)
|
||||
|
||||
Reference in New Issue
Block a user