|
@@ -0,0 +1,291 @@
|
|
|
|
+import { initPayment } from "@/modules/payment";
|
|
|
|
+import { css } from "@linaria/core";
|
|
|
|
+import { useAuth } from "@queenjs-modules/auth";
|
|
|
|
+import { Button, Input } from "ant-design-vue";
|
|
|
|
+import { defineComponent, reactive } from "vue";
|
|
|
|
+
|
|
|
|
+export default defineComponent({
|
|
|
|
+ setup() {
|
|
|
|
+ const auth = useAuth();
|
|
|
|
+ const { store, actions } = initPayment({
|
|
|
|
+ config: { project: "queenshow" },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const payVersions = [
|
|
|
|
+ {
|
|
|
|
+ label: "个人",
|
|
|
|
+ children: ["queenshow_person_year", "queenshow_person_month"],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "团队",
|
|
|
|
+ children: [
|
|
|
|
+ "queenshow_team_15month",
|
|
|
|
+ "queenshow_team_year",
|
|
|
|
+ "queenshow_team_month",
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ const payPointsInfo = {
|
|
|
|
+ queenshow_person_year: {
|
|
|
|
+ name: "一年VIP",
|
|
|
|
+ desc: "高性价比之选",
|
|
|
|
+ },
|
|
|
|
+ queenshow_person_month: {
|
|
|
|
+ name: "月度VIP",
|
|
|
|
+ desc: "续费价199.0元",
|
|
|
|
+ },
|
|
|
|
+ queenshow_team_15month: {
|
|
|
|
+ name: "15个月/人",
|
|
|
|
+ desc: "鲲舞精心之选",
|
|
|
|
+ },
|
|
|
|
+ queenshow_team_year: {
|
|
|
|
+ name: "年VIP/人",
|
|
|
|
+ desc: "高性价比之选",
|
|
|
|
+ },
|
|
|
|
+ queenshow_team_month: {
|
|
|
|
+ name: "月VIP/人",
|
|
|
|
+ desc: "续费价199.0元",
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const state = reactive({
|
|
|
|
+ versionIdx: 0,
|
|
|
|
+ orderInfo: {
|
|
|
|
+ productKey: "",
|
|
|
|
+ price: 0,
|
|
|
|
+ quantity: 1,
|
|
|
|
+ number: 1,
|
|
|
|
+ },
|
|
|
|
+ amountPrice: 0,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ function changeOrderInfo(
|
|
|
|
+ type: keyof (typeof state)["orderInfo"],
|
|
|
|
+ value: any
|
|
|
|
+ ) {
|
|
|
|
+ (state.orderInfo as any)[type] = value;
|
|
|
|
+ updateOrderAmount();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function updateOrderAmount() {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return () => {
|
|
|
|
+ const { saas } = auth.store.userInfo as any;
|
|
|
|
+ return (
|
|
|
|
+ <div class={rootCls}>
|
|
|
|
+ <header class="p-0.24rem">
|
|
|
|
+ <div class="flex">
|
|
|
|
+ <img
|
|
|
|
+ class="w-0.48rem h-0.48rem rounded-[50%]"
|
|
|
|
+ src={auth.store.userInfo.avatar}
|
|
|
|
+ />
|
|
|
|
+ <div class="ml-0.14rem space-y-0.08rem">
|
|
|
|
+ <div class="text-0.2rem font-500 text-white">
|
|
|
|
+ {auth.store.userInfo.name}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-0.16rem font-500 text-[#888]">
|
|
|
|
+ {saas ? "会员版" : "免费版"}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </header>
|
|
|
|
+ <main>
|
|
|
|
+ <section class="w-2.95rem mr-0.24rem space-y-0.2rem">
|
|
|
|
+ <div class="flex items-center">
|
|
|
|
+ <img
|
|
|
|
+ class="w-0.22rem h-0.22rem mr-0.1rem"
|
|
|
|
+ src={require("@/assets/imgs/icon-vip.png")}
|
|
|
|
+ />
|
|
|
|
+ <span class="text-0.22rem text-[#222]">会员版</span>
|
|
|
|
+ </div>
|
|
|
|
+ <p>适合个人创作设计,如个人新媒体、个人网店、直播带货等</p>
|
|
|
|
+ <div class="splitline"></div>
|
|
|
|
+ <ul class="pl-0.16rem leading-0.24rem space-y-0.12rem">
|
|
|
|
+ <li>个人或企业商用授权(选购)</li>
|
|
|
|
+ <li>VIP专属内容</li>
|
|
|
|
+ <li>模版创建无上限</li>
|
|
|
|
+ <li>鲲秀AI使用权限</li>
|
|
|
|
+ <li>专属客服/正规发票</li>
|
|
|
|
+ </ul>
|
|
|
|
+ </section>
|
|
|
|
+ <div class="flex-1 space-y-0.18rem">
|
|
|
|
+ {/* <section>
|
|
|
|
+ <label>购买版本</label>
|
|
|
|
+ <span class="checkbox checked">{payConf.versionName}</span>
|
|
|
|
+ </section> */}
|
|
|
|
+ <section>
|
|
|
|
+ <label class="">购买版本</label>
|
|
|
|
+ {payVersions.map((d, i) => {
|
|
|
|
+ return (
|
|
|
|
+ <span
|
|
|
|
+ key={i}
|
|
|
|
+ class={["checkbox", i === state.versionIdx && "checked"]}
|
|
|
|
+ onClick={() => (state.versionIdx = i)}
|
|
|
|
+ >
|
|
|
|
+ {d.label}
|
|
|
|
+ </span>
|
|
|
|
+ );
|
|
|
|
+ })}
|
|
|
|
+ </section>
|
|
|
|
+ <section>
|
|
|
|
+ <label>价格选择</label>
|
|
|
|
+ <div class="mt-0.24rem">
|
|
|
|
+ {payVersions[state.versionIdx].children.map((d, i) => {
|
|
|
|
+ const item = payPointsInfo[d as keyof typeof payPointsInfo];
|
|
|
|
+ const price =
|
|
|
|
+ store.payPoints.find((p) => p.productKey === d)?.price ||
|
|
|
|
+ 0;
|
|
|
|
+
|
|
|
|
+ console.log(price, d);
|
|
|
|
+ return (
|
|
|
|
+ <div
|
|
|
|
+ key={i}
|
|
|
|
+ class={[
|
|
|
|
+ "checkbox priceBox",
|
|
|
|
+ state.orderInfo.productKey === d && "checked",
|
|
|
|
+ ]}
|
|
|
|
+ onClick={() => changeOrderInfo("productKey", d)}
|
|
|
|
+ >
|
|
|
|
+ <div class="text-0.16rem font-bold text-[#666] pt-0.16rem ">
|
|
|
|
+ {item.name}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-0.3rem font-bold">
|
|
|
|
+ <span class="text-0.14rem">¥</span>
|
|
|
|
+ {price.toFixed(1)}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-0.14rem text-[#666] pt-0.16rem ">
|
|
|
|
+ {item.desc}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+ })}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mt-0.28rem">
|
|
|
|
+ <span class="text-0.16rem text-[#111] font-bold">
|
|
|
|
+ 人数选择:
|
|
|
|
+ </span>
|
|
|
|
+ <Input class="w-1.8rem mx-0.16rem !border-[#c9c9c9]" />
|
|
|
|
+ <span class="text-0.16rem text-[#666]">人</span>
|
|
|
|
+ <span class="text-0.16rem text-[#111] font-bold ml-0.85rem">
|
|
|
|
+ 时长设置:
|
|
|
|
+ </span>
|
|
|
|
+ <Input class="w-1.8rem mx-0.16rem !border-[#c9c9c9]" />
|
|
|
|
+ <span class="text-0.16rem text-[#666]">年</span>
|
|
|
|
+ </div>
|
|
|
|
+ </section>
|
|
|
|
+ <section>
|
|
|
|
+ <label class="">支付订单</label>
|
|
|
|
+ <div class="payMethod">
|
|
|
|
+ <div class="text-0.16rem font-bold my-0.3rem">
|
|
|
|
+ <span>实付款:</span>
|
|
|
|
+ <span class="text-0.3rem text-[#D34D39]">
|
|
|
|
+ {state.amountPrice}
|
|
|
|
+ </span>
|
|
|
|
+ <span class="text-[#D34D39]">元</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="payBtn">
|
|
|
|
+ <img
|
|
|
|
+ class="h-0.2rem mr-0.1rem"
|
|
|
|
+ src={require("@/assets/imgs/icon-wx.png")}
|
|
|
|
+ />
|
|
|
|
+ 微信支付
|
|
|
|
+ </div>
|
|
|
|
+ <span class="mx-0.1rem align-text-bottom">或</span>
|
|
|
|
+ <div class="payBtn">
|
|
|
|
+ <img
|
|
|
|
+ class="h-0.2rem mr-0.1rem"
|
|
|
|
+ src={require("@/assets/imgs/icon-zfb.png")}
|
|
|
|
+ />
|
|
|
|
+ 支付宝支付
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </section>
|
|
|
|
+ </div>
|
|
|
|
+ </main>
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const rootCls = css`
|
|
|
|
+ margin: -24px;
|
|
|
|
+
|
|
|
|
+ header {
|
|
|
|
+ background-color: #2a2d41;
|
|
|
|
+ }
|
|
|
|
+ main {
|
|
|
|
+ display: flex;
|
|
|
|
+ padding: 0.24rem;
|
|
|
|
+ background-color: #f1f2f4;
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ section {
|
|
|
|
+ padding: 0.24rem;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ border-radius: 0.08rem;
|
|
|
|
+
|
|
|
|
+ label {
|
|
|
|
+ margin-right: 0.4rem;
|
|
|
|
+ font-size: 0.2rem;
|
|
|
|
+ color: #111;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .checkbox {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ padding: 0.16rem;
|
|
|
|
+ margin-right: 0.3rem;
|
|
|
|
+ min-width: 1.4rem;
|
|
|
|
+ border: 1px solid rgba(51, 51, 51, 0.3);
|
|
|
|
+ border-radius: 0.06rem;
|
|
|
|
+ font-size: 0.18rem;
|
|
|
|
+ color: #333;
|
|
|
|
+ text-align: center;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ &.priceBox {
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ width: 1.6rem;
|
|
|
|
+ height: 1.6rem;
|
|
|
|
+ vertical-align: top;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.checked {
|
|
|
|
+ border: 1px solid #885428;
|
|
|
|
+ background-color: #fff7e8;
|
|
|
|
+ color: #885428;
|
|
|
|
+ * {
|
|
|
|
+ color: #885428;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .splitline {
|
|
|
|
+ border-bottom: 1px solid #e0e0e0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .payMethod {
|
|
|
|
+ margin-top: 0.24rem;
|
|
|
|
+ border-top: 1px solid #e0e0e0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .payBtn {
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ width: 2rem;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 0.12rem;
|
|
|
|
+ border: 1px solid #e0e0e0;
|
|
|
|
+ border-radius: 0.06rem;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+`;
|