fieat 添加订单功能的对接,取消订单,评价,删除订单
This commit is contained in:
parent
5e4fe65f7f
commit
bac5f7deec
@ -5,9 +5,9 @@
|
||||
wx:for-item="resource"
|
||||
wx:key="*this"
|
||||
>
|
||||
<image wx:if="{{resource.type === 'image'}}" class="resource-item-{{classType}}" src="{{resource.src}}" />
|
||||
<image wx:if="{{resource.type === 'image'}}" class="resource-item-{{classType}}" src="{{resource.src}}" mode="aspectFill"/>
|
||||
<my-video wx:else videoSrc="{{resource.src}} " my-video="resource-item-{{classType}}">
|
||||
<image class="resource-item resource-item-{{classType}}" slot="cover-img" src="{{resource.coverSrc}}" />
|
||||
<image class="resource-item resource-item-{{classType}}" slot="cover-img" src="{{resource.coverSrc}}" mode="aspectFill"/>
|
||||
<image class="play-icon" slot="play-icon" src="./assets/play.png" />
|
||||
</my-video>
|
||||
</view>
|
||||
|
@ -1,5 +1,12 @@
|
||||
// import { getCommentDetail } from '../../../../services/good/comments/fetchCommentDetail';
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
import {
|
||||
ServerBasePath
|
||||
} from '~/app'
|
||||
import {
|
||||
addComment
|
||||
} from '~/services/order/addComment';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
serviceRateValue: 1,
|
||||
@ -13,16 +20,21 @@ Page({
|
||||
column: 3,
|
||||
},
|
||||
isAllowedSubmit: false,
|
||||
orderGuid: 0,
|
||||
goodsGuid: 0,
|
||||
imgUrl: '',
|
||||
title: '',
|
||||
goodsDetail: '',
|
||||
imageProps: {
|
||||
mode: 'aspectFit',
|
||||
},
|
||||
textAreaValue: ""
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
orderGuid: options.orderGuid,
|
||||
goodsGuid: options.goodsGuid,
|
||||
imgUrl: options.imgUrl,
|
||||
title: options.title,
|
||||
goodsDetail: options.specs,
|
||||
@ -30,20 +42,28 @@ Page({
|
||||
},
|
||||
|
||||
onRateChange(e) {
|
||||
const { value } = e?.detail;
|
||||
const {
|
||||
value
|
||||
} = e?.detail;
|
||||
const item = e?.currentTarget?.dataset?.item;
|
||||
this.setData({ [item]: value }, () => {
|
||||
this.setData({
|
||||
[item]: value
|
||||
}, () => {
|
||||
this.updateButtonStatus();
|
||||
});
|
||||
},
|
||||
|
||||
onAnonymousChange(e) {
|
||||
const status = !!e?.detail?.checked;
|
||||
this.setData({ isAnonymous: status });
|
||||
this.setData({
|
||||
isAnonymous: status
|
||||
});
|
||||
},
|
||||
|
||||
handleSuccess(e) {
|
||||
const { files } = e.detail;
|
||||
const {
|
||||
files
|
||||
} = e.detail;
|
||||
|
||||
this.setData({
|
||||
uploadFiles: files,
|
||||
@ -51,8 +71,12 @@ Page({
|
||||
},
|
||||
|
||||
handleRemove(e) {
|
||||
const { index } = e.detail;
|
||||
const { uploadFiles } = this.data;
|
||||
const {
|
||||
index
|
||||
} = e.detail;
|
||||
const {
|
||||
uploadFiles
|
||||
} = this.data;
|
||||
uploadFiles.splice(index, 1);
|
||||
this.setData({
|
||||
uploadFiles,
|
||||
@ -61,26 +85,125 @@ Page({
|
||||
|
||||
onTextAreaChange(e) {
|
||||
const value = e?.detail?.value;
|
||||
this.textAreaValue = value;
|
||||
this.setData({
|
||||
textAreaValue: value
|
||||
})
|
||||
this.updateButtonStatus();
|
||||
},
|
||||
|
||||
updateButtonStatus() {
|
||||
const { serviceRateValue, goodRateValue, conveyRateValue, isAllowedSubmit } = this.data;
|
||||
const { textAreaValue } = this;
|
||||
const {
|
||||
serviceRateValue,
|
||||
goodRateValue,
|
||||
conveyRateValue,
|
||||
isAllowedSubmit
|
||||
} = this.data;
|
||||
const {
|
||||
textAreaValue
|
||||
} = this.data;
|
||||
const temp = serviceRateValue && goodRateValue && conveyRateValue && textAreaValue;
|
||||
if (temp !== isAllowedSubmit) this.setData({ isAllowedSubmit: temp });
|
||||
if (temp !== isAllowedSubmit) this.setData({
|
||||
isAllowedSubmit: temp
|
||||
});
|
||||
},
|
||||
|
||||
onSubmitBtnClick() {
|
||||
const { isAllowedSubmit } = this.data;
|
||||
if (!isAllowedSubmit) return;
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '评价提交成功',
|
||||
icon: 'check-circle',
|
||||
});
|
||||
wx.navigateBack();
|
||||
// 上传图片
|
||||
handleAddPic(e) {
|
||||
const {
|
||||
files
|
||||
} = e.detail;
|
||||
|
||||
// 每次选择图片都上传,展示每次上传图片的进度
|
||||
files.forEach(file => this.onUploadPic(file))
|
||||
},
|
||||
});
|
||||
|
||||
// 移除Pic
|
||||
handleRemovePic(e) {
|
||||
const {
|
||||
index
|
||||
} = e.detail;
|
||||
const {
|
||||
uploadFiles
|
||||
} = this.data;
|
||||
|
||||
uploadFiles.splice(index, 1);
|
||||
this.setData({
|
||||
uploadFiles: uploadFiles,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片方法
|
||||
onUploadPic(file) {
|
||||
let {
|
||||
uploadFiles
|
||||
} = this.data
|
||||
|
||||
this.setData({
|
||||
uploadFiles : [...uploadFiles, {
|
||||
...file,
|
||||
status: 'loading'
|
||||
}],
|
||||
});
|
||||
const {
|
||||
length
|
||||
} = uploadFiles;
|
||||
|
||||
const task = wx.uploadFile({
|
||||
url: ServerBasePath + 'Common/UploadFile', // 仅为示例,非真实的接口地址
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
formData: {
|
||||
fileDir: 'Shops'
|
||||
},
|
||||
success: (res) => {
|
||||
this.setData({
|
||||
[`uploadFiles[${length}].url`]: JSON.parse(res.data).data.url,
|
||||
[`uploadFiles[${length}].status`]: 'done',
|
||||
});
|
||||
// this.triggerEventToParent()
|
||||
},
|
||||
});
|
||||
task.onProgressUpdate((res) => {
|
||||
this.setData({
|
||||
[`uploadFiles[${length}].percent`]: res.progress,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 提交
|
||||
onSubmitBtnClick() {
|
||||
// goodRateValue 评分
|
||||
// textAreaValue 评价内容
|
||||
// uploadFiles 评价图片
|
||||
const {
|
||||
orderGuid,
|
||||
goodsGuid,
|
||||
goodRateValue,
|
||||
textAreaValue,
|
||||
uploadFiles,
|
||||
isAllowedSubmit
|
||||
} = this.data;
|
||||
let data = {
|
||||
orderGuid: orderGuid,
|
||||
goodsGuid: goodsGuid,
|
||||
GoodsCommentRating: goodRateValue,
|
||||
GoodsCommentContent: textAreaValue,
|
||||
GoodsCommentImages: uploadFiles.map(item => item.url).join(','),
|
||||
}
|
||||
if (!isAllowedSubmit) return;
|
||||
|
||||
addComment(data).then((res) =>{
|
||||
if(res.code === 200){
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '评价提交成功',
|
||||
icon: 'check-circle',
|
||||
});
|
||||
wx.navigateBack();
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
});
|
@ -2,7 +2,8 @@
|
||||
<view class="comment-card">
|
||||
<view class="goods-info-container">
|
||||
<view class="goods-image-container">
|
||||
<t-image t-class="goods-image" src="{{imgUrl}}" />
|
||||
<!-- <t-image t-class="goods-image" src="{{imgUrl}}" /> -->
|
||||
<image class="goods-image" src="{{imgUrl}}" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="goods-title-container">
|
||||
<view class="goods-title">{{title}}</view>
|
||||
@ -32,14 +33,16 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="upload-container">
|
||||
<t-upload
|
||||
<!-- <t-upload
|
||||
media-type="{{['image','video']}}"
|
||||
files="{{uploadFiles}}"
|
||||
bind:remove="handleRemove"
|
||||
bind:success="handleSuccess"
|
||||
gridConfig="{{gridConfig}}"
|
||||
imageProps="{{imageProps}}"
|
||||
/>
|
||||
/> -->
|
||||
<t-upload mediaType="{{['image','video']}}" max="{{5}}" files="{{uploadFiles}}" bind:add="handleAddPic" bind:remove="handleRemovePic" gridConfig="{{gridConfig}}"imageProps="{{imageProps}}">
|
||||
</t-upload>
|
||||
</view>
|
||||
|
||||
<!-- <view class="anonymous-box">
|
||||
|
@ -8,8 +8,8 @@ page {
|
||||
}
|
||||
|
||||
.comment-card .goods-info-container .goods-image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
@ -166,3 +166,6 @@ page {
|
||||
.upload-container .upload-addcontent-slot {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.upload-box{
|
||||
}
|
@ -1,6 +1,26 @@
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
import Dialog from 'tdesign-miniprogram/dialog/index';
|
||||
import { OrderButtonTypes } from '../../config';
|
||||
import {
|
||||
OrderButtonTypes
|
||||
} from '../../config';
|
||||
import {
|
||||
wechatPayOrder
|
||||
} from '~/services/pay';
|
||||
import {
|
||||
wxRepay
|
||||
} from '~/services/order/wxRepay';
|
||||
import {
|
||||
waitPayCancelOrder
|
||||
} from '~/services/order/waitPayCancelOrder';
|
||||
import {
|
||||
payCancelOrder
|
||||
} from '~/services/order/payCancelOrder';
|
||||
import {
|
||||
delOrder
|
||||
} from '~/services/order/delOrder';
|
||||
import {
|
||||
confirmReceipt
|
||||
} from '~/services/order/confirmReceipt';
|
||||
|
||||
Component({
|
||||
options: {
|
||||
@ -28,7 +48,12 @@ Component({
|
||||
//邀请好友拼团按钮
|
||||
if (button.type === OrderButtonTypes.INVITE_GROUPON && order.groupInfoVo) {
|
||||
const {
|
||||
groupInfoVo: { groupId, promotionId, remainMember, groupPrice },
|
||||
groupInfoVo: {
|
||||
groupId,
|
||||
promotionId,
|
||||
remainMember,
|
||||
groupPrice
|
||||
},
|
||||
goodsList,
|
||||
} = order;
|
||||
const goodsImg = goodsList[0] && goodsList[0].imgUrl;
|
||||
@ -84,7 +109,9 @@ Component({
|
||||
methods: {
|
||||
// 点击【订单操作】按钮,根据按钮类型分发
|
||||
onOrderBtnTap(e) {
|
||||
const { type } = e.currentTarget.dataset;
|
||||
const {
|
||||
type
|
||||
} = e.currentTarget.dataset;
|
||||
switch (type) {
|
||||
case OrderButtonTypes.DELETE:
|
||||
this.onDelete(this.data.order);
|
||||
@ -115,29 +142,84 @@ Component({
|
||||
}
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '你点击了取消订单',
|
||||
icon: 'check-circle',
|
||||
});
|
||||
},
|
||||
|
||||
onConfirm() {
|
||||
Dialog.confirm({
|
||||
title: '确认是否已经收到货?',
|
||||
content: '',
|
||||
confirmBtn: '确认收货',
|
||||
cancelBtn: '取消',
|
||||
})
|
||||
.then(() => {
|
||||
//删除订单
|
||||
onDelete(order) {
|
||||
delOrder(order.id).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.triggerEvent('refresh')
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '你确认了确认收货',
|
||||
icon: 'check-circle',
|
||||
message: '删除成功',
|
||||
icon: '',
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//取消订单
|
||||
onCancel(order) {
|
||||
|
||||
console.log(order, '看看order先');
|
||||
// 待支付取消
|
||||
if (order.status === 1) {
|
||||
let data = {
|
||||
orderGuid: order.Guid
|
||||
}
|
||||
waitPayCancelOrder(data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.triggerEvent('refresh')
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '取消成功',
|
||||
icon: '',
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
// 已支付取消
|
||||
if (order.status !== 1) {
|
||||
let data = {
|
||||
orderGuid: order.Guid
|
||||
}
|
||||
payCancelOrder(data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.triggerEvent('refresh')
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '申请取消成功',
|
||||
icon: '',
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//确认收货
|
||||
onConfirm(order) {
|
||||
Dialog.confirm({
|
||||
title: '确认是否已经收到货?',
|
||||
content: '',
|
||||
confirmBtn: '确认收货',
|
||||
cancelBtn: '取消',
|
||||
})
|
||||
.then(() => {
|
||||
let data = {
|
||||
orderGuid: order.Guid
|
||||
}
|
||||
confirmReceipt(data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.triggerEvent('refresh')
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '收货成功',
|
||||
icon: 'check-circle',
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
Toast({
|
||||
@ -149,13 +231,22 @@ Component({
|
||||
});
|
||||
},
|
||||
|
||||
onPay() {
|
||||
// 重新调起支付
|
||||
onPay(order) {
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: '你点击了去支付',
|
||||
icon: 'check-circle',
|
||||
});
|
||||
let data = {
|
||||
orderNo: order.orderNo,
|
||||
openId: wx.getStorageSync('openId')
|
||||
}
|
||||
|
||||
wxRepay(data).then((res) => {
|
||||
console.log(res, '重新调起支付的参数');
|
||||
})
|
||||
},
|
||||
|
||||
onBuyAgain() {
|
||||
@ -167,16 +258,19 @@ Component({
|
||||
});
|
||||
},
|
||||
|
||||
// 申请售后
|
||||
onApplyRefund(order) {
|
||||
console.log(order,'这里的参数');
|
||||
const goods = order.goodsList[this.properties.goodsIndex];
|
||||
const params = {
|
||||
orderGuid: order.Guid,
|
||||
orderNo: order.orderNo,
|
||||
skuId: goods?.skuId ?? '19384938948343',
|
||||
spuId: goods?.spuId ?? '28373847384343',
|
||||
skuId: goods?.skuId,
|
||||
spuId: goods?.id,
|
||||
orderStatus: order.status,
|
||||
logisticsNo: order.logisticsNo,
|
||||
price: goods?.price ?? 89,
|
||||
num: goods?.num ?? 89,
|
||||
price: goods?.price,
|
||||
num: goods?.num,
|
||||
createTime: order.createTime,
|
||||
orderAmt: order.totalAmount,
|
||||
payAmt: order.amount,
|
||||
@ -185,7 +279,9 @@ Component({
|
||||
const paramsStr = Object.keys(params)
|
||||
.map((k) => `${k}=${params[k]}`)
|
||||
.join('&');
|
||||
wx.navigateTo({ url: `/pages/order/apply-service/index?${paramsStr}` });
|
||||
wx.navigateTo({
|
||||
url: `/pages/order/apply-service/index?${paramsStr}`
|
||||
});
|
||||
},
|
||||
|
||||
onViewRefund() {
|
||||
@ -199,12 +295,40 @@ Component({
|
||||
|
||||
/** 添加订单评论 */
|
||||
onAddComment(order) {
|
||||
console.log(order?.goodsList?.[0],'asdasdsa');
|
||||
const imgUrl = order?.goodsList?.[0]?.thumb;
|
||||
const title = order?.goodsList?.[0]?.title;
|
||||
const specs = order?.goodsList?.[0]?.specs;
|
||||
const orderGuid = order?.Guid;
|
||||
const goodsGuid = order?.goodsList?.[0]?.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/goods/comments/create/index?specs=${specs}&title=${title}&orderNo=${order?.orderNo}&imgUrl=${imgUrl}`,
|
||||
url: `/pages/goods/comments/create/index?specs=${specs}&title=${title}&orderNo=${order?.orderNo}&imgUrl=${imgUrl}&orderGuid=${orderGuid}&goodsGuid=${goodsGuid}`,
|
||||
});
|
||||
},
|
||||
|
||||
// 处理支付
|
||||
handlePay(data) {
|
||||
const {
|
||||
jsApiUiPackage,
|
||||
outTradeNo,
|
||||
interactId,
|
||||
transactionId
|
||||
} = data;
|
||||
const payOrderInfo = {
|
||||
payInfo: jsApiUiPackage,
|
||||
orderId: outTradeNo,
|
||||
orderAmt: totalAmount,
|
||||
payAmt: totalPayAmount,
|
||||
interactId: interactId,
|
||||
tradeNo: outTradeNo,
|
||||
transactionId: transactionId,
|
||||
};
|
||||
console.log(payOrderInfo, '支付信息');
|
||||
|
||||
// if (channel === 'wechat') {
|
||||
wechatPayOrder(payOrderInfo);
|
||||
// }
|
||||
},
|
||||
|
||||
},
|
||||
});
|
||||
});
|
@ -6,7 +6,7 @@
|
||||
wx:for-item="leftBtn"
|
||||
size="extra-small"
|
||||
shape="round"
|
||||
t-class="{{isBtnMax ? 't-button--max':'t-button'}} order-btn delete-btn"
|
||||
t-class="{{isBtnMax ? 't-button--max':'t-button'}} order-btn delete-btn .right .normal"
|
||||
hover-class="order-btn--active"
|
||||
catchtap="onOrderBtnTap"
|
||||
data-type="{{leftBtn.type}}"
|
||||
|
@ -31,6 +31,10 @@
|
||||
|
||||
.btn-bar .left .delete-btn {
|
||||
font-size: 22rpx;
|
||||
--td-button-default-color: #333333;
|
||||
--td-button-default-border-color: #dddddd;
|
||||
background: white;
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
.btn-bar .left .delete-btn::after {
|
||||
display: none;
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
import {
|
||||
commitPay,
|
||||
wechatPayOrder
|
||||
} from './pay';
|
||||
} from '~/services/pay';
|
||||
import {
|
||||
getAddressPromise
|
||||
} from '../../usercenter/address/list/util';
|
||||
|
@ -79,9 +79,6 @@ Page({
|
||||
},
|
||||
|
||||
onPullDownRefresh_(e) {
|
||||
const {
|
||||
callback
|
||||
} = e.detail;
|
||||
this.setData({
|
||||
pullDownRefreshing: true
|
||||
});
|
||||
@ -90,7 +87,6 @@ Page({
|
||||
this.setData({
|
||||
pullDownRefreshing: false
|
||||
});
|
||||
callback && callback();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({
|
||||
@ -134,7 +130,7 @@ Page({
|
||||
_status = 0
|
||||
}
|
||||
const params = {
|
||||
pageIndex: this.page.num,
|
||||
PageNum: this.page.num,
|
||||
pageSize: this.page.size,
|
||||
status: _status
|
||||
};
|
||||
@ -156,7 +152,7 @@ Page({
|
||||
// parentOrderNo: order.parentOrderNo,
|
||||
// storeId: order.storeId,
|
||||
// storeName: order.storeName,
|
||||
status: order.orderStatus,
|
||||
status: order.status,
|
||||
statusDesc: order.statusName,
|
||||
amount: order.payPrice,
|
||||
totalAmount: order.orderAmount,
|
||||
@ -257,6 +253,7 @@ Page({
|
||||
},
|
||||
|
||||
onRefresh() {
|
||||
console.log(1111);
|
||||
this.refreshList(this.data.curTab);
|
||||
},
|
||||
|
||||
|
@ -56,12 +56,12 @@
|
||||
<view slot="more">
|
||||
<view class="price-total">
|
||||
<text>总价</text>
|
||||
<price fill price="{{order.totalAmount + ''}}" />
|
||||
<price priceUnit="yuan" fill price="{{order.totalAmount + ''}}" />
|
||||
<text>,运费</text>
|
||||
<price fill price="{{order.freightFee + ''}}" />
|
||||
<price priceUnit="yuan" fill price="{{order.freightFee + ''}}" />
|
||||
<text decode> </text>
|
||||
<text class="bold-price" decode="{{true}}">实付 </text>
|
||||
<price fill class="real-pay" price="{{order.amount + ''}}" decimalSmaller />
|
||||
<price priceUnit="yuan" fill class="real-pay" price="{{order.amount + ''}}" decimalSmaller />
|
||||
</view>
|
||||
<!-- 订单按钮栏 -->
|
||||
<order-button-bar order="{{order}}" bindrefresh="onRefresh" data-order="{{order}}" />
|
||||
|
@ -8,13 +8,13 @@ import Toast from 'tdesign-miniprogram/toast/index';
|
||||
|
||||
const menuData = [
|
||||
[
|
||||
// {
|
||||
// title: '申请开店',
|
||||
// tit: '',
|
||||
// url: '',
|
||||
// status: 0,
|
||||
// type: 'apply-shop',
|
||||
// },
|
||||
{
|
||||
title: '申请开店',
|
||||
tit: '',
|
||||
url: '',
|
||||
status: 0,
|
||||
type: 'apply-shop',
|
||||
},
|
||||
{
|
||||
title: '收货地址',
|
||||
tit: '',
|
||||
@ -60,7 +60,7 @@ const menuData = [
|
||||
const orderTagInfos = [{
|
||||
title: '待付款',
|
||||
iconName: 'wallet',
|
||||
orderNum: 1,
|
||||
orderNum: 0,
|
||||
tabType: 5,
|
||||
status: 1,
|
||||
},
|
||||
@ -104,6 +104,11 @@ const getDefaultData = () => ({
|
||||
collectData: {
|
||||
collectCount: 0,
|
||||
historyCount: 0,
|
||||
waitPayCount: 0,
|
||||
deliverCount: 0,
|
||||
packageCount: 0,
|
||||
commentCount: 0,
|
||||
exchangCount: 0,
|
||||
},
|
||||
menuData,
|
||||
orderTagInfos,
|
||||
@ -156,11 +161,18 @@ Page({
|
||||
// ...v,
|
||||
// ...orderInfo[index],
|
||||
// }));
|
||||
console.log(collectData,'数据');
|
||||
this.data.orderTagInfos[0].orderNum = collectData.waitPayCount
|
||||
this.data.orderTagInfos[1].orderNum = collectData.deliverCount
|
||||
this.data.orderTagInfos[2].orderNum = collectData.packageCount
|
||||
this.data.orderTagInfos[3].orderNum = collectData.commentCount
|
||||
this.data.orderTagInfos[4].orderNum = collectData.exchangCount
|
||||
console.log(this.data.orderTagInfos,'asdasdasd');
|
||||
this.setData({
|
||||
userInfo,
|
||||
collectData,
|
||||
// menuData,
|
||||
// orderTagInfos: info,
|
||||
orderTagInfos: this.data.orderTagInfos,
|
||||
// customerServiceInfo,
|
||||
currAuthStep: 2,
|
||||
});
|
||||
|
21
services/order/addComment.js
Normal file
21
services/order/addComment.js
Normal file
@ -0,0 +1,21 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 评价 */
|
||||
export function addComment(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `OrderApi/addComment`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
21
services/order/confirmReceipt.js
Normal file
21
services/order/confirmReceipt.js
Normal file
@ -0,0 +1,21 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 确认收货 */
|
||||
export function confirmReceipt(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `OrderApi/confirmReceipt`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
20
services/order/delOrder.js
Normal file
20
services/order/delOrder.js
Normal file
@ -0,0 +1,20 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 删除订单 */
|
||||
export function delOrder(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `OrderApi/` + id,
|
||||
method: 'DELETE',
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
21
services/order/payCancelOrder.js
Normal file
21
services/order/payCancelOrder.js
Normal file
@ -0,0 +1,21 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 已支付取消订单 */
|
||||
export function payCancelOrder(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `OrderApi/payCancelOrder`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
21
services/order/waitPayCancelOrder.js
Normal file
21
services/order/waitPayCancelOrder.js
Normal file
@ -0,0 +1,21 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 待支付取消订单 */
|
||||
export function waitPayCancelOrder(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `OrderApi/waitPayCancelOrder`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
21
services/order/wxRepay.js
Normal file
21
services/order/wxRepay.js
Normal file
@ -0,0 +1,21 @@
|
||||
import {
|
||||
request
|
||||
} from '../_utils/request';
|
||||
|
||||
/** 重新调起微信支付 */
|
||||
export function wxRepay(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: `WxPay/wxRepay`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
|
||||
resolve(res);
|
||||
},
|
||||
fail: function (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@ -22,6 +22,11 @@ export function fetchUserCenter() {
|
||||
collectData: {
|
||||
collectCount: res.data.collectCount,
|
||||
historyCount: res.data.historyCount,
|
||||
waitPayCount: res.data.waitPayCount,
|
||||
deliverCount: res.data.deliverCount,
|
||||
packageCount: res.data.packageCount,
|
||||
commentCount: res.data.commentCount,
|
||||
exchangCount: res.data.exchangCount,
|
||||
}
|
||||
};
|
||||
resolve(data);
|
||||
|
Loading…
Reference in New Issue
Block a user