完成简易版的充值和充值记录查询页面,简单的我的页面
This commit is contained in:
@@ -1 +0,0 @@
|
||||
export {};
|
@@ -1,68 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var component_1 = require("../common/component");
|
||||
var color_1 = require("../common/color");
|
||||
var utils_1 = require("../common/utils");
|
||||
(0, component_1.VantComponent)({
|
||||
props: {
|
||||
message: String,
|
||||
background: String,
|
||||
type: {
|
||||
type: String,
|
||||
value: 'danger',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
value: color_1.WHITE,
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
value: 3000,
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 110,
|
||||
},
|
||||
safeAreaInsetTop: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
top: null,
|
||||
},
|
||||
data: {
|
||||
show: false,
|
||||
onOpened: null,
|
||||
onClose: null,
|
||||
onClick: null,
|
||||
},
|
||||
created: function () {
|
||||
var statusBarHeight = (0, utils_1.getSystemInfoSync)().statusBarHeight;
|
||||
this.setData({ statusBarHeight: statusBarHeight });
|
||||
},
|
||||
methods: {
|
||||
show: function () {
|
||||
var _this = this;
|
||||
var _a = this.data, duration = _a.duration, onOpened = _a.onOpened;
|
||||
clearTimeout(this.timer);
|
||||
this.setData({ show: true });
|
||||
wx.nextTick(onOpened);
|
||||
if (duration > 0 && duration !== Infinity) {
|
||||
this.timer = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, duration);
|
||||
}
|
||||
},
|
||||
hide: function () {
|
||||
var onClose = this.data.onClose;
|
||||
clearTimeout(this.timer);
|
||||
this.setData({ show: false });
|
||||
wx.nextTick(onClose);
|
||||
},
|
||||
onTap: function (event) {
|
||||
var onClick = this.data.onClick;
|
||||
if (onClick) {
|
||||
onClick(event.detail);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-transition": "../transition/index"
|
||||
}
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<van-transition
|
||||
name="slide-down"
|
||||
show="{{ show }}"
|
||||
custom-class="van-notify__container"
|
||||
custom-style="{{ computed.rootStyle({ zIndex, top }) }}"
|
||||
bind:tap="onTap"
|
||||
>
|
||||
<view
|
||||
class="van-notify van-notify--{{ type }}"
|
||||
style="{{ computed.notifyStyle({ background, color }) }}"
|
||||
>
|
||||
<view
|
||||
wx:if="{{ safeAreaInsetTop }}"
|
||||
style="height: {{ statusBarHeight }}px"
|
||||
/>
|
||||
<text>{{ message }}</text>
|
||||
</view>
|
||||
</van-transition>
|
@@ -1,22 +0,0 @@
|
||||
/* eslint-disable */
|
||||
var style = require('../wxs/style.wxs');
|
||||
var addUnit = require('../wxs/add-unit.wxs');
|
||||
|
||||
function rootStyle(data) {
|
||||
return style({
|
||||
'z-index': data.zIndex,
|
||||
top: addUnit(data.top),
|
||||
});
|
||||
}
|
||||
|
||||
function notifyStyle(data) {
|
||||
return style({
|
||||
background: data.background,
|
||||
color: data.color,
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
rootStyle: rootStyle,
|
||||
notifyStyle: notifyStyle,
|
||||
};
|
@@ -1 +0,0 @@
|
||||
@import '../common/index.wxss';.van-notify{word-wrap:break-word;font-size:var(--notify-font-size,14px);line-height:var(--notify-line-height,20px);padding:var(--notify-padding,6px 15px);text-align:center}.van-notify__container{box-sizing:border-box;left:0;position:fixed;top:0;width:100%}.van-notify--primary{background-color:var(--notify-primary-background-color,#1989fa)}.van-notify--success{background-color:var(--notify-success-background-color,#07c160)}.van-notify--danger{background-color:var(--notify-danger-background-color,#ee0a24)}.van-notify--warning{background-color:var(--notify-warning-background-color,#ff976a)}
|
22
miniprogram_npm/@vant/weapp/notify/notify.d.ts
vendored
22
miniprogram_npm/@vant/weapp/notify/notify.d.ts
vendored
@@ -1,22 +0,0 @@
|
||||
interface NotifyOptions {
|
||||
type?: 'primary' | 'success' | 'danger' | 'warning';
|
||||
color?: string;
|
||||
zIndex?: number;
|
||||
top?: number;
|
||||
message: string;
|
||||
context?: any;
|
||||
duration?: number;
|
||||
selector?: string;
|
||||
background?: string;
|
||||
safeAreaInsetTop?: boolean;
|
||||
onClick?: () => void;
|
||||
onOpened?: () => void;
|
||||
onClose?: () => void;
|
||||
}
|
||||
declare function Notify(options: NotifyOptions | string): any;
|
||||
declare namespace Notify {
|
||||
var clear: (options?: NotifyOptions | undefined) => void;
|
||||
var setDefaultOptions: (options: NotifyOptions) => void;
|
||||
var resetDefaultOptions: () => void;
|
||||
}
|
||||
export default Notify;
|
@@ -1,67 +0,0 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var color_1 = require("../common/color");
|
||||
var defaultOptions = {
|
||||
selector: '#van-notify',
|
||||
type: 'danger',
|
||||
message: '',
|
||||
background: '',
|
||||
duration: 3000,
|
||||
zIndex: 110,
|
||||
top: 0,
|
||||
color: color_1.WHITE,
|
||||
safeAreaInsetTop: false,
|
||||
onClick: function () { },
|
||||
onOpened: function () { },
|
||||
onClose: function () { },
|
||||
};
|
||||
var currentOptions = __assign({}, defaultOptions);
|
||||
function parseOptions(message) {
|
||||
if (message == null) {
|
||||
return {};
|
||||
}
|
||||
return typeof message === 'string' ? { message: message } : message;
|
||||
}
|
||||
function getContext() {
|
||||
var pages = getCurrentPages();
|
||||
return pages[pages.length - 1];
|
||||
}
|
||||
function Notify(options) {
|
||||
options = __assign(__assign({}, currentOptions), parseOptions(options));
|
||||
var context = options.context || getContext();
|
||||
var notify = context.selectComponent(options.selector);
|
||||
delete options.context;
|
||||
delete options.selector;
|
||||
if (notify) {
|
||||
notify.setData(options);
|
||||
notify.show();
|
||||
return notify;
|
||||
}
|
||||
console.warn('未找到 van-notify 节点,请确认 selector 及 context 是否正确');
|
||||
}
|
||||
exports.default = Notify;
|
||||
Notify.clear = function (options) {
|
||||
options = __assign(__assign({}, defaultOptions), parseOptions(options));
|
||||
var context = options.context || getContext();
|
||||
var notify = context.selectComponent(options.selector);
|
||||
if (notify) {
|
||||
notify.hide();
|
||||
}
|
||||
};
|
||||
Notify.setDefaultOptions = function (options) {
|
||||
Object.assign(currentOptions, options);
|
||||
};
|
||||
Notify.resetDefaultOptions = function () {
|
||||
currentOptions = __assign({}, defaultOptions);
|
||||
};
|
Reference in New Issue
Block a user