Browse Source

拼团商品详情问题接口404

uniapp运行的H5版本,购物车报错不能购买
小程序绑定手机号会报错
uniapp 3.1 tabbar显示
master
Gao xiaosong 5 years ago
parent
commit
32a514eb74
  1. 2
      assets/css/style.css
  2. 2
      assets/css/style.css.map
  3. 2
      assets/css/style.less
  4. 4
      pages/activity/GoodsGroup/children/activity-card.vue
  5. 2
      pages/activity/GoodsGroup/index.vue
  6. 16
      pages/shop/ShoppingCart/index.vue
  7. 68
      pages/user/User/index.vue
  8. 10
      utils/index.js

2
assets/css/style.css

File diff suppressed because one or more lines are too long

2
assets/css/style.css.map

File diff suppressed because one or more lines are too long

2
assets/css/style.less

@ -2057,7 +2057,7 @@ page {
}
.shoppingCart .list {
margin-top: 1.71*100rpx;
margin-top: 0.8*100rpx;
}
.shoppingCart .list .item {

4
pages/activity/GoodsGroup/children/activity-card.vue

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

2
pages/activity/GoodsGroup/index.vue

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

16
pages/shop/ShoppingCart/index.vue

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

68
pages/user/User/index.vue

@ -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,16 +215,8 @@
uni.showLoading({
title: "绑定中"
});
//
uni.getProvider({
service: "oauth",
success: function (res) {
// h5
if (res.provider) {
uni.login({
success: loginRes => {
bindingPhone({
code: loginRes.code,
code: cookie.get('wxLoginCode'),
encryptedData: e.mp.detail.encryptedData,
iv: e.mp.detail.iv
})
@ -249,17 +242,52 @@
duration: 2000
});
});
},
fail() {
reject("绑定失败");
}
});
}
},
fail() {
reject("获取环境服务商失败");
}
});
// //
// 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: "已拒绝授权",

10
utils/index.js

@ -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('授权通过')
@ -859,12 +860,20 @@ export const handleLoginFailure = () => {
store.commit("updateAuthorization", false);
let currentPageUrl = getCurrentPageUrl()
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('当前是授权页面')
@ -873,6 +882,7 @@ export const handleLoginFailure = () => {
store.commit("updateAuthorizationPage", true);
let path = '/' + getCurrentPageUrlWithArgs()
let qrCode = handleQrCode()
if (qrCode) {

Loading…
Cancel
Save