完善功能
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
<u-button @click="mobileLogin" hover-class="none" :customStyle="{color: themeColor, border: '1px solid ' + themeColor, padding: '16rpx 0'}" :plain="true" :hair-line="false" shape="circle">手机号登录/注册</u-button>
|
||||
</view>
|
||||
|
||||
<u-button @click="testLogin" hover-class="none" :customStyle="{backgroundColor: themeColor, color: '#fff', border: 'none', padding: '16rpx 0'}" :hair-line="false" shape="circle">测试账号一键登录</u-button>
|
||||
<!-- <u-button @click="testLogin" hover-class="none" :customStyle="{backgroundColor: themeColor, color: '#fff', border: 'none', padding: '16rpx 0'}" :hair-line="false" shape="circle">测试账号一键登录</u-button> -->
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 u-flex u-row-center">
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// setTabbar()
|
||||
},
|
||||
methods: {
|
||||
tabChange(index) {
|
||||
|
||||
@ -252,18 +252,7 @@ export default {
|
||||
this.pay.alipay = 1
|
||||
//#endif
|
||||
|
||||
this.initDelivery()
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
// 取消全局监听
|
||||
uni.$off(['selectaddress', 'store'])
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配送方式
|
||||
initDelivery(){
|
||||
getDelivery()
|
||||
getDelivery()
|
||||
.then(({ code, data, msg }) => {
|
||||
// 请求结果判断
|
||||
if (code != 1) throw new Error(msg)
|
||||
@ -298,14 +287,15 @@ export default {
|
||||
uni.$on('payment', (params) => {
|
||||
setTimeout(() => {
|
||||
uni.$off('payment')
|
||||
console.log("payment>>>", 'payment');
|
||||
|
||||
if (params.result) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/pay_result/pay_result?id=${params.order_id}`
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/user_order/user_order'
|
||||
uni.reLaunch({
|
||||
url: '/pages/order/order'
|
||||
})
|
||||
}
|
||||
}, 500)
|
||||
@ -318,13 +308,14 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
// 初始化支付方式
|
||||
initPay() {
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
// 取消全局监听
|
||||
uni.$off(['selectaddress', 'store'])
|
||||
},
|
||||
|
||||
methods: {
|
||||
appointmentTime() {
|
||||
this.timePopup = true
|
||||
},
|
||||
@ -334,17 +325,17 @@ export default {
|
||||
getOrderCoupon({
|
||||
goods: this.goods
|
||||
})
|
||||
.then(({ code, data, msg }) => {
|
||||
if (code != 1) throw new Error(msg)
|
||||
return data
|
||||
})
|
||||
.then((data) => {
|
||||
this.usableCoupon = data.usable
|
||||
this.unusableCoupon = data.unusable
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
.then(({ code, data, msg }) => {
|
||||
if (code != 1) throw new Error(msg)
|
||||
return data
|
||||
})
|
||||
.then((data) => {
|
||||
this.usableCoupon = data.usable
|
||||
this.unusableCoupon = data.unusable
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
|
||||
// 选择优惠券
|
||||
@ -456,54 +447,6 @@ export default {
|
||||
this.showLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 订单处理
|
||||
// handleOrderMethods(action) {
|
||||
// // 订单提交数据
|
||||
// const orderFrom = {
|
||||
// action,
|
||||
// goods: this.goods,
|
||||
// delivery_type: this.delivery,
|
||||
// use_integral: this.useIntegral,
|
||||
// address_id: this.addressId,
|
||||
// coupon_id: this.couponId,
|
||||
// bargain_launch_id: this.bargainLaunchId == -1 ? '' : this.bargainLaunchId
|
||||
// }
|
||||
|
||||
// switch (action) {
|
||||
// case 'info':
|
||||
// this.initPageData(orderFrom)
|
||||
// break
|
||||
// case 'submit':
|
||||
// this.handleOrderSubmit(orderFrom)
|
||||
// break
|
||||
// }
|
||||
// },
|
||||
|
||||
// // 订单提交
|
||||
// async handleOrderSubmit(from) {
|
||||
// this.showLoading = true
|
||||
|
||||
// from.remark = this.userRemark
|
||||
// from.type = this.type
|
||||
|
||||
// try {
|
||||
// const { code, data, msg } = this.teamId ? await teamBuy(from) : await orderBuy(from)
|
||||
|
||||
// if (code == 1) {
|
||||
// uni.redirectTo({
|
||||
// url: `/pages/payment/payment?from=${data.type}&order_id=${data.order_id}`
|
||||
// })
|
||||
// } else {
|
||||
// throw new Error(msg)
|
||||
// }
|
||||
// } catch (err) {
|
||||
// console.log(err)
|
||||
// // this.$toast({ title: '下单异常,请重新操作' })
|
||||
// } finally {
|
||||
// this.showLoading = false
|
||||
// }
|
||||
// },
|
||||
},
|
||||
computed: {
|
||||
delivery() {
|
||||
|
||||
134
pages/pay_result/pay_result.vue
Normal file
134
pages/pay_result/pay_result.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<view class="pay-result column-center">
|
||||
<view class="contain bg-white">
|
||||
<view class="header column-center">
|
||||
<view>
|
||||
<image class="tips-icon" :src="`${cloudPath}img/icon_paySuccess.png`"></image>
|
||||
</view>
|
||||
<view class="xl mt20">订单支付成功</view>
|
||||
</view>
|
||||
<view style="height:181rpx"></view>
|
||||
<view class="info">
|
||||
<view class="order-num row-between mt20">
|
||||
<view class="ml20">订单编号</view>
|
||||
<view class="mr20">
|
||||
{{payInfo.order_sn}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="payInfo.pay_time" class="order-time row-between mt20">
|
||||
<view class="ml20">付款时间</view>
|
||||
<view class="mr20">{{payInfo.pay_time}}</view>
|
||||
</view>
|
||||
<view class="order-pay-type row-between mt20">
|
||||
<view class="ml20">支付方式</view>
|
||||
<view class="mr20">{{payInfo.pay_way_text}}</view>
|
||||
</view>
|
||||
<view class="order-pay-money row-between mt20">
|
||||
<view class="ml20">支付金额</view>
|
||||
<view class="mr20">
|
||||
<price-format :price="payInfo.order_amount"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line ml20"></view>
|
||||
<view class="opt-btn-contain row-center wrap">
|
||||
<navigator hover-class="none" class="check-order-btn row-center bg-default br60 mt20" open-type="switchTab" url="/pages/order/order">
|
||||
<view class="white lg">查看订单</view>
|
||||
</navigator>
|
||||
<navigator hover-class="none" class="go-back-btn row-center br60 mt20" open-type="switchTab" url="/pages/index/index">
|
||||
<view class="textdefault br60 lg">返回首页</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getOrderDetail
|
||||
} from '@/api/order';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payInfo: {}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
|
||||
},
|
||||
props: {},
|
||||
onLoad: function(options) {
|
||||
this.id = options.id;
|
||||
this.getOrderResultFun();
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
getOrderResultFun() {
|
||||
getOrderDetail(this.id).then(res => {
|
||||
if (res.code == 1) {
|
||||
this.payInfo = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.pay-result {
|
||||
.contain {
|
||||
width: 682rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 78rpx;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
padding-bottom: 40rpx;
|
||||
position: relative;
|
||||
|
||||
.tips-icon {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
top: -50rpx;
|
||||
}
|
||||
|
||||
.order-num {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.opt-btn-contain {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.check-order-btn {
|
||||
width: 650rpx;
|
||||
height: 84rpx;
|
||||
}
|
||||
|
||||
.go-back-btn {
|
||||
width: 650rpx;
|
||||
height: 84rpx;
|
||||
border:1px solid #254062;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 650rpx;
|
||||
border-top: 1px solid rgba(229, 229, 229, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user