拼团商品详情问题接口404
uniapp运行的H5版本,购物车报错不能购买 小程序绑定手机号会报错 uniapp 3.1 tabbar显示
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2057,7 +2057,7 @@ page {
|
||||
}
|
||||
|
||||
.shoppingCart .list {
|
||||
margin-top: 1.71*100rpx;
|
||||
margin-top: 0.8*100rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="activity-goods-box x-bc" @tap="jump('/pages/activity/GroupDetails/index', { id: id })">
|
||||
<view class="activity-goods-box x-bc" @tap="jump('/pages/activity/GroupDetails/index', { id: cid })">
|
||||
<view class="img-box">
|
||||
<slot name="tag"></slot>
|
||||
<image class="img" :src="img" mode="aspectFill"></image>
|
||||
@ -27,7 +27,7 @@ export default {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
id: 0,
|
||||
cid: 0,
|
||||
img: '',
|
||||
title: '',
|
||||
info: '',
|
||||
|
@ -9,7 +9,7 @@
|
||||
</view>
|
||||
<view class="group-box">
|
||||
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
|
||||
<activity-card :id="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
|
||||
<activity-card :cid="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
|
||||
:price="groupon.price" :productPrice="groupon.productPrice">
|
||||
<block slot="tag">
|
||||
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change="switchSelect(cartListValidIndex)">
|
||||
<label class="well-check">
|
||||
<checkbox value :checked="item.checked"></checkbox>
|
||||
<checkbox value :checked="item.checked+''"></checkbox>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
@ -95,7 +95,7 @@
|
||||
<Recommend></Recommend>
|
||||
</view>
|
||||
<view style="height:210rpx"></view>
|
||||
<view :class="['footer acea-row row-between-wrapper']" v-if="cartList.valid.length > 0">
|
||||
<view :class="{'footer acea-row row-between-wrapper':true,'footer-h5':isH5}" v-if="cartList.valid.length > 0">
|
||||
<view>
|
||||
<view class="select-btn">
|
||||
<view class="checkbox-wrapper">
|
||||
@ -170,6 +170,7 @@
|
||||
invalid: [],
|
||||
valid: []
|
||||
},
|
||||
isH5: false,
|
||||
validList: [],
|
||||
isAllSelect: false,
|
||||
cartCount: 0,
|
||||
@ -182,7 +183,6 @@
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo", "token"]),
|
||||
|
||||
// watch: {
|
||||
// $yroute(n) {
|
||||
// if (n.name === "ShoppingCart") {
|
||||
@ -220,6 +220,10 @@
|
||||
}
|
||||
},
|
||||
onShow: function () {
|
||||
// #ifdef H5
|
||||
this.isH5 = true
|
||||
// #endif
|
||||
console.log(this.userInfo)
|
||||
if (this.userInfo.uid) {
|
||||
this.carnum();
|
||||
this.countMoney();
|
||||
@ -509,3 +513,9 @@
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.footer-h5 {
|
||||
bottom: 50px
|
||||
}
|
||||
</style>
|
||||
|
@ -152,6 +152,7 @@
|
||||
isWeixin,
|
||||
VUE_APP_RESOURCES_URL
|
||||
} from "@/utils";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import SwitchWindow from "@/components/SwitchWindow";
|
||||
import Authorization from "@/pages/authorization/index";
|
||||
|
||||
@ -214,52 +215,79 @@
|
||||
uni.showLoading({
|
||||
title: "绑定中"
|
||||
});
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
success: function (res) {
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
uni.login({
|
||||
success: loginRes => {
|
||||
bindingPhone({
|
||||
code: loginRes.code,
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
// this.User();
|
||||
thit.$store.dispatch("userInfo", true);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading();
|
||||
thit.$store.dispatch("userInfo", true);
|
||||
console.log(error);
|
||||
uni.showToast({
|
||||
title: error.msg ||
|
||||
error.response.data.msg ||
|
||||
error.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
fail() {
|
||||
reject("绑定失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
reject("获取环境服务商失败");
|
||||
}
|
||||
});
|
||||
bindingPhone({
|
||||
code: cookie.get('wxLoginCode'),
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
// this.User();
|
||||
thit.$store.dispatch("userInfo", true);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading();
|
||||
thit.$store.dispatch("userInfo", true);
|
||||
console.log(error);
|
||||
uni.showToast({
|
||||
title: error.msg ||
|
||||
error.response.data.msg ||
|
||||
error.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
// // 获取当前环境的服务商
|
||||
// uni.getProvider({
|
||||
// service: "oauth",
|
||||
// success: function (res) {
|
||||
// // 此处可以排除h5
|
||||
// if (res.provider) {
|
||||
// uni.login({
|
||||
// success: loginRes => {
|
||||
// bindingPhone({
|
||||
// code: loginRes.code,
|
||||
// encryptedData: e.mp.detail.encryptedData,
|
||||
// iv: e.mp.detail.iv
|
||||
// })
|
||||
// .then(res => {
|
||||
// // this.User();
|
||||
// thit.$store.dispatch("userInfo", true);
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// icon: "success",
|
||||
// duration: 2000
|
||||
// });
|
||||
// })
|
||||
// .catch(error => {
|
||||
// uni.hideLoading();
|
||||
// thit.$store.dispatch("userInfo", true);
|
||||
// console.log(error);
|
||||
// uni.showToast({
|
||||
// title: error.msg ||
|
||||
// error.response.data.msg ||
|
||||
// error.response.data.message,
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// });
|
||||
// },
|
||||
// fail() {
|
||||
// reject("绑定失败");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// fail() {
|
||||
// reject("获取环境服务商失败");
|
||||
// }
|
||||
// });
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已拒绝授权",
|
||||
|
@ -275,6 +275,7 @@ export const login = () => {
|
||||
console.log('登录接口调用成功')
|
||||
console.log('开始检查用户信息授权')
|
||||
let code = loginRes.code;
|
||||
cookie.set('wxLoginCode',loginRes.code)
|
||||
// 检查授权, 检查用户信息授权
|
||||
authorize('userInfo').then(() => {
|
||||
console.log('授权通过')
|
||||
@ -516,7 +517,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
|
||||
if (isAuth) {
|
||||
// 有token
|
||||
if (path == '/pages/home/index' || path == '/pages/shop/GoodsClass/index' || path == '/pages/shop/ShoppingCart/index' || path == '/pages/user/User/index') {
|
||||
@ -859,13 +860,21 @@ export const handleLoginFailure = () => {
|
||||
store.commit("updateAuthorization", false);
|
||||
|
||||
let currentPageUrl = getCurrentPageUrl()
|
||||
// token 失效
|
||||
// 判断当前是不是已经在登录页面或者授权页,防止二次跳转
|
||||
if (store.getters.isAuthorizationPage || currentPageUrl == '/pages/user/Login/index') {
|
||||
console.log(store.getters.isAuthorizationPage, currentPageUrl, '已经是登录页面或者授权页面,跳出方法')
|
||||
return
|
||||
|
||||
if (store.state.$deviceType == 'weixin') {
|
||||
if (store.getters.isAuthorizationPage){
|
||||
toAuth()
|
||||
}
|
||||
} else {
|
||||
// token 失效
|
||||
// 判断当前是不是已经在登录页面或者授权页,防止二次跳转
|
||||
if (store.getters.isAuthorizationPage || currentPageUrl == '/pages/user/Login/index') {
|
||||
console.log(store.getters.isAuthorizationPage, currentPageUrl, '已经是登录页面或者授权页面,跳出方法')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console.log('————————')
|
||||
console.log('当前是授权页面')
|
||||
console.log(store.getters)
|
||||
@ -873,6 +882,7 @@ export const handleLoginFailure = () => {
|
||||
store.commit("updateAuthorizationPage", true);
|
||||
|
||||
let path = '/' + getCurrentPageUrlWithArgs()
|
||||
|
||||
let qrCode = handleQrCode()
|
||||
|
||||
if (qrCode) {
|
||||
|
Reference in New Issue
Block a user