Browse Source

[优化] 价格组件样式

[优化] 全局$msg方法,增加promise回调
master
LAPTOP-D7TKRI82\邓 5 years ago
parent
commit
299482d7f6
  1. 24
      common/mixin.js
  2. 2
      components/lf-price/lf-price.vue

24
common/mixin.js

@ -57,13 +57,23 @@ export default{
}
},
$msg(title = '', param = {}) {
if(!title) return;
uni.showToast({
title,
duration: param.duration || 1500,
mask: param.mask || true, // 默认应该加mask 禁止提示时操作
icon: param.icon || 'none'
});
return new Promise((resolve, reject) => {
if(!title){
reject();
return;
}
uni.showToast({
title,
duration: param.duration || 1500,
mask: param.mask || true, // 默认应该加mask 禁止提示时操作
icon: param.icon || 'none',
complete: result => {
setTimeout(() => {
resolve();
}, param.duration || 1500);
}
});
})
},
$url(url, options = {}){
this.$u.throttle(() => {

2
components/lf-price/lf-price.vue

@ -1,5 +1,5 @@
<template>
<view :style="{'--color': color}">
<view :style="{'--color': color, 'display': 'inline-block'}">
<block v-if="isPoint">
<text class="price-one text-price">{{ showPrice(1) }}</text>
<text class="price-two">.{{ showPrice(2) }}</text>

Loading…
Cancel
Save