1.修改小程序段拼团未登录情况下无法进行登录回跳的问题
2.新增订单扫码核销的功能 3.修改cookie方法未取到值返回null导致报错的问题 4.修改loading页面跳转登录的问题
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
toLaunch() {
|
||||
console.log("loading home");
|
||||
this.changeAuthorization(false);
|
||||
let redirect = cookie.get('redirect')
|
||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||
if (redirect && redirect.indexOf('/pages') != -1) {
|
||||
this.$yrouter.replace({
|
||||
path: '/pages' + redirect.split('/pages')[1],
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="group-con">
|
||||
<view class="header acea-row row-between-wrapper">
|
||||
<view class="header acea-row row-between-wrapper" v-if="storeCombination">
|
||||
<view class="pictrue">
|
||||
<image :src="storeCombination.image" />
|
||||
</view>
|
||||
@ -15,20 +15,13 @@
|
||||
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view>
|
||||
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="wrapper" v-if="pinkT">
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view class="line"></view>
|
||||
<view class="name acea-row row-center-wrapper">
|
||||
<text>剩余</text>
|
||||
<count-down
|
||||
:isDay="false"
|
||||
:tipText="false"
|
||||
:dayText="false"
|
||||
:hourText="' : '"
|
||||
:minuteText="' : '"
|
||||
:secondText="false"
|
||||
:datatime="pinkT.stopTime/1000"
|
||||
></count-down>
|
||||
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '"
|
||||
:secondText="' 秒'" :datatime="pinkT.stopTime/1000"></count-down>
|
||||
<text>结束</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
@ -38,11 +31,10 @@
|
||||
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</text>
|
||||
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</text>
|
||||
</view>
|
||||
<view
|
||||
class="list acea-row row-middle"
|
||||
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"
|
||||
>
|
||||
<view class="pictrue">
|
||||
|
||||
<view class="list acea-row row-middle"
|
||||
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']">
|
||||
<view class="pictrue" v-if="pinkT">
|
||||
<image :src="pinkT.avatar" />
|
||||
</view>
|
||||
<view class="acea-row row-middle" v-if="pinkAll.length > 0">
|
||||
@ -54,29 +46,17 @@
|
||||
<image class="img-none" src="@/static/images/vacancy.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
|
||||
class="lookAll acea-row row-center-wrapper"
|
||||
@click="lookAll"
|
||||
>
|
||||
<view v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" class="lookAll acea-row row-center-wrapper"
|
||||
@click="lookAll">
|
||||
{{ iShidden ? "收起" : "查看全部" }}
|
||||
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
|
||||
</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
|
||||
@click="goPoster"
|
||||
>邀请好友参团</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
|
||||
@click="pay"
|
||||
>我要参团</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="pinkBool === 1 || pinkBool === -1"
|
||||
@click="goDetail(storeCombination.id)"
|
||||
>再次开团</view>
|
||||
<view class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0" @click="goPoster">邀请好友参团
|
||||
</view>
|
||||
<view class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0" @click="pay">我要参团
|
||||
</view>
|
||||
<view class="teamBnt bg-color-red" v-if="pinkBool === 1 || pinkBool === -1"
|
||||
@click="goDetail(storeCombination.id)">再次开团</view>
|
||||
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
|
||||
<text class="iconfont icon-guanbi3"></text>
|
||||
<text>取消开团</text>
|
||||
@ -90,9 +70,18 @@
|
||||
</template>
|
||||
<script>
|
||||
import CountDown from "@/components/CountDown";
|
||||
import { getCombinationPink, getCombinationRemove } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
|
||||
import {
|
||||
getCombinationPink,
|
||||
getCombinationRemove
|
||||
} from "@/api/activity";
|
||||
import {
|
||||
postCartAdd
|
||||
} from "@/api/store";
|
||||
import {
|
||||
isWeixin,
|
||||
parseQuery,
|
||||
handleQrCode
|
||||
} from "@/utils/index";
|
||||
|
||||
const NAME = "GroupRule";
|
||||
export default {
|
||||
@ -108,8 +97,8 @@ export default {
|
||||
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
|
||||
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
|
||||
pinkAll: [], //团员
|
||||
pinkT: [], //团长信息
|
||||
storeCombination: [], //拼团产品
|
||||
pinkT: {}, //团长信息
|
||||
storeCombination: {}, //拼团产品
|
||||
pinkId: 0,
|
||||
uniqueId: "",
|
||||
count: 0, //拼团剩余人数
|
||||
@ -156,8 +145,7 @@ export default {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
|
@ -90,8 +90,9 @@
|
||||
});
|
||||
login()
|
||||
.then((res) => {
|
||||
this.$yrouter.replace({
|
||||
path: cookie.get("redirect")
|
||||
console.log('重定向')
|
||||
this.$yrouter.reLaunch({
|
||||
path: cookie.get("redirect").replace(/\ /g, '')
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -9,18 +9,24 @@
|
||||
</view>
|
||||
<view class="bnt" @click="storeCancellation">立即核销</view>
|
||||
</view>
|
||||
<!-- <view class="scan" v-if="iswechat">
|
||||
<!-- #ifndef H5 -->
|
||||
<view class="scan" v-if="iswechat">
|
||||
<image src="@/static/images/scan.gif" @click="openQRCode" />
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WriteOff from "@/components/WriteOff";
|
||||
import { isWeixin } from "@/utils";
|
||||
import {
|
||||
isWeixin
|
||||
} from "@/utils";
|
||||
// import { wechatEvevt } from "@/libs/wechat";
|
||||
import { orderVerific } from "@/api/order";
|
||||
import {
|
||||
orderVerific
|
||||
} from "@/api/order";
|
||||
const NAME = "OrderCancellation";
|
||||
|
||||
export default {
|
||||
@ -32,7 +38,6 @@ export default {
|
||||
data: function() {
|
||||
return {
|
||||
iShidden: true,
|
||||
iswechat: isWeixin(),
|
||||
orderInfo: {},
|
||||
verify_code: ""
|
||||
};
|
||||
@ -55,8 +60,7 @@ export default {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
@ -97,8 +101,7 @@ export default {
|
||||
.catch(error => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title:
|
||||
error.msg ||
|
||||
title: error.msg ||
|
||||
error.response.data.msg ||
|
||||
error.response.data.message,
|
||||
icon: "none",
|
||||
@ -109,6 +112,22 @@ export default {
|
||||
openQRCode: function() {
|
||||
let that = this;
|
||||
// 这里需要调用扫码功能
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
var result = res.result;
|
||||
if (result) {
|
||||
that.verify_code = res.result;
|
||||
that.storeCancellation();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '没有扫描到什么!',
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -119,6 +138,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 3 * 100rpx;
|
||||
background-size: 100% 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 3 * 100rpx;
|
||||
|
BIN
static/images/scan.gif
Normal file
BIN
static/images/scan.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 KiB |
@ -211,7 +211,7 @@ export const login = () => {
|
||||
if (code) {
|
||||
auth(code)
|
||||
.then(() => {
|
||||
let redirect = cookie.get('redirect')
|
||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||
console.log(redirect)
|
||||
if (redirect) {
|
||||
redirect = redirect.split('/pages')[1]
|
||||
@ -327,7 +327,7 @@ export const handleGetUserInfo = () => {
|
||||
store.dispatch('setUserInfo', res.data)
|
||||
console.log('获取用户信息后跳转回显的页面')
|
||||
|
||||
let redirect = cookie.get('redirect')
|
||||
let redirect = cookie.get('redirect').replace(/\ /g, '')
|
||||
if (redirect) {
|
||||
reLaunch({
|
||||
path: redirect,
|
||||
@ -585,11 +585,9 @@ export function routerPermissions(url, type) {
|
||||
})
|
||||
return
|
||||
}
|
||||
{
|
||||
push({
|
||||
path,
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log('————————')
|
||||
console.log('自动登录失败,跳转到授权页面')
|
||||
@ -661,7 +659,7 @@ export function reLaunch(location, complete, fail, success) {
|
||||
uni.reLaunch(params)
|
||||
}).catch(error => {
|
||||
// 没有权限
|
||||
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
@ -850,6 +848,7 @@ export const handleLoginFailure = () => {
|
||||
// 改为授权取消
|
||||
store.commit("updateAuthorization", false);
|
||||
|
||||
|
||||
let currentPageUrl = getCurrentPageUrl()
|
||||
if (store.state.$deviceType == 'weixin') {
|
||||
// 如果不是授权页面,
|
||||
|
@ -5,7 +5,7 @@ const doc = null;
|
||||
|
||||
function get(key) {
|
||||
if (!key || !_has(key)) {
|
||||
return null;
|
||||
return '';
|
||||
}
|
||||
return uni.getStorageSync(key)
|
||||
}
|
||||
|
Reference in New Issue
Block a user