123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- <template>
- <!-- 支付 -->
- <div class="Nopyment" v-loading="loading">
- <div class="message">
- <div>
- <img :src="data.picture_url" alt="" />
- </div>
- <div class="text">
- <p class="p1">
- {{ data.name }}
- </p>
- <!-- <p class="p2">
- <span>xx课程</span>
- </p> -->
- <p class="p3">{{ data.author }}</p>
- </div>
- <div class="price">
- <p>¥{{ data.price.toFixed(2) }}</p>
- </div>
- </div>
- <div class="pay-platform">
- <p class="pay-platform-title"><!-- 选择支付平台 -->{{ $t("Key473") }}</p>
- <ul class="pay-platform-list">
- <li
- :class="item.isSelected ? 'active' : ''"
- v-for="(item, index) in platList"
- :key="'plat' + index"
- >
- <img :src="item.img" class="plat-logo" />
- <img src="../../assets/pay/active.png" class="active-icon" />
- </li>
- </ul>
- </div>
- <div class="total">
- <p class="p1">
- <span>
- <!-- 一件商品,总金额: -->
- {{ $t("Key53") }}:</span
- >
- <span class="co-value">¥{{ data.price.toFixed(2) }}</span>
- </p>
- <p class="p2">
- <span>
- <!-- 优惠折扣 -->
- {{ $t("Key54") }}:
- </span>
- <span class="co-value">-¥{{ data.discount_money.toFixed(2) }}</span>
- </p>
- <p class="p4">
- <span></span>
- <span class="co-value useCode">
- <!-- "没使用优惠码" -->
- {{ data.back_discount_code ? data.back_discount_code : $t("Key108") }}
- </span>
- </p>
- <p class="p3">
- <span>
- <!-- 应付 -->
- {{ $t("Key55") }}:
- </span>
- <span class="co-value">¥{{ data.receivables_money.toFixed(2) }}</span>
- </p>
- </div>
- <div class="submitBtn">
- <button @click="buy(data)"><!-- 去支付 -->{{ $t("Key474") }}</button>
- </div>
- </div>
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import { LearnWebSI } from "@/api/ajax";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {},
- props: ["data", "orderNumber", "closePyment"],
- data() {
- //这里存放数据
- return {
- loading: false,
- platList: [
- {
- img: require("../../assets/pay/shouxinyi.png"),
- isSelected: true,
- },
- ],
- };
- },
- //计算属性 类似于data概念
- computed: {},
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
- // 购买
- buy(item) {
- this.loading = true;
- // 首先添加订单
- let Mnam = "order-order_manager-PayMyOrder";
- LearnWebSI(Mnam, {
- id: this.orderNumber, //订单id
- pay_money: this.data.receivables_money, //支付金额
- bank_transaction_sn: "", //银行交易流水号
- })
- .then((res) => {
- console.log(res);
- if (!res.pay_page_url) {
- window.location.href = "/GCLS-Personal/#/OrderPaySuccess";
- } else {
- window.location.href = res.pay_page_url;
- }
- // this.$message({
- // type: "success",
- // message: "支付成功",
- // });
- // this.closePyment("支付成功");
- // this.loading = false;
- // 调取支付接口
- })
- .catch((res) => {
- this.loading = false;
- });
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {},
- //生命周期-创建之前
- beforeCreated() {},
- //生命周期-挂载之前
- beforeMount() {},
- //生命周期-更新之前
- beforUpdate() {},
- //生命周期-更新之后
- updated() {},
- //生命周期-销毁之前
- beforeDestory() {},
- //生命周期-销毁完成
- destoryed() {},
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() {},
- };
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- .Nopyment {
- .pay-platform {
- width: 656px;
- box-sizing: border-box;
- padding: 16px 0 16px;
- border-top: 1px rgba(44, 44, 44, 0.15) solid;
- border-bottom: 1px rgba(44, 44, 44, 0.15) solid;
- &-title {
- padding: 0;
- margin: 0;
- font-style: normal;
- font-weight: normal;
- font-size: 16px;
- line-height: 150%;
- color: #000000;
- margin-bottom: 16px;
- }
- &-list {
- display: flex;
- flex-wrap: wrap;
- margin: 0;
- padding: 0;
- > li {
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 152px;
- height: 60px;
- background: #ffffff;
- border: 1px solid rgba(44, 44, 44, 0.15);
- box-sizing: border-box;
- border-radius: 4px;
- cursor: pointer;
- margin: 0 8px 8px 0;
- > .plat-logo {
- width: 99px;
- height: 26px;
- }
- > .active-icon {
- position: absolute;
- bottom: -1px;
- right: -1px;
- width: 20px;
- height: 20px;
- display: block;
- }
- &.active {
- border-color: #ff9900;
- }
- }
- }
- }
- .message {
- width: 656px;
- height: 152px;
- background: rgba(70, 70, 70, 0.03);
- border-radius: 8px;
- display: flex;
- margin-bottom: 24px;
- img {
- width: 120px;
- height: 120px;
- margin-left: 16px;
- margin-top: 16px;
- }
- .text {
- margin-left: 24px;
- .p1 {
- width: 360px;
- // height: 45px;
- max-height: 48px;
- font-size: 16px;
- line-height: 20px;
- color: #2c2c2c;
- margin-top: 22px;
- word-break: break-all;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- .p2 {
- margin-top: 10px;
- span {
- width: 64px;
- height: 24px;
- background: #ffefd8;
- border-radius: 4px;
- font-weight: bold;
- font-size: 12px;
- text-align: center;
- color: #ff9900;
- line-height: 24px;
- padding: 2px 8px;
- }
- }
- .p3 {
- margin-top: 10px;
- }
- }
- .price {
- p {
- margin-left: 67px;
- margin-top: 22px;
- font-weight: bold;
- font-size: 16px;
- text-align: right;
- color: #ff4c00;
- }
- }
- }
- .promotionCode {
- display: flex;
- justify-content: flex-start;
- align-self: center;
- width: 100%;
- margin-top: 24px;
- height: 58px;
- line-height: 56px;
- border-top: 1px solid rgba(44, 44, 44, 0.15);
- border-bottom: 1px solid rgba(44, 44, 44, 0.15);
- .sp1 {
- font-size: 16px;
- color: #000000;
- }
- input {
- padding: 0 24px;
- flex: 1;
- height: 56px;
- outline: none;
- border: none;
- box-sizing: border-box;
- }
- .sp2 {
- cursor: pointer;
- font-size: 16px;
- color: #ff9900;
- }
- }
- .total {
- width: 656px;
- text-align: right;
- color: #000000;
- font-size: 16px;
- padding-top: 24px;
- .useCode {
- font-size: 12px;
- color: rgba(0, 0, 0, 0.5);
- word-break: break-word;
- }
- > p {
- > span {
- display: inline-block;
- }
- .co-value {
- width: 160px;
- }
- }
- .p1 {
- > span {
- display: inline-block;
- line-height: 24px;
- }
- }
- .p2 {
- margin: 16px 0 10px;
- }
- .p3 {
- > span {
- line-height: 36px;
- }
- .co-value {
- font-size: 24px;
- color: #ff4c00;
- }
- }
- }
- .submitBtn {
- text-align: right;
- margin-top: 16px;
- button {
- width: 120px;
- height: 40px;
- background: #ff4d00;
- border-radius: 4px;
- color: white;
- line-height: 40px;
- text-align: center;
- border: none;
- outline: none;
- cursor: pointer;
- }
- }
- }
- </style>
- <style lang="scss">
- </style>
|