提交
This commit is contained in:
parent
da23c1066d
commit
c2df8f6f8d
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
3
main.js
3
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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export default {
|
|||
getlist(index) {
|
||||
this.current = index
|
||||
if (index == 1) {
|
||||
this.$router.navigateTo('UnlimitedOrder');
|
||||
this.$customRouter.navigateTo('UnlimitedOrder');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ export default {
|
|||
},
|
||||
|
||||
toHome() {
|
||||
this.$router.navigateTo('/pages/shouye/index', {}, 'reLaunch');
|
||||
this.$customRouter.navigateTo('/pages/shouye/index', {}, 'reLaunch');
|
||||
},
|
||||
|
||||
applyPageTransitions() {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
|
||||
// 延迟返回
|
||||
setTimeout(() => {
|
||||
this.$router.navigateTo("./index", {}, 'redirectTo');
|
||||
this.$customRouter.navigateTo("./index", {}, 'redirectTo');
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user