Initial commit: GamePortrait 竖屏版 - 深色豪华主题

This commit is contained in:
li
2026-01-16 17:47:53 +08:00
commit 40976e4b45
26611 changed files with 2843638 additions and 0 deletions
+170
View File
@@ -0,0 +1,170 @@
import { type ExtractPropTypes } from 'vue';
import { CouponInfo } from '../coupon';
export declare const couponListProps: {
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
chosenCoupon: {
type: NumberConstructor;
default: number;
};
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
};
export type CouponListProps = ExtractPropTypes<typeof couponListProps>;
declare const _default: import("vue").DefineComponent<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
chosenCoupon: {
type: NumberConstructor;
default: number;
};
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
chosenCoupon: {
type: NumberConstructor;
default: number;
};
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
onExchange?: ((...args: any[]) => any) | undefined;
"onUpdate:code"?: ((...args: any[]) => any) | undefined;
}, {
code: string;
currency: string;
coupons: CouponInfo[];
chosenCoupon: number;
showCount: boolean;
disabledCoupons: CouponInfo[];
showExchangeBar: boolean;
showCloseButton: boolean;
exchangeMinLength: number;
displayedCouponIndex: number;
exchangeButtonLoading: boolean;
exchangeButtonDisabled: boolean;
}>;
export default _default;
+206
View File
@@ -0,0 +1,206 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name2 in all)
__defProp(target, name2, { get: all[name2], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
couponListProps: () => couponListProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_vue2 = require("vue");
var import_utils = require("../utils");
var import_use_refs = require("../composables/use-refs");
var import_tab = require("../tab");
var import_tabs = require("../tabs");
var import_empty = require("../empty");
var import_field = require("../field");
var import_button = require("../button");
var import_coupon = require("../coupon");
var import_use = require("@vant/use");
const [name, bem, t] = (0, import_utils.createNamespace)("coupon-list");
const couponListProps = {
code: (0, import_utils.makeStringProp)(""),
coupons: (0, import_utils.makeArrayProp)(),
currency: (0, import_utils.makeStringProp)("\xA5"),
showCount: import_utils.truthProp,
emptyImage: String,
chosenCoupon: (0, import_utils.makeNumberProp)(-1),
enabledTitle: String,
disabledTitle: String,
disabledCoupons: (0, import_utils.makeArrayProp)(),
showExchangeBar: import_utils.truthProp,
showCloseButton: import_utils.truthProp,
closeButtonText: String,
inputPlaceholder: String,
exchangeMinLength: (0, import_utils.makeNumberProp)(1),
exchangeButtonText: String,
displayedCouponIndex: (0, import_utils.makeNumberProp)(-1),
exchangeButtonLoading: Boolean,
exchangeButtonDisabled: Boolean
};
var stdin_default = (0, import_vue2.defineComponent)({
name,
props: couponListProps,
emits: ["change", "exchange", "update:code"],
setup(props, {
emit,
slots
}) {
const [couponRefs, setCouponRefs] = (0, import_use_refs.useRefs)();
const root = (0, import_vue2.ref)();
const barRef = (0, import_vue2.ref)();
const activeTab = (0, import_vue2.ref)(0);
const listHeight = (0, import_vue2.ref)(0);
const currentCode = (0, import_vue2.ref)(props.code);
const buttonDisabled = (0, import_vue2.computed)(() => !props.exchangeButtonLoading && (props.exchangeButtonDisabled || !currentCode.value || currentCode.value.length < props.exchangeMinLength));
const updateListHeight = () => {
const TABS_HEIGHT = 44;
const rootHeight = (0, import_use.useRect)(root).height;
const headerHeight = (0, import_use.useRect)(barRef).height + TABS_HEIGHT;
listHeight.value = (rootHeight > headerHeight ? rootHeight : import_utils.windowHeight.value) - headerHeight;
};
const onExchange = () => {
emit("exchange", currentCode.value);
if (!props.code) {
currentCode.value = "";
}
};
const scrollToCoupon = (index) => {
(0, import_vue2.nextTick)(() => {
var _a;
return (_a = couponRefs.value[index]) == null ? void 0 : _a.scrollIntoView();
});
};
const renderEmpty = () => (0, import_vue.createVNode)(import_empty.Empty, {
"image": props.emptyImage
}, {
default: () => [(0, import_vue.createVNode)("p", {
"class": bem("empty-tip")
}, [t("noCoupon")])]
});
const renderExchangeBar = () => {
if (props.showExchangeBar) {
return (0, import_vue.createVNode)("div", {
"ref": barRef,
"class": bem("exchange-bar")
}, [(0, import_vue.createVNode)(import_field.Field, {
"modelValue": currentCode.value,
"onUpdate:modelValue": ($event) => currentCode.value = $event,
"clearable": true,
"border": false,
"class": bem("field"),
"placeholder": props.inputPlaceholder || t("placeholder"),
"maxlength": "20"
}, null), (0, import_vue.createVNode)(import_button.Button, {
"plain": true,
"type": "primary",
"class": bem("exchange"),
"text": props.exchangeButtonText || t("exchange"),
"loading": props.exchangeButtonLoading,
"disabled": buttonDisabled.value,
"onClick": onExchange
}, null)]);
}
};
const renderCouponTab = () => {
const {
coupons
} = props;
const count = props.showCount ? ` (${coupons.length})` : "";
const title = (props.enabledTitle || t("enable")) + count;
return (0, import_vue.createVNode)(import_tab.Tab, {
"title": title
}, {
default: () => {
var _a;
return [(0, import_vue.createVNode)("div", {
"class": bem("list", {
"with-bottom": props.showCloseButton
}),
"style": {
height: `${listHeight.value}px`
}
}, [coupons.map((coupon, index) => (0, import_vue.createVNode)(import_coupon.Coupon, {
"key": coupon.id,
"ref": setCouponRefs(index),
"coupon": coupon,
"chosen": index === props.chosenCoupon,
"currency": props.currency,
"onClick": () => emit("change", index)
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
}
});
};
const renderDisabledTab = () => {
const {
disabledCoupons
} = props;
const count = props.showCount ? ` (${disabledCoupons.length})` : "";
const title = (props.disabledTitle || t("disabled")) + count;
return (0, import_vue.createVNode)(import_tab.Tab, {
"title": title
}, {
default: () => {
var _a;
return [(0, import_vue.createVNode)("div", {
"class": bem("list", {
"with-bottom": props.showCloseButton
}),
"style": {
height: `${listHeight.value}px`
}
}, [disabledCoupons.map((coupon) => (0, import_vue.createVNode)(import_coupon.Coupon, {
"disabled": true,
"key": coupon.id,
"coupon": coupon,
"currency": props.currency
}, null)), !disabledCoupons.length && renderEmpty(), (_a = slots["disabled-list-footer"]) == null ? void 0 : _a.call(slots)])];
}
});
};
(0, import_vue2.watch)(() => props.code, (value) => {
currentCode.value = value;
});
(0, import_vue2.watch)(import_utils.windowHeight, updateListHeight);
(0, import_vue2.watch)(currentCode, (value) => emit("update:code", value));
(0, import_vue2.watch)(() => props.displayedCouponIndex, scrollToCoupon);
(0, import_vue2.onMounted)(() => {
updateListHeight();
scrollToCoupon(props.displayedCouponIndex);
});
return () => (0, import_vue.createVNode)("div", {
"ref": root,
"class": bem()
}, [renderExchangeBar(), (0, import_vue.createVNode)(import_tabs.Tabs, {
"active": activeTab.value,
"onUpdate:active": ($event) => activeTab.value = $event,
"class": bem("tab")
}, {
default: () => [renderCouponTab(), renderDisabledTab()]
}), (0, import_vue.createVNode)("div", {
"class": bem("bottom")
}, [(0, import_vue.withDirectives)((0, import_vue.createVNode)(import_button.Button, {
"round": true,
"block": true,
"type": "primary",
"class": bem("close"),
"text": props.closeButtonText || t("close"),
"onClick": () => emit("change", -1)
}, null), [[import_vue.vShow, props.showCloseButton]])])]);
}
});
+1
View File
@@ -0,0 +1 @@
:root{--van-coupon-list-background: var(--van-background);--van-coupon-list-field-padding: 5px 0 5px var(--van-padding-md);--van-coupon-list-exchange-button-height: 32px;--van-coupon-list-close-button-height: 40px;--van-coupon-list-empty-tip-color: var(--van-text-color-2);--van-coupon-list-empty-tip-font-size: var(--van-font-size-md);--van-coupon-list-empty-tip-line-height: var(--van-line-height-md)}.van-coupon-list{position:relative;height:100%;background:var(--van-coupon-list-background)}.van-coupon-list__field{padding:var(--van-coupon-list-field-padding)}.van-coupon-list__field .van-field__body{height:34px;padding-left:var(--van-padding-sm);line-height:34px;background:var(--van-background);border-radius:var(--van-radius-max)}.van-coupon-list__field .van-field__body::-webkit-input-placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__body::placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__clear{margin-right:0}.van-coupon-list__exchange-bar{display:flex;align-items:center;background-color:var(--van-background-2)}.van-coupon-list__exchange{flex:none;height:var(--van-coupon-list-exchange-button-height);font-size:var(--van-font-size-lg);line-height:calc(var(--van-coupon-list-exchange-button-height) - 2px);border:0}.van-coupon-list .van-tabs__wrap{box-shadow:0 6px 12px -12px var(--van-gray-6)}.van-coupon-list__list{box-sizing:border-box;padding:var(--van-padding-md) 0 var(--van-padding-lg);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-coupon-list__list--with-bottom{padding-bottom:50px}.van-coupon-list__bottom{position:absolute;bottom:0;left:0;z-index:999;box-sizing:border-box;width:100%;padding:5px var(--van-padding-md);font-weight:var(--van-font-bold);background-color:var(--van-background-2)}.van-coupon-list__close{height:var(--van-coupon-list-close-button-height)}.van-coupon-list__empty-tip{color:var(--van-coupon-list-empty-tip-color);font-size:var(--van-coupon-list-empty-tip-font-size);line-height:var(--van-coupon-list-empty-tip-line-height)}
+125
View File
@@ -0,0 +1,125 @@
export declare const CouponList: import("../utils").WithInstall<import("vue").DefineComponent<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
chosenCoupon: {
type: NumberConstructor;
default: number;
};
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
code: {
type: import("vue").PropType<string>;
default: string;
};
coupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
currency: {
type: import("vue").PropType<string>;
default: string;
};
showCount: {
type: BooleanConstructor;
default: true;
};
emptyImage: StringConstructor;
chosenCoupon: {
type: NumberConstructor;
default: number;
};
enabledTitle: StringConstructor;
disabledTitle: StringConstructor;
disabledCoupons: {
type: import("vue").PropType<import("..").CouponInfo[]>;
default: () => never[];
};
showExchangeBar: {
type: BooleanConstructor;
default: true;
};
showCloseButton: {
type: BooleanConstructor;
default: true;
};
closeButtonText: StringConstructor;
inputPlaceholder: StringConstructor;
exchangeMinLength: {
type: NumberConstructor;
default: number;
};
exchangeButtonText: StringConstructor;
displayedCouponIndex: {
type: NumberConstructor;
default: number;
};
exchangeButtonLoading: BooleanConstructor;
exchangeButtonDisabled: BooleanConstructor;
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
onExchange?: ((...args: any[]) => any) | undefined;
"onUpdate:code"?: ((...args: any[]) => any) | undefined;
}, {
code: string;
currency: string;
coupons: import("..").CouponInfo[];
chosenCoupon: number;
showCount: boolean;
disabledCoupons: import("..").CouponInfo[];
showExchangeBar: boolean;
showCloseButton: boolean;
exchangeMinLength: number;
displayedCouponIndex: number;
exchangeButtonLoading: boolean;
exchangeButtonDisabled: boolean;
}>>;
export default CouponList;
export { couponListProps } from './CouponList';
export type { CouponListProps } from './CouponList';
export type { CouponListThemeVars } from './types';
declare module 'vue' {
interface GlobalComponents {
VanCouponList: typeof CouponList;
}
}
+39
View File
@@ -0,0 +1,39 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
CouponList: () => CouponList,
couponListProps: () => import_CouponList2.couponListProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_CouponList = __toESM(require("./CouponList"));
var import_CouponList2 = require("./CouponList");
const CouponList = (0, import_utils.withInstall)(import_CouponList.default);
var stdin_default = CouponList;
+1
View File
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../icon/index.css");
require("../../cell/index.css");
require("../../field/index.css");
require("../../loading/index.css");
require("../../button/index.css");
require("../../sticky/index.css");
require("../../swipe/index.css");
require("../../swipe-item/index.css");
require("../../tabs/index.css");
require("../../tab/index.css");
require("../../checkbox-group/index.css");
require("../../checkbox/index.css");
require("../../coupon/index.css");
require("../../empty/index.css");
require("../index.css");
+9
View File
@@ -0,0 +1,9 @@
export type CouponListThemeVars = {
couponListBackground?: string;
couponListFieldPadding?: string;
couponListExchangeButtonHeight?: string;
couponListCloseButtonHeight?: string;
couponListEmptyTipColor?: string;
couponListEmptyTipFontSize?: string;
couponListEmptyTipLineHeight?: number | string;
};
+15
View File
@@ -0,0 +1,15 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
module.exports = __toCommonJS(stdin_exports);