123456789101112131415161718192021222324252627282930313233343536 |
- const typeConst = {
- 'wx':1
- };
- export default {
- const:typeConst,
- confirm:function (data,type=typeConst.wx) {
- if (typeof data !== 'object') data={title};
- if (data.confirmColor === undefined) {
- data.confirmColor = '#8DD4BD';
- }
- if (data.cancelColor === undefined) {
- data.cancelColor = '#999';
- }
- data.success = function (res) {
- if (res.confirm) {
- this.confirm && this.confirm();
- } else {
- this.cancel && this.cancel();
- }
- }.bind(data);
- return this[type] && this[type](data);
- },
- [typeConst.wx]:function (data) {
- return uni.showModal(data);
- },
- }
|