diff --git a/components/detail-preview-popup/detail-preview-popup.vue b/components/detail-preview-popup/detail-preview-popup.vue
index a6a31ea..76109cf 100644
--- a/components/detail-preview-popup/detail-preview-popup.vue
+++ b/components/detail-preview-popup/detail-preview-popup.vue
@@ -22,8 +22,8 @@
-
-
+
+
加载中...
@@ -125,7 +125,7 @@ export default {
children: [],
goods: null,
loading: false,
- hasLoadingGif: false,
+ loadingError: false,
loadError: false
}
},
@@ -161,9 +161,6 @@ export default {
this.innerProbability = this.probability;
this.innerExtraInfo = this.extraInfo;
- // 检查是否有loading图片资源
- this.checkLoadingResource();
-
// 监听全局预览事件
uni.$on('global-preview-event', this.handleGlobalEvent);
},
@@ -177,24 +174,10 @@ export default {
moveHandle(e) {
return true;
},
- // 检查loading图片资源是否存在
- checkLoadingResource() {
- try {
- const loadingPath = this.$img('/static/img/loading.gif');
- uni.getImageInfo({
- src: loadingPath,
- success: () => {
- this.hasLoadingGif = true;
- },
- fail: () => {
- this.hasLoadingGif = false;
- }
- });
- } catch (e) {
- this.hasLoadingGif = false;
- }
+ // 处理loading图片加载失败
+ handleLoadingError() {
+ this.loadingError = true;
},
-
// 处理列表项点击
handleItemClick(item) {
console.log('点击了', item);
diff --git a/components/nav-header/nav-header.vue b/components/nav-header/nav-header.vue
index ebc29a7..548edb5 100644
--- a/components/nav-header/nav-header.vue
+++ b/components/nav-header/nav-header.vue
@@ -187,7 +187,7 @@ export default {
getStatusBarHeight() {
uni.getSystemInfo({
success: (res) => {
- this.statusBarHeight = res.statusBarHeight || 20;
+ this.statusBarHeight = res.statusBarHeight;
}
});
},
@@ -201,10 +201,10 @@ export default {
if (this.backUrl) {
// 如果指定了返回页面路径,则跳转到指定页面
- this.$router.navigateTo(this.backUrl, {}, 'redirectTo')
+ this.$customRouter.navigateTo(this.backUrl, {}, 'redirectTo')
.catch(err => {
console.log('返回页面失败', err);
- this.$router.navigateTo(this.backUrl, {}, 'switchTab')
+ this.$customRouter.navigateTo(this.backUrl, {}, 'switchTab')
.catch(err => {
console.log('返回页面失败1', err);
});
@@ -219,7 +219,7 @@ export default {
}
});
} else {
- this.$router.navigateTo('/pages/shouye/index', {}, 'switchTab');
+ this.$customRouter.navigateTo('/pages/shouye/index', {}, 'switchTab');
}
}
},
diff --git a/components/page-container/page-container.vue b/components/page-container/page-container.vue
index 8e41a11..ed0e12e 100644
--- a/components/page-container/page-container.vue
+++ b/components/page-container/page-container.vue
@@ -129,10 +129,10 @@ export default {
};
// 如果导航栏是固定定位,则需要为内容区添加顶部内边距
- if (this.fixed) {
- let paddingTop = this.statusBar ? (this.statusBarHeight + this.navbarHeight) : this.navbarHeight;
- style['padding-top'] = paddingTop + 'px';
- }
+ // if (this.fixed) {
+ // let paddingTop = this.statusBar ? (this.statusBarHeight + this.navbarHeight) : this.navbarHeight;
+ // style['padding-top'] = paddingTop + 'px';
+ // }
return style;
}
diff --git a/main.js b/main.js
index 38d3216..9779a00 100644
--- a/main.js
+++ b/main.js
@@ -25,7 +25,8 @@ Vue.prototype.$wxloginPage = EnvConfig.wxLoginUrl
// 公共方法
Vue.prototype.gotoPage = gotopage
-Vue.prototype.$router = router
+// 注册路由方法到Vue实例,改用自定义属性名
+Vue.prototype.$customRouter = router
Vue.prototype.$navigateTo = router.navigateTo
Vue.prototype.$noMultipleClicks = common.noMultipleClicks
Vue.prototype.$c = common
diff --git a/pages/DrawCard/index.vue b/pages/DrawCard/index.vue
index 47fbd71..d4401bc 100644
--- a/pages/DrawCard/index.vue
+++ b/pages/DrawCard/index.vue
@@ -181,7 +181,7 @@
})
},
todetails(e) {
- this.$router.navigateTo('cardDetail', { goods_id: e.id });
+ this.$customRouter.navigateTo('cardDetail', { goods_id: e.id });
},
getlist(v) {
this.show = v;
diff --git a/pages/infinite/benefit.vue b/pages/infinite/benefit.vue
index 468d0ef..ddf1833 100644
--- a/pages/infinite/benefit.vue
+++ b/pages/infinite/benefit.vue
@@ -60,7 +60,7 @@ export default {
getlist(index) {
this.current = index
if (index == 1) {
- this.$router.navigateTo('UnlimitedOrder');
+ this.$customRouter.navigateTo('UnlimitedOrder');
}
}
},
diff --git a/pages/infinite/bonus_house_details.vue b/pages/infinite/bonus_house_details.vue
index d2f2324..4b86ed4 100644
--- a/pages/infinite/bonus_house_details.vue
+++ b/pages/infinite/bonus_house_details.vue
@@ -691,7 +691,7 @@ export default {
},
toHome() {
- this.$router.navigateTo('/pages/shouye/index', {}, 'reLaunch');
+ this.$customRouter.navigateTo('/pages/shouye/index', {}, 'reLaunch');
},
applyPageTransitions() {
diff --git a/pages/infinite/index.vue b/pages/infinite/index.vue
index 4c69f34..0d87e18 100644
--- a/pages/infinite/index.vue
+++ b/pages/infinite/index.vue
@@ -54,7 +54,7 @@ export default {
if (item.url) {
console.log(item);
uni.setStorageSync('fuliwu_title', item.name)
- this.$router.navigateTo(item.url);
+ this.$customRouter.navigateTo(item.url);
// this.$c.to({
// type:1,
// url: item.url,
diff --git a/pages/other/order_list.vue b/pages/other/order_list.vue
index 0294861..085217a 100644
--- a/pages/other/order_list.vue
+++ b/pages/other/order_list.vue
@@ -89,7 +89,7 @@ export default {
},
goOrderDetail(item) {
- this.$router.navigateTo('/pages/other/order_info', { order_num: item.order_num });
+ this.$customRouter.navigateTo('/pages/other/order_info', { order_num: item.order_num });
}
}
}
diff --git a/pages/shop/detail.vue b/pages/shop/detail.vue
index 6a8bf83..3d7d540 100644
--- a/pages/shop/detail.vue
+++ b/pages/shop/detail.vue
@@ -229,7 +229,7 @@
setTimeout(() => {
that.$refs.order_show.close()
//去订单
- that.$router.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
+ that.$customRouter.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
}, 1500)
}
}
@@ -243,7 +243,7 @@
setTimeout(() => {
that.$refs.order_show.close()
//去订单
- that.$router.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
+ that.$customRouter.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
}, 1500)
}
} else {
diff --git a/pages/shop/index.vue b/pages/shop/index.vue
index 778be16..f5a32d6 100644
--- a/pages/shop/index.vue
+++ b/pages/shop/index.vue
@@ -100,13 +100,13 @@
},
openUrl(e) {
if (e.target == 1) {
- this.$router.navigateTo('../shouye/detail', { id: e.goods_id });
+ this.$customRouter.navigateTo('../shouye/detail', { id: e.goods_id });
}
if (e.target == 2) {
- this.$router.navigateTo('detail', { goods_id: e.product_id });
+ this.$customRouter.navigateTo('detail', { goods_id: e.product_id });
}
if (e.target == 3) {
- this.$router.navigateTo('../web-view', { url: e.url });
+ this.$customRouter.navigateTo('../web-view', { url: e.url });
}
},
diff --git a/pages/shouye/detail.vue b/pages/shouye/detail.vue
index d5f3f0a..86647b6 100644
--- a/pages/shouye/detail.vue
+++ b/pages/shouye/detail.vue
@@ -308,7 +308,7 @@ export default {
console.log(item);
// 使用本地引入的方法调用预览弹窗
preview({
- productType: this.optData.type_text,
+ productType:this.title,
dataItem: item,
goods: this.pageData.goods
}).then(() => {
diff --git a/pages/shouye/detail_wuxian.vue b/pages/shouye/detail_wuxian.vue
index 98b2ce7..a8780fc 100644
--- a/pages/shouye/detail_wuxian.vue
+++ b/pages/shouye/detail_wuxian.vue
@@ -46,7 +46,7 @@
-
@@ -64,7 +64,8 @@
-
+
@@ -399,10 +400,11 @@ export default {
num: 0,
};
// console.log(a);
+ //console.log( this.optData.type_text);
// 使用本地引入的方法调用预览弹窗
preview({
- productType: this.optData.type_text,
+ productType: this.title,
dataItem: obj,
goods: goods
}).then(() => {
diff --git a/pages/shouye/huanxiang.vue b/pages/shouye/huanxiang.vue
index 07e42b2..1de4506 100644
--- a/pages/shouye/huanxiang.vue
+++ b/pages/shouye/huanxiang.vue
@@ -107,13 +107,13 @@
todetail(e) {
if (this.type == '3') {
- this.$router.navigateTo('/package/index/leitai', {
+ this.$customRouter.navigateTo('/package/index/leitai', {
goods_id: this.id,
goods_num: e,
type_text: this.type_text
}, 'redirectTo');
} else {
- this.$router.navigateTo('detail', {
+ this.$customRouter.navigateTo('detail', {
goods_id: this.id,
goods_num: e,
type_text: this.type_text
diff --git a/pages/shouye/index.vue b/pages/shouye/index.vue
index 300d6aa..b1b7209 100644
--- a/pages/shouye/index.vue
+++ b/pages/shouye/index.vue
@@ -412,7 +412,7 @@ export default {
url = "/package/index/leitai";
}
- this.$router.navigateTo(url, params);
+ this.$customRouter.navigateTo(url, params);
},
getlist(v) {
this.tabCur = v;
@@ -424,10 +424,10 @@ export default {
},
toRanking() {
- this.$router.navigateTo("/pages/shouye/ranking");
+ this.$customRouter.navigateTo("/pages/shouye/ranking");
},
toyaqingRanking() {
- this.$router.navigateTo("/pages/shouye/yaoqing_ranking");
+ this.$customRouter.navigateTo("/pages/shouye/yaoqing_ranking");
},
},
};
diff --git a/pages/shouye/rili.vue b/pages/shouye/rili.vue
index 7aefade..cdaf07d 100644
--- a/pages/shouye/rili.vue
+++ b/pages/shouye/rili.vue
@@ -40,7 +40,7 @@
// })
// } else {
if (e.goods_id !== 0) {
- this.$router.navigateTo('detail', { goods_id: e.goods_id });
+ this.$customRouter.navigateTo('detail', { goods_id: e.goods_id });
}
// }
diff --git a/pages/user/bangding.vue b/pages/user/bangding.vue
index 7bb1970..21b4ba7 100644
--- a/pages/user/bangding.vue
+++ b/pages/user/bangding.vue
@@ -44,7 +44,7 @@ export default {
uni.navigateBack({
fail: function() {
// 如果返回失败,表示没有上一页,则跳转到首页
- that.$router.navigateTo('/pages/user/index', {}, 'reLaunch');
+ that.$customRouter.navigateTo('/pages/user/index', {}, 'reLaunch');
}
});
},
@@ -77,7 +77,7 @@ export default {
uni.navigateBack({
fail: function() {
// 如果返回失败,表示没有上一页,则跳转到首页
- that.$router.navigateTo('/pages/user/index', {}, 'reLaunch');
+ that.$customRouter.navigateTo('/pages/user/index', {}, 'reLaunch');
}
});
}, 1000)
diff --git a/pages/user/change.vue b/pages/user/change.vue
index 4942829..f4238c8 100644
--- a/pages/user/change.vue
+++ b/pages/user/change.vue
@@ -144,7 +144,7 @@
// 延迟返回
setTimeout(() => {
- this.$router.navigateTo("./index", {}, 'redirectTo');
+ this.$customRouter.navigateTo("./index", {}, 'redirectTo');
}, 1000);
} else {
uni.showToast({
diff --git a/pages/user/coupon.vue b/pages/user/coupon.vue
index 1183478..9f825b7 100644
--- a/pages/user/coupon.vue
+++ b/pages/user/coupon.vue
@@ -106,7 +106,7 @@
methods: {
toUse(item) {
if (this.pageType == 1) {
- this.$router.navigateTo('/pages/shouye/index', {}, 'switchTab');
+ this.$customRouter.navigateTo('/pages/shouye/index', {}, 'switchTab');
}
if (this.pageType == 2) {
diff --git a/pages/user/fhjl.vue b/pages/user/fhjl.vue
index 31d5020..d9a09e7 100644
--- a/pages/user/fhjl.vue
+++ b/pages/user/fhjl.vue
@@ -219,13 +219,13 @@ export default {
})
},
toorder(e) {
- this.$router.navigateTo('/pages/shouye/detail', {
+ this.$customRouter.navigateTo('/pages/shouye/detail', {
goods_id: e,
goods_num: 1
})
},
towuliu(e) {
- this.$router.navigateTo('/pages/shouye/wuliu_detail', { id: e })
+ this.$customRouter.navigateTo('/pages/shouye/wuliu_detail', { id: e })
},
getlist(v) {
this.show = v
diff --git a/pages/user/index.vue b/pages/user/index.vue
index f2effe6..193820f 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -560,9 +560,9 @@ export default {
},
todetail(a) {
if (a.type == 2) {
- this.$router.navigateTo('/pages/shouye/detail_wuxian', { goods_id: a.goods_id });
+ this.$customRouter.navigateTo('/pages/shouye/detail_wuxian', { goods_id: a.goods_id });
} else {
- this.$router.navigateTo('/pages/shouye/detail', {
+ this.$customRouter.navigateTo('/pages/shouye/detail', {
goods_id: a.goods_id,
goods_num: a.num
});
diff --git a/pages/user/login.vue b/pages/user/login.vue
index a3ddd32..99462e1 100644
--- a/pages/user/login.vue
+++ b/pages/user/login.vue
@@ -19,18 +19,18 @@
我已阅读并同意
-
+
《用户协议》
和
-
+
《隐私政策》
-
+
拒绝
@@ -130,13 +130,13 @@ export default {
// 重定向到指定URL
setTimeout(() => {
- that.$router.routerTo({
+ that.$customRouter.routerTo({
url: redirectUrl,
type: 'navigateTo'
}).catch(err => {
console.error('重定向跳转失败:', err)
// 失败时跳转到首页
- that.$router.navigateTo('/pages/user/index', {}, 'navigateTo')
+ that.$customRouter.navigateTo('/pages/user/index', {}, 'navigateTo')
})
}, 1000);
@@ -251,10 +251,10 @@ export default {
if (res.status == 1 && res.data.userinfo != null && res.data.userinfo.mobile_is == 0) {
console.log("判断用户有没有手机号", res.data.userinfo.mobile_is);
// 使用新的路由守卫方法跳转到绑定页面
- that.$router.navigateTo('/pages/user/bangding', {}, 'navigateTo');
+ that.$customRouter.navigateTo('/pages/user/bangding', {}, 'navigateTo');
} else {
// 使用新的路由守卫方法跳转到用户首页
- that.$router.navigateTo('/pages/user/index', {}, 'navigateTo');
+ that.$customRouter.navigateTo('/pages/user/index', {}, 'navigateTo');
}
}
})