绿满眶商城微信小程序-uniapp
zxl
2025-06-24 e50f021ddf73b80f5a1273b8b01e7dd4344a4cdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<template>
  <div class="wrapper">
    <div class="pay-wrapper">
      <div class="pay-money">
        ¥{{ Number(payPrice) | unitPrice }}
      </div>
      <div class="pay-btns">
        <div v-show="!from" @click="checkOrder">查看{{ this.orderType == "RECHARGE" ? '余额' : '订单' }}</div>
        <div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
      </div>
    </div>
    <div class="pay-box">
      <div class="pay-tag-box">
        <h2>订单支付成功!</h2>
        <div class="pay-item">
          <div>
            支付方式:
          </div>
          <div>{{ paymentMethod | paymentTypeFilter }}</div>
        </div>
      </div>
    </div>
    <goodsRecommend />
  </div>
 
</template>
<script>
import goodsRecommend from "@/components/m-goods-recommend";
export default {
  data() {
    return {
      checked: false,
      paymentMethod: "",
 
      from: "",
      payPrice: 0,
      goodsList: [],
      activeColor: this.$mainColor,
    };
  },
  components: {
    goodsRecommend,
  },
  filters: {
    paymentTypeFilter(val) {
      switch (val) {
        case "WECHAT":
          return "微信";
        case "ALIPAY":
          return "支付宝";
        case "WALLET":
          return "余额支付";
        default:
          return "";
      }
    },
  },
  onLoad(options) {
    this.paymentMethod = options.paymentMethod || "";
    this.from = options.from || "";
    this.payPrice = options.payPrice || 0;
    this.orderType = options.orderType;
 
  },
  methods: {
    checkOrder() {
      /**
       * 查看订单
       * 1.充值跳转到明细里面
       * 2.支付跳转到订单详情
       */
      if (this.orderType == "RECHARGE") {
        uni.reLaunch({
          url: `/pages/mine/deposit/operation`,
        });
      } else {
        this.navigateTo("/pages/order/myOrder?status=0");
      }
    },
 
    navigateTo(url, type) {
      if (type === "switch") {
        uni.switchTab({
          url,
        });
      } else {
        uni.redirectTo({
          url,
        });
      }
    },
  },
};
</script>
<style scoped lang="scss">
.subscribe {
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 40rpx auto;
  padding: 0 20rpx 20rpx;
  width: 80%;
}
 
.pay-btns {
  display: flex;
  width: 50%;
  justify-content: space-between;
  margin: 0 auto;
  color: #fff;
 
  >div {
    padding: 6px 12px;
    border: 1px solid #fff;
    border-radius: 100px;
  }
}
 
.pay-money {
  line-height: 1;
  font-size: 50rpx;
  color: #fff;
  margin-bottom: 100rpx;
}
 
.pay-item {
  font-weight: bold;
  margin: 32rpx 0;
  display: flex;
  justify-content: space-between;
  font-size: 24rpx;
  color: rgba($color: $main-color, $alpha: 0.8);
}
 
.pay-box {
  overflow: hidden;
}
 
.pay-tag-box {
  width: 80%;
  margin: 80rpx auto 40rpx auto;
  padding: 20rpx;
  border-radius: 20rpx;
  background: rgba($color: $main-color, $alpha: 0.2);
 
  >h2 {
    margin-top: 20rpx;
    font-size: 40rpx;
    color: $main-color;
  }
}
 
.pay-wrapper {
  background-image: linear-gradient(90deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
  height: 480rpx;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
 
.pay-box {
  transform: translateY(-100rpx);
  width: 100%;
  background: #fff;
  border-top-right-radius: 100rpx;
}
</style>