Compare commits
5 Commits
183a95f48b
...
351e675c6d
Author | SHA1 | Date | |
---|---|---|---|
351e675c6d | |||
7bbf436a1c | |||
9d138814f2 | |||
f0ca5624ea | |||
947d85c1c6 |
@@ -112,7 +112,7 @@ export default {
|
||||
if(options?.path?.includes('ticketsBuy/ticketsBuy') && options?.query.couponsId) {
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: 'pages/common/groupbuy/index?id=' + options?.query.couponsId
|
||||
url: 'pages/common/groupbuy/detail?id=' + options?.query.couponsId
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
"modules": {}
|
||||
},
|
||||
"mp-weixin": {
|
||||
"appid": "wx92e663dc11d0c0a8",
|
||||
"appid": "wx67a750d0ceed4d88",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
},
|
||||
|
@@ -38,6 +38,12 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "肃客会员"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/coupons/ticketsBuy/ticketsBuy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "团购详情"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
|
29
src/pages/coupons/ticketsBuy/ticketsBuy.vue
Normal file
29
src/pages/coupons/ticketsBuy/ticketsBuy.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
onLoad((options) => {
|
||||
getApp().logger?.info('ticketsBuy options: ', options);
|
||||
let couponId = options?.couponsId;
|
||||
if(options?.query && couponId == undefined) {
|
||||
const params = decodeURIComponent(options?.query);
|
||||
couponId = getQueryParam(params, 'couponsId');
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: `/pages/common/groupbuy/detail?id=${couponId}`
|
||||
});
|
||||
}, 300);
|
||||
});
|
||||
|
||||
function getQueryParam(queryParams: string, key: string) {
|
||||
let regex = new RegExp('(?:[?&]|^)' + key + '=([^&]+)'),
|
||||
match = queryParams.match(regex);
|
||||
return match && match[1];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
||||
</style>
|
@@ -86,7 +86,7 @@ const submenuList = [
|
||||
title: '注册有礼',
|
||||
icon: assetsUrl('ic_register_gift2.png'),
|
||||
path: '/pages/common/register/reward'
|
||||
// path: '/pages/common/register/index'
|
||||
// path: '/pages/coupons/ticketsBuy/ticketsBuy?couponsId=1797773484774432769'
|
||||
},
|
||||
{
|
||||
title: '团购秒杀',
|
||||
@@ -196,10 +196,14 @@ const fetchCompanyList = (fn: any = undefined) => {
|
||||
} else {
|
||||
let index = companyList.value.findIndex((res: { id: string }) => res.id === getApp().globalData?.companyId);
|
||||
//未在当前公司下注册
|
||||
if(index < 0 && !getApp()?.globalData?.storeId) {
|
||||
if(index < 0) {
|
||||
if(!getApp()?.globalData?.storeId) {
|
||||
goPath('/pages/common/register/index');
|
||||
return;
|
||||
}
|
||||
index = 0;
|
||||
}
|
||||
|
||||
userStore.setUserInfo(userList.value[index]);
|
||||
userStore.setCompanyInfo(companyList.value[index]);
|
||||
avatarModifyRemind();
|
||||
|
@@ -80,7 +80,7 @@ const params = ref<{
|
||||
nickName: userInfo.value.nickName,
|
||||
telephone: userInfo.value.telephone,
|
||||
gender: userInfo.value.gender,
|
||||
birthday: userInfo.value.birthday
|
||||
birthday: userInfo.value.birthday|| dayjs().format('YYYY-MM-DD')
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
@@ -135,7 +135,7 @@ const save = async () => {
|
||||
|
||||
const result = await updateProfile({
|
||||
...params.value,
|
||||
birthday: dayjs(params.value.birthday).format('YYYY-MM-DD HH:mm:ss'),
|
||||
birthday: dayjs(birthday.value).isValid() ? dayjs(birthday.value).format('YYYY-MM-DD HH:mm:ss') : dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
birthdayType: 0
|
||||
});
|
||||
|
||||
|
@@ -93,16 +93,13 @@ const useUserStore = defineStore('user', {
|
||||
// referrerUserId: getReferrerUserId()
|
||||
});
|
||||
getApp().globalData?.logger.info('login result: ', res);
|
||||
console.log('login result: ', res);
|
||||
console.log('login result: ', res.token);
|
||||
console.log('login result: ', res.sessionKey);
|
||||
setToken(res.token);
|
||||
setSessionKey(res.sessionKey);
|
||||
setOpenId(res.maOpenId);
|
||||
if(res.user) {
|
||||
await this.setUserInfo(res.user);
|
||||
this.setUserInfo(res.user);
|
||||
} else {
|
||||
this.setUserInfo(res.userInfo)
|
||||
this.setUserInfo(res.userInfo);
|
||||
}
|
||||
// }
|
||||
resolve(res);
|
||||
@@ -155,7 +152,9 @@ const useUserStore = defineStore('user', {
|
||||
if(this.userInfo) {
|
||||
this.userInfo.userDiscount = this.getUserDiscount;
|
||||
await setCompanyId(this.userInfo.companyId);
|
||||
getApp().globalData!.companyId = this.userInfo.companyId;
|
||||
if(getApp().globalData){
|
||||
getApp().globalData.companyId = this.userInfo.companyId;
|
||||
}
|
||||
} else {
|
||||
await clearToken();
|
||||
}
|
||||
@@ -165,7 +164,9 @@ const useUserStore = defineStore('user', {
|
||||
|
||||
setCompanyInfo(partial: Partial<any>) {
|
||||
this.companyInfo = partial as any;
|
||||
getApp().globalData!.companyId = this.companyInfo.id;
|
||||
if(getApp()?.globalData) {
|
||||
getApp().globalData.companyId = this.companyInfo.id;
|
||||
}
|
||||
},
|
||||
|
||||
setDeliveryAddress(partial: Partial<any>) {
|
||||
|
@@ -40,9 +40,11 @@ function getCompanyId() {
|
||||
}
|
||||
|
||||
function setCompanyId(companyId: string) {
|
||||
if(companyId) {
|
||||
uni.setStorageSync(CompanyIdKey, companyId);
|
||||
if(getApp()?.globalData) {
|
||||
getApp().globalData!.companyId = companyId;
|
||||
getApp().globalData.companyId = companyId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { HttpError, HttpRequestConfig, HttpResponse } from 'uview-plus/libs/luch-request';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getCompanyId, getToken } from '@/utils/auth';
|
||||
import { showMessage } from '@/utils/request/status';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
@@ -22,7 +22,7 @@ function requestInterceptors() {
|
||||
const token = getToken();
|
||||
if(token && config.header) {
|
||||
config.header.token = token;
|
||||
config.header.companyid = getApp().globalData?.companyId;
|
||||
config.header.companyid = getCompanyId();
|
||||
|
||||
// config.header.contentType = "x-www-form-urlencoded"
|
||||
}
|
||||
@@ -61,7 +61,7 @@ function responseInterceptors() {
|
||||
}
|
||||
|
||||
// 登录状态失效,重新登录
|
||||
if(data.code === 4011) {
|
||||
if(data.code === 4011 || data?.retcode === 4011) {
|
||||
// 是否在获取token中,防止重复获取
|
||||
if(!isRefreshing) {
|
||||
// 修改登录状态为true
|
||||
|
Reference in New Issue
Block a user