| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template>
- <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='我的订单' bgColor="transparent"></cus-header>
- <image class="top_bg" :src="imgBase+'order_detail_bg.png'" mode="widthFix"></image>
- <view class="top adf">
- <view class="top-left adfac">
- <image :src="imgBase+'order_detail_success.png'"></image>
- <view class="top-left-texts adffc">
- <view class="text">{{statusCfg[orderInfo.orderStatus]}}</view>
- <view class="text tip adfac" v-if="orderInfo.orderStatus===0">
- 剩余支付时间<text style="margin: 0 4rpx;"></text>
- <u-count-down :time="countDownTime" format="HH:mm:ss" autoStart @finish="finish"></u-count-down>,
- 超时将自动取消
- </view>
- <view class="text tip" v-else>{{statusTip[orderInfo.orderStatus]||''}}</view>
- </view>
- </view>
- <view class="top-right">¥{{orderInfo.payAmount||0}}</view>
- </view>
- <view class="form">
- <view class="form-item adfacjb">
- <view class="form-item-title">订单号</view>
- <view class="form-item-value">{{orderInfo.orderNo||''}}</view>
- </view>
- <view class="form-item adfacjb">
- <view class="form-item-title">订单类型</view>
- <view class="form-item-value">{{typeCfg[orderInfo.type]}} {{orderInfo.totalFrequency}}次</view>
- </view>
- <view class="form-item adfacjb">
- <view class="form-item-title">订单金额</view>
- <view class="form-item-value">¥{{orderInfo.payAmount||0}}</view>
- </view>
- <view class="form-item adfacjb">
- <view class="form-item-title">下单时间</view>
- <view class="form-item-value">{{orderInfo.createDate||''}}</view>
- </view>
- <view class="form-item adfacjb">
- <view class="form-item-title">有效期至</view>
- <view class="form-item-value">{{orderInfo.expirationTime}}</view>
- </view>
- </view>
- <view class="bottom adfacjb">
- <template v-if="orderInfo.status!=0">
- <view class="bottom-default" @click="buyAgain">再次购买</view>
- </template>
- <template v-else>
- <view class="bottom-default half qx" @click="orderCancel">取消</view>
- <view class="bottom-default half" @click="orderPay">去支付</view>
- </template>
- </view>
- <WechatPay ref="wxPay" @confirmPay="toPay" @cancelPay="cancelPay"></WechatPay>
- </view>
- </template>
- <script>
- import WechatPay from '@/components/wechatPay/index.vue'
- export default {
- components:{ WechatPay },
- data(){
- return {
- id:'',
- orderInfo:null,
- countDownTime:5 * 60 * 1000,
- statusCfg:{
- '-3':'已退款',
- '-2':'已取消',
- '-1':'已失效',
- '0':'待支付',
- '1':'已支付',
- '2':'已完成'
- },
- typeCfg:{
- '1':'基础版',
- '2':'专业版'
- },
- statusTip:{
- '1':'您的问卷已激活,开始PREILL评估',
- '2':'您的问卷已激活,开始PREILL评估',
- '-2':'您的订单已取消,可重新购买'
- }
- }
- },
- onLoad(options) {
- this.id = options.id;
- this.id&&this.getDetail()
- },
- methods:{
- getDetail(){
- this.$api.get(`/que/order/${this.id}`).then(({data:res})=>{
- if(res.code!==0) return this.$showToast(res.msg)
- this.orderInfo = res.data;
- })
- },
- finish(){
-
- },
- buyAgain(){
- uni.navigateTo({
- url:'/pagesPublish/rechargeCenter'
- })
- },
- orderCancel(){
- uni.showModal({
- title:'温馨提示',
- content:'确定取消该订单?',
- success: (res) => {
- if(res.confirm){
- this.$api.put(`/que/order/closeOrder/${this.orderInfo.orderNo}`).then(({data:res})=>{
- if(res.code!==0) return this.$showToast(res.msg)
- this.$showToast('取消成功')
- setTimeout(()=>{
- uni.redirectTo({
- url:'/pagesMy/order'
- })
- },1500)
- })
- }
- }
- })
- },
- orderPay(){
- this.$refs.wxPay.payShow = true;
- this.$api.post('/pay/createOrder',{
- orderNo:this.orderInfo.orderNo,
- openId:JSON.parse(uni.getStorageSync('userInfo')).openId
- }).then(({data:res})=>{
- if(!res.hasOwnProperty('paySign')) return this.$showToast('支付失败')
- this.$refs.wxPay.payShow = false;
- this.$wxPay(res).then(result => {
- uni.navigateTo({
- url:'/pagesPublish/payResult'
- })
- })
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .default_page{
- padding: 0 24rpx 192rpx;
- box-sizing: border-box;
- background: #F7F7F7;
-
- .top_bg{
- width: 100%;
- position: absolute;
- left: 0;
- top: 0;
- }
-
- .top{
- margin-top: 54rpx;
- padding: 0 24rpx;
- position: relative;
- justify-content: space-between;
- &-left{
- image{
- width: 69rpx;
- height: 69rpx;
- }
- &-texts{
- margin-left: 20rpx;
- .text{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 40rpx;
- color: #002846;
- line-height: 40rpx;
- &.tip{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #667E90;
- line-height: 26rpx;
- margin-top: 24rpx;
- }
- }
- }
- }
- &-right{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 36rpx;
- color: #002846;
- line-height: 30rpx;
- text-align: right;
- }
- }
-
- .form{
- background: #FFFFFF;
- border-radius: 25rpx;
- margin-top: 54rpx;
- padding: 0 24rpx;
- position: relative;
- &-item{
- box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
- padding: 34rpx 0;
- &-title{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #002846;
- line-height: 30rpx;
- }
- &-value{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #667E90;
- line-height: 30rpx;
- text-align: right;
- }
- }
- }
-
- .bottom{
- width: calc(100% - 88rpx);
- height: 88rpx;
- position: fixed;
- left: 44rpx;
- bottom: 54rpx;
- &-default{
- width: 100%;
- height: 88rpx;
- border: 1rpx solid #33A7A7;
- background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
- border-radius: 44rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 88rpx;
- text-align: center;
- letter-spacing: 2rpx;
- &.half{
- width: calc(50% - 19rpx);
- }
- &.qx{
- color: #657588;
- background: #FFFFFF;
- border: 1rpx solid #CCD4DA;
- }
- }
- }
- }
- </style>
|