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