feat: 5.20 update
This commit is contained in:
parent
f52191e065
commit
5b37d7962d
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/img/logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
|
|
||||||
<title>泰古润</title>
|
<title>泰古润</title>
|
||||||
|
|||||||
@ -20,7 +20,7 @@ function getHeaders(contentType = 'application/json') {
|
|||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': contentType,
|
'Content-Type': contentType,
|
||||||
};
|
};
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('member_token');
|
||||||
if (token) {
|
if (token) {
|
||||||
headers['Authorization'] = `Bearer ${token}`;
|
headers['Authorization'] = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ function handleResponse(response) {
|
|||||||
*/
|
*/
|
||||||
function handleUnauthorized() {
|
function handleUnauthorized() {
|
||||||
// 清除登录状态
|
// 清除登录状态
|
||||||
localStorage.removeItem('token');
|
localStorage.removeItem('member_token');
|
||||||
localStorage.removeItem('member_username');
|
localStorage.removeItem('member_username');
|
||||||
|
|
||||||
// 跳转到登录页
|
// 跳转到登录页
|
||||||
@ -146,7 +146,7 @@ export const del = (url, data, timeout = DEFAULT_TIMEOUT) => request(url, data,
|
|||||||
*/
|
*/
|
||||||
export function postForm(url, formData, timeout = DEFAULT_TIMEOUT) {
|
export function postForm(url, formData, timeout = DEFAULT_TIMEOUT) {
|
||||||
const headers = {};
|
const headers = {};
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('member_token');
|
||||||
if (token) {
|
if (token) {
|
||||||
headers['Authorization'] = `Bearer ${token}`;
|
headers['Authorization'] = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ export function upload(url, files, timeout = 30000) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const headers = {};
|
const headers = {};
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('member_token');
|
||||||
if (token) {
|
if (token) {
|
||||||
headers['Authorization'] = `Bearer ${token}`;
|
headers['Authorization'] = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export function isLogin() {
|
export function isLogin() {
|
||||||
return !!localStorage.getItem('token');
|
return !!localStorage.getItem('member_token');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatGMT(t, format) {
|
export function formatGMT(t, format) {
|
||||||
|
|||||||
@ -158,7 +158,7 @@ app.config.globalProperties.$valid = (field, msg) => {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
app.config.globalProperties.$token = (e) => {
|
app.config.globalProperties.$token = (e) => {
|
||||||
const token = localStorage.getItem(e).split('.');
|
const token = localStorage.getItem(e === 'token' ? 'member_token' : e).split('.');
|
||||||
return {
|
return {
|
||||||
header: JSON.parse(atob(token[0])),
|
header: JSON.parse(atob(token[0])),
|
||||||
payload: JSON.parse(atob(token[1])),
|
payload: JSON.parse(atob(token[1])),
|
||||||
@ -225,7 +225,7 @@ app.config.globalProperties.$uploadFiles = (files, uploadUrl) => {
|
|||||||
fetch(`${import.meta.env.VITE_API_URL}${uploadUrl}`, {
|
fetch(`${import.meta.env.VITE_API_URL}${uploadUrl}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${localStorage.getItem('token')}`,
|
'Authorization': `Bearer ${localStorage.getItem('member_token')}`,
|
||||||
},
|
},
|
||||||
body: fd,
|
body: fd,
|
||||||
}).then(rep => {
|
}).then(rep => {
|
||||||
|
|||||||
@ -300,6 +300,11 @@ const routes = [
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/SyncAuth',
|
||||||
|
name: 'SyncAuth',
|
||||||
|
component: () => import('./views/SyncAuth.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
name: '404',
|
name: '404',
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { post } from '@/api/http';
|
|||||||
|
|
||||||
export const useUserStore = defineStore('user', {
|
export const useUserStore = defineStore('user', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
token: localStorage.getItem('token') || '',
|
token: localStorage.getItem('member_token') || '',
|
||||||
// 用户基本信息
|
// 用户基本信息
|
||||||
user: null,
|
user: null,
|
||||||
cellphone: localStorage.getItem('cellphone') || '',
|
cellphone: localStorage.getItem('cellphone') || '',
|
||||||
@ -54,9 +54,9 @@ export const useUserStore = defineStore('user', {
|
|||||||
setToken(token) {
|
setToken(token) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
if (token) {
|
if (token) {
|
||||||
localStorage.setItem('token', token);
|
localStorage.setItem('member_token', token);
|
||||||
} else {
|
} else {
|
||||||
localStorage.removeItem('token');
|
localStorage.removeItem('member_token');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -85,7 +85,7 @@ export const useUserStore = defineStore('user', {
|
|||||||
|
|
||||||
// 清除 localStorage
|
// 清除 localStorage
|
||||||
const keys = [
|
const keys = [
|
||||||
'token', 'cellphone', 'nickname', 'userimg',
|
'member_token', 'cellphone', 'nickname', 'userimg',
|
||||||
'isshop', 'iscenter', 'user_id', 'huiyuankaid', 'member_username'
|
'isshop', 'iscenter', 'user_id', 'huiyuankaid', 'member_username'
|
||||||
];
|
];
|
||||||
keys.forEach(key => localStorage.removeItem(key));
|
keys.forEach(key => localStorage.removeItem(key));
|
||||||
|
|||||||
@ -3497,6 +3497,7 @@
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
border-radius: 1.07vw;
|
border-radius: 1.07vw;
|
||||||
border: solid 0.13vw #000000;
|
border: solid 0.13vw #000000;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5176,6 +5177,7 @@
|
|||||||
height: 16vw;
|
height: 16vw;
|
||||||
border: solid 0.4vw #ffffff;
|
border: solid 0.4vw #ffffff;
|
||||||
margin-right: 2.67vw;
|
margin-right: 2.67vw;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inf {
|
.inf {
|
||||||
|
|||||||
@ -1951,7 +1951,8 @@ img {
|
|||||||
|
|
||||||
.cashoutaccount {
|
.cashoutaccount {
|
||||||
.ca_content {
|
.ca_content {
|
||||||
max-height: 124vw;
|
// max-height: 124vw;
|
||||||
|
min-height: 60vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
@ -1988,9 +1989,12 @@ img {
|
|||||||
|
|
||||||
.ca_bottom {
|
.ca_bottom {
|
||||||
width: 92vw;
|
width: 92vw;
|
||||||
height: 60vw;
|
// height: 40vh;
|
||||||
position: fixed;
|
height: max-content;
|
||||||
margin-top: auto;
|
// position: fixed;
|
||||||
|
margin-top: 10vw;
|
||||||
|
margin-left: 4vw;
|
||||||
|
padding-bottom: 4vw;
|
||||||
left: 4vw;
|
left: 4vw;
|
||||||
bottom: 6vw;
|
bottom: 6vw;
|
||||||
|
|
||||||
|
|||||||
@ -164,8 +164,39 @@ export default {
|
|||||||
location.replace('#/')
|
location.replace('#/')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// this.checkWxLogin();
|
||||||
|
const code = JSON.stringify(this.$route.query.code);
|
||||||
|
if (code) {
|
||||||
|
alert(code)
|
||||||
|
|
||||||
|
this.$post('/v1/client/AuthClient/loginwxweb', { code }).then(res => {
|
||||||
|
this.$showSuccessToast('登录成功')
|
||||||
|
if (res.data?.openid) {
|
||||||
|
localStorage.setItem('openid', res.data.openid)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
alert(JSON.stringify(err))
|
||||||
|
this.$showFailToast(err.message || '微信登录失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$closeSkeleton?.()
|
this.$closeSkeleton?.()
|
||||||
},
|
},
|
||||||
|
checkWxLogin() {
|
||||||
|
if (!this.$isWechat()) return
|
||||||
|
if (this.$route.query.code) return
|
||||||
|
// console.log(window.location.href);
|
||||||
|
|
||||||
|
this.$get('/v1/client/AuthClient/loginwxweburl', {
|
||||||
|
returnUrl: `${encodeURIComponent(window.location.href)}`
|
||||||
|
}).then(res => {
|
||||||
|
alert(JSON.stringify(res))
|
||||||
|
if (res.data) {
|
||||||
|
window.location.href = res.data
|
||||||
|
}
|
||||||
|
}).catch(res => {
|
||||||
|
alert(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
validatePhone(phone) {
|
validatePhone(phone) {
|
||||||
if (!phone) {
|
if (!phone) {
|
||||||
this.$showFailToast?.('请输入手机号')
|
this.$showFailToast?.('请输入手机号')
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
<img :src="i.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'" alt="">
|
<img :src="i.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'" alt="">
|
||||||
<div>
|
<div>
|
||||||
<span>
|
<span>
|
||||||
{{ i.bankspname === '支付宝' ? '支付宝账号' : i.bankspname }}({{ i.bankcardnumber }})
|
{{ i.bankspname === '支付宝' ? '支付宝账号' : i.bankspname }}({{ i.bankid === 91 ? i.bankcellphone
|
||||||
|
: i.bankcardnumber }})
|
||||||
</span>
|
</span>
|
||||||
<p>
|
<p>
|
||||||
2小时内到账
|
2小时内到账
|
||||||
|
|||||||
@ -63,12 +63,12 @@
|
|||||||
<div class="item" v-for="item in records">
|
<div class="item" v-for="item in records">
|
||||||
<div class="line1">
|
<div class="line1">
|
||||||
<span class="type">{{ item.typename }}</span>
|
<span class="type">{{ item.typename }}</span>
|
||||||
<p>剩余:{{ item.balance }}</p>
|
<p>剩余:{{ item.balance?.toFixed(2) }}</p>
|
||||||
<span :class="item.nums > 0 ? 'income' : 'expend'">{{ item.nums > 0 ? '+' : '' }}
|
<span :class="item.nums > 0 ? 'income' : 'expend'">{{ item.nums > 0 ? '+' : '' }}
|
||||||
{{ item.nums?.toFixed(2) }}</span>
|
{{ item.nums?.toFixed(2) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
操作时间:{{ item.addtime }}
|
操作时间:{{ $formatGMT(item.addtime, 'yyyy-MM-dd HH:mm:ss') }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
订单编号:{{ item.ordernum }}
|
订单编号:{{ item.ordernum }}
|
||||||
|
|||||||
@ -171,7 +171,7 @@ export default {
|
|||||||
fd.append('file', file)
|
fd.append('file', file)
|
||||||
return fetch(`${import.meta.env.VITE_API_URL}${url}`, {
|
return fetch(`${import.meta.env.VITE_API_URL}${url}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Authorization': `Bearer ${localStorage.getItem('token')}` },
|
headers: { 'Authorization': `Bearer ${localStorage.getItem('member_token')}` },
|
||||||
body: fd,
|
body: fd,
|
||||||
}).then(res => res.json()).then(res => {
|
}).then(res => res.json()).then(res => {
|
||||||
if (res.status !== 200) throw new Error(res.message)
|
if (res.status !== 200) throw new Error(res.message)
|
||||||
|
|||||||
@ -134,7 +134,8 @@
|
|||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<!-- <van-popup v-model:show="showDateRange" position="bottom" :style="{ height: '75%' }"> -->
|
<!-- <van-popup v-model:show="showDateRange" position="bottom" :style="{ height: '75%' }"> -->
|
||||||
<van-calendar v-model:show="showDateRange" type="range" :min-date="new Date(2026, 0, 1)" @confirm="onDateRangeConfirm" />
|
<van-calendar v-model:show="showDateRange" type="range" :min-date="new Date(2026, 0, 1)"
|
||||||
|
@confirm="onDateRangeConfirm" />
|
||||||
|
|
||||||
<!-- <van-calendar type="range" v-model="selectedDateRange" :min-date="new Date(new Date().getFullYear() - 1, 0, 1)"
|
<!-- <van-calendar type="range" v-model="selectedDateRange" :min-date="new Date(new Date().getFullYear() - 1, 0, 1)"
|
||||||
title="选择日期区间" show-title show-subtitle @confirm="onDateRangeConfirm" /> -->
|
title="选择日期区间" show-title show-subtitle @confirm="onDateRangeConfirm" /> -->
|
||||||
@ -181,7 +182,7 @@ export default {
|
|||||||
return res.data || []
|
return res.data || []
|
||||||
},
|
},
|
||||||
onLoad(list) {
|
onLoad(list) {
|
||||||
console.log('list loaded:', list);
|
// console.log('list loaded:', list);
|
||||||
},
|
},
|
||||||
onconfirm(value) {
|
onconfirm(value) {
|
||||||
this.date = this.currentDate;
|
this.date = this.currentDate;
|
||||||
|
|||||||
@ -99,7 +99,7 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.$get('/v1/client/CBusinessschoolcatesClient',).then(res => {
|
this.$get('/v1/client/CBusinessschoolcatesClient',).then(res => {
|
||||||
this.categories = res.data;
|
this.categories = res.data;
|
||||||
console.log(this.categories);
|
// console.log(this.categories);
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default {
|
|||||||
emits: ['updateShare'],
|
emits: ['updateShare'],
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$get('/v1/client/CNewsClient?pid=3').then(data => {
|
this.$get('/v1/client/CNewsClient?pid=3').then(data => {
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
this.articleList = data.data.items;
|
this.articleList = data.data.items;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export default {
|
|||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
this.$get(`/v1/client/CBusinessschoolsClient/${this.$route.query.id}`).then(res => {
|
this.$get(`/v1/client/CBusinessschoolsClient/${this.$route.query.id}`).then(res => {
|
||||||
this.article = res.data;
|
this.article = res.data;
|
||||||
console.log(this.article);
|
// console.log(this.article);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
28
src/views/SyncAuth.vue
Normal file
28
src/views/SyncAuth.vue
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
mounted() {
|
||||||
|
if (this.token)
|
||||||
|
localStorage.setItem('member_token', this.token);
|
||||||
|
// if (this.miniopenid)
|
||||||
|
// localStorage.setItem('miniopenid', this.miniopenid);
|
||||||
|
if (this.target)
|
||||||
|
location.replace(`#/${this.target}`);
|
||||||
|
else
|
||||||
|
location.replace('#/');
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
token: decodeURIComponent(this.$route.query.token || ''),
|
||||||
|
// miniopenid: decodeURIComponent(this.$route.query.miniopenid || ''),
|
||||||
|
target: decodeURIComponent(this.$route.query.target || ''),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -318,7 +318,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
onFinish(e) {
|
onFinish(e) {
|
||||||
this.showRegion = false;
|
this.showRegion = false;
|
||||||
console.log(e);
|
// console.log(e);
|
||||||
|
|
||||||
this.address.ReceiveRegion = e.selectedOptions.map(x => x.id).join(';');
|
this.address.ReceiveRegion = e.selectedOptions.map(x => x.id).join(';');
|
||||||
this.address.ReceiveRegionName = e.selectedOptions.map(x => x.text).join('');
|
this.address.ReceiveRegionName = e.selectedOptions.map(x => x.text).join('');
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="video_box">
|
<div class="video_box">
|
||||||
<video v-if="data.Video" :src="$file(data.Video.filecover)" controls></video>
|
<video v-if="data.video" :src="$file(data.video.contents)" :poster="data.video.filecover" controls></video>
|
||||||
|
|
||||||
<button @click="$navigate('/ColumnDetail?id=1')">了解我们</button>
|
<button @click="$navigate('/ColumnDetail?id=1')">了解我们</button>
|
||||||
</div>
|
</div>
|
||||||
@ -158,12 +158,12 @@ export default {
|
|||||||
this.$get('/v1/client/CSlidesClient?pid=1').then(data => {
|
this.$get('/v1/client/CSlidesClient?pid=1').then(data => {
|
||||||
this.data.Carousel = data.data;
|
this.data.Carousel = data.data;
|
||||||
}),
|
}),
|
||||||
|
this.$get('/v1/client/CDatadicsClient/code_sp').then(data => {
|
||||||
|
this.data.video = data.data;
|
||||||
|
})
|
||||||
]).catch(err => {
|
]).catch(err => {
|
||||||
this.$showFailToast(err.message || '数据加载失败');
|
this.$showFailToast(err.message || '数据加载失败');
|
||||||
});
|
});
|
||||||
// 视频和背景图从数据字典获取
|
|
||||||
this.data.Video = this.$datadic.getContent('code_sp')
|
|
||||||
this.data.slideBg = this.$datadic.getContent('code_yqmbj')
|
|
||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
// this.showcreate = true;
|
// this.showcreate = true;
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mall">
|
<div class="mall" :style="bgStyle" style="background-size: 100% 62.933vw;background-repeat: no-repeat;">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<div class="search_box">
|
<div class="search_box">
|
||||||
<img src="/img/search.png" alt="">
|
<img src="/img/search.png" alt="">
|
||||||
<input v-model="searchParams.Key" type="search" placeholder="水产海鲜限时折扣抢购中"
|
<input v-model="searchParams.Key" placeholder="请输入关键词搜索"
|
||||||
@search="$navigate('Category?Key=' + searchParams.Key)">
|
@search="$navigate('Category?Key=' + searchParams.Key)">
|
||||||
<button @click="$navigate('Category?Key=' + searchParams.Key)">搜索</button>
|
<button @click="$navigate('Category?Key=' + searchParams.Key)">搜索</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="banner">
|
<div class="banner">
|
||||||
<van-swipe :autoplay="3000" indicator-color="white">
|
<van-swipe :autoplay="3000" indicator-color="white" @change="onSwipeChange">
|
||||||
<van-swipe-item v-for="item in data.Carousel">
|
<van-swipe-item v-for="item in data.Carousel">
|
||||||
<a @click="item.link ? $openUrl(item.link) : ''"><img :src="$file(item.img) || '/img/avatar.png'"
|
<a @click="item.link ? $openUrl(item.link) : ''"><img :src="$file(item.img) || '/img/avatar.png'"
|
||||||
width="100%"></a>
|
width="100%"></a>
|
||||||
@ -239,6 +239,7 @@ export default {
|
|||||||
},
|
},
|
||||||
hotData: [],
|
hotData: [],
|
||||||
typeData: [],
|
typeData: [],
|
||||||
|
bgcolor: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -249,6 +250,9 @@ export default {
|
|||||||
}),
|
}),
|
||||||
this.$get(`/v1/client/CSlidesClient?pid=2`).then(res => {
|
this.$get(`/v1/client/CSlidesClient?pid=2`).then(res => {
|
||||||
this.data.Carousel = res.data
|
this.data.Carousel = res.data
|
||||||
|
if (res.data?.[0]?.bgcolor) {
|
||||||
|
this.bgcolor = res.data[0].bgcolor
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
||||||
this.hotData = res.data.items;
|
this.hotData = res.data.items;
|
||||||
@ -270,6 +274,20 @@ export default {
|
|||||||
changeTab(type) {
|
changeTab(type) {
|
||||||
this.searchParams.pid = type;
|
this.searchParams.pid = type;
|
||||||
this.$refs.BaseList.refresh()
|
this.$refs.BaseList.refresh()
|
||||||
|
},
|
||||||
|
onSwipeChange(index) {
|
||||||
|
const item = this.data.Carousel[index]
|
||||||
|
this.bgcolor = item?.bgcolor || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
bgStyle() {
|
||||||
|
if (this.bgcolor) {
|
||||||
|
return {
|
||||||
|
background: `linear-gradient(${this.bgcolor}, #f5f5f5)`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
</van-cell>
|
</van-cell>
|
||||||
|
|
||||||
<!-- 微信支付 -->
|
<!-- 微信支付 -->
|
||||||
<van-cell title="微信支付" v-if="!hide" is-link @click="payMethod = ['wechat']">
|
<van-cell title="微信支付" is-link @click="payMethod = ['wechat']">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<img class="pay-icon" src="/img/pay_weixin.png" />
|
<img class="pay-icon" src="/img/pay_weixin.png" />
|
||||||
</template>
|
</template>
|
||||||
@ -43,12 +43,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
|
|
||||||
<van-cell title="快捷支付HJ(更顺畅)" v-if="!hide" is-link @click="payMethod = ['wechat']">
|
<van-cell v-if="!hide" title="快捷支付HJ(更顺畅)" is-link @click="payMethod = ['bankcard']">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<img class="pay-icon" src="/img/pay_bankcard.png" />
|
<img class="pay-icon" src="/img/pay_bankcard.png" />
|
||||||
</template>
|
</template>
|
||||||
<template #right-icon>
|
<template #right-icon>
|
||||||
<van-checkbox name="wechat" :class="{ selected: payMethod.includes('wechat') }" />
|
<van-checkbox name="bankcard" :class="{ selected: payMethod.includes('bankcard') }" />
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
@ -89,6 +89,7 @@ export default {
|
|||||||
},
|
},
|
||||||
payMethod: ['balance'],
|
payMethod: ['balance'],
|
||||||
showPayResult: false,
|
showPayResult: false,
|
||||||
|
paychannelList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -99,6 +100,9 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.loadData();
|
this.loadData();
|
||||||
|
this.$get('/v1/client/FOrdersClient/paychannel').then(res => {
|
||||||
|
this.paychannelList = res.data || [];
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
back() {
|
back() {
|
||||||
@ -119,57 +123,34 @@ export default {
|
|||||||
},
|
},
|
||||||
async doPay() {
|
async doPay() {
|
||||||
const method = this.payMethod[0];
|
const method = this.payMethod[0];
|
||||||
if (method === 'balance') {
|
// 获取对应的 Paychannel 值
|
||||||
this.balancePay();
|
const channelMap = {
|
||||||
} else if (method === 'alipay') {
|
balance: 4,
|
||||||
this.alipayPay();
|
alipay: 2,
|
||||||
} else if (method === 'wechat') {
|
wechat: 1,
|
||||||
this.wechatPay();
|
bankcard: 3
|
||||||
}
|
};
|
||||||
},
|
const paychannel = channelMap[method];
|
||||||
// 余额支付
|
const openid = localStorage.getItem('openid') || '';
|
||||||
async balancePay() {
|
|
||||||
try {
|
try {
|
||||||
// 余额支付调用支付宝接口(实际由后端判断余额支付)
|
const res = await this.$post(`/v1/client/FOrdersClient/${this.ordernum}/pay`, {
|
||||||
const res = await this.$get(`/v1/client/FOrdersClient/${this.ordernum}/payyue`);
|
Paychannel: paychannel,
|
||||||
if (res.data) {
|
Openid: method === 'wechat' ? openid : ''
|
||||||
|
});
|
||||||
|
if (res.data && res.data.startsWith('http')) {
|
||||||
|
// 返回链接则跳转
|
||||||
location.href = res.data;
|
location.href = res.data;
|
||||||
}
|
} else if (res.status === 200) {
|
||||||
this.showPayResult = true;
|
// 余额支付成功
|
||||||
if (res.status === 200) {
|
this.$showSuccessToast(res.message || '支付成功');
|
||||||
this.$showSuccessToast('支付成功');
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.onPayCompleted();
|
this.onPayCompleted();
|
||||||
}, 1000);
|
}, 1500);
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
this.$showFailToast(err.message || '支付失败');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 支付宝支付
|
|
||||||
async alipayPay() {
|
|
||||||
try {
|
|
||||||
const res = await this.$get(`/v1/client/FOrdersClient/${this.ordernum}/payali`);
|
|
||||||
if (res.data) {
|
|
||||||
location.href = res.data;
|
|
||||||
} else if (res.data.qrcode) {
|
|
||||||
// 如果返回二维码,可以展示二维码
|
|
||||||
this.$showSuccessToast('唤起支付宝中...');
|
|
||||||
}
|
|
||||||
this.showPayResult = true;
|
|
||||||
} catch (err) {
|
|
||||||
this.$showFailToast(err.message || '支付失败');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
async wechatPay() {
|
|
||||||
try {
|
|
||||||
const res = await this.$get(`/v1/client/FOrdersClient/${this.ordernum}/paywechat`);
|
|
||||||
if (res.data.redirect) {
|
|
||||||
location.href = res.data.redirect;
|
|
||||||
}
|
}
|
||||||
this.showPayResult = true;
|
this.showPayResult = true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
this.showPayResult = false;
|
||||||
this.$showFailToast(err.message || '支付失败');
|
this.$showFailToast(err.message || '支付失败');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -98,7 +98,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.data.state);
|
// console.log(this.data.state);
|
||||||
|
|
||||||
this.ordernum = this.$route.query.ordernum;
|
this.ordernum = this.$route.query.ordernum;
|
||||||
if (this.ordernum) {
|
if (this.ordernum) {
|
||||||
|
|||||||
@ -104,7 +104,7 @@ export default {
|
|||||||
})
|
})
|
||||||
if (this.id)
|
if (this.id)
|
||||||
this.$get(`/v1/client/DShopsClient/${this.id}`).then(res => {
|
this.$get(`/v1/client/DShopsClient/${this.id}`).then(res => {
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
this.data.shop = res.data;
|
this.data.shop = res.data;
|
||||||
this.req.shopuserid = res.data.userid;
|
this.req.shopuserid = res.data.userid;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -250,14 +250,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
const code = this.$route.query.code
|
|
||||||
if (code) {
|
|
||||||
this.$post('/v1/client/AuthClient/loginwxweb', { code }).then(res => {
|
|
||||||
this.$showSuccessToast('登录成功')
|
|
||||||
}).catch(err => {
|
|
||||||
this.$showFailToast(err.message || '微信登录失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Promise.all(
|
Promise.all(
|
||||||
[
|
[
|
||||||
this.$get('/v1/client/DUsersClient').then(data => {
|
this.$get('/v1/client/DUsersClient').then(data => {
|
||||||
@ -276,7 +268,7 @@ export default {
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
this.checkWxLogin()
|
|
||||||
},
|
},
|
||||||
onShowManagerPopup() {
|
onShowManagerPopup() {
|
||||||
this.managerPopupVisible = true
|
this.managerPopupVisible = true
|
||||||
@ -284,19 +276,7 @@ export default {
|
|||||||
onCloseManagerPopup() {
|
onCloseManagerPopup() {
|
||||||
this.managerPopupVisible = false
|
this.managerPopupVisible = false
|
||||||
},
|
},
|
||||||
checkWxLogin() {
|
|
||||||
if (!this.$isWechat()) return
|
|
||||||
if (this.$route.query.code) return
|
|
||||||
this.$get('/v1/client/AuthClient/loginwxweburl', {
|
|
||||||
returnUrl: `${encodeURIComponent(window.location.href)}`
|
|
||||||
}).then(res => {
|
|
||||||
if (res.data) {
|
|
||||||
window.location.href = res.data
|
|
||||||
}
|
|
||||||
}).catch(res => {
|
|
||||||
alert(res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
logout() {
|
logout() {
|
||||||
this.$showConfirmDialog({
|
this.$showConfirmDialog({
|
||||||
title: "确认退出?",
|
title: "确认退出?",
|
||||||
|
|||||||
@ -218,12 +218,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-tabs v-model:active="active" type="card" class="tabs" color="#374c6d">
|
<van-tabs v-model:active="active" type="card" class="tabs" color="#374c6d" @change="changeTabs">
|
||||||
<van-tab title="全部"></van-tab>
|
<van-tab title="全部"></van-tab>
|
||||||
<van-tab title="礼包"></van-tab>
|
<van-tab title="礼包" name="31"></van-tab>
|
||||||
<van-tab title="商家"></van-tab>
|
<van-tab title="商家" name="34"></van-tab>
|
||||||
<van-tab title="商城"></van-tab>
|
<van-tab title="商城" name="33"></van-tab>
|
||||||
<van-tab title="分成"></van-tab>
|
<van-tab title="分成" name="32"></van-tab>
|
||||||
</van-tabs>
|
</van-tabs>
|
||||||
|
|
||||||
<BaseList ref="baselist" url="/v1/client/DUsermoneysClient" class="_m_" :params="searchParams">
|
<BaseList ref="baselist" url="/v1/client/DUsermoneysClient" class="_m_" :params="searchParams">
|
||||||
@ -310,7 +310,7 @@ export default {
|
|||||||
show: false,
|
show: false,
|
||||||
showDate: false,
|
showDate: false,
|
||||||
searchParams: {
|
searchParams: {
|
||||||
// type: 'Balance',
|
type: '',
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
month: new Date().getMonth() + 1,
|
month: new Date().getMonth() + 1,
|
||||||
},
|
},
|
||||||
@ -326,6 +326,11 @@ export default {
|
|||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$showFailToast(err.message || '加载失败');
|
this.$showFailToast(err.message || '加载失败');
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.$get('/v1/client/DUsermoneysClient/select').then(res => {
|
||||||
|
// console.log(res.data);
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onconfirm(value) {
|
onconfirm(value) {
|
||||||
this.date = this.currentDate;
|
this.date = this.currentDate;
|
||||||
@ -336,7 +341,8 @@ export default {
|
|||||||
this.$refs.baselist.refresh()
|
this.$refs.baselist.refresh()
|
||||||
},
|
},
|
||||||
changeTabs(e) {
|
changeTabs(e) {
|
||||||
this.show = false;
|
this.searchParams.type = e || '';
|
||||||
|
// this.$refs.baselist.refresh();
|
||||||
},
|
},
|
||||||
onShowTerm() {
|
onShowTerm() {
|
||||||
this.showTerm = true;
|
this.showTerm = true;
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
订单:{{ item.ordernum }}
|
订单:{{ item.ordernum }}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
时间:{{ $formatGMT(item.addtime, 'yyyy-dd-MM HH:ss') }}
|
时间:{{ $formatGMT(item.addtime, 'yyyy-dd-MM HH:mm:ss') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user