Commit 3e16d9fd by zhangxw

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 6d7c01e5 70c9ca1f
...@@ -100,7 +100,11 @@ export const ORDER_STATUS = { ...@@ -100,7 +100,11 @@ export const ORDER_STATUS = {
buttons: { buttons: {
[GoodsSource.SELF]: [ [GoodsSource.SELF]: [
//自营商品 在商品列表对应的按钮 //自营商品 在商品列表对应的按钮
OrderActionButtons.CONFIRM_RECEIVE, // OrderActionButtons.CONFIRM_RECEIVE,
],
[GoodsSource.YZH]: [
//自营商品 在商品列表对应的按钮
// OrderActionButtons.CONFIRM_RECEIVE,
], ],
}, },
}, },
......
import { getAfterSaleDetail } from "~/packageMine/pages/order/utils"; import { getAfterSaleDetail,calcOrderProp } from "~/packageMine/pages/order/utils";
import { import {
ORDER_STATUS, ORDER_STATUS,
OrderStatusEnum, OrderStatusEnum,
...@@ -19,7 +19,6 @@ Page({ ...@@ -19,7 +19,6 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then((params) => { wx.p.router.getRouterParams(options).then((params) => {
console.log("🚀 ~ params:", params)
if (params) { if (params) {
this.setData({ this.setData({
...params, ...params,
...@@ -59,7 +58,8 @@ Page({ ...@@ -59,7 +58,8 @@ Page({
str = `${sendbackAddressModel.provinceName}${sendbackAddressModel.cityName}${sendbackAddressModel.countyName}${sendbackAddressModel.address}`; str = `${sendbackAddressModel.provinceName}${sendbackAddressModel.cityName}${sendbackAddressModel.countyName}${sendbackAddressModel.address}`;
} }
res.addressInfo = str; res.addressInfo = str;
const {___qty,___price,___totalPrice} =calcOrderProp(res.orderGoods)
Object.assign(res.orderGoods,{___qty,___price,___totalPrice})
this.setData({ this.setData({
orderInfo: res, orderInfo: res,
status, status,
...@@ -80,7 +80,17 @@ Page({ ...@@ -80,7 +80,17 @@ Page({
// } // }
// this.cancelSaleApply() // this.cancelSaleApply()
// console.log('this.button', this.data.button) // console.log('this.button', this.data.button)
this[this.data.button.handler]() // this[this.data.button.handler]()
this.toAfterSale()
},
toAfterSale(){
const { orderInfo } = this.data;
console.log("🚀 ~ toAfterSale ~ orderInfo:", orderInfo)
return
wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two",
orderInfo
);
}, },
/**撤销申请 */ /**撤销申请 */
cancelSaleApply() { cancelSaleApply() {
......
...@@ -17,6 +17,7 @@ Page({ ...@@ -17,6 +17,7 @@ Page({
data: { data: {
RefundReason: Object.freeze(RefundReason), RefundReason: Object.freeze(RefundReason),
method: null, method: null,
imagesMax:9
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -24,7 +25,10 @@ Page({ ...@@ -24,7 +25,10 @@ Page({
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then((orderObj) => { wx.p.router.getRouterParams(options).then((orderObj) => {
console.log("🚀 ~ orderObj:", orderObj) console.log("🚀 ~ orderObj:", orderObj)
orderObj.returnType = 1001; Object.assign(orderObj, {
returnType:orderObj.returnType||1001,
imgUrls:orderObj.imgUrls || []
})
this.setData({ this.setData({
orderObj, orderObj,
method: Methods[orderObj.goodsSource], method: Methods[orderObj.goodsSource],
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<!-- 退款信息组件 --> <!-- 退款信息组件 -->
<refund-info-box <refund-info-box
orderObj="{{orderObj}}" orderObj="{{orderObj}}"
refund-count="{{orderObj.applyQty||orderObj.sellQty}}" refund-count="{{orderObj.applyQty}}"
max-refund-count="{{maxRefundCount}}" max-refund-count="{{maxRefundCount}}"
refund-price="{{orderObj.refundPoints}}" refund-price="{{orderObj.refundPoints}}"
show-refund-count="{{showRefundCount}}" show-refund-count="{{showRefundCount}}"
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.returnContent}}" bindinput="input" showWordLimit customMaxLength></gl-textarea> <gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.returnContent}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view> </view>
<view class="title">上传图片</view> <view class="title">上传图片({{orderObj.imgUrls.length}}/{{imagesMax}})</view>
<!-- 图片上传组件 --> <!-- 图片上传组件 -->
<image-upload-box img-urls="{{orderObj.imgUrls}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box> <image-upload-box img-urls="{{orderObj.imgUrls}}" imagesMax="{{imagesMax}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box>
<view class="btn text-center" bindtap="submit">提交</view> <view class="btn text-center" bindtap="submit">提交</view>
</view> </view>
......
...@@ -3,9 +3,12 @@ Component({ ...@@ -3,9 +3,12 @@ Component({
imgUrls: { imgUrls: {
type: Array, type: Array,
value: [] value: []
},
imagesMax: {
type: Number,
value: 5
} }
}, },
methods: { methods: {
previewImage(e) { previewImage(e) {
let params = e.currentTarget.dataset; let params = e.currentTarget.dataset;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</block> --> </block> -->
<!-- <block wx:else> --> <!-- <block wx:else> -->
<!-- <block wx:if="{{imgUrls.length < 5}}"> --> <!-- <block wx:if="{{imgUrls.length < 5}}"> -->
<view wx:if="{{imgUrls.length<5}}" class="item camera-box text-center" bindtap="onUpload"> <view wx:if="{{imgUrls.length<imagesMax}}" class="item camera-box text-center" bindtap="onUpload">
<view class="icon"> <view class="icon">
<glsx-image webp src="/mine/camera.png"></glsx-image> <glsx-image webp src="/mine/camera.png"></glsx-image>
</view> </view>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<image webp src="{{item}}" mode="aspectFill" class="image"></image> <image webp src="{{item}}" mode="aspectFill" class="image"></image>
<view class="del" catchtap="onDel" data-index="{{index}}"> <view class="del" catchtap="onDel" data-index="{{index}}">
<view class="icon"> <view class="icon">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon> <mp-icon icon="close2" color="#656566" type="field" size="{{16}}"></mp-icon>
</view> </view>
</view> </view>
</view> </view>
......
const { mockDeliveryInfoData } = require("./mock.js");
Component({ Component({
properties: { properties: {
showExpress: { showExpress: {
...@@ -11,6 +9,4 @@ Component({ ...@@ -11,6 +9,4 @@ Component({
value: {} value: {}
} }
}, },
data: {
},
}); });
\ No newline at end of file \ No newline at end of file
const mockDeliveryInfoData = {
orderInfo: {
deliveryCompany: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层深圳广联赛讯有限公司',
deliveryNumber: 'SF1234567890',
deliveryStatus: 2
},
deliveryStatus: {
1: "待发货",
2: "已发货",
3: "已收货",
}
};
module.exports = {
mockDeliveryInfoData
};
\ No newline at end of file \ No newline at end of file
...@@ -3,21 +3,21 @@ Component({ ...@@ -3,21 +3,21 @@ Component({
orderInfo: { orderInfo: {
type: Object, type: Object,
value: {}, value: {},
observer: function (v) { // observer: function (v) {
this.compute(v); // this.compute(v);
} // }
} }
}, },
methods: { methods: {
compute(info) { // compute(info) {
let { freightAmount = 0, sellQty,applyQty, redeemPoints } = info; // let { freightAmount = 0, sellQty,applyQty, redeemPoints } = info;
const total = +redeemPoints * +(sellQty||applyQty) + +freightAmount; // const total = +redeemPoints * +(sellQty||applyQty) + +freightAmount;
this.setData({ // this.setData({
total, // total,
freightAmount, // freightAmount,
info // info
}) // })
console.log(this.data.orderInfo) // console.log(this.data.orderInfo)
} // }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
</block> --> </block> -->
<view class="item"> <view class="item">
<view class="label">实付款:</view> <view class="label">实付款:</view>
<view class="value fontColor">{{total}}积分</view> <view class="value fontColor">{{orderInfo.___totalPrice}}积分</view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">运费:</view> <view class="label">运费:</view>
<view class="value">{{freightAmount}}</view> <view class="value">{{orderInfo.freightAmount||0}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">订单编号:</view> <view class="label">订单编号:</view>
......
// 整合所有组件的mock数据,用于页面整体调试
const { mockDeliveryInfoData } = require('./components/DeliveryInfo/mock.js');
const { mockOrderInfoData } = require('./components/OrderInfo/mock.js');
const { mockOrderGoodsData } = require('./components/OrderGoods/mock.js');
const { mockOrderAmountData } = require('./components/OrderAmount/mock.js');
const mockOrderDetailData = {
orderInfo: {
...mockDeliveryInfoData.orderInfo,
...mockOrderInfoData.orderInfo,
...mockOrderGoodsData.orderInfo,
...mockOrderAmountData.orderInfo,
merchantName: '官方旗舰店',
orderSource: 1
},
orderObj: mockOrderInfoData.orderObj,
statusEnum: mockOrderInfoData.statusEnum,
deliveryStatus: mockDeliveryInfoData.deliveryStatus
};
module.exports = {
mockOrderDetailData
};
\ No newline at end of file \ No newline at end of file
...@@ -7,9 +7,9 @@ Component({ ...@@ -7,9 +7,9 @@ Component({
item: { item: {
type: Object, type: Object,
value: {}, value: {},
observer: function (v) { // observer: function (v) {
this.compute(v); // this.compute(v);
}, // },
}, },
}, },
...@@ -17,14 +17,14 @@ Component({ ...@@ -17,14 +17,14 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
compute(item) { // compute(item) {
let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item; // let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item;
const total = sellQty || applyQty || 0; // const total = sellQty || applyQty || 0;
let sum = redeemPoints * total + +freightAmount; // let sum = redeemPoints * total + +freightAmount;
this.setData({ // this.setData({
sum, // sum,
total, // total,
}); // });
}, // },
}, },
}); });
<view class="bottom"> <view class="bottom">
<view class="total"> <view class="total">
共{{total}}件,实付款 共{{item.___qty}}件,实付款
<text class="price">{{sum||'--'}}积分</text> <text class="price">{{item.___totalPrice||'--'}}积分</text>
</view> </view>
<order-action-buttons order="{{item}}" has-user-info="{{hasUserInfo}}" /> <order-action-buttons order="{{item}}" has-user-info="{{hasUserInfo}}" />
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="info-top"> <view class="info-top">
<view class="name text-hide">{{item.goodsSkuName}}</view> <view class="name text-hide">{{item.goodsSkuName}}</view>
<view class="number"> <view class="number">
<mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.sellQty||item.applyQty}} <mp-icon icon="close" color="#656566" size="{{12}}"></mp-icon>{{item.___qty}}
</view> </view>
</view> </view>
<view class="info-bottom"> <view class="info-bottom">
......
...@@ -140,7 +140,7 @@ Component({ ...@@ -140,7 +140,7 @@ Component({
// 售后 // 售后
onAfterSale(e) { onAfterSale(e) {
let { subOrderCode, redeemPoints, goodsSource, sellQty,applyQty,goodsSkuCode } = let { subOrderCode, redeemPoints, goodsSource,goodsSkuCode,___qty } =
this.data.order; this.data.order;
console.log(this.data.order) console.log(this.data.order)
wx.p.router.go( wx.p.router.go(
...@@ -149,7 +149,7 @@ Component({ ...@@ -149,7 +149,7 @@ Component({
subOrderCode, subOrderCode,
refundPoints: redeemPoints, refundPoints: redeemPoints,
goodsSource, goodsSource,
applyQty: applyQty || sellQty, applyQty: ___qty,
goodsSkuCode goodsSkuCode
} }
); );
......
/* packageMine/pages/order/index/index.wxss */
.sticky-box {
background-color: #F9F7F7;
}
.tab {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #F9F7F7;
z-index: 2;
transition: all 0.4s;
}
.navigation {
width: 100%;
height: 100%;
position: relative;
}
.navigation .back {
width: 64rpx;
height: 64rpx;
background: rgba(255, 255, 255, 0.5);
border-radius: var(--margin);
position: absolute;
left: 20rpx;
}
.navigation .back .icon {
width: 36rpx;
height: 36rpx;
}
.search-box {
position: absolute;
left: 80rpx;
width: 420rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 36rpx;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 16rpx 0 var(--margin);
}
.search-box .icon {
width: 40rpx;
height: 100%;
margin-right: 10rpx;
}
.search-box .input {
width: calc(100% - 98rpx);
}
.search-box .clear-box {
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.search-box .clear-box .clear {
width: 32rpx;
height: 32rpx;
opacity: 0.7;
}
.placeholder-class {
color: #C8C9CC;
}
.layout {
padding: 24rpx var(--margin) 40rpx;
}
.layout .item {
position: relative;
padding-left: 24rpx;
margin-bottom: 20rpx;
background-color: #fff;
box-sizing: border-box;
border-radius: var(--borderRadius);
display: flex;
flex-direction: column;
}
.layout .item .top {
height: 82rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
position: relative;
}
.layout .item .top .name {
width: 410rpx;
height: 40rpx;
font-size: 28rpx;
color: #2D2D2E;
}
.layout .item .goods {
height: 208rpx;
padding: 24rpx 24rpx 24rpx 0;
box-sizing: border-box;
display: flex;
}
.addTo {
border-bottom: 2rpx solid #eff0f2;
}
.layout .item .goods .btn {
display: flex;
align-items: center;
justify-content: center;
width: 124rpx;
height: 46rpx;
border-radius: 25rpx;
border: 2rpx solid #b1b1b3;
font-size: 24rpx;
margin-left: 12rpx;
color: #656566;
position: absolute;
bottom: 0;
right: 0;
}
.layout .item .goods .confirm {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
.layout .item .icon {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
border-radius: 8rpx;
overflow: hidden;
}
.background-X {
background-color: rgb(244, 244, 244);
}
.layout .item .info {
width: calc(100% - 180rpx);
height: 160rpx;
display: flex;
flex-direction: column;
position: relative;
}
.layout .item .info .info-top,
.layout .item .info .info-bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.layout .item .info .info-top .number {
color: #656566;
font-size: 24rpx;
}
.layout .item .info .info-bottom {
margin-top: 4rpx;
font-size: 24rpx;
color: #707071;
display: flex;
flex-direction: column;
align-items:flex-start;
gap: 8rpx;
}
.layout .item .info .info-bottom .price {
color: var(--themeColor);
font-size: 26rpx;
font-weight: 500;
}
.layout .item .info .info-bottom .specification {
color: #b1b1b3;
}
.layout .item .status {
font-size: 28rpx;
color: #282829;
font-weight: 400;
}
.layout .item .bottom {
margin-top: 36rpx;
height: 64rpx;
display: flex;
align-items: flex-start;
font-size: 24rpx;
color: #656566;
}
.layout .item .bottom .total {
position: relative;
bottom: 16rpx;
}
.layout .item .bottom .price {
color: var(--themeColor);
font-weight: 600;
margin-left: 10rpx;
}
.layout .item .btn-box {
position: absolute;
right: 24rpx;
bottom: 16rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.layout .item .btn-box .btn {
display: flex;
align-items: center;
justify-content: center;
width: 144rpx;
height: 64rpx;
border-radius: 16rpx;
border: 1rpx solid #DCDFE6;
font-size: 24rpx;
margin-left: 12rpx;
color: #1B233D;
}
.layout .item .btn-box .pay {
background-color: var(--btnColor);
color: #fff;
border-color: var(--btnColor);
}
.layout .item .btn-box .empty{
color: var(--btnColor);
background-color: #fff;
}
.layout .item .btn-box .confirm {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
.userProfile {
background-color: #fff;
font-size: 24rpx;
margin: 0;
padding: 0;
font-weight: 500;
line-height: 46rpx;
}
.layout .coupon-item {
height: 202rpx;
background: #fefffe;
border-radius: 8rpx;
margin-bottom: 36rpx;
padding: 20rpx;
box-sizing: border-box;
position: relative;
}
.layout .coupon-item .orderPrices {
position: absolute;
color: var(--btnColor);
font-size: 48rpx;
right: 32rpx;
}
.layout .coupon-item .orderPrices text {
font-size: 36rpx;
}
.layout .coupon-item .icon {
width: 162rpx;
height: 162rpx;
margin-right: 20rpx;
}
.layout .coupon-item .info {
width: 360rpx;
height: 100%;
color: #b1b1b3;
font-size: 24rpx;
}
.layout .coupon-item .info .name {
font-size: 28rpx;
font-weight: 500;
color: #282829;
}
.layout .coupon-item .info .order-btn {
width: 138rpx;
height: 48rpx;
background: var(--btnColor);
border-radius: 24rpx;
margin-top: 40rpx;
color: #ffffff;
font-size: 24rpx;
}
.imageHeight {
height: 99rpx !important;
}
.imageStraight {
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/index.js // packageMine/pages/order/index/index.js
import { ORDER_STATUS, OrderStatusTypes,OrderStatusEnum } from "~/constants/mine.js"; import { ORDER_STATUS, OrderStatusTypes,OrderStatusEnum } from "~/constants/mine.js";
import { calcOrderProp } from "~/packageMine/pages/order/utils";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -164,29 +165,13 @@ Page({ ...@@ -164,29 +165,13 @@ Page({
let list = []; let list = [];
wx.p.api.mineApi[requestMethod](obj).then((data) => { wx.p.api.mineApi[requestMethod](obj).then((data) => {
wx.hideLoading(); wx.hideLoading();
data?.list?.map((e) => { data?.list?.forEach((e) => {
// let { const {___qty,___price,___totalPrice} =calcOrderProp(e)
// orderGoods,
// createdDate,
// orderClassify
// } = e;
// let goodsNumber = 0;
// let expiredTime = 0;
// orderGoods?.map((i) => {
// i.retailPrice = Number(i.retailPrice).toFixed(2);
// if (i.activityPrice)
// i.activityPrice = Number(i.activityPrice).toFixed(2);
// goodsNumber += i.goodsNumber;
// expiredTime = new Date(i.warrantyDate).format("yyyy-MM-dd hh:mm:ss");
// if (orderClassify == 5) {
// e.payPrice = NP.times(i.retailPrice, i.goodsNumber);
// }
// });
list.push({ list.push({
...e, ...e,
// goodsNumber, ___price,
// time: new Date(createdDate).format("yyyy-MM-dd hh:mm:ss"), ___totalPrice,
// expiredTime, ___qty,
}); });
}); });
this.setData({ this.setData({
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" /> <input type="text" placeholder="搜索" value="{{keyword}}" class="input" confirm-type="search" bindconfirm="search" bindinput="input" bindblur="blur" />
<block wx:if="{{keyword}}"> <block wx:if="{{keyword}}">
<view class="clear-box" bindtap="clear"> <view class="clear-box" bindtap="clear">
<mp-icon type="field" icon="close2" color="#2C2C2C" size="{{14}}"></mp-icon> <mp-icon type="field" icon="close2" color="#656566" size="{{14}}"></mp-icon>
</view> </view>
</block> </block>
</view> </view>
......
...@@ -98,3 +98,11 @@ export function getAfterSaleDetail(status) { ...@@ -98,3 +98,11 @@ export function getAfterSaleDetail(status) {
} }
return AFTER_SALE_STATUS[_status_] || {}; return AFTER_SALE_STATUS[_status_] || {};
} }
export function calcOrderProp(order){
const { applyQty, sellQty, redeemPoints, freightAmount = 0 } = order;
const ___qty = sellQty || applyQty || 0;
const ___price = (redeemPoints || 0) * ___qty;
const ___totalPrice = (redeemPoints || 0) * ___qty + +freightAmount;
return {___qty, ___price, ___totalPrice};
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!