fix: 5.23文档修复

This commit is contained in:
chenhao 2026-05-25 15:41:09 +08:00
parent 6a20d18c12
commit 7381a330b2
34 changed files with 668 additions and 439 deletions

50
package-lock.json generated
View File

@ -11,6 +11,7 @@
"@vant/area-data": "^2.1.0", "@vant/area-data": "^2.1.0",
"@zxing/library": "^0.21.3", "@zxing/library": "^0.21.3",
"html-to-image": "^1.11.13", "html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"image-conversion": "^2.1.1", "image-conversion": "^2.1.1",
"pinia": "^3.0.4", "pinia": "^3.0.4",
"postcss-px-to-viewport-8-plugin": "^1.2.5", "postcss-px-to-viewport-8-plugin": "^1.2.5",
@ -665,6 +666,15 @@
"node": ">=0.4.0" "node": ">=0.4.0"
} }
}, },
"node_modules/base64-arraybuffer": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"license": "MIT",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/birpc": { "node_modules/birpc": {
"version": "2.9.0", "version": "2.9.0",
"resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.9.0.tgz", "resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.9.0.tgz",
@ -711,6 +721,15 @@
"url": "https://github.com/sponsors/mesqueeb" "url": "https://github.com/sponsors/mesqueeb"
} }
}, },
"node_modules/css-line-break": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
}
},
"node_modules/csstype": { "node_modules/csstype": {
"version": "3.2.3", "version": "3.2.3",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz",
@ -829,6 +848,19 @@
"integrity": "sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg==", "integrity": "sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/html2canvas": {
"version": "1.4.1",
"resolved": "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"license": "MIT",
"dependencies": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.6.3", "version": "0.6.3",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz", "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
@ -1643,6 +1675,15 @@
"url": "https://github.com/sponsors/mesqueeb" "url": "https://github.com/sponsors/mesqueeb"
} }
}, },
"node_modules/text-segmentation": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
}
},
"node_modules/tinyglobby": { "node_modules/tinyglobby": {
"version": "0.2.16", "version": "0.2.16",
"resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.16.tgz", "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.16.tgz",
@ -1825,6 +1866,15 @@
"node": "^20.19.0 || >=22.12.0" "node": "^20.19.0 || >=22.12.0"
} }
}, },
"node_modules/utrie": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"license": "MIT",
"dependencies": {
"base64-arraybuffer": "^1.0.2"
}
},
"node_modules/vant": { "node_modules/vant": {
"version": "4.9.24", "version": "4.9.24",
"resolved": "https://registry.npmmirror.com/vant/-/vant-4.9.24.tgz", "resolved": "https://registry.npmmirror.com/vant/-/vant-4.9.24.tgz",

View File

@ -12,6 +12,7 @@
"@vant/area-data": "^2.1.0", "@vant/area-data": "^2.1.0",
"@zxing/library": "^0.21.3", "@zxing/library": "^0.21.3",
"html-to-image": "^1.11.13", "html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"image-conversion": "^2.1.1", "image-conversion": "^2.1.1",
"pinia": "^3.0.4", "pinia": "^3.0.4",
"postcss-px-to-viewport-8-plugin": "^1.2.5", "postcss-px-to-viewport-8-plugin": "^1.2.5",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/img/address.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,3 +1,19 @@
<template> <template>
<router-view /> <router-view v-slot="{ Component, route }">
<keep-alive :include="cacheList">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
</template> </template>
<script>
export default {
name: 'App',
computed: {
cacheList() {
const routes = this.$router.getRoutes()
return routes.filter(r => r.meta.cache).map(r => r.name)
}
}
}
</script>

View File

@ -25,6 +25,7 @@ export default {
pageSize: { type: Number, default: 10 }, pageSize: { type: Number, default: 10 },
finishedText: { type: String, default: '没有更多了' }, finishedText: { type: String, default: '没有更多了' },
parseData: { type: Function, default: (res) => res.data.items }, parseData: { type: Function, default: (res) => res.data.items },
cacheKey: { type: String, default: '' },
}, },
data() { data() {
return { return {
@ -34,6 +35,8 @@ export default {
page: 1, page: 1,
requestId: 0, requestId: 0,
observer: null, observer: null,
_cacheKey: null,
_dataCache: null,
} }
}, },
emits: ['update:list', 'load', 'refresh'], emits: ['update:list', 'load', 'refresh'],
@ -50,6 +53,19 @@ export default {
deep: true deep: true
} }
}, },
created() {
if (this.cacheKey) {
const cached = sessionStorage.getItem(this.cacheKey)
if (cached) {
try {
const { list, page, finished, params } = JSON.parse(cached)
if (JSON.stringify(this.params) === JSON.stringify(params)) {
this._dataCache = { list, page, finished }
}
} catch (e) { }
}
}
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.observer = new IntersectionObserver((entries) => { this.observer = new IntersectionObserver((entries) => {
@ -66,6 +82,14 @@ export default {
beforeUnmount() { beforeUnmount() {
this.observer?.disconnect() this.observer?.disconnect()
window.removeEventListener('scroll', this.onWindowScroll) window.removeEventListener('scroll', this.onWindowScroll)
if (this.cacheKey && this.list.length > 0) {
sessionStorage.setItem(this.cacheKey, JSON.stringify({
list: this.list,
page: this.page,
finished: this.finished,
params: this.params
}))
}
}, },
methods: { methods: {
onWindowScroll() { onWindowScroll() {
@ -79,6 +103,13 @@ export default {
}, },
loadMore() { loadMore() {
if (this.loading) return if (this.loading) return
if (this._dataCache && this._dataCache.params && JSON.stringify(this.params) === JSON.stringify(this._dataCache.params)) {
this.list = this._dataCache.list
this.page = this._dataCache.page
this.finished = this._dataCache.finished
this.loading = false
return
}
const currentRequestId = this.requestId const currentRequestId = this.requestId
this.loading = true this.loading = true
const request = this.method === 'get' ? this.$get : this.$post const request = this.method === 'get' ? this.$get : this.$post
@ -123,6 +154,8 @@ export default {
<style scoped> <style scoped>
.base-list { .base-list {
min-height: 200px; min-height: 200px;
display: flex;
flex-direction: column;
} }
.loading-wrap { .loading-wrap {
@ -130,6 +163,20 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 20px; padding: 20px;
width: 100%;
box-sizing: border-box;
}
.loading-wrap :deep(.van-loading) {
display: inline-flex;
align-items: center;
flex-direction: row;
white-space: nowrap;
float: none !important;
}
.loading-wrap :deep(.van-loading__text) {
float: none !important;
} }
.finished-text, .finished-text,

View File

@ -1,7 +1,8 @@
<template> <template>
<!-- $isWechat() ? '' : title || --> <!-- -->
<van-nav-bar fixed :title="title || $route.meta.title" :safe-area-inset-top="true" placeholder left-arrow left-text="返回" <van-nav-bar fixed :title="$isWechat() ? '' : title || $route.meta.title" :safe-area-inset-top="true" placeholder
@click-left="back ? back() : $router.back();" :class="$isWechat() ? 'wechat-nav' : ''"> left-arrow left-text="返回" @click-left="back ? back() : $router.back();"
:class="$isWechat() ? 'wechat-nav' : ''">
<template #right> <template #right>
<slot v-if="$slots.right" name="right" /> <slot v-if="$slots.right" name="right" />
<van-icon v-else-if="!hideHome" name="wap-home-o" size="18" @click="$router.replace('/')" /> <van-icon v-else-if="!hideHome" name="wap-home-o" size="18" @click="$router.replace('/')" />

View File

@ -35,6 +35,14 @@ const routes = [
], ],
meta: { noLogin: true } meta: { noLogin: true }
}, },
{
path: '/WxCallback',
name: 'WxCallback',
component: () => import('./views/Account/WxCallback.vue'),
meta: {
noLogin: true,
}
},
{ {
path: '/Login', path: '/Login',
name: 'Login', name: 'Login',
@ -134,7 +142,7 @@ const routes = [
path: '/Invite', path: '/Invite',
name: 'Invite', name: 'Invite',
component: () => import('./views/User/Invite.vue'), component: () => import('./views/User/Invite.vue'),
meta: { title: '邀请码' } meta: { title: '邀请码', cache: true }
}, },
{ {
path: '/Team', path: '/Team',
@ -176,13 +184,13 @@ const routes = [
path: '/Business_School', path: '/Business_School',
name: 'Business_School', name: 'Business_School',
component: () => import('./views/Platform/Business_School.vue'), component: () => import('./views/Platform/Business_School.vue'),
meta: { title: '商学院', noLogin: true, } meta: { title: '商学院', noLogin: true, cache: true }
}, },
{ {
path: '/School_detail', path: '/School_detail',
name: 'School_detail', name: 'School_detail',
component: () => import('./views/Platform/School_Detail.vue'), component: () => import('./views/Platform/School_Detail.vue'),
meta: { title: '商学院详情', noLogin: true, } meta: { title: '商学院详情', noLogin: true, cache: true }
}, },
{ {
path: '/School_Category', path: '/School_Category',
@ -194,19 +202,19 @@ const routes = [
path: '/Column', path: '/Column',
name: 'Column', name: 'Column',
component: () => import('./views/Platform/Column.vue'), component: () => import('./views/Platform/Column.vue'),
meta: { title: '栏目列表', noLogin: true, } meta: { title: '栏目列表', noLogin: true, cache: true }
}, },
{ {
path: '/ColumnDetail', path: '/ColumnDetail',
name: 'ColumnDetail', name: 'ColumnDetail',
component: () => import('./views/Platform/ColumnDetail.vue'), component: () => import('./views/Platform/ColumnDetail.vue'),
meta: { title: '栏目详情', noLogin: true, } meta: { title: '栏目详情', noLogin: true, cache: true }
}, },
{ {
path: '/GoodsDetail', path: '/GoodsDetail',
name: 'GoodsDetail', name: 'GoodsDetail',
component: () => import('./views/Goods/GoodsDetail.vue'), component: () => import('./views/Goods/GoodsDetail.vue'),
meta: { title: '商品详情' } meta: { title: '商品详情', noLogin: true, }
}, },
{ {
path: '/Category', path: '/Category',

View File

@ -11,7 +11,7 @@
.b_l_w; .b_l_w;
.box; .box;
.box-wrap; .box-wrap;
padding: 24vw 0 0; padding: 12vw 0 0;
&::before { &::before {
content: ''; content: '';
@ -78,17 +78,20 @@
width: 3.73vw; width: 3.73vw;
} }
span { input {
margin-left: 2.67vw; border: none;
font-size: 4vw; flex: 1;
line-height: 6.67vw; padding: 3.33vw 1.2vw;
color: #222222; font-size: 3.47vw;
} color: #333;
width: 100%;
} }
.input_box { :-ms-input-placeholder,
.box; ::-webkit-input-placeholder,
.box-align-center; input::placeholder {
color: #999;
}
.hqyzm { .hqyzm {
.bs; .bs;
@ -102,18 +105,8 @@
} }
} }
input { .input_box {
border: none; display: none;
width: 100%;
padding: 3.33vw 0;
font-size: 3.47vw;
color: #333;
}
:-ms-input-placeholder,
::-webkit-input-placeholder,
input::placeholder {
color: #999;
} }
} }
} }
@ -322,12 +315,12 @@
.box-align-center; .box-align-center;
img { img {
width: 3.73vw; width: 4vw;
height: 3.73vw; height: 4vw;
} }
span { span {
font-size: 3.47vw; font-size: 3.67vw;
margin-left: 1.6vw; margin-left: 1.6vw;
color: #333333; color: #333333;
} }
@ -581,7 +574,7 @@
padding-top: 4.8vw; padding-top: 4.8vw;
border-radius: 2vw; border-radius: 2vw;
flex-wrap: wrap; flex-wrap: wrap;
border: solid 0.13vw #ffffff; border: solid 1px #ffffff;
.top { .top {
.box; .box;
@ -1058,7 +1051,7 @@
padding: 2.93vw 2.67vw; padding: 2.93vw 2.67vw;
background-color: #ffffff; background-color: #ffffff;
border-radius: 3.33vw; border-radius: 3.33vw;
border: solid 0.13vw #85cb58; border: solid 1px #85cb58;
} }
.choose { .choose {
@ -1069,7 +1062,7 @@
border-radius: 2vw; border-radius: 2vw;
background: url(/img/gift_bg1.png); background: url(/img/gift_bg1.png);
background-size: 100% 100%; background-size: 100% 100%;
// border: solid 0.13vw #85cb58; // border: solid 1px #85cb58;
padding: 4vw 4vw; padding: 4vw 4vw;
margin-top: 6.53vw; margin-top: 6.53vw;
width: 100%; width: 100%;
@ -1221,7 +1214,7 @@
.box-align-center; .box-align-center;
padding-bottom: 3.33vw; padding-bottom: 3.33vw;
margin-top: 3.33vw; margin-top: 3.33vw;
border-bottom: solid 0.13vw #33333380; border-bottom: solid 1px #33333380;
.img { .img {
.box; .box;
@ -2229,7 +2222,7 @@
width: 26.4vw; width: 26.4vw;
height: 26.4vw; height: 26.4vw;
border-radius: 2.67vw; border-radius: 2.67vw;
border: solid 0.13vw #f7f7f7; border: solid 1px #f7f7f7;
margin-bottom: 1.73vw; margin-bottom: 1.73vw;
} }
@ -2435,7 +2428,7 @@
// position: absolute; // position: absolute;
// left: 0; // left: 0;
// top: 0; // top: 0;
// width: 20.13vw; // width: 21px;
// height: 100%; // height: 100%;
// z-index: 1; // z-index: 1;
// background: url(/img/mall_i35.png) no-repeat; // background: url(/img/mall_i35.png) no-repeat;
@ -2477,7 +2470,7 @@
>div { >div {
padding: 0 3vw 3.6vw; padding: 0 3vw 3.6vw;
height: 100%; // height: 100%;
} }
img { img {
@ -2634,7 +2627,7 @@
height: 6.13vw; height: 6.13vw;
padding: 0 1.47vw; padding: 0 1.47vw;
border-radius: 1.07vw; border-radius: 1.07vw;
border: solid 0.13vw #222222; border: solid 1px #222222;
color: #1b1b1b; color: #1b1b1b;
p { p {
@ -3044,7 +3037,7 @@
z-index: 3; z-index: 3;
font-size: 3.33vw; font-size: 3.33vw;
margin-bottom: 4vw; margin-bottom: 4vw;
padding: 0 0.13vw; padding: 0 1px;
// color: #474747; // color: #474747;
// padding: 2.8vw 4.93vw 2.53vw 4.93vw; // padding: 2.8vw 4.93vw 2.53vw 4.93vw;
@ -3172,7 +3165,7 @@
// .item { // .item {
// margin-top: 6vw; // margin-top: 6vw;
// padding-bottom: 5.2vw; // padding-bottom: 5.2vw;
// border-bottom: 0.13vw solid #f5f5f5; // border-bottom: 1px solid #f5f5f5;
// >div { // >div {
// .box; // .box;
@ -3284,7 +3277,7 @@
width: 13.33vw; width: 13.33vw;
height: 5.33vw; height: 5.33vw;
border-radius: 0.67vw; border-radius: 0.67vw;
border: solid 0.13vw #ffffff; border: solid 1px #ffffff;
white-space: nowrap; white-space: nowrap;
img { img {
@ -3329,7 +3322,7 @@
.box; .box;
.box-align-center; .box-align-center;
border-radius: 0.67vw; border-radius: 0.67vw;
border: solid 0.13vw #ffffff; border: solid 1px #ffffff;
span { span {
color: #999999; color: #999999;
@ -3386,7 +3379,7 @@
flex-wrap: wrap; flex-wrap: wrap;
background-color: #fff5f5; background-color: #fff5f5;
border-radius: 2vw; border-radius: 2vw;
border: solid 0.13vw #fc6a39; border: solid 1px #fc6a39;
margin: 2.933vw 0; margin: 2.933vw 0;
padding: 3.867vw; padding: 3.867vw;
@ -3500,7 +3493,7 @@
height: 6.67vw; height: 6.67vw;
background: transparent; background: transparent;
border-radius: 1.07vw; border-radius: 1.07vw;
border: solid 0.13vw #000000; border: solid 1px #000000;
white-space: nowrap; white-space: nowrap;
} }
} }
@ -4838,7 +4831,7 @@
// .bs; // .bs;
b { b {
font-size: 3.73vw; font-size: 4vw;
} }
span { span {
@ -4914,9 +4907,13 @@
} }
.list_title { .list_title {
font-size: 4vw; font-size: 4vw !important;
margin: 4vw 0; margin: 4vw 0;
font-weight: bold; font-weight: bold;
.van-tab {
font-size: 4vw !important;
}
} }
.list { .list {
@ -5452,7 +5449,7 @@
width: max-content; width: max-content;
height: 4.67vw; height: 4.67vw;
border-radius: 1.33vw; border-radius: 1.33vw;
border: solid 0.13vw #e2593a; border: solid 1px #e2593a;
img { img {
height: 4.67vw; height: 4.67vw;

View File

@ -51,6 +51,15 @@ img {
object-fit: contain; object-fit: contain;
} }
// v-html容器中img样式
.html,
.vhtml {
img {
max-width: 100%;
margin-top: 1.2vw;
}
}
[v-cloak] { [v-cloak] {
display: none !important; display: none !important;
} }
@ -1734,6 +1743,15 @@ img {
} }
} }
._remark {
.box;
.box-align-center;
border-radius: 2vw;
padding: 3.333vw;
background: #fff;
margin-bottom: 4vw;
}
>button { >button {
.b_l_w; .b_l_w;
margin: 3.333vw 0; margin: 3.333vw 0;
@ -2195,6 +2213,15 @@ img {
background-color: #ffffff; background-color: #ffffff;
border-radius: 1.6vw; border-radius: 1.6vw;
.vhtml {
padding: 3.33vw 0;
img {
max-width: 100%;
margin-top: 1.2vw;
}
}
.tit { .tit {
.box; .box;
.box-align-center; .box-align-center;

View File

@ -1,94 +1,74 @@
/** /**
* HTML转图片工具 * HTML转图片工具
* 基于 html-to-image 将DOM元素转换为图片 * 基于 html2canvas 实现兼容低版本 Safari/微信
*/ */
import { toCanvas } from 'html-to-image' import html2canvas from 'html2canvas';
/** /**
* 将DOM元素转换为图片 * 将DOM元素转换为图片
* @param {string|HTMLElement} selector - DOM选择器或元素 * @param {string|HTMLElement} selector - DOM选择器或元素
* @param {Object} options - 配置选项 * @param {Object} options - 配置选项
* @param {number} [options.width] - 自定义宽度会应用到元素上
* @param {number} [options.height] - 自定义高度会应用到元素上
* @param {number} [options.canvasWidth] - 输出画布宽度
* @param {number} [options.canvasHeight] - 输出画布高度
* @param {number} [options.pixelRatio] - 像素比例默认2 * @param {number} [options.pixelRatio] - 像素比例默认2
* @param {boolean} [options.useCORS] - 是否允许跨域默认true
* @param {string} [options.format] - 图片格式'png''jpeg'默认'png' * @param {string} [options.format] - 图片格式'png''jpeg'默认'png'
* @param {number} [options.quality] - 图片质量0-1仅jpeg有效默认1.0 * @param {number} [options.quality] - 图片质量0-1仅jpeg有效默认1.0
* @returns {Promise<string>} - 返回base64图片数据URL * @returns {Promise<string>} - 返回base64图片数据URL
*/ */
export async function toDataURL(selector, options = {}) { export async function toDataURL(selector, options = {}) {
const { const {
width,
height,
canvasWidth,
canvasHeight,
pixelRatio = 2, pixelRatio = 2,
useCORS = true,
format = 'png', format = 'png',
quality = 1.0 quality = 1.0
} = options } = options;
const element = typeof selector === 'string' ? document.querySelector(selector) : selector const element = typeof selector === 'string' ? document.querySelector(selector) : selector;
if (!element) { if (!element) throw new Error('Element not found');
throw new Error('Element not found')
}
const canvasEl = await toCanvas(element, { const canvas = await html2canvas(element, {
width, scale: pixelRatio,
height, useCORS: true,
canvasWidth, allowTaint: false,
canvasHeight, backgroundColor: '#ffffff',
pixelRatio, dpi: window.devicePixelRatio * pixelRatio,
cors: useCORS, logging: false
backgroundColor: '#ffffff' });
})
const mimeType = format === 'jpeg' ? 'image/jpeg' : 'image/png' const mimeType = format === 'jpeg' ? 'image/jpeg' : 'image/png';
return canvasEl.toDataURL(mimeType, quality) return canvas.toDataURL(mimeType, quality);
} }
/** /**
* 将DOM元素转换为图片并下载 * 将DOM元素转换为图片并下载
* @param {string|HTMLElement} selector - DOM选择器或元素
* @param {string} [filename] - 下载文件名不含扩展名
* @param {Object} options - 配置选项同toDataURL
*/ */
export async function toImageDownload(selector, filename = 'download', options = {}) { export async function toImageDownload(selector, filename = 'download', options = {}) {
const dataUrl = await toDataURL(selector, options) const dataUrl = await toDataURL(selector, options);
const link = document.createElement('a');
const link = document.createElement('a') link.download = filename + '.png';
link.download = filename + '.png' link.href = dataUrl;
link.href = dataUrl document.body.appendChild(link);
document.body.appendChild(link) link.click();
link.click() document.body.removeChild(link);
document.body.removeChild(link)
} }
/** /**
* 将DOM元素转换为Blob * 转为 Blob
* @param {string|HTMLElement} selector - DOM选择器或元素
* @param {Object} options - 配置选项同toDataURL
* @returns {Promise<Blob>}
*/ */
export async function toBlob(selector, options = {}) { export function toBlob(selector, options = {}) {
const dataUrl = await toDataURL(selector, options) return new Promise(async (resolve, reject) => {
try {
const arr = dataUrl.split(',') const dataUrl = await toDataURL(selector, options);
const mime = arr[0].match(/:(.*?);/)[1] const arr = dataUrl.split(',');
const bstr = atob(arr[1]) const mime = arr[0].match(/:(.*?);/)[1];
let n = bstr.length const bstr = atob(arr[1]);
const u8arr = new Uint8Array(n) const u8arr = new Uint8Array(bstr.length);
while (n--) { for (let i = 0; i < bstr.length; i++) {
u8arr[n] = bstr.charCodeAt(n) u8arr[i] = bstr.charCodeAt(i);
} }
return new Blob([u8arr], { type: mime }) resolve(new Blob([u8arr], { type: mime }));
} catch (e) {
reject(e);
}
});
} }
export default { export default { toDataURL, toImageDownload, toBlob };
toDataURL,
toImageDownload,
toBlob
}

View File

@ -25,9 +25,6 @@
<div class="line"> <div class="line">
<div class="title"> <div class="title">
<img src="/img/login-i1.png" alt=""> <img src="/img/login-i1.png" alt="">
<span>手机号</span>
</div>
<div class="input_box">
<input type="tel" maxlength="11" :placeholder="active === 1 && !isReg ? '请输入手机号码作为账号' : '请输入手机号'" <input type="tel" maxlength="11" :placeholder="active === 1 && !isReg ? '请输入手机号码作为账号' : '请输入手机号'"
v-model="formData.Phone" /> v-model="formData.Phone" />
<van-icon v-if="formData.Phone" @click="formData.Phone = ''" name="cross" size="5vw"></van-icon> <van-icon v-if="formData.Phone" @click="formData.Phone = ''" name="cross" size="5vw"></van-icon>
@ -38,9 +35,6 @@
<div class="line" v-if="active === 1 || isReg"> <div class="line" v-if="active === 1 || isReg">
<div class="title"> <div class="title">
<img src="/img/login-i2.png" alt=""> <img src="/img/login-i2.png" alt="">
<span>验证码</span>
</div>
<div class="input_box">
<input type="text" placeholder="请输入验证码" v-model="formData.SmsCode" maxlength="6" /> <input type="text" placeholder="请输入验证码" v-model="formData.SmsCode" maxlength="6" />
<van-button class="hqyzm" @click="getSmsCode" :disabled="countdown.isCounting"> <van-button class="hqyzm" @click="getSmsCode" :disabled="countdown.isCounting">
{{ countdown.isCounting ? `已发送(${countdown.seconds}s)` : '获取验证码' }} {{ countdown.isCounting ? `已发送(${countdown.seconds}s)` : '获取验证码' }}
@ -52,9 +46,6 @@
<div class="line" v-if="active === 0 || isReg"> <div class="line" v-if="active === 0 || isReg">
<div class="title"> <div class="title">
<img src="/img/login-i3.png" alt=""> <img src="/img/login-i3.png" alt="">
<span>密码</span>
</div>
<div class="input_box">
<input :type="showPassword ? 'text' : 'password'" placeholder="请输入密码" v-model="formData.Password" <input :type="showPassword ? 'text' : 'password'" placeholder="请输入密码" v-model="formData.Password"
@keydown.enter="handleSubmit" /> @keydown.enter="handleSubmit" />
<van-icon @click="showPassword = !showPassword" :name="showPassword ? 'closed-eye' : 'eye-o'" <van-icon @click="showPassword = !showPassword" :name="showPassword ? 'closed-eye' : 'eye-o'"
@ -66,9 +57,6 @@
<div class="line" v-if="isReg"> <div class="line" v-if="isReg">
<div class="title"> <div class="title">
<img src="/img/login-i4.png" alt=""> <img src="/img/login-i4.png" alt="">
<span>确认密码</span>
</div>
<div class="input_box">
<input :type="showConfirmPassword ? 'text' : 'password'" placeholder="请确认密码" v-model="formData.RePassword" <input :type="showConfirmPassword ? 'text' : 'password'" placeholder="请确认密码" v-model="formData.RePassword"
@keydown.enter="handleSubmit" /> @keydown.enter="handleSubmit" />
<van-icon @click="showConfirmPassword = !showConfirmPassword" <van-icon @click="showConfirmPassword = !showConfirmPassword"
@ -80,9 +68,6 @@
<div class="line" v-if="isReg"> <div class="line" v-if="isReg">
<div class="title"> <div class="title">
<img src="/img/login-i5.png" alt=""> <img src="/img/login-i5.png" alt="">
<span>邀请人</span>
</div>
<div class="input_box">
<input type="text" maxlength="11" placeholder="请填写邀请人账号(选填)" v-model="formData.Recommend" /> <input type="text" maxlength="11" placeholder="请填写邀请人账号(选填)" v-model="formData.Recommend" />
<van-icon v-if="formData.Recommend" @click="formData.Recommend = ''" name="cross" size="5vw"></van-icon> <van-icon v-if="formData.Recommend" @click="formData.Recommend = ''" name="cross" size="5vw"></van-icon>
</div> </div>
@ -160,48 +145,35 @@ export default {
}, },
methods: { methods: {
init() { init() {
// code
if (sessionStorage.getItem('wx_code_processed') === '1') {
sessionStorage.removeItem('wx_code_processed')
return
}
//
if (this.$isLogin?.()) { if (this.$isLogin?.()) {
location.replace('#/') location.replace('#/')
return return
} }
if (!this.$isLogin) { //
this.$showFailToast?.('登录状态异常,请重新登录') if (this.$isWechatMini()) {
// localStorage.removeItem('member_token') wx.miniProgram.reLaunch({ url: `/pages/user/login` })
location.replace('#/Login')
return return
} }
// this.checkWxLogin(); // code code
const code = JSON.stringify(this.$route.query.code); if (this.$isWechat()) {
if (code) { if (sessionStorage.getItem('wx_callback_code')) {
alert(code) // code token + code
} else {
this.$post('/v1/client/AuthClient/loginwxweb', { code }).then(res => { this.checkWxLogin()
this.$showSuccessToast('登录成功')
if (res.data?.openid) {
localStorage.setItem('openid', res.data.openid)
} }
}).catch(err => { return
alert(JSON.stringify(err))
this.$showFailToast(err.message || '微信登录失败')
})
} }
this.$closeSkeleton?.()
}, },
checkWxLogin() { checkWxLogin() {
if (!this.$isWechat()) return if (!this.$isWechat()) return
if (this.$route.query.code) return const REDIRECT_URI = encodeURIComponent('https://m.taigurun.cn/#/WxCallback')
// console.log(window.location.href); window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdff8dd2032f1e054&redirect_uri=${REDIRECT_URI}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
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) {
@ -223,8 +195,6 @@ export default {
}, },
getSmsCode() { getSmsCode() {
if (!this.validatePhone(this.formData.Phone)) return if (!this.validatePhone(this.formData.Phone)) return
//
this.countdown.isCounting = true this.countdown.isCounting = true
this.countdown.seconds = 60 this.countdown.seconds = 60
this.countdown.timer = setInterval(() => { this.countdown.timer = setInterval(() => {
@ -235,14 +205,13 @@ export default {
clearInterval(this.countdown.timer) clearInterval(this.countdown.timer)
} }
}, 1000) }, 1000)
this.$post('/v1/client/AuthClient/sendcode', { this.$post('/v1/client/AuthClient/sendcode', {
"purpose": this.isReg ? "register" : "login", purpose: this.isReg ? 'register' : 'login',
"cellphone": this.formData.Phone cellphone: this.formData.Phone
}).then(data => { }).then(data => {
if (data.status === 200) { if (data.status === 200) {
this.$showSuccessToast?.('发送成功') this.$showSuccessToast?.('发送成功')
this.smsCode = data.data // this.smsCode = data.data
} }
}).catch(() => { }).catch(() => {
this.countdown.isCounting = false this.countdown.isCounting = false
@ -252,7 +221,6 @@ export default {
handleSubmit() { handleSubmit() {
if (!this.validatePhone(this.formData.Phone)) return if (!this.validatePhone(this.formData.Phone)) return
if (!this.validateAgreement()) return if (!this.validateAgreement()) return
if (this.isReg) { if (this.isReg) {
this.handleRegister() this.handleRegister()
} else { } else {
@ -260,8 +228,8 @@ export default {
} }
}, },
handleLogin() { handleLogin() {
//
if (this.active === 0) { if (this.active === 0) {
//
if (!this.formData.Password) { if (!this.formData.Password) {
this.$showFailToast?.('请输入密码') this.$showFailToast?.('请输入密码')
return return
@ -276,18 +244,13 @@ export default {
this.$showFailToast?.(data.message) this.$showFailToast?.(data.message)
return return
} }
const userStore = useUserStore() this.afterLogin(data.data.token)
userStore.setToken(data.data.token)
userStore.fetchUserInfo()
this.$showSuccessToast?.(data.message)
location.replace('#/My')
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
this.$showFailToast?.(err.message || '登录失败') this.$showFailToast?.(err.message || '登录失败')
}) })
} } else {
// //
else {
if (!this.formData.SmsCode) { if (!this.formData.SmsCode) {
this.$showFailToast?.('请输入验证码') this.$showFailToast?.('请输入验证码')
return return
@ -303,27 +266,57 @@ export default {
this.$showFailToast?.(data.message) this.$showFailToast?.(data.message)
return return
} }
const userStore = useUserStore() this.afterLogin(data.data.token)
userStore.setToken(data.data.token)
userStore.fetchUserInfo()
this.$showSuccessToast?.(data.message)
location.replace('#/My')
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
this.$showFailToast?.(err.message || '登录失败') this.$showFailToast?.(err.message || '登录失败')
}) })
} }
}, },
// / token openid
afterLogin(token) {
const userStore = useUserStore()
userStore.setToken(token)
userStore.fetchUserInfo()
this.bindWxOpenid(token)
},
// token + code openid
bindWxOpenid(token) {
const code = sessionStorage.getItem('wx_callback_code')
if (!code) {
this.$showSuccessToast?.('登录成功')
location.replace('#/My')
return
}
fetch(`${import.meta.env.VITE_API_URL}/v1/client/AuthClient/loginwxweb`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
body: JSON.stringify(code),
}).then(res =>
res.json()
).then(res => {
// alert(JSON.stringify(res))
sessionStorage.removeItem('wx_callback_code')
if (res.message) {
localStorage.setItem('openid', res.message)
// alert('openid' + res.message)
}
this.$showSuccessToast?.('登录成功')
location.replace('#/My')
}).catch(() => {
sessionStorage.removeItem('wx_callback_code')
this.$showSuccessToast?.('登录成功')
location.replace('#/My')
})
},
handleRegister() { handleRegister() {
if (!this.formData.SmsCode) { if (!this.formData.SmsCode) {
this.$showFailToast?.('请输入验证码') this.$showFailToast?.('请输入验证码')
return return
} }
//
// if (this.formData.SmsCode !== this.smsCode) {
// this.$showFailToast?.('')
// return
// }
if (!this.formData.Password) { if (!this.formData.Password) {
this.$showFailToast?.('请输入密码') this.$showFailToast?.('请输入密码')
return return
@ -336,7 +329,6 @@ export default {
this.$showFailToast?.('密码至少6位') this.$showFailToast?.('密码至少6位')
return return
} }
this.loading = true this.loading = true
this.$post('/v1/client/AuthClient/register', { this.$post('/v1/client/AuthClient/register', {
cellphone: this.formData.Phone, cellphone: this.formData.Phone,
@ -349,10 +341,7 @@ export default {
this.$showFailToast?.(data.message) this.$showFailToast?.(data.message)
return return
} }
const userStore = useUserStore() this.afterLogin(data.data.token)
userStore.setToken(data.data.token)
this.$showSuccessToast?.('注册成功')
location.replace('#/My')
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
this.$showFailToast?.(err.message || '注册失败') this.$showFailToast?.(err.message || '注册失败')

View File

@ -13,10 +13,6 @@
<div class="line"> <div class="line">
<div class="title"> <div class="title">
<img src="/img/login-i1.png" alt=""> <img src="/img/login-i1.png" alt="">
<span>账号</span>
</div>
<div class="input_box">
<input type="phone" maxlength="11" placeholder="请输入账号(手机号)" v-model="data.cellphone" <input type="phone" maxlength="11" placeholder="请输入账号(手机号)" v-model="data.cellphone"
onblur="window.scrollTo(0, 0);" /> onblur="window.scrollTo(0, 0);" />
<van-icon @click="data.cellphone = ''" name="cross" size="5vw"></van-icon> <van-icon @click="data.cellphone = ''" name="cross" size="5vw"></van-icon>
@ -26,10 +22,6 @@
<div class="line"> <div class="line">
<div class="title"> <div class="title">
<img src="/img/login-i2.png" alt=""> <img src="/img/login-i2.png" alt="">
<span>验证码</span>
</div>
<div class="input_box">
<input type="text" placeholder="请输入验证码" v-model="data.code" maxlength="6" <input type="text" placeholder="请输入验证码" v-model="data.code" maxlength="6"
onblur="window.scrollTo(0, 0);" /> onblur="window.scrollTo(0, 0);" />
<van-button class="hqyzm" @click="sendCode" :disabled="isSend"> <van-button class="hqyzm" @click="sendCode" :disabled="isSend">
@ -41,10 +33,6 @@
<div class="line"> <div class="line">
<div class="title"> <div class="title">
<img src="/img/login-i3.png" alt=""> <img src="/img/login-i3.png" alt="">
<span>密码</span>
</div>
<div class="input_box">
<input :type="show1 ? 'text' : 'password'" placeholder="请输入新的登录密码" v-model="data.password" <input :type="show1 ? 'text' : 'password'" placeholder="请输入新的登录密码" v-model="data.password"
@keydown.enter="login" onblur="window.scrollTo(0, 0);" /> @keydown.enter="login" onblur="window.scrollTo(0, 0);" />
<van-icon @click="show1 = true" name="eye-o" size="5vw" v-if="!show1"></van-icon> <van-icon @click="show1 = true" name="eye-o" size="5vw" v-if="!show1"></van-icon>
@ -55,9 +43,6 @@
<div class="line"> <div class="line">
<div class="title"> <div class="title">
<img src="/img/login-i4.png" alt=""> <img src="/img/login-i4.png" alt="">
<span>确认密码</span>
</div>
<div class="input_box">
<input :type="show2 ? 'text' : 'password'" placeholder="请再次输入登录密码" v-model="data.RePassword" <input :type="show2 ? 'text' : 'password'" placeholder="请再次输入登录密码" v-model="data.RePassword"
@keydown.enter="login" onblur="window.scrollTo(0, 0);" /> @keydown.enter="login" onblur="window.scrollTo(0, 0);" />
<van-icon @click="show2 = true" name="eye-o" size="5vw" v-if="!show2"></van-icon> <van-icon @click="show2 = true" name="eye-o" size="5vw" v-if="!show2"></van-icon>

View File

@ -0,0 +1,20 @@
<template></template>
<script>
export default {
name: 'WxCallback',
mounted() {
const url = new URL(window.location.href)
const code = url.searchParams.get('code')
if (code) {
sessionStorage.setItem('wx_callback_code', code)
sessionStorage.setItem('wx_code_processed', '1')
// /
this.$router.replace('/Login')
} else {
this.$router.replace('/')
}
}
}
</script>

View File

@ -14,9 +14,12 @@
{{ i.bankspname === '支付宝' ? '支付宝账号' : i.bankspname }}{{ i.bankid === 91 ? i.bankcellphone {{ i.bankspname === '支付宝' ? '支付宝账号' : i.bankspname }}{{ i.bankid === 91 ? i.bankcellphone
: i.bankcardnumber }} : i.bankcardnumber }}
</span> </span>
<p> <p v-if="i.bankid === 91">
2小时内到账 2小时内到账
</p> </p>
<p v-else>
{{ i.realname }}
</p>
</div> </div>
</div> </div>
</template> </template>
@ -38,9 +41,9 @@
</div> </div>
<div class="btn_box"> <div class="btn_box">
<button class="alipay" @click="showAddAliPayPopup = true"> <!-- <button class="alipay" @click="showAddAliPayPopup = true">
添加支付宝 添加支付宝
</button> </button> -->
<button class="bankcard" @click="showAddPopup = true"> <button class="bankcard" @click="showAddPopup = true">
添加银行卡 添加银行卡
</button> </button>
@ -97,8 +100,9 @@
:formatter="formatter" /> :formatter="formatter" />
<van-field v-model="tempData.bankcardnumber" label="银行卡号" placeholder="请输入银行卡号" <van-field v-model="tempData.bankcardnumber" label="银行卡号" placeholder="请输入银行卡号"
:rules="[{ required: true, message: '请填写银行卡号' }]" clearable required :formatter="formatter" /> :rules="[{ required: true, message: '请填写银行卡号' }]" clearable required :formatter="formatter" />
<van-field v-model="tempData.bankname" label="银行名称" placeholder="请输入银行名称" <van-field v-model="tempData.bankname" label="银行名称" placeholder="请选择银行名称"
:rules="[{ required: true, message: '请填写银行名称' }]" clearable required /> :rules="[{ required: true, message: '请选择银行名称' }]" readonly required is-link
@click="showBankPicker = true" />
<van-field v-model="regionName" label="开户地区" placeholder="请选择开户地区" <van-field v-model="regionName" label="开户地区" placeholder="请选择开户地区"
:rules="[{ required: true, message: '请选择开户地区' }]" clearable required is-link @click="showRegion = true;" :rules="[{ required: true, message: '请选择开户地区' }]" clearable required is-link @click="showRegion = true;"
readonly /> readonly />
@ -122,6 +126,10 @@
<van-cascader v-model="region" title="请选择地区" :options="areaList" :field-names="defaultProps" @change="onChange" <van-cascader v-model="region" title="请选择地区" :options="areaList" :field-names="defaultProps" @change="onChange"
@finish="onFinish" @close="showRegion = false" /> @finish="onFinish" @close="showRegion = false" />
</van-popup> </van-popup>
<van-popup v-model:show="showBankPicker" round position="bottom">
<van-picker title="选择银行" :columns="bankColumns" @confirm="onBankConfirm" @cancel="showBankPicker = false" />
</van-popup>
</div> </div>
</BasePage> </BasePage>
@ -136,20 +144,11 @@ export default {
this.init(); this.init();
this.getBankId() this.getBankId()
}, },
watch: {
'tempData.bankname': function (newVal) {
if (newVal && this.bankidGroup.length) {
const bank = this.bankidGroup.find(item => item.name.includes(newVal) || newVal.includes(item.name))
if (bank) {
this.tempData.bankid = bank.id
}
}
}
},
data() { data() {
return { return {
showAddAliPayPopup: false, showAddAliPayPopup: false,
showAddPopup: false, showAddPopup: false,
showBankPicker: false,
tempData: {}, tempData: {},
saving: false, saving: false,
checked: 0, checked: 0,
@ -170,6 +169,11 @@ export default {
}, },
} }
}, },
computed: {
bankColumns() {
return this.bankidGroup.map(item => ({ text: item.name, value: item.id }));
}
},
methods: { methods: {
init() { init() {
this.$get('/v1/client/DUserbankcardsClient').then(data => { this.$get('/v1/client/DUserbankcardsClient').then(data => {
@ -195,6 +199,14 @@ export default {
this.tempData.provid = selectedOptions[0]?.value || ''; this.tempData.provid = selectedOptions[0]?.value || '';
this.tempData.areaid = selectedOptions[1]?.value || selectedOptions[0]?.value || ''; this.tempData.areaid = selectedOptions[1]?.value || selectedOptions[0]?.value || '';
}, },
onBankConfirm({ selectedValues }) {
const bank = this.bankidGroup.find(item => item.id === selectedValues[0]);
if (bank) {
this.tempData.bankid = bank.id;
this.tempData.bankname = bank.name;
}
this.showBankPicker = false;
},
onconfirm({ selectedValues }) { onconfirm({ selectedValues }) {
const date = selectedValues.join('-'); const date = selectedValues.join('-');
if (this.tempData.obj === 'certbegindate') { if (this.tempData.obj === 'certbegindate') {
@ -252,6 +264,9 @@ export default {
this.$post('/v1/client/DUserbankcardsClient', params).then(res => { this.$post('/v1/client/DUserbankcardsClient', params).then(res => {
this.$showSuccessToast('添加成功'); this.$showSuccessToast('添加成功');
this.tempData = {}; this.tempData = {};
this.regionName = '';
this.region = '';
this.checked = 0;
this.init(); this.init();
this.showAddPopup = false; this.showAddPopup = false;
}).catch(err => { }).catch(err => {

View File

@ -1,5 +1,5 @@
<template> <template>
<BasePage :back="back"> <BasePage>
<van-tabs class="b_l_w f5" v-model:active="activeTab" animated :sticky="true" @change="onTabChange"> <van-tabs class="b_l_w f5" v-model:active="activeTab" animated :sticky="true" @change="onTabChange">
<van-tab title="全部" name=""></van-tab> <van-tab title="全部" name=""></van-tab>
<van-tab v-for="item in states" :title="item.label" :name="item.value"></van-tab> <van-tab v-for="item in states" :title="item.label" :name="item.value"></van-tab>

View File

@ -228,10 +228,7 @@ export default {
let matchedSku = this.specCombinations.find(combo => { let matchedSku = this.specCombinations.find(combo => {
return specKeys.every(key => { return specKeys.every(key => {
const spec = this.specSelect.find(s => s.name === key); return combo.skuname.includes(this.selectedSpecs[key]);
if (!spec) return false;
const specValue = this.selectedSpecs[key];
return combo.skuname === specValue;
}); });
}); });

View File

@ -1,9 +1,5 @@
<template> <template>
<router-view v-slot="{ Component, route }"> <router-view />
<keep-alive :include="cacheList">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
<van-tabbar v-model="DefaultActive" placeholder @change="changeActive" active-color="#841e36" inactive-color="#1b1b1b" <van-tabbar v-model="DefaultActive" placeholder @change="changeActive" active-color="#841e36" inactive-color="#1b1b1b"
fixed> fixed>
<van-tabbar-item v-for="item in Tabbars" :key="item.Name" :name="item.Name" :badge="getBadge(item)" :dot="item.Dot" <van-tabbar-item v-for="item in Tabbars" :key="item.Name" :name="item.Name" :badge="getBadge(item)" :dot="item.Dot"
@ -31,7 +27,7 @@ export default {
}, },
{ {
Name: 'Gift', Name: 'Gift',
Label: '商品区', Label: '礼包区',
Icon_Active: '/img/Gift_Active.png', Icon_Active: '/img/Gift_Active.png',
Icon_Inactive: '/img/Gift_Inactive.png', Icon_Inactive: '/img/Gift_Inactive.png',
}, },
@ -41,6 +37,12 @@ export default {
Icon_Active: '/img/Mall_Active.png', Icon_Active: '/img/Mall_Active.png',
Icon_Inactive: '/img/Mall_Inactive.png', Icon_Inactive: '/img/Mall_Inactive.png',
}, },
{
Name: 'PointMall',
Label: '积分区',
Icon_Active: '/img/PointMall_Active.png',
Icon_Inactive: '/img/PointMall_Inactive.png',
},
{ {
Name: 'My', Name: 'My',
Label: '我的', Label: '我的',
@ -50,12 +52,6 @@ export default {
], ],
} }
}, },
computed: {
cacheList() {
const routes = this.$router.getRoutes()
return routes.filter(r => r.meta.cache).map(r => r.name)
}
},
watch: { watch: {
'$route.path': { '$route.path': {
handler() { handler() {
@ -70,18 +66,30 @@ export default {
methods: { methods: {
updateActive() { updateActive() {
const routeName = this.$route.name const routeName = this.$route.name
if (routeName === 'PointMall') {
return
}
const tabbar = this.Tabbars.find(item => item.Name === routeName) const tabbar = this.Tabbars.find(item => item.Name === routeName)
if (tabbar) { if (tabbar) {
this.DefaultActive = tabbar.Name this.DefaultActive = tabbar.Name
} }
}, },
changeActive(name) { changeActive(name) {
if (name === 'PointMall') {
this.$showToast('暂未开放');
this.DefaultActive = this.$route.name; //
return
}
this.$router.push({ name }) this.$router.push({ name })
}, },
getBadge(item) { getBadge(item) {
return item.Badge || '' return item.Badge || ''
}, },
onTabClick(name) { onTabClick(name) {
if (name === 'PointMall') {
return
}
if (this.$route.name === name) { if (this.$route.name === name) {
// //
// this.$router.replace({ name }) // this.$router.replace({ name })

View File

@ -34,13 +34,13 @@
<div class="cc"> <div class="cc">
<div class="ll" @click="$navigate('Balance')"> <div class="ll" @click="$navigate('Balance')">
<span> <span>
可用余额<van-icon name="arrow"></van-icon> 余额<van-icon name="arrow"></van-icon>
</span> </span>
<b>{{ data.keyongyue?.toFixed(2) }}</b> <b>{{ data.keyongyue?.toFixed(2) }}</b>
</div> </div>
<div class="ll" @click="$navigate('CV')"> <div class="ll" @click="$navigate('CV')">
<span> <span>
会员卡额度<van-icon name="arrow"></van-icon> 会员卡<van-icon name="arrow"></van-icon>
</span> </span>
<b>{{ data.huiyuanka?.toFixed(2) }}</b> <b>{{ data.huiyuanka?.toFixed(2) }}</b>
</div> </div>

View File

@ -6,14 +6,14 @@
<!-- <img style="width: 26.4vw;" src="/img/bs-icon.png" alt=""> --> <!-- <img style="width: 26.4vw;" src="/img/bs-icon.png" alt=""> -->
<div style="margin-top: 3vw;" class="box box-align-center"> <div style="margin-top: 3vw;" class="box box-align-center">
<van-tabs v-model:active="activeTab" color="#ca2904" title-active-color="#ca2904" class="tabs" <van-tabs v-model:active="activeTab" color="#ca2904" title-active-color="#ca2904" class="tabs"
line-height="0.67vw" line-width="8vw" :ellipsis="false" @click-tab="changeTab(category.id)"> line-height="0.67vw" line-width="8vw" :ellipsis="false">
<van-tab v-for="category in categories" :key="category.id" :name="category.id" <van-tab v-for="category in categories" :key="category.id" :name="category.id"
:title="category.name"></van-tab> :title="category.name"></van-tab>
</van-tabs> </van-tabs>
<!-- <img class="r" @click="showLeft = true" style="height: 4vw;" src="/img/filter.png" alt="filter"> --> <!-- <img class="r" @click="showLeft = true" style="height: 4vw;" src="/img/filter.png" alt="filter"> -->
</div> </div>
</div> </div>
<BaseList :url="`/v1/client/CBusinessschoolsClient`" :params="params" class="list_item"> <BaseList cache-key="Business_School" :url="`/v1/client/CBusinessschoolsClient`" :params="params" class="list_item">
<template #default="{ item }"> <template #default="{ item }">
<div class="school-list" :key="item.id" @click="$navigate(`/School_Detail?id=${item.id}`)"> <div class="school-list" :key="item.id" @click="$navigate(`/School_Detail?id=${item.id}`)">
<div class="img"> <div class="img">
@ -80,9 +80,7 @@ export default {
activeTab: 1, activeTab: 1,
showLeft: false, showLeft: false,
categories: [], categories: [],
params: { _categoriesCache: null,
pid: 1
}
} }
}, },
computed: { computed: {
@ -97,19 +95,20 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
if (this._categoriesCache) {
this.categories = this._categoriesCache
return
}
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); this._categoriesCache = res.data;
}) })
}
},
onTabClick({ name }) {
this.$navigate(`/School_Category?id=${name}`)
}, },
changeTab(id) { changeTab(id) {
this.activeTab = id; this.activeTab = id;
this.showLeft = false; this.showLeft = false;
} }
},
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- :title="currentColumn.name || '栏目列表'" --> <!-- -->
<BasePage title="新闻列表"> <BasePage :title="currentColumn.name || '平台动态'">
<!-- <div class="column-list" v-if="currentColumn"> --> <!-- <div class="column-list" v-if="currentColumn"> -->
<!-- v-if="currentColumn.ColumnType === 'list'" --> <!-- v-if="currentColumn.ColumnType === 'list'" -->
<div class="column-list"> <div class="column-list">
@ -30,9 +30,24 @@ export default {
name: 'Column', name: 'Column',
emits: ['updateShare'], emits: ['updateShare'],
mounted() { mounted() {
const cacheKey = 'Column_articleList'
const cached = sessionStorage.getItem(cacheKey)
if (cached) {
try {
const { articleList, columnName } = JSON.parse(cached)
this.articleList = articleList
this.currentColumn.name = columnName
return
} catch (e) { }
}
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;
this.currentColumn.name = data.data.items[0].pidname;
sessionStorage.setItem(cacheKey, JSON.stringify({
articleList: this.articleList,
columnName: this.currentColumn.name
}))
}) })
}, },
data() { data() {
@ -40,6 +55,7 @@ export default {
columns: [], columns: [],
articles: [], articles: [],
articleList: [], articleList: [],
currentColumn: {},
} }
}, },

View File

@ -31,6 +31,17 @@ export default {
} }
}, },
mounted() { mounted() {
const cacheKey = `ColumnDetail_${this.id}`
const cached = sessionStorage.getItem(cacheKey)
if (cached) {
try {
this.article = JSON.parse(cached)
this.$nextTick(() => {
this.setupImagePreview();
});
return
} catch (e) {}
}
this.getDetail(this.id); this.getDetail(this.id);
this.$nextTick(() => { this.$nextTick(() => {
this.setupImagePreview(); this.setupImagePreview();
@ -40,6 +51,7 @@ export default {
getDetail(id) { getDetail(id) {
this.$get(`/v1/client/CNewsClient/${id}`).then(data => { this.$get(`/v1/client/CNewsClient/${id}`).then(data => {
this.article = data.data; this.article = data.data;
sessionStorage.setItem(`ColumnDetail_${id}`, JSON.stringify(data.data))
}).catch(err => { }).catch(err => {
this.$showFailToast(err.message); this.$showFailToast(err.message);
}); });

View File

@ -1,5 +1,5 @@
<template> <template>
<BasePage :title="article.Title"> <BasePage :title="article.name">
<div class="b_l_w" style="padding: 3.333vw; border-bottom: 1px solid #ebedf0"> <div class="b_l_w" style="padding: 3.333vw; border-bottom: 1px solid #ebedf0">
<span style="font-size: 24px">{{ article.name }}</span> <span style="font-size: 24px">{{ article.name }}</span>
<div style="display: flex; justify-content: space-between; margin-top: 12px"> <div style="display: flex; justify-content: space-between; margin-top: 12px">
@ -24,9 +24,18 @@ export default {
} }
}, },
beforeCreate() { beforeCreate() {
this.$get(`/v1/client/CBusinessschoolsClient/${this.$route.query.id}`).then(res => { const id = this.$route.query.id
const cacheKey = `School_Detail_${id}`
const cached = sessionStorage.getItem(cacheKey)
if (cached) {
try {
this.article = JSON.parse(cached)
return
} catch (e) {}
}
this.$get(`/v1/client/CBusinessschoolsClient/${id}`).then(res => {
this.article = res.data; this.article = res.data;
// console.log(this.article); sessionStorage.setItem(cacheKey, JSON.stringify(res.data))
}) })
}, },
mounted() { mounted() {

View File

@ -38,33 +38,21 @@
</div> </div>
</div> </div>
<!-- v-if="selected.id" --> <!-- v-if="selected.id" -->
<div class="detail"> <div class="detail" v-if="selected.id">
<!-- <div> <div v-if="selected.jifen">
<span class="title"> <span class="title">
购买产品数量 赠送积分数额
</span>
<span class="r">
<van-stepper v-model="value" />
</span>
</div> -->
<div>
<span class="title">
赠送积分
</span>
<b class="r"> 1980.00
<!-- {{
// (selected.saleprice * value || 0)?.toFixed(2)
}} -->
</b>
</div>
<div>
<span class="title">
赠送会员卡额度
</span> </span>
<b class="r"> <b class="r">
<!-- {{ (Number(selected.gongxianzhi) || 0)?.toFixed(2) }} --> {{ selected.jifen?.toFixed(2) }}
<span></span> 6000.00 </b>
</div>
<div v-if="selected.huiyuanka">
<span class="title">
赠送会员卡额
</span>
<b class="r">
<span></span> {{ selected.huiyuanka?.toFixed(2) }}
</b> </b>
</div> </div>
</div> </div>
@ -140,7 +128,7 @@
请选择礼包产品 请选择礼包产品
</div> </div>
<b style="color: #f00;font-size: 3.2vw;"> <b style="color: #f00;font-size: 3.2vw;">
礼包产品一经售出概不退还 礼包产品为活动产品不支持退货退款
</b> </b>
</div> </div>
</div> </div>
@ -201,7 +189,7 @@
<!-- <BasePwd v-model:show="showPayPwd" :title="`交易密码`" @val="submitOrder" /> --> <!-- <BasePwd v-model:show="showPayPwd" :title="`交易密码`" @val="submitOrder" /> -->
<van-action-sheet v-model:show="showDetail" title="权益详情" style="min-height: 60vh;padding: 3.333vw;"> <van-action-sheet v-model:show="showDetail" title="权益详情" style="min-height: 60vh;padding: 3.333vw;">
<div class="w100" v-html="data.SpuDetail"></div> <div class="w100 html" v-html="data.SpuDetail"></div>
</van-action-sheet> </van-action-sheet>
<van-action-sheet v-model:show="showContract" safe-area-inset-bottom title="保供臻选商务权益礼包电子协议" closeable <van-action-sheet v-model:show="showContract" safe-area-inset-bottom title="保供臻选商务权益礼包电子协议" closeable
@ -254,7 +242,8 @@ export default {
}, },
methods: { methods: {
init() { init() {
Promise.all([]) Promise.all([
])
}, },
onAddressConfirm(address) { onAddressConfirm(address) {
this.address.ReceiveName = address.ReceiveName; this.address.ReceiveName = address.ReceiveName;
@ -283,8 +272,17 @@ export default {
this.submitOrder(); this.submitOrder();
}, },
onShowDetail(e) { onShowDetail(e) {
this.data.SpuDetail = e.SpuDetail; this.$get(`/v1/client/EProsClient/${e.id}`)
.then(res => {
this.data.SpuDetail = res.data.contents;
this.showDetail = true; this.showDetail = true;
})
.catch(() => {
this.$showFailToast('数据加载失败');
});
// this.data.SpuDetail = e.SpuDetail;
// this.spuid = e.id;
// this.showDetail = true;
}, },
onRefresh() { onRefresh() {
this.$refs.BaseList.refresh() this.$refs.BaseList.refresh()

View File

@ -16,9 +16,10 @@
</div> </div>
<van-swipe vertical v-bind:touchable="false" class="notice-swipe" style="height: 12vw" :autoplay="3000" <van-swipe vertical v-bind:touchable="false" class="notice-swipe" style="height: 12vw" :autoplay="3000"
v-bind:show-indicators="false"> v-bind:show-indicators="false">
<van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="(group, index) in trendsGrouped" :key="index"> <van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="(group, index) in trendsGrouped"
:key="index">
<template v-for="item in group"> <template v-for="item in group">
<a @click="$navigate(`/ColumnDetail?id=${item.id}`)"> <a @click="$navigate(`/Column?pid=3`)">
<span></span>{{ item.name }} <span></span>{{ item.name }}
</a> </a>
</template> </template>
@ -29,7 +30,7 @@
<div class="column3_part"> <div class="column3_part">
<div class="p1" @click="$navigate('/ColumnDetail?id=1')"> <div class="p1" @click="$navigate('/ColumnDetail?id=1')">
<img src="/img/index-column-i1.png"> <img src="/img/index-column-i1.png">
<span>公司介绍</span> <span>平台介绍</span>
<p>了解泰古润</p> <p>了解泰古润</p>
</div> </div>
<div class="p2" @click="$navigate('/Business_School')"> <div class="p2" @click="$navigate('/Business_School')">
@ -43,7 +44,7 @@
</div> --> </div> -->
<div class="p3" @click="$navigate('/Column?pid=3')"> <div class="p3" @click="$navigate('/Column?pid=3')">
<img src="/img/index-column-i4.png"> <img src="/img/index-column-i4.png">
<span>公司动态</span> <span>平台动态</span>
<p>最新动态资讯</p> <p>最新动态资讯</p>
</div> </div>
</div> </div>

View File

@ -7,6 +7,21 @@
<b style="#d2220d">{{ data.statename }}</b> <b style="#d2220d">{{ data.statename }}</b>
</div> </div>
<div class="_address">
<div class="icon">
<img src="/img/address.png">
</div>
<div class="c">
<div class="name">
{{ data.receiptrealname }} {{ data.receiptcellphone }}
</div>
<div class="s">
<p>{{ data.receiptprovince }}{{ data.receiptcity }}{{ data.receiptcounty }}{{
data.receiptaddress }}</p>
</div>
</div>
</div>
<div class="_goods"> <div class="_goods">
<img :src="$file(data.proimg)"> <img :src="$file(data.proimg)">
<div class="c"> <div class="c">
@ -25,6 +40,12 @@
</div> </div>
</div> </div>
<div class="_remark" v-if="data.remark">
<p>买家留言: </p>
<span class="r">
{{ data.remark || '无' }}
</span>
</div>
<div class="_detail"> <div class="_detail">
<div class="p"> <div class="p">
<p> <p>

View File

@ -13,27 +13,57 @@
<van-tab v-for="i in tradeStates" :title="i.label" :name="String(i.value)"></van-tab> <van-tab v-for="i in tradeStates" :title="i.label" :name="String(i.value)"></van-tab>
</van-tabs> </van-tabs>
</div> </div>
<van-search v-model="searchParams.ordernum" left-icon=" " shape="round" placeholder="输入订单号搜索" @search="onSearch" <van-search v-model="_searchParams.ordernum" left-icon=" " shape="round" placeholder="输入订单号搜索" @search="onSearch"
@clear="onClear"> @clear="onClear">
<template #right-icon> <template #right-icon>
<van-icon name="/img/sort-search.png" @click="onSearch"></van-icon> <van-icon name="/img/sort-search.png" @click="onSearch"></van-icon>
</template> </template>
</van-search> </van-search>
<BaseList v-if="TradeArea !== 2" ref="baseList" url="/v1/client/FOrdersClient" :params="searchParams" <BaseList ref="baseList" url="/v1/client/FOrdersClient" :params="searchParams" :parseData="parseData"
:parseData="res => res.data.items" style="padding: 3.33vw;" @refresh="onRefresh"> style="padding: 3.33vw;" @refresh="onRefresh">
<template #default="{ item }"> <template #default="{ item }">
<div class="list"> <div class="list">
<!-- 买单订单 -->
<template v-if="item.shopname">
<div class="merchant_info">
<img class="icon" :src="$file(item.shopimg)" alt="">
<div class="inf">
<span>{{ item.shopname }}</span>
<div>
<p>{{ item.ordermoney?.toFixed(2) }}</p>
<span class="dr" v-if="item.discountratio">{{ item.discountratio }}%让利</span>
</div>
</div>
</div>
<div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div>
<div class="detail_box">
<div>
<span>订单编号:</span>
<span class="r">{{ item.ordernum }}<img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt=""></span>
</div>
<div>
<span>下单时间:</span>
<span class="r">{{ $formatGMT(item.addtime, 'yyyy-MM-dd HH:mm:ss') }}</span>
</div>
</div>
<div class="state_box">
<b :class="'b' + item.state">{{ item.statename }}</b>
<div class="btn_box">
<button @click="$navigate(`MerchantTradeDetail?id=${item.ordernum}&type=user`)">查看详情</button>
</div>
</div>
</template>
<!-- 商城/礼包订单 -->
<template v-else>
<div class="order_box"> <div class="order_box">
<span> <span>订单编号:{{ item.ordernum }}</span>
订单编号:{{ item.ordernum }}
</span>
<img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt=""> <img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt="">
</div> </div>
<div class="goods_box"> <div class="goods_box">
<img :src="$file(item.proimg)" alt=""> <img :src="$file(item.proimg)" alt="">
<div class="goods_info"> <div class="goods_info">
<div class="tit">{{ item.proname }}</div> <div class="tit">{{ item.proname }}</div>
<div class="spec"> <div class="spec">
@ -46,80 +76,22 @@
</div> </div>
</div> </div>
</div> </div>
<div class="price"> <div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span> 实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div> </div>
<div class="state_box"> <div class="state_box">
<b :class="'b' + item.state"> <b :class="'b' + item.state">{{ item.statename }}</b>
{{ item.statename }}
</b>
<div class="btn_box"> <div class="btn_box">
<button v-if="item.state === 0" @click="cancelTrade(item)">取消订单</button> <button v-if="item.state === 0" @click="cancelTrade(item)">取消订单</button>
<!-- <button v-if="item.state === 3">查看物流</button> -->
<button @click="$navigate(`TradeDetail?ordernum=${item.ordernum}`)">查看详情</button> <button @click="$navigate(`TradeDetail?ordernum=${item.ordernum}`)">查看详情</button>
<button v-if="item.state === 3" @click="confirmReceipt(item)">确认收货</button> <button v-if="item.state === 3" @click="confirmReceipt(item)">确认收货</button>
<button v-if="item.state === 0" @click="$navigate(`Pay?ordernum=${item.ordernum}`)">立即支付</button> <button v-if="item.state === 0" @click="$navigate(`Pay?ordernum=${item.ordernum}`)">立即支付</button>
</div> </div>
</div> </div>
</template>
</div> </div>
</template> </template>
</BaseList> </BaseList>
<BaseList v-else ref="baseList" url="/v1/client/FOrdersshopClient" :params="searchParams"
:parseData="res => res.data.items" style="padding: 3.33vw;" @refresh="onRefresh">
<template #default="{ item }">
<div class="list">
<div class="merchant_info">
<img class="icon" :src="$file(item.shopimg)" alt="">
<div class="inf">
<span>{{ item.shopname }}</span>
<div>
<p>{{ item.ordermoney?.toFixed(2) }}</p>
<span class="dr" v-if="item.discountratio">
{{ item.discountratio }}%让利
</span>
</div>
</div>
</div>
<div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div>
<div class="detail_box">
<div>
<span>订单编号:</span>
<span class="r">
{{ item.ordernum }}
<img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt="">
</span>
</div>
<div>
<span>下单时间:</span>
<span class="r">
{{ $formatGMT(item.addtime, 'yyyy-MM-dd HH:mm:ss') }}
</span>
</div>
</div>
<div class="state_box">
<b :class="'b' + item.state">
{{ item.statename }}
</b>
<div class="btn_box">
<button @click="$navigate(`MerchantTradeDetail?id=${item.ordernum}&type=user`)">查看详情</button>
</div>
</div>
</div>
</template>
</BaseList>
</div> </div>
</BasePage> </BasePage>
</template> </template>
@ -130,15 +102,16 @@ export default {
data() { data() {
return { return {
activeTab: '', activeTab: '',
TradeArea: Number(this.$route.query.TradeArea) || 3, TradeArea: Number(this.$route.query.TradeArea) || 0,
searchParams: { _initialized: false,
_searchParams: {
ordernum: '', ordernum: '',
state: '', state: '',
mallstate: Number(this.$route.query.TradeArea) || 3,
}, },
tradeStates: [ tradeStates: [
], ],
mallList: [ mallList: [
{ value: 0, label: '全部订单' },
{ value: 3, label: '商城订单' }, { value: 3, label: '商城订单' },
{ value: 1, label: '礼包订单' }, { value: 1, label: '礼包订单' },
{ value: 2, label: '买单订单' }, { value: 2, label: '买单订单' },
@ -146,11 +119,45 @@ export default {
} }
}, },
mounted() { mounted() {
this.getTradeStates(); Promise.all([
this.$get('/v1/client/FOrdersClient/orderstate'),
this.$get('/v1/client/EProsClient/mallstate')
]).then(([stateRes, areaRes]) => {
this.tradeStates = stateRes.data;
this.mallList = [{ value: 0, label: '全部订单' }, ...(areaRes.data || [])];
this._initialized = true;
this.$refs.baseList?.refresh();
const stateFromRoute = this.$route.query.state;
if (stateFromRoute !== undefined && stateFromRoute !== '') {
this.activeTab = String(stateFromRoute);
this._searchParams.state = stateFromRoute;
}
}).catch((err) => {
this.$showFailToast(err.message || '加载失败');
});
},
computed: {
parseData() {
return res => res.data.items;
},
parseData2() {
return res => res.data.items;
},
searchParams() {
const params = {
ordernum: this._searchParams.ordernum,
state: this._searchParams.state,
};
if (this.TradeArea !== 0) {
params.mallstate = this.TradeArea;
}
return params;
}
}, },
watch: { watch: {
TradeArea(val) { TradeArea(val) {
this.searchParams.mallstate = val; this._searchParams.state = '';
this.activeTab = '';
}, },
'$route.query.state': { '$route.query.state': {
handler(newVal) { handler(newVal) {
@ -168,31 +175,31 @@ export default {
this.$router.push('/My') this.$router.push('/My')
}, },
onTabChange(name) { onTabChange(name) {
this.searchParams.state = name; this._searchParams.state = name;
this.$refs.baseList?.refresh(); this.$refs.baseList?.refresh();
}, },
changeMall(name) { changeMall(name) {
this.searchParams.mallstate = Number(name) || 3; if (this.TradeArea !== name) {
this.searchParams.state = ''; this.TradeArea = Number(name) || 0;
this.$refs.baseList?.refresh(); }
}, },
onSearch() { onSearch() {
this.$refs.baseList?.refresh(); this.$refs.baseList?.refresh();
}, },
onClear() { onClear() {
this.searchParams.ordernum = ''; this._searchParams.ordernum = '';
this.$refs.baseList?.refresh(); this.$refs.baseList?.refresh();
}, },
getTradeAreas() {
this.$get('/v1/client/EProsClient/mallstate').then(res => {
this.mallList = [{ value: 0, label: '全部订单' }, ...(res.data || [])];
}).catch((err) => {
this.$showFailToast(err.message || '获取订单类型失败');
});
},
getTradeStates() { getTradeStates() {
this.$get('/v1/client/FOrdersClient/orderstate').then(res => { this.$get('/v1/client/FOrdersClient/orderstate').then(res => {
this.tradeStates = res.data; this.tradeStates = res.data;
this.$nextTick(() => {
const stateFromRoute = this.$route.query.state;
if (stateFromRoute !== undefined && stateFromRoute !== '') {
this.activeTab = String(stateFromRoute);
this.searchParams.state = stateFromRoute;
}
});
}).catch((err) => { }).catch((err) => {
this.$showFailToast(err.message || '获取订单状态失败'); this.$showFailToast(err.message || '获取订单状态失败');
}); });

View File

@ -10,9 +10,8 @@
<img class="icon" :src="$file(data.Avatar) + '?t=1'" crossorigin="anonymous"> <img class="icon" :src="$file(data.Avatar) + '?t=1'" crossorigin="anonymous">
<div class="name"> <div class="name">
<b>{{ $substring(data.NickName, 0, 8) }}</b> <b>{{ $substring(data.NickName, 0, 8) }}</b>
<p>邀请你使用泰古润平台<br>
共赴葡园品鉴醇香</p>
</div> </div>
<p class="tips">邀请你使用泰古润平台<br>积分带卡消费享受更多实惠</p>
<div class="ewm_test box box-tb box-align-center"> <div class="ewm_test box box-tb box-align-center">
<vue-qr v-if="!loading" :text="link" backgroundColor="rgb(255,255,255)" <vue-qr v-if="!loading" :text="link" backgroundColor="rgb(255,255,255)"
colorLight="rgb(255,255,255)"></vue-qr> colorLight="rgb(255,255,255)"></vue-qr>
@ -152,19 +151,23 @@ export default {
.name { .name {
position: absolute; position: absolute;
left: 20.27vw; left: 34vw;
bottom: 23.6vw; bottom: 46vw;
line-height: 6vw; // line-height: 6vw;
width: 100%; width: 100%;
b { b {
font-size: 3.47vw; font-size: 3.47vw;
color: #3a0a05;
} }
p {
font-size: 3.2vw;
} }
.tips {
font-size: 3.2vw;
color: #3a0a05;
position: absolute;
left: 20.27vw;
bottom: 34vw;
} }
.icon { .icon {

View File

@ -43,7 +43,7 @@
<div @click="$navigate('CV')"> <div @click="$navigate('CV')">
<div class="t"> <div class="t">
<img src="/img/my_w2.png" alt=""> <img src="/img/my_w2.png" alt="">
<span>会员卡额度</span> <span>会员卡</span>
</div> </div>
<b>{{ data.xiaofeiquan?.toFixed(2) }}</b> <b>{{ data.xiaofeiquan?.toFixed(2) }}</b>
</div> </div>
@ -85,9 +85,9 @@
<p>待收货</p> <p>待收货</p>
</div> </div>
</van-badge> </van-badge>
<div class="st_box" @click="$navigate(`TradeList?TradeArea=3&state=4`)"> <div class="st_box" @click="$navigate(`TradeList?TradeArea=0`)">
<img src="/img/my_o4.png"> <img src="/img/my_o4.png">
<p>已完成</p> <p>全部订单</p>
</div> </div>
</div> </div>
</div> </div>
@ -199,7 +199,7 @@
<van-dialog v-model:show="showFollow" :closeOnClickOverlay="false" :showConfirmButton="false" <van-dialog v-model:show="showFollow" :closeOnClickOverlay="false" :showConfirmButton="false"
style="background: transparent; display: flex; align-items: center; flex-direction: column;"> style="background: transparent; display: flex; align-items: center; flex-direction: column;">
<img :src="$file(data.FollowQRCode)" style="width: 60vw" /> <img :src="$file(FollowQRCode)" style="width: 60vw" />
<div style="margin: 3.333vw 0"> <div style="margin: 3.333vw 0">
<span style="color: #fff">为了更好为您提供服务<br />请长按识别二维码关注公众号</span> <span style="color: #fff">为了更好为您提供服务<br />请长按识别二维码关注公众号</span>
</div> </div>
@ -227,6 +227,21 @@ export default {
}, },
mounted() { mounted() {
this.init(); this.init();
this.$get('/v1/client/HWxinfoClient/qrcode').then(res => {
this.FollowQRCode = res.data;
});
if (this.$isWechat()) {
// alert(localStorage.getItem('openid'))
this.$get(`/v1/client/DUsersClient/subscribe?openid=${localStorage.getItem('openid')}`).then(res => {
// alert(JSON.stringify(res))
if (res.data === false) {
this.showFollow = true;
}
}).catch(() => { });
// this.showFollow = true;
}
window.addEventListener('showManagerPopup', this.onShowManagerPopup)
window.addEventListener('closeManagerPopup', this.onCloseManagerPopup)
}, },
beforeUnmount() { beforeUnmount() {
window.removeEventListener('showManagerPopup', this.onShowManagerPopup) window.removeEventListener('showManagerPopup', this.onShowManagerPopup)
@ -251,6 +266,7 @@ export default {
hfLoading: true, hfLoading: true,
isSendCode: false, isSendCode: false,
sendCodeTime: 0, sendCodeTime: 0,
FollowQRCode: '',
} }
}, },
methods: { methods: {
@ -262,8 +278,7 @@ export default {
} }
window.addEventListener('showManagerPopup', this.onShowManagerPopup) window.addEventListener('showManagerPopup', this.onShowManagerPopup)
window.addEventListener('closeManagerPopup', this.onCloseManagerPopup) window.addEventListener('closeManagerPopup', this.onCloseManagerPopup)
Promise.all( Promise.all([
[
this.$get('/v1/client/DUsersClient').then(data => { this.$get('/v1/client/DUsersClient').then(data => {
// console.log(data); // console.log(data);
this.data = data.data; this.data = data.data;
@ -276,7 +291,6 @@ export default {
this.$ls.set('huiyuankaid', data.data.huiyuankaid); this.$ls.set('huiyuankaid', data.data.huiyuankaid);
this.$ls.set('user_cv', data.data.xiaofeiquan); this.$ls.set('user_cv', data.data.xiaofeiquan);
this.$ls.set('user_point', data.data.xiaofeijifen); this.$ls.set('user_point', data.data.xiaofeijifen);
}), }),
] ]
) )

View File

@ -75,7 +75,8 @@
<div class="list_title"> <div class="list_title">
<!-- 直推好友列表({{ total.TotalCount }}) --> <!-- 直推好友列表({{ total.TotalCount }}) -->
<van-tabs v-model:active="active" background="transparent" color="#ad9573"> <van-tabs v-model:active="active" background="transparent" color="#ad9573" style="font-size: 4vw;"
font-size="4vw">
<van-tab :title="'分享的好友(' + total.friendcount + ')'"></van-tab> <van-tab :title="'分享的好友(' + total.friendcount + ')'"></van-tab>
<van-tab :title="'拓展的商家'"></van-tab> <van-tab :title="'拓展的商家'"></van-tab>
<van-tab :title="'我的推荐人'"></van-tab> <van-tab :title="'我的推荐人'"></van-tab>
@ -223,7 +224,7 @@ export default {
.merchantinfo img { .merchantinfo img {
width: 12vw; width: 12vw;
height: 12vw; height: 12vw;
border-radius: 50%; /* border-radius: 50%; */
} }
.merchantinfo .inf { .merchantinfo .inf {

View File

@ -17,7 +17,7 @@
<div class="db"> <div class="db">
<div class="left"> <div class="left">
<span></span> <span></span>
<b>{{ data.totalsum?.toFixed(2) }}</b> <b>{{ data.totalsum?.toFixed(2) }}</b>
</div> </div>
@ -52,7 +52,7 @@
<template #default="{ item }"> <template #default="{ item }">
<div class="item"> <div class="item">
<div class="t"> <div class="t">
<span class="tit">当前{{ item.balance?.toFixed(2) }}</span> <span class="tit">当前{{ item.balance?.toFixed(2) }}</span>
<span :class="item.nums > 0 ? 'in' : 'out'" class="r"> <span :class="item.nums > 0 ? 'in' : 'out'" class="r">
<span v-if="item.nums > 0">增加+</span> <span v-if="item.nums > 0">增加+</span>
<span v-else>减少</span> <span v-else>减少</span>

View File

@ -22,7 +22,7 @@
已核销 已核销
</span> </span>
<span class="r pre" v-else> <span class="r pre" v-else>
增送额度<b style="color: f00;">500.00</b> 赠送金额 <b style="color: f00;">500.00</b>
</span> </span>
</div> </div>
<div class="info_box"> <div class="info_box">

View File

@ -5,7 +5,7 @@
<div class="tit"> <div class="tit">
被赠送人账号 被赠送人账号
</div> </div>
<input v-model="cellphone" type="text" maxlength="11" @blur="checkExists" placeholder="请输入被赠送人ID"> <input v-model="cellphone" type="text" maxlength="11" @blur="checkExists" placeholder="请输入被赠送人手机号">
<hr> <hr>
<span class="errorinfo">{{ errorInfo }}</span> <span class="errorinfo">{{ errorInfo }}</span>
</div> </div>
@ -36,8 +36,8 @@
<div class="quota_box"> <div class="quota_box">
<div class="title"> <div class="title">
<b>赠送</b> <b>赠送</b>
<span class="r"> <span class="r" @click="showTerm = true">
<van-icon name="info-o" /> <van-icon name="info-o" />
赠送说明 赠送说明
</span> </span>
@ -52,6 +52,11 @@
</div> </div>
</div> </div>
</BasePage> </BasePage>
<van-action-sheet v-model:show="showTerm" safe-area-inset-bottom :title="`${this.$route.meta.title}说明`" closeable
style="min-height: 50%; padding: 0px 10px 10px 10px">
<div class="w100 html" v-html="$datadic.getContent('code_hykzssm')" />
</van-action-sheet>
</template> </template>
<script> <script>
@ -103,6 +108,7 @@ export default {
amount: 500.00, amount: 500.00,
checked: 'balance', checked: 'balance',
checkedCH: "余额", checkedCH: "余额",
showTerm: false,
left: 0, left: 0,
loading: false, loading: false,
toUser: { NickName: null }, toUser: { NickName: null },
@ -176,6 +182,7 @@ export default {
}).then(data => { }).then(data => {
if (data.status === 200) { if (data.status === 200) {
this.$showSuccessToast('赠卡成功!') this.$showSuccessToast('赠卡成功!')
this.$navigate('CertificateRecord')
} }
}).catch(err => { }).catch(err => {
this.$showFailToast(err.message); this.$showFailToast(err.message);