|
|
- import { showConfirmDialog } from 'vant';
- import { showDialog } from 'vant';
-
-
- export default {
- methods : {
- //再来一单
- moreOrder(projectId,successCallback) {
- this.$api('getProjectDetail', {
- id: projectId
- }, res => {
- if (res.code == 200) {
- successCallback && successCallback(res,projectId)
- }
- })
- },
-
- //立即评价
- toEvaluate(id,projectId,terId) {
- uni.navigateTo({
- url: `/pages/order/evaluate?id=${id}&projectId=${projectId}&terId=${terId}`
- })
- },
-
- //取消订单
- calcelOrder(orderId,successCallback) {
- showConfirmDialog({
- title: '取消订单',
- message: '确认取消订单?',
- }).then(() => {
- this.$api('cancelVipOrder', {
- orderId
- }, res => {
- if (res.code == 200) {
- successCallback && successCallback()
- }
- })
- }).catch(() => {});
- },
-
- //立即支付
- toPayOrder(item) {
-
- let data = {
- addressId: item.addressId,
- orderId: item.id,
- payType: item.payType,
- remark: item.remark,
- serviceTime: item.serviceTime
- }
-
- // if(item.couponId){
- // data.couponId = couponId
- // }
-
- this.$api('immediatelyPay', data, res => {
- if (res.code == 200) {
- if (item.payType == 1) { //余额支付
- showDialog({
- title: '支付成功',
- message: '订单支付成功!请前往订单查看',
- }).then(() => {
- this.active = 2
- });
- }else{
- this.$wxPay(res, this.getOrderList, this.getOrderList)
- }
- }
- this.getOrderList()
- })
- },
- }
- }
|