This commit is contained in:
zpc 2025-04-22 13:58:23 +08:00
parent da23c1066d
commit c2df8f6f8d
22 changed files with 53 additions and 67 deletions

View File

@ -22,8 +22,8 @@
<!-- 加载中状态 -->
<view class="loading-container center" v-if="loading">
<view class="loading-icon">
<image :src="$img('/static/img/loading.gif')" mode="aspectFit" v-if="hasLoadingGif"></image>
<view class="loading-dot" v-else></view>
<image :src="$img('/static/img/loading.gif')" mode="aspectFit" @error="handleLoadingError"></image>
<view class="loading-dot" v-if="loadingError"></view>
</view>
<view class="loading-text">加载中...</view>
</view>
@ -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);

View File

@ -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');
}
}
},

View File

@ -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;
}

View File

@ -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

View File

@ -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;

View File

@ -60,7 +60,7 @@ export default {
getlist(index) {
this.current = index
if (index == 1) {
this.$router.navigateTo('UnlimitedOrder');
this.$customRouter.navigateTo('UnlimitedOrder');
}
}
},

View File

@ -691,7 +691,7 @@ export default {
},
toHome() {
this.$router.navigateTo('/pages/shouye/index', {}, 'reLaunch');
this.$customRouter.navigateTo('/pages/shouye/index', {}, 'reLaunch');
},
applyPageTransitions() {

View File

@ -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,

View File

@ -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 });
}
}
}

View File

@ -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 {

View File

@ -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 });
}
},

View File

@ -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(() => {

View File

@ -46,7 +46,7 @@
</view>
</view>
<!--选项卡-->
<detail-toolbar v-if="goods!=null" :goods-type="goods.type" :current-tab="tabCur"
<detail-toolbar v-if="goods != null" :goods-type="goods.type" :current-tab="tabCur"
@rule-click="$refs.rulePop.getRule(pageData.danye_id, '购买说明')" @tab-change="tabChange"
@change-box="changeBox" :isWuxian="true"></detail-toolbar>
<detail-wuxian-lingzhu v-if="goods != null && goods.lingzhu_is == 1" :goods-num="0" :goods="goods">
@ -64,7 +64,8 @@
</view>
</view>
<view class="goods-list justify-center">
<detail-list-item v-for="(a, b) in item.goods_list" :key="b" :item="a" @click="previewDetail(item, a)">
<detail-list-item v-for="(a, b) in item.goods_list" :key="b" :item="a"
@click="previewDetail(item, a)">
<template #content>
<view class="item-info">
<view class="item-title hang1">
@ -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(() => {

View File

@ -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

View File

@ -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");
},
},
};

View File

@ -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 });
}
// }

View File

@ -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)

View File

@ -144,7 +144,7 @@
//
setTimeout(() => {
this.$router.navigateTo("./index", {}, 'redirectTo');
this.$customRouter.navigateTo("./index", {}, 'redirectTo');
}, 1000);
} else {
uni.showToast({

View File

@ -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) {

View File

@ -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

View File

@ -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
});

View File

@ -19,18 +19,18 @@
<view class="agree-r">
我已阅读并同意
<text @click.stop="$router.navigateTo('/pages/guize/guize', {type: 4})">
<text @click.stop="$customRouter.navigateTo('/pages/guize/guize', {type: 4})">
用户协议
</text>
<text @click.stop="$router.navigateTo('/pages/guize/guize', {type: 5})">
<text @click.stop="$customRouter.navigateTo('/pages/guize/guize', {type: 5})">
隐私政策
</text>
</view>
</view>
<view class="btn-list">
<view @click="$router.navigateTo('/pages/shouye/index', {}, 'switchTab')" class="cancel">
<view @click="$customRouter.navigateTo('/pages/shouye/index', {}, 'switchTab')" class="cancel">
拒绝
</view>
@ -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');
}
}
})