[仅供测试]重写navigateTo方法,解决微信小程序中超过10个页面栈时会出现的bug

This commit is contained in:
学习很差啦
2022-07-20 18:24:49 +08:00
parent cbd73ae638
commit 09485747a6
58 changed files with 472 additions and 421 deletions

View File

@@ -46,20 +46,20 @@
formatPrice(item.price)[0]
}}</span>
.{{ formatPrice(item.price)[1] }}
</span>
<span class='wholesale-item'>
{{item.num}}{{goodsDetail.goodsUnit}}
</span>
<span class='wholesale-item'>
{{item.num}}{{goodsDetail.goodsUnit}}
</span>
</div>
</div>
<div class="goods-price" v-else>
<span>
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
</span>
</div>
<div class="goods-price" v-else>
<span>
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
</span>
</div>
</view>
<view class="goods-check-skus">
@@ -68,12 +68,12 @@
{{ selectName }}
<span>{{ num }}</span>
</span>
</view>
<view class="goods-check-skus">
库存
<span class="goods-check-skus-name">
<span>{{ goodsDetail.quantity }}</span>
</span>
</view>
<view class="goods-check-skus">
库存
<span class="goods-check-skus-name">
<span>{{ goodsDetail.quantity }}</span>
</span>
</view>
</view>
</view>
@@ -101,7 +101,7 @@
<!-- 数量 -->
<view class="goods-skus-number">
<view class="view-class-title">数量</view>
<u-input style='text-align: right;' v-model="num" type="number" />
</view>
</scroll-view>
@@ -133,14 +133,14 @@
formatList: [],
currentSelceted: [],
skuList: "",
isClose: false, //是否可以点击遮罩关闭
isClose: false, //是否可以点击遮罩关闭
};
},
props: {
wholesaleList:{
type: null,
default: false,
props: {
wholesaleList:{
type: null,
default: false,
},
buyMask: {
type: Boolean,
@@ -170,23 +170,23 @@
default: "",
type: null,
},
},
computed: {
wholesalePrice(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.price }) :[]
},
wholesaleNum(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.num }) :[]
}
},
watch: {
num(val){
if(val){
if(val > this.goodsDetail.quantity){
console.log(val)
this.val = this.goodsDetail.quantity
}
}
computed: {
wholesalePrice(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.price }) :[]
},
wholesaleNum(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.num }) :[]
}
},
watch: {
num(val){
if(val){
if(val > this.goodsDetail.quantity){
console.log(val)
this.val = this.goodsDetail.quantity
}
}
},
buyType: {
handler(val) {
@@ -263,7 +263,7 @@
buy(data) {
API_trade.addToCart(data).then((res) => {
if (res.data.success) {
uni.navigateTo({
this.$navigateTo({
url: `/pages/order/fillorder?way=${
data.cartType
}&addr=${""}&parentOrder=${encodeURIComponent(
@@ -314,7 +314,7 @@
API_trade.addToCart(data).then((res) => {
if (res.data.code == 200) {
uni.navigateTo({
this.$navigateTo({
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
this.addr.id || ""
}&parentOrder=${encodeURIComponent(JSON.stringify(this.parentOrder))}`,
@@ -399,9 +399,9 @@
</script>
<style lang="scss" scoped>
@import "./popup.scss";
.price-row{
text-align: center;
.price-row{
text-align: center;
}
.buy {
background-image: linear-gradient(135deg, #ffba0d, #ffc30d 69%, #ffcf0d);
@@ -422,8 +422,8 @@
.goods-skus-number {
justify-content: space-between;
display: flex;
text-align: right
display: flex;
text-align: right
}
/deep/ .uni-scroll-view {
@@ -468,13 +468,13 @@
border-radius: 30rpx;
}
}
}
.wholesale-item{
color: #999 !important;
font-size: 24rpx;
margin:0 20rpx;
display: flex;
justify-content: center;
}
.wholesale-item{
color: #999 !important;
font-size: 24rpx;
margin:0 20rpx;
display: flex;
justify-content: center;
}
.goods-header {
@@ -494,7 +494,7 @@
.goods-price {
color: $price-color;
line-height: 80rpx;
line-height: 80rpx;
margin-right: 20rpx;
>* {
color: $price-color;
@@ -536,4 +536,4 @@
color: #333;
}
}
</style>
</style>