Commit af07b33a by wangzhihui

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents 3bf664ba bf480082
......@@ -113,7 +113,6 @@ Component({
onAfterSale(e) {
let { subOrderCode, redeemPoints, goodsSource,goodsSkuCode,___qty, tparReturnOrderCode } =
this.data.order;
console.log(this.data.order)
wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two",
{
......@@ -135,7 +134,7 @@ Component({
content: "是否确认收货",
confirmText: "确认",
cancelText: "取消",
confirmColor: "#F13C3D",
confirmColor: "#FC5B32",
}).then((res) => {
if (res.confirm) {
wx.p.api.shopmallApi.confirmReceipt(subOrderCode).then((data) => {
......
......@@ -150,11 +150,22 @@ export function getOrderDetailButtons(order) {
// return AFTER_SALE_STATUS[_status_] || {};
// }
export function calcOrderProp(order) {
const { applyQty, sellQty, redeemPoints, freightAmount = 0 } = order;
export function calcOrderProp(order = {}) {
// 安全地解构,提供默认值
const { applyQty = 0, sellQty = 0, redeemPoints = 0, freightAmount = 0 } = order;
const ___qty = sellQty || applyQty || 0;
const ___price = (redeemPoints || 0) * ___qty;
const ___totalPrice = (redeemPoints || 0) * ___qty + +freightAmount;
// 计算基础价格,避免重复计算
const basePrice = redeemPoints * ___qty;
// 计算价格,处理小数
let ___price = basePrice;
___price = Number.isInteger(___price) ? ___price : parseFloat(___price.toFixed(2));
// 计算总价,明确类型转换
let ___totalPrice = basePrice + Number(freightAmount);
___totalPrice = Number.isInteger(___totalPrice) ? ___totalPrice : parseFloat(___totalPrice.toFixed(2));
return { ___qty, ___price, ___totalPrice };
}
export const APIS = {
......
......@@ -59,6 +59,12 @@ Page({
if (data) this.sessionId = data.sessionId
wx.hideLoading()
},
clear(e) {
let target = e.currentTarget.dataset.name
this.setData({
[target]: ''
})
},
input(e) {
const {
value
......
......@@ -28,6 +28,9 @@
<view class="box">
<view class="login-item flex">
<input maxlength="11" type="number" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="填写手机号" bindinput="input" data-name="mobile" class="input" value="{{mobile}}" />
<view class="icon-box" wx:if="{{mobile}}" bindtap="clear" data-name="mobile">
<glsx-image src="/login/login-clear.png"></glsx-image>
</view>
</view>
<view class="login-item flex">
<input maxlength="4" type="number" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="填写验证码" bindinput="input" data-name="captcha" class="input" value="{{captcha}}" />
......
/* pages/login/login.wxss */
page{
background-color: #FAFBFF !important;
background-color: #FFFFFF !important;
}
.layout {
position: relative;
......@@ -153,10 +153,19 @@ page{
.login-item .input {
flex: 1;
font-size: 32rpx;
font-weight: 600;
}
.icon-box{
width: 32rpx;
height: 32rpx;
padding-left: 20rpx;
}
.placeholderClass {
color: #CCCED1;
font-weight: 400;
}
.code-btn {
......
/* pages/chooseMerchant/index.wxss */
page{
background: #F7F8FA;
}
@keyframes opacity-view {
0% {
opacity: 0;
......@@ -154,7 +157,6 @@ page {
width: 100%;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #CDD1D4;
border-radius: 32rpx;
box-sizing: border-box;
padding: 0 24rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!