|
@@ -189,11 +189,15 @@
|
|
|
<image src="../../static/logo.png"></image>
|
|
<image src="../../static/logo.png"></image>
|
|
|
<text class="text">加载中...</text>
|
|
<text class="text">加载中...</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <CustomToast ref="customToast">
|
|
|
|
|
+ </CustomToast>
|
|
|
<!-- <u-modal :show="showModal" title="温馨提示" content="处方药须凭处方在药师指导下购买和使用" @confirm="hideModal()"></u-modal> -->
|
|
<!-- <u-modal :show="showModal" title="温馨提示" content="处方药须凭处方在药师指导下购买和使用" @confirm="hideModal()"></u-modal> -->
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import {CustomToast} from '@/components/custom-toast.vue';
|
|
|
|
|
+
|
|
|
import {
|
|
import {
|
|
|
getDicts
|
|
getDicts
|
|
|
} from '@/api/index'
|
|
} from '@/api/index'
|
|
@@ -209,7 +213,8 @@
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
item: {},
|
|
item: {},
|
|
|
- popupBottom
|
|
|
|
|
|
|
+ popupBottom,
|
|
|
|
|
+ CustomToast
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -358,18 +363,26 @@
|
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number') {
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number') {
|
|
|
// 如果限购数量为0,提示库存不足
|
|
// 如果限购数量为0,提示库存不足
|
|
|
if (this.remainingPurchaseLimit === 0) {
|
|
if (this.remainingPurchaseLimit === 0) {
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: "该商品限购:" + this.purchaseLimit +",已达到购买上限",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$refs.customToast.show({
|
|
|
|
|
+ title: "该商品限购:" + this.purchaseLimit +",已达到购买上限",
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon: 'none',
|
|
|
|
|
+ // title: "该商品限购:" + this.purchaseLimit +",已达到购买上限",
|
|
|
|
|
+ // });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
// 如果购买数量超过限购数量,提示
|
|
// 如果购买数量超过限购数量,提示
|
|
|
if (this.specNum > this.remainingPurchaseLimit) {
|
|
if (this.specNum > this.remainingPurchaseLimit) {
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$refs.customToast.show({
|
|
|
|
|
+ title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon: 'none',
|
|
|
|
|
+ // title: "购买数量不能超过限购数量:" + this.remainingPurchaseLimit,
|
|
|
|
|
+ // });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -582,10 +595,14 @@
|
|
|
// 检查限购数量
|
|
// 检查限购数量
|
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$refs.customToast.show({
|
|
|
|
|
+ title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon: 'none',
|
|
|
|
|
+ // title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 数量减法
|
|
// 数量减法
|
|
@@ -600,10 +617,14 @@
|
|
|
// 检查限购数量
|
|
// 检查限购数量
|
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$refs.customToast.show({
|
|
|
|
|
+ title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon: 'none',
|
|
|
|
|
+ // title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 数量加法
|
|
// 数量加法
|
|
@@ -615,10 +636,14 @@
|
|
|
// 检查限购数量
|
|
// 检查限购数量
|
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
if (this.remainingPurchaseLimit !== null && typeof this.remainingPurchaseLimit === 'number' && this.specNum > this.remainingPurchaseLimit) {
|
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
this.specNum = this.remainingPurchaseLimit;
|
|
|
- uni.showToast({
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$refs.customToast.show({
|
|
|
|
|
+ title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // icon: 'none',
|
|
|
|
|
+ // title: "该商品限购:" + this.remainingPurchaseLimit + "次,已达购买上限",
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 确定选择该规格
|
|
// 确定选择该规格
|
|
@@ -930,7 +955,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.limit-text {
|
|
.limit-text {
|
|
|
- font-size: 24upx;
|
|
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: #FF6633;
|
|
color: #FF6633;
|