mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
[仅供测试]重写navigateTo方法,解决微信小程序中超过10个页面栈时会出现的bug
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
for (let i of Array.from(keyword)) {
|
||||
unicodes += this.unicode(i) + "|"
|
||||
}
|
||||
const rule = '(' + unicodes + ')'
|
||||
const rule = '(' + unicodes + ')'
|
||||
const reg = new RegExp(rule, 'gi');
|
||||
return str ? str.replace(reg, matchValue =>
|
||||
`<span style="color:${this.lightColor}">${matchValue}</span>`
|
||||
@@ -198,13 +198,13 @@
|
||||
},
|
||||
// 跳转到商品详情
|
||||
navigateToDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
this.$navigateTo({
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
// 跳转地址
|
||||
navigateToStoreDetailPage(item) {
|
||||
uni.navigateTo({
|
||||
this.$navigateTo({
|
||||
url: `/pages/product/shopPage?id=${item.content.storeId}`,
|
||||
});
|
||||
},
|
||||
@@ -341,4 +341,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
this.goodsList.push(...goodsList.data.result.content);
|
||||
},
|
||||
handleClick(item) {
|
||||
uni.navigateTo({
|
||||
this.$navigateTo({
|
||||
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user