fixed 修改细节
This commit is contained in:
parent
2181e41643
commit
9d350dbb53
@ -1,4 +1,7 @@
|
|||||||
import { mockIp, mockReqId } from '../../utils/mock';
|
import {
|
||||||
|
mockIp,
|
||||||
|
mockReqId
|
||||||
|
} from '../../utils/mock';
|
||||||
|
|
||||||
export const transformGoodsDataToConfirmData = (goodsDataList) => {
|
export const transformGoodsDataToConfirmData = (goodsDataList) => {
|
||||||
const list = [];
|
const list = [];
|
||||||
@ -6,10 +9,11 @@ export const transformGoodsDataToConfirmData = (goodsDataList) => {
|
|||||||
goodsDataList.forEach((goodsData) => {
|
goodsDataList.forEach((goodsData) => {
|
||||||
list.push({
|
list.push({
|
||||||
storeId: goodsData.storeId,
|
storeId: goodsData.storeId,
|
||||||
|
storeName: goodsData?.storeName,
|
||||||
spuId: goodsData.spuId,
|
spuId: goodsData.spuId,
|
||||||
skuId: goodsData.skuId,
|
skuId: goodsData.skuId,
|
||||||
goodsName: goodsData.title,
|
goodsName: goodsData.title,
|
||||||
image: goodsData.primaryImage,
|
image: goodsData.thumb,
|
||||||
reminderStock: 119,
|
reminderStock: 119,
|
||||||
quantity: goodsData.quantity,
|
quantity: goodsData.quantity,
|
||||||
payPrice: goodsData.price,
|
payPrice: goodsData.price,
|
||||||
@ -37,18 +41,22 @@ export const transformGoodsDataToConfirmData = (goodsDataList) => {
|
|||||||
|
|
||||||
/** 生成结算数据 */
|
/** 生成结算数据 */
|
||||||
export function genSettleDetail(params) {
|
export function genSettleDetail(params) {
|
||||||
const { userAddressReq, couponList, goodsRequestList } = params;
|
const {
|
||||||
|
userAddressReq,
|
||||||
|
couponList,
|
||||||
|
goodsRequestList
|
||||||
|
} = params;
|
||||||
|
|
||||||
const resp = {
|
const resp = {
|
||||||
data: {
|
data: {
|
||||||
settleType: 0,
|
settleType: 0,
|
||||||
userAddress: null,
|
userAddress: null,
|
||||||
totalGoodsCount: 3,
|
totalGoodsCount: 0,
|
||||||
packageCount: 1,
|
packageCount: 0,
|
||||||
totalAmount: '289997',
|
totalAmount: '289997',
|
||||||
totalPayAmount: '',
|
totalPayAmount: '',
|
||||||
totalDiscountAmount: '110000',
|
totalDiscountAmount: '110000',
|
||||||
totalPromotionAmount: '1100',
|
totalPromotionAmount: '0',
|
||||||
totalCouponAmount: '0',
|
totalCouponAmount: '0',
|
||||||
totalSalePrice: '289997',
|
totalSalePrice: '289997',
|
||||||
totalGoodsAmount: '289997',
|
totalGoodsAmount: '289997',
|
||||||
@ -56,8 +64,7 @@ export function genSettleDetail(params) {
|
|||||||
invoiceRequest: null,
|
invoiceRequest: null,
|
||||||
skuImages: null,
|
skuImages: null,
|
||||||
deliveryFeeList: null,
|
deliveryFeeList: null,
|
||||||
storeGoodsList: [
|
storeGoodsList: [{
|
||||||
{
|
|
||||||
storeId: '1000',
|
storeId: '1000',
|
||||||
storeName: '云Mall深圳旗舰店',
|
storeName: '云Mall深圳旗舰店',
|
||||||
remark: null,
|
remark: null,
|
||||||
@ -69,14 +76,11 @@ export function genSettleDetail(params) {
|
|||||||
storeTotalDiscountAmount: '110000',
|
storeTotalDiscountAmount: '110000',
|
||||||
storeTotalCouponAmount: '0',
|
storeTotalCouponAmount: '0',
|
||||||
skuDetailVos: [],
|
skuDetailVos: [],
|
||||||
couponList: [
|
couponList: [{
|
||||||
{
|
|
||||||
couponId: 11,
|
couponId: 11,
|
||||||
storeId: '1000',
|
storeId: '1000',
|
||||||
},
|
}, ],
|
||||||
],
|
}, ],
|
||||||
},
|
|
||||||
],
|
|
||||||
inValidGoodsList: null,
|
inValidGoodsList: null,
|
||||||
outOfStockGoodsList: null,
|
outOfStockGoodsList: null,
|
||||||
limitGoodsList: null,
|
limitGoodsList: null,
|
||||||
@ -92,7 +96,7 @@ export function genSettleDetail(params) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const list = transformGoodsDataToConfirmData(goodsRequestList);
|
const list = transformGoodsDataToConfirmData(goodsRequestList);
|
||||||
|
console.log(list, '看看list');
|
||||||
// 获取购物车传递的商品数据
|
// 获取购物车传递的商品数据
|
||||||
resp.data.storeGoodsList[0].skuDetailVos = list;
|
resp.data.storeGoodsList[0].skuDetailVos = list;
|
||||||
|
|
||||||
@ -119,8 +123,8 @@ export function genSettleDetail(params) {
|
|||||||
|
|
||||||
// 计算折扣
|
// 计算折扣
|
||||||
const totalDiscountPrice =
|
const totalDiscountPrice =
|
||||||
discountPrice.length > 0
|
discountPrice.length > 0 ?
|
||||||
? discountPrice.reduce((pre, cur) => {
|
discountPrice.reduce((pre, cur) => {
|
||||||
if (cur.type === 1) {
|
if (cur.type === 1) {
|
||||||
return pre + cur.value;
|
return pre + cur.value;
|
||||||
}
|
}
|
||||||
@ -129,8 +133,8 @@ export function genSettleDetail(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return pre + cur;
|
return pre + cur;
|
||||||
}, 0)
|
}, 0) :
|
||||||
: 0;
|
0;
|
||||||
|
|
||||||
resp.data.totalSalePrice = totalPrice;
|
resp.data.totalSalePrice = totalPrice;
|
||||||
|
|
||||||
@ -139,6 +143,10 @@ export function genSettleDetail(params) {
|
|||||||
resp.data.totalPayAmount =
|
resp.data.totalPayAmount =
|
||||||
totalPrice - totalDiscountPrice - Number(resp.data.totalPromotionAmount);
|
totalPrice - totalDiscountPrice - Number(resp.data.totalPromotionAmount);
|
||||||
|
|
||||||
|
list.forEach(item => {
|
||||||
|
resp.data.totalGoodsCount += item.quantity
|
||||||
|
});
|
||||||
|
|
||||||
if (userAddressReq) {
|
if (userAddressReq) {
|
||||||
resp.data.settleType = 1;
|
resp.data.settleType = 1;
|
||||||
resp.data.userAddress = userAddressReq;
|
resp.data.userAddress = userAddressReq;
|
||||||
|
@ -259,7 +259,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.popup-sku-actions .sku-operate .sku-operate-addCart {
|
.popup-sku-actions .sku-operate .sku-operate-addCart {
|
||||||
background-color: #ffece9;
|
background-color: #f8f8f8;
|
||||||
color: #1989fa;
|
color: #1989fa;
|
||||||
border-radius: 48rpx 0 0 48rpx;
|
border-radius: 48rpx 0 0 48rpx;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="sold-num">已售{{soldNum}}</view>
|
<view class="sold-num">已售{{soldNum}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{activityList.length > 0}}" class="goods-activity" bindtap="showPromotionPopup">
|
<view wx:if="{{details.goodsSellingPoint}}">{{ details.goodsSellingPoint }}</view>
|
||||||
|
<!-- <view wx:if="{{activityList.length > 0}}" class="goods-activity" bindtap="showPromotionPopup">
|
||||||
<view class="tags-container">
|
<view class="tags-container">
|
||||||
<view wx:for="{{activityList}}" data-promotionId="{{item.promotionId}}" wx:key="index" wx:if="{{index<4}}">
|
<view wx:for="{{activityList}}" data-promotionId="{{item.promotionId}}" wx:key="index" wx:if="{{index<4}}">
|
||||||
<view class="goods-activity-tag">{{item.tag}}</view>
|
<view class="goods-activity-tag">{{item.tag}}</view>
|
||||||
@ -49,7 +50,7 @@
|
|||||||
<view class="activity-show-text">领劵</view>
|
<view class="activity-show-text">领劵</view>
|
||||||
<t-icon name="chevron-right" size="42rpx" />
|
<t-icon name="chevron-right" size="42rpx" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="goods-title">
|
<view class="goods-title">
|
||||||
<view class="goods-name">{{details.title}}</view>
|
<view class="goods-name">{{details.title}}</view>
|
||||||
<view class="goods-tag">
|
<view class="goods-tag">
|
||||||
|
@ -377,13 +377,14 @@ page {
|
|||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1rpx solid rgb(204, 204, 204);
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop-left-img {
|
.shop-left-img {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border: 1rpx solid rgb(204, 204, 204);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop-left-box {
|
.shop-left-box {
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { couponsData } from './mock';
|
import {
|
||||||
|
couponsData
|
||||||
|
} from './mock';
|
||||||
|
import {
|
||||||
|
fetchCouponList
|
||||||
|
} from '~/services/coupon/index';
|
||||||
const emptyCouponImg = `https://cdn-we-retail.ym.tencent.com/miniapp/coupon/ordersure-coupon-newempty.png`;
|
const emptyCouponImg = `https://cdn-we-retail.ym.tencent.com/miniapp/coupon/ordersure-coupon-newempty.png`;
|
||||||
|
|
||||||
Component({
|
Component({
|
||||||
@ -19,7 +23,11 @@ Component({
|
|||||||
value: false,
|
value: false,
|
||||||
observer(couponsShow) {
|
observer(couponsShow) {
|
||||||
if (couponsShow) {
|
if (couponsShow) {
|
||||||
const { promotionGoodsList, orderSureCouponList, storeId } =
|
const {
|
||||||
|
promotionGoodsList,
|
||||||
|
orderSureCouponList,
|
||||||
|
storeId
|
||||||
|
} =
|
||||||
this.data;
|
this.data;
|
||||||
const products =
|
const products =
|
||||||
promotionGoodsList &&
|
promotionGoodsList &&
|
||||||
@ -53,6 +61,7 @@ Component({
|
|||||||
selectedCoupons,
|
selectedCoupons,
|
||||||
storeId,
|
storeId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
console.log(res,'res来咯');
|
||||||
this.initData(res);
|
this.initData(res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -69,41 +78,32 @@ Component({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData(data = {}) {
|
initData(data = {}) {
|
||||||
const { couponResultList = [], reduce = 0 } = data;
|
const {
|
||||||
|
couponResultList = [], reduce = 0
|
||||||
|
} = data;
|
||||||
|
console.log(data,'data来咯');
|
||||||
const selectedList = [];
|
const selectedList = [];
|
||||||
let selectedNum = 0;
|
let selectedNum = 0;
|
||||||
const couponsList =
|
const couponsList =
|
||||||
couponResultList &&
|
couponResultList &&
|
||||||
couponResultList.map((coupon) => {
|
couponResultList.map((coupon) => {
|
||||||
const { status, couponVO } = coupon;
|
console.log(coupon,'优惠价');
|
||||||
const {
|
if (coupon.status === 1) {
|
||||||
couponId,
|
|
||||||
condition = '',
|
|
||||||
endTime = 0,
|
|
||||||
name = '',
|
|
||||||
startTime = 0,
|
|
||||||
value,
|
|
||||||
type,
|
|
||||||
} = couponVO;
|
|
||||||
if (status === 1) {
|
|
||||||
selectedNum++;
|
selectedNum++;
|
||||||
selectedList.push({
|
selectedList.push({
|
||||||
couponId,
|
couponId: coupon.key,
|
||||||
promotionId: ruleId,
|
promotionId: ruleId,
|
||||||
storeId: this.storeId,
|
storeId: this.storeId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const val = type === 2 ? value / 100 : value / 10;
|
|
||||||
return {
|
return {
|
||||||
key: couponId,
|
key: coupon.key,
|
||||||
title: name,
|
title: coupon.title,
|
||||||
isSelected: false,
|
isSelected: false,
|
||||||
timeLimit: `${dayjs(+startTime).format('YYYY-MM-DD')}-${dayjs(
|
timeLimit: coupon.timeLimit,
|
||||||
+endTime,
|
value: coupon.value,
|
||||||
).format('YYYY-MM-DD')}`,
|
status: coupon.status === 1 ? 'default' : 'useless',
|
||||||
value: val,
|
desc: coupon.desc,
|
||||||
status: status === -1 ? 'useless' : 'default',
|
|
||||||
desc: condition,
|
|
||||||
type,
|
type,
|
||||||
tag: '',
|
tag: '',
|
||||||
};
|
};
|
||||||
@ -116,8 +116,13 @@ Component({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
selectCoupon(e) {
|
selectCoupon(e) {
|
||||||
const { key } = e.currentTarget.dataset;
|
const {
|
||||||
const { couponsList, selectedList } = this.data;
|
key
|
||||||
|
} = e.currentTarget.dataset;
|
||||||
|
const {
|
||||||
|
couponsList,
|
||||||
|
selectedList
|
||||||
|
} = this.data;
|
||||||
couponsList.forEach((coupon) => {
|
couponsList.forEach((coupon) => {
|
||||||
if (coupon.key === key) {
|
if (coupon.key === key) {
|
||||||
coupon.isSelected = !coupon.isSelected;
|
coupon.isSelected = !coupon.isSelected;
|
||||||
@ -144,10 +149,16 @@ Component({
|
|||||||
},
|
},
|
||||||
coupons(coupon = {}) {
|
coupons(coupon = {}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log(coupon,'coupon里有什么');
|
||||||
if (coupon?.selectedCoupons) {
|
if (coupon?.selectedCoupons) {
|
||||||
|
// 优惠券接口
|
||||||
|
fetchCouponList({
|
||||||
|
status: 1
|
||||||
|
}).then((res) => {
|
||||||
resolve({
|
resolve({
|
||||||
couponResultList: couponsData.couponResultList,
|
couponResultList: res,
|
||||||
reduce: couponsData.reduce,
|
reduce: 1000,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return reject({
|
return reject({
|
||||||
|
@ -10,19 +10,19 @@
|
|||||||
</wxs>
|
</wxs>
|
||||||
|
|
||||||
<view class="address-card wr-class">
|
<view class="address-card wr-class">
|
||||||
<t-cell wx:if="{{addressData && addressData.detailAddress}}" bindtap="onAddressTap" hover>
|
<t-cell wx:if="{{addressData}}" bindtap="onAddressTap" hover>
|
||||||
<view class="order-address" slot="title">
|
<view class="order-address" slot="title">
|
||||||
<t-icon name="location" color="#333333" size="40rpx" />
|
<t-icon name="location" color="#333333" size="40rpx" />
|
||||||
<view class="address-content">
|
<view class="address-content">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="address-tag" wx:if="{{addressData.addressTag}}">
|
<view class="address-tag" wx:if="{{addressData.isDefault}}">
|
||||||
{{addressData.addressTag}}
|
默认
|
||||||
</view>
|
</view>
|
||||||
{{addressData.provinceName}} {{addressData.cityName}} {{addressData.districtName}}
|
{{addressData.provinceName}} {{addressData.cityName}} {{addressData.districtName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="detail">{{addressData.detailAddress}}</view>
|
<view class="detail">{{addressData.detaiaddresslAddress}}</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
{{addressData.name}} {{utils.hidePhoneNum(addressData.phone)}}
|
{{addressData.name}} {{utils.hidePhoneNum(addressData.phoneNumber)}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<t-icon
|
<t-icon
|
||||||
|
@ -84,6 +84,7 @@ Page({
|
|||||||
// 从购物车跳转过来时,获取传入的商品列表数据
|
// 从购物车跳转过来时,获取传入的商品列表数据
|
||||||
const goodsRequestListJson = wx.getStorageSync('order.goodsRequestList');
|
const goodsRequestListJson = wx.getStorageSync('order.goodsRequestList');
|
||||||
goodsRequestList = JSON.parse(goodsRequestListJson);
|
goodsRequestList = JSON.parse(goodsRequestListJson);
|
||||||
|
console.log(goodsRequestList,'数据看看');
|
||||||
} else if (typeof options.goodsRequestList === 'string') {
|
} else if (typeof options.goodsRequestList === 'string') {
|
||||||
goodsRequestList = JSON.parse(options.goodsRequestList);
|
goodsRequestList = JSON.parse(options.goodsRequestList);
|
||||||
}
|
}
|
||||||
@ -226,7 +227,7 @@ Page({
|
|||||||
id: index,
|
id: index,
|
||||||
thumb: item.image,
|
thumb: item.image,
|
||||||
title: item.goodsName,
|
title: item.goodsName,
|
||||||
specs: item.skuSpecLst.map((s) => s.specValue), // 规格列表 string[]
|
specs: item.skuSpecLst?.map((s) => s.specValue), // 规格列表 string[]
|
||||||
price: item.tagPrice || item.settlePrice || '0', // 优先取限时活动价
|
price: item.tagPrice || item.settlePrice || '0', // 优先取限时活动价
|
||||||
settlePrice: item.settlePrice,
|
settlePrice: item.settlePrice,
|
||||||
titlePrefixTags: item.tagText ? [{ text: item.tagText }] : [],
|
titlePrefixTags: item.tagText ? [{ text: item.tagText }] : [],
|
||||||
@ -242,6 +243,7 @@ Page({
|
|||||||
storeName: ele.storeName,
|
storeName: ele.storeName,
|
||||||
remark: '',
|
remark: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
submitCouponList.push({
|
submitCouponList.push({
|
||||||
storeId: ele.storeId,
|
storeId: ele.storeId,
|
||||||
couponList: ele.couponList || [],
|
couponList: ele.couponList || [],
|
||||||
@ -251,6 +253,9 @@ Page({
|
|||||||
orderCardList.push(orderCard);
|
orderCardList.push(orderCard);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.setData({ orderCardList, storeInfoList, submitCouponList });
|
this.setData({ orderCardList, storeInfoList, submitCouponList });
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
@ -393,15 +398,18 @@ Page({
|
|||||||
if (invoiceData && invoiceData.email) {
|
if (invoiceData && invoiceData.email) {
|
||||||
params.invoiceRequest = invoiceData;
|
params.invoiceRequest = invoiceData;
|
||||||
}
|
}
|
||||||
|
/** 提交订单方法(接口) */
|
||||||
commitPay(params).then(
|
commitPay(params).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
this.payLock = false;
|
this.payLock = false;
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
|
console.log(res,'后端接口返回调起微信支付的参数');
|
||||||
// 提交出现 失效 不在配送范围 限购的商品 提示弹窗
|
// 提交出现 失效 不在配送范围 限购的商品 提示弹窗
|
||||||
if (this.isInvalidOrder(data)) {
|
if (this.isInvalidOrder(data)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (res.code === 'Success') {
|
if (res.code === 'Success') {
|
||||||
|
console.log("正在调起支付");
|
||||||
this.handlePay(data, settleDetailData);
|
this.handlePay(data, settleDetailData);
|
||||||
} else {
|
} else {
|
||||||
Toast({
|
Toast({
|
||||||
@ -484,6 +492,7 @@ Page({
|
|||||||
tradeNo: tradeNo,
|
tradeNo: tradeNo,
|
||||||
transactionId: transactionId,
|
transactionId: transactionId,
|
||||||
};
|
};
|
||||||
|
console.log(payOrderInfo,'支付信息');
|
||||||
|
|
||||||
if (channel === 'wechat') {
|
if (channel === 'wechat') {
|
||||||
wechatPayOrder(payOrderInfo);
|
wechatPayOrder(payOrderInfo);
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
wx:for-index="storeIndex"
|
wx:for-index="storeIndex"
|
||||||
wx:key="storeIndex"
|
wx:key="storeIndex"
|
||||||
>
|
>
|
||||||
<view class="store-wrapper">
|
<!-- <view class="store-wrapper">
|
||||||
<t-icon prefix="wr" size="40rpx" color="#333333" name="store" class="store-logo" />
|
<t-icon prefix="wr" size="40rpx" color="#333333" name="store" class="store-logo" />
|
||||||
{{stores.storeName}}
|
{{stores.storeName}}
|
||||||
</view>
|
</view> -->
|
||||||
<view
|
<view
|
||||||
wx:if="{{orderCardList[storeIndex].goodsList.length > 0}}"
|
wx:if="{{orderCardList[storeIndex].goodsList.length > 0}}"
|
||||||
wx:for="{{orderCardList[storeIndex].goodsList}}"
|
wx:for="{{orderCardList[storeIndex].goodsList}}"
|
||||||
@ -23,13 +23,13 @@
|
|||||||
wx:key="id"
|
wx:key="id"
|
||||||
class="goods-wrapper"
|
class="goods-wrapper"
|
||||||
>
|
>
|
||||||
<t-image src="{{goods.thumb}}" t-class="goods-image" mode="aspectFill" />
|
<image src="{{goods.thumb}}" class="goods-image" mode="aspectFill" />
|
||||||
<view class="goods-content">
|
<view class="goods-content">
|
||||||
<view class="goods-title">{{goods.title}}</view>
|
<view class="goods-title">{{goods.title}}</view>
|
||||||
<view>{{goods.specs}}</view>
|
<view>{{goods.specs}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-right">
|
<view class="goods-right">
|
||||||
<price wr-class="goods-price" price="{{goods.price}}" fill="{{true}}" decimalSmaller />
|
<price priceUnit="yuan" wr-class="goods-price" price="{{goods.price}}" fill="{{true}}" decimalSmaller />
|
||||||
<view class="goods-num">x{{goods.num}}</view>
|
<view class="goods-num">x{{goods.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -38,6 +38,7 @@
|
|||||||
<view class="pay-item">
|
<view class="pay-item">
|
||||||
<text>商品总额</text>
|
<text>商品总额</text>
|
||||||
<price
|
<price
|
||||||
|
priceUnit="yuan"
|
||||||
fill
|
fill
|
||||||
decimalSmaller
|
decimalSmaller
|
||||||
wr-class="pay-item__right font-bold"
|
wr-class="pay-item__right font-bold"
|
||||||
@ -49,19 +50,19 @@
|
|||||||
<view class="pay-item__right font-bold">
|
<view class="pay-item__right font-bold">
|
||||||
<block wx:if="{{settleDetailData.totalDeliveryFee && settleDetailData.totalDeliveryFee != 0}}">
|
<block wx:if="{{settleDetailData.totalDeliveryFee && settleDetailData.totalDeliveryFee != 0}}">
|
||||||
+
|
+
|
||||||
<price fill decimalSmaller price="{{settleDetailData.totalDeliveryFee}}" />
|
<price priceUnit="yuan" fill decimalSmaller price="{{settleDetailData.totalDeliveryFee}}" />
|
||||||
</block>
|
</block>
|
||||||
<text wx:else>免运费</text>
|
<text wx:else>免运费</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pay-item">
|
<!-- <view class="pay-item">
|
||||||
<text>活动优惠</text>
|
<text>活动优惠</text>
|
||||||
<view class="pay-item__right primary font-bold">
|
<view class="pay-item__right primary font-bold">
|
||||||
-
|
-
|
||||||
<price fill price="{{settleDetailData.totalPromotionAmount || 0}}" />
|
<price priceUnit="yuan" fill price="{{settleDetailData.totalPromotionAmount || 0}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="pay-item">
|
<!-- <view class="pay-item">
|
||||||
<text>优惠券</text>
|
<text>优惠券</text>
|
||||||
<view
|
<view
|
||||||
class="pay-item__right"
|
class="pay-item__right"
|
||||||
@ -70,21 +71,21 @@
|
|||||||
>
|
>
|
||||||
<block wx:if="{{submitCouponList.length}}">
|
<block wx:if="{{submitCouponList.length}}">
|
||||||
<block wx:if="{{settleDetailData.totalCouponAmount && settleDetailData.totalCouponAmount !== '0'}}">
|
<block wx:if="{{settleDetailData.totalCouponAmount && settleDetailData.totalCouponAmount !== '0'}}">
|
||||||
-<price fill decimalSmaller price="{{settleDetailData.totalCouponAmount}}" />
|
-<price class="pay-item__right primary font-bold" priceUnit="yuan" fill decimalSmaller price="{{settleDetailData.totalCouponAmount}}" />
|
||||||
</block>
|
</block>
|
||||||
<block wx:else>选择优惠券</block>
|
<block wx:else>选择优惠券</block>
|
||||||
</block>
|
</block>
|
||||||
<text wx:else>无可用</text>
|
<text wx:else>无可用</text>
|
||||||
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="pay-item" wx:if="{{settleDetailData.invoiceSupport}}">
|
<!-- <view class="pay-item" wx:if="{{settleDetailData.invoiceSupport}}">
|
||||||
<text>发票</text>
|
<text>发票</text>
|
||||||
<view class="pay-item__right" catchtap="onReceipt">
|
<view class="pay-item__right" catchtap="onReceipt">
|
||||||
<text>{{handleInvoice(invoiceData)}}</text>
|
<text>{{handleInvoice(invoiceData)}}</text>
|
||||||
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="pay-item">
|
<view class="pay-item">
|
||||||
<text>订单备注</text>
|
<text>订单备注</text>
|
||||||
<view class="pay-item__right" data-storenoteindex="{{0}}" catchtap="onNotes">
|
<view class="pay-item__right" data-storenoteindex="{{0}}" catchtap="onNotes">
|
||||||
@ -99,12 +100,12 @@
|
|||||||
<view class="pay-amount">
|
<view class="pay-amount">
|
||||||
<text class="order-num">共{{settleDetailData.totalGoodsCount}}件</text>
|
<text class="order-num">共{{settleDetailData.totalGoodsCount}}件</text>
|
||||||
<text>小计</text>
|
<text>小计</text>
|
||||||
<price class="total-price" price="{{settleDetailData.totalPayAmount}}" fill="{{false}}" decimalSmaller />
|
<price priceUnit="yuan" class="total-price" price="{{settleDetailData.totalPayAmount}}" fill="{{false}}" decimalSmaller />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wx-pay-cover">
|
<view class="wx-pay-cover">
|
||||||
<view class="wx-pay">
|
<view class="wx-pay">
|
||||||
<price decimalSmaller fill class="price" price="{{settleDetailData.totalPayAmount || '0'}}" />
|
<price priceUnit="yuan" decimalSmaller fill class="price" price="{{settleDetailData.totalPayAmount || '0'}}" />
|
||||||
<view class="submit-btn {{ settleDetailData.settleType === 1 ? '':'btn-gray'}}" bindtap="submitOrder">
|
<view class="submit-btn {{ settleDetailData.settleType === 1 ? '':'btn-gray'}}" bindtap="submitOrder">
|
||||||
提交订单
|
提交订单
|
||||||
</view>
|
</view>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import Dialog from 'tdesign-miniprogram/dialog/index';
|
import Dialog from 'tdesign-miniprogram/dialog/index';
|
||||||
import Toast from 'tdesign-miniprogram/toast/index';
|
import Toast from 'tdesign-miniprogram/toast/index';
|
||||||
|
|
||||||
import { dispatchCommitPay } from '../../../services/order/orderConfirm';
|
import {
|
||||||
|
dispatchCommitPay
|
||||||
|
} from '../../../services/order/orderConfirm';
|
||||||
|
|
||||||
// 真实的提交支付
|
// 真实的提交支付
|
||||||
export const commitPay = (params) => {
|
export const commitPay = (params) => {
|
||||||
@ -26,7 +28,12 @@ export const commitPay = (params) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const paySuccess = (payOrderInfo) => {
|
export const paySuccess = (payOrderInfo) => {
|
||||||
const { payAmt, tradeNo, groupId, promotionId } = payOrderInfo;
|
const {
|
||||||
|
payAmt,
|
||||||
|
tradeNo,
|
||||||
|
groupId,
|
||||||
|
promotionId
|
||||||
|
} = payOrderInfo;
|
||||||
// 支付成功
|
// 支付成功
|
||||||
Toast({
|
Toast({
|
||||||
context: this,
|
context: this,
|
||||||
@ -50,7 +57,9 @@ export const paySuccess = (payOrderInfo) => {
|
|||||||
.map((k) => `${k}=${params[k]}`)
|
.map((k) => `${k}=${params[k]}`)
|
||||||
.join('&');
|
.join('&');
|
||||||
// 跳转支付结果页面
|
// 跳转支付结果页面
|
||||||
wx.redirectTo({ url: `/pages/order/pay-result/index?${paramsStr}` });
|
wx.redirectTo({
|
||||||
|
url: `/pages/order/pay-result/index?${paramsStr}`
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const payFail = (payOrderInfo, resultMsg) => {
|
export const payFail = (payOrderInfo, resultMsg) => {
|
||||||
@ -63,7 +72,9 @@ export const payFail = (payOrderInfo, resultMsg) => {
|
|||||||
confirmBtn: '放弃',
|
confirmBtn: '放弃',
|
||||||
cancelBtn: '继续付款',
|
cancelBtn: '继续付款',
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
wx.redirectTo({ url: '/pages/order/order-list/index' });
|
wx.redirectTo({
|
||||||
|
url: '/pages/order/order-list/index'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//订单列表页,订单详情页,取消付款,toast提示
|
//订单列表页,订单详情页,取消付款,toast提示
|
||||||
@ -83,21 +94,24 @@ export const payFail = (payOrderInfo, resultMsg) => {
|
|||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: 'close-circle',
|
icon: 'close-circle',
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
console.log(resultMsg,'错误信息');
|
||||||
wx.redirectTo({ url: '/pages/order/order-list/index' });
|
// setTimeout(() => {
|
||||||
}, 2000);
|
// wx.redirectTo({
|
||||||
|
// url: '/pages/order/order-list/index'
|
||||||
|
// });
|
||||||
|
// }, 2000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 微信支付方式
|
// 微信支付方式
|
||||||
export const wechatPayOrder = (payOrderInfo) => {
|
export const wechatPayOrder = (payOrderInfo) => {
|
||||||
// const payInfo = JSON.parse(payOrderInfo.payInfo);
|
const payInfo = JSON.parse(payOrderInfo.payInfo);
|
||||||
// const { timeStamp, nonceStr, signType, paySign } = payInfo;
|
const { timeStamp, nonceStr, signType, paySign } = payInfo;
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// demo 中直接走支付成功
|
// demo 中直接走支付成功
|
||||||
paySuccess(payOrderInfo);
|
// paySuccess(payOrderInfo);
|
||||||
resolve();
|
// resolve();
|
||||||
/* wx.requestPayment({
|
wx.requestPayment({
|
||||||
timeStamp,
|
timeStamp,
|
||||||
nonceStr,
|
nonceStr,
|
||||||
package: payInfo.package,
|
package: payInfo.package,
|
||||||
@ -110,6 +124,6 @@ export const wechatPayOrder = (payOrderInfo) => {
|
|||||||
fail: function (err) {
|
fail: function (err) {
|
||||||
payFail(payOrderInfo, err.errMsg);
|
payFail(payOrderInfo, err.errMsg);
|
||||||
},
|
},
|
||||||
}); */
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
@ -16,10 +16,10 @@ export const getAddressPromise = () => {
|
|||||||
|
|
||||||
/** 用户选择了一个地址 */
|
/** 用户选择了一个地址 */
|
||||||
export const resolveAddress = (allAddress,address) => {
|
export const resolveAddress = (allAddress,address) => {
|
||||||
allAddress.forEach(({ resolver }) => resolver(address));
|
addressPromise.forEach(({ resolver }) => resolver(address));
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 用户没有选择任何地址只是返回上一页了 */
|
/** 用户没有选择任何地址只是返回上一页了 */
|
||||||
export const rejectAddress = (allAddress) => {
|
export const rejectAddress = (allAddress) => {
|
||||||
allAddress.forEach(({ rejecter }) => rejecter(new Error('cancel')));
|
addressPromise.forEach(({ rejecter }) => rejecter(new Error('cancel')));
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
"description": "Project configuration file, more information: https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"include": []
|
"include": []
|
||||||
|
Loading…
Reference in New Issue
Block a user