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",
"@zxing/library": "^0.21.3",
"html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"image-conversion": "^2.1.1",
"pinia": "^3.0.4",
"postcss-px-to-viewport-8-plugin": "^1.2.5",
@ -665,6 +666,15 @@
"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": {
"version": "2.9.0",
"resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.9.0.tgz",
@ -711,6 +721,15 @@
"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": {
"version": "3.2.3",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz",
@ -829,6 +848,19 @@
"integrity": "sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg==",
"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": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
@ -1643,6 +1675,15 @@
"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": {
"version": "0.2.16",
"resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.16.tgz",
@ -1825,6 +1866,15 @@
"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": {
"version": "4.9.24",
"resolved": "https://registry.npmmirror.com/vant/-/vant-4.9.24.tgz",

View File

@ -12,6 +12,7 @@
"@vant/area-data": "^2.1.0",
"@zxing/library": "^0.21.3",
"html-to-image": "^1.11.13",
"html2canvas": "^1.4.1",
"image-conversion": "^2.1.1",
"pinia": "^3.0.4",
"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>
<router-view />
</template>
<router-view v-slot="{ Component, route }">
<keep-alive :include="cacheList">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
</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 },
finishedText: { type: String, default: '没有更多了' },
parseData: { type: Function, default: (res) => res.data.items },
cacheKey: { type: String, default: '' },
},
data() {
return {
@ -34,6 +35,8 @@ export default {
page: 1,
requestId: 0,
observer: null,
_cacheKey: null,
_dataCache: null,
}
},
emits: ['update:list', 'load', 'refresh'],
@ -50,6 +53,19 @@ export default {
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() {
this.$nextTick(() => {
this.observer = new IntersectionObserver((entries) => {
@ -66,6 +82,14 @@ export default {
beforeUnmount() {
this.observer?.disconnect()
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: {
onWindowScroll() {
@ -79,6 +103,13 @@ export default {
},
loadMore() {
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
this.loading = true
const request = this.method === 'get' ? this.$get : this.$post
@ -123,6 +154,8 @@ export default {
<style scoped>
.base-list {
min-height: 200px;
display: flex;
flex-direction: column;
}
.loading-wrap {
@ -130,6 +163,20 @@ export default {
justify-content: center;
align-items: center;
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,

View File

@ -1,7 +1,8 @@
<template>
<!-- $isWechat() ? '' : title || -->
<van-nav-bar fixed :title="title || $route.meta.title" :safe-area-inset-top="true" placeholder left-arrow left-text="返回"
@click-left="back ? back() : $router.back();" :class="$isWechat() ? 'wechat-nav' : ''">
<!-- -->
<van-nav-bar fixed :title="$isWechat() ? '' : title || $route.meta.title" :safe-area-inset-top="true" placeholder
left-arrow left-text="返回" @click-left="back ? back() : $router.back();"
:class="$isWechat() ? 'wechat-nav' : ''">
<template #right>
<slot v-if="$slots.right" name="right" />
<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 }
},
{
path: '/WxCallback',
name: 'WxCallback',
component: () => import('./views/Account/WxCallback.vue'),
meta: {
noLogin: true,
}
},
{
path: '/Login',
name: 'Login',
@ -134,7 +142,7 @@ const routes = [
path: '/Invite',
name: 'Invite',
component: () => import('./views/User/Invite.vue'),
meta: { title: '邀请码' }
meta: { title: '邀请码', cache: true }
},
{
path: '/Team',
@ -176,13 +184,13 @@ const routes = [
path: '/Business_School',
name: 'Business_School',
component: () => import('./views/Platform/Business_School.vue'),
meta: { title: '商学院', noLogin: true, }
meta: { title: '商学院', noLogin: true, cache: true }
},
{
path: '/School_detail',
name: 'School_detail',
component: () => import('./views/Platform/School_Detail.vue'),
meta: { title: '商学院详情', noLogin: true, }
meta: { title: '商学院详情', noLogin: true, cache: true }
},
{
path: '/School_Category',
@ -194,19 +202,19 @@ const routes = [
path: '/Column',
name: 'Column',
component: () => import('./views/Platform/Column.vue'),
meta: { title: '栏目列表', noLogin: true, }
meta: { title: '栏目列表', noLogin: true, cache: true }
},
{
path: '/ColumnDetail',
name: 'ColumnDetail',
component: () => import('./views/Platform/ColumnDetail.vue'),
meta: { title: '栏目详情', noLogin: true, }
meta: { title: '栏目详情', noLogin: true, cache: true }
},
{
path: '/GoodsDetail',
name: 'GoodsDetail',
component: () => import('./views/Goods/GoodsDetail.vue'),
meta: { title: '商品详情' }
meta: { title: '商品详情', noLogin: true, }
},
{
path: '/Category',

View File

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

View File

@ -51,6 +51,15 @@ img {
object-fit: contain;
}
// v-html容器中img样式
.html,
.vhtml {
img {
max-width: 100%;
margin-top: 1.2vw;
}
}
[v-cloak] {
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 {
.b_l_w;
margin: 3.333vw 0;
@ -2195,6 +2213,15 @@ img {
background-color: #ffffff;
border-radius: 1.6vw;
.vhtml {
padding: 3.33vw 0;
img {
max-width: 100%;
margin-top: 1.2vw;
}
}
.tit {
.box;
.box-align-center;

View File

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

View File

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

View File

@ -13,10 +13,6 @@
<div class="line">
<div class="title">
<img src="/img/login-i1.png" alt="">
<span>账号</span>
</div>
<div class="input_box">
<input type="phone" maxlength="11" placeholder="请输入账号(手机号)" v-model="data.cellphone"
onblur="window.scrollTo(0, 0);" />
<van-icon @click="data.cellphone = ''" name="cross" size="5vw"></van-icon>
@ -26,10 +22,6 @@
<div class="line">
<div class="title">
<img src="/img/login-i2.png" alt="">
<span>验证码</span>
</div>
<div class="input_box">
<input type="text" placeholder="请输入验证码" v-model="data.code" maxlength="6"
onblur="window.scrollTo(0, 0);" />
<van-button class="hqyzm" @click="sendCode" :disabled="isSend">
@ -41,10 +33,6 @@
<div class="line">
<div class="title">
<img src="/img/login-i3.png" alt="">
<span>密码</span>
</div>
<div class="input_box">
<input :type="show1 ? 'text' : 'password'" placeholder="请输入新的登录密码" v-model="data.password"
@keydown.enter="login" onblur="window.scrollTo(0, 0);" />
<van-icon @click="show1 = true" name="eye-o" size="5vw" v-if="!show1"></van-icon>
@ -55,9 +43,6 @@
<div class="line">
<div class="title">
<img src="/img/login-i4.png" alt="">
<span>确认密码</span>
</div>
<div class="input_box">
<input :type="show2 ? 'text' : 'password'" placeholder="请再次输入登录密码" v-model="data.RePassword"
@keydown.enter="login" onblur="window.scrollTo(0, 0);" />
<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.bankcardnumber }}
</span>
<p>
<p v-if="i.bankid === 91">
2小时内到账
</p>
<p v-else>
{{ i.realname }}
</p>
</div>
</div>
</template>
@ -38,9 +41,9 @@
</div>
<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>
@ -97,8 +100,9 @@
:formatter="formatter" />
<van-field v-model="tempData.bankcardnumber" label="银行卡号" placeholder="请输入银行卡号"
:rules="[{ required: true, message: '请填写银行卡号' }]" clearable required :formatter="formatter" />
<van-field v-model="tempData.bankname" label="银行名称" placeholder="请输入银行名称"
:rules="[{ required: true, message: '请填写银行名称' }]" clearable required />
<van-field v-model="tempData.bankname" label="银行名称" placeholder="请选择银行名称"
:rules="[{ required: true, message: '请选择银行名称' }]" readonly required is-link
@click="showBankPicker = true" />
<van-field v-model="regionName" label="开户地区" placeholder="请选择开户地区"
:rules="[{ required: true, message: '请选择开户地区' }]" clearable required is-link @click="showRegion = true;"
readonly />
@ -122,6 +126,10 @@
<van-cascader v-model="region" title="请选择地区" :options="areaList" :field-names="defaultProps" @change="onChange"
@finish="onFinish" @close="showRegion = false" />
</van-popup>
<van-popup v-model:show="showBankPicker" round position="bottom">
<van-picker title="选择银行" :columns="bankColumns" @confirm="onBankConfirm" @cancel="showBankPicker = false" />
</van-popup>
</div>
</BasePage>
@ -136,20 +144,11 @@ export default {
this.init();
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() {
return {
showAddAliPayPopup: false,
showAddPopup: false,
showBankPicker: false,
tempData: {},
saving: false,
checked: 0,
@ -170,6 +169,11 @@ export default {
},
}
},
computed: {
bankColumns() {
return this.bankidGroup.map(item => ({ text: item.name, value: item.id }));
}
},
methods: {
init() {
this.$get('/v1/client/DUserbankcardsClient').then(data => {
@ -195,6 +199,14 @@ export default {
this.tempData.provid = 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 }) {
const date = selectedValues.join('-');
if (this.tempData.obj === 'certbegindate') {
@ -252,6 +264,9 @@ export default {
this.$post('/v1/client/DUserbankcardsClient', params).then(res => {
this.$showSuccessToast('添加成功');
this.tempData = {};
this.regionName = '';
this.region = '';
this.checked = 0;
this.init();
this.showAddPopup = false;
}).catch(err => {

View File

@ -1,5 +1,5 @@
<template>
<BasePage :back="back">
<BasePage>
<van-tabs class="b_l_w f5" v-model:active="activeTab" animated :sticky="true" @change="onTabChange">
<van-tab title="全部" name=""></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 => {
return specKeys.every(key => {
const spec = this.specSelect.find(s => s.name === key);
if (!spec) return false;
const specValue = this.selectedSpecs[key];
return combo.skuname === specValue;
return combo.skuname.includes(this.selectedSpecs[key]);
});
});

View File

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

View File

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

View File

@ -6,14 +6,14 @@
<!-- <img style="width: 26.4vw;" src="/img/bs-icon.png" alt=""> -->
<div style="margin-top: 3vw;" class="box box-align-center">
<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"
:title="category.name"></van-tab>
</van-tabs>
<!-- <img class="r" @click="showLeft = true" style="height: 4vw;" src="/img/filter.png" alt="filter"> -->
</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 }">
<div class="school-list" :key="item.id" @click="$navigate(`/School_Detail?id=${item.id}`)">
<div class="img">
@ -80,9 +80,7 @@ export default {
activeTab: 1,
showLeft: false,
categories: [],
params: {
pid: 1
}
_categoriesCache: null,
}
},
computed: {
@ -97,19 +95,20 @@ export default {
},
methods: {
getList() {
if (this._categoriesCache) {
this.categories = this._categoriesCache
return
}
this.$get('/v1/client/CBusinessschoolcatesClient',).then(res => {
this.categories = res.data;
// console.log(this.categories);
this._categoriesCache = res.data;
})
},
changeTab(id) {
this.activeTab = id;
this.showLeft = false;
}
},
onTabClick({ name }) {
this.$navigate(`/School_Category?id=${name}`)
},
changeTab(id) {
this.activeTab = id;
this.showLeft = false;
}
}
</script>

View File

@ -1,6 +1,6 @@
<template>
<!-- :title="currentColumn.name || '栏目列表'" -->
<BasePage title="新闻列表">
<!-- -->
<BasePage :title="currentColumn.name || '平台动态'">
<!-- <div class="column-list" v-if="currentColumn"> -->
<!-- v-if="currentColumn.ColumnType === 'list'" -->
<div class="column-list">
@ -30,9 +30,24 @@ export default {
name: 'Column',
emits: ['updateShare'],
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 => {
// console.log(data);
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() {
@ -40,6 +55,7 @@ export default {
columns: [],
articles: [],
articleList: [],
currentColumn: {},
}
},

View File

@ -31,6 +31,17 @@ export default {
}
},
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.$nextTick(() => {
this.setupImagePreview();
@ -40,6 +51,7 @@ export default {
getDetail(id) {
this.$get(`/v1/client/CNewsClient/${id}`).then(data => {
this.article = data.data;
sessionStorage.setItem(`ColumnDetail_${id}`, JSON.stringify(data.data))
}).catch(err => {
this.$showFailToast(err.message);
});

View File

@ -1,10 +1,10 @@
<template>
<BasePage :title="article.Title">
<BasePage :title="article.name">
<div class="b_l_w" style="padding: 3.333vw; border-bottom: 1px solid #ebedf0">
<span style="font-size: 24px">{{ article.name }}</span>
<div style="display: flex; justify-content: space-between; margin-top: 12px">
<span style="color: #999999">{{ article.addtime ? $formatGMT(article.addtime, 'yyyy-MM-dd') : ''
}}</span>
}}</span>
<span style="color: #999999">阅读 {{ article.click }}</span>
</div>
</div>
@ -24,9 +24,18 @@ export default {
}
},
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;
// console.log(this.article);
sessionStorage.setItem(cacheKey, JSON.stringify(res.data))
})
},
mounted() {

View File

@ -38,33 +38,21 @@
</div>
</div>
<!-- v-if="selected.id" -->
<div class="detail">
<!-- <div>
<div class="detail" v-if="selected.id">
<div v-if="selected.jifen">
<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>
<b class="r">
<!-- {{ (Number(selected.gongxianzhi) || 0)?.toFixed(2) }} -->
<span></span> 6000.00
{{ selected.jifen?.toFixed(2) }}
</b>
</div>
<div v-if="selected.huiyuanka">
<span class="title">
赠送会员卡额
</span>
<b class="r">
<span></span> {{ selected.huiyuanka?.toFixed(2) }}
</b>
</div>
</div>
@ -125,7 +113,7 @@
<!-- <van-checkbox icon-size="2.667vw" class="agreement" v-model="checked" checked-color="#85cb58">
已阅读并同意<a @click.stop="showContract = true">保供臻选商务权益礼包电子协议</a>
</van-checkbox> -->
</van-checkbox> -->
</div>
</div>
<!-- </div> -->
@ -140,7 +128,7 @@
请选择礼包产品
</div>
<b style="color: #f00;font-size: 3.2vw;">
礼包产品一经售出概不退还
礼包产品为活动产品不支持退货退款
</b>
</div>
</div>
@ -201,7 +189,7 @@
<!-- <BasePwd v-model:show="showPayPwd" :title="`交易密码`" @val="submitOrder" /> -->
<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 v-model:show="showContract" safe-area-inset-bottom title="保供臻选商务权益礼包电子协议" closeable
@ -254,7 +242,8 @@ export default {
},
methods: {
init() {
Promise.all([])
Promise.all([
])
},
onAddressConfirm(address) {
this.address.ReceiveName = address.ReceiveName;
@ -283,8 +272,17 @@ export default {
this.submitOrder();
},
onShowDetail(e) {
this.data.SpuDetail = e.SpuDetail;
this.showDetail = true;
this.$get(`/v1/client/EProsClient/${e.id}`)
.then(res => {
this.data.SpuDetail = res.data.contents;
this.showDetail = true;
})
.catch(() => {
this.$showFailToast('数据加载失败');
});
// this.data.SpuDetail = e.SpuDetail;
// this.spuid = e.id;
// this.showDetail = true;
},
onRefresh() {
this.$refs.BaseList.refresh()

View File

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

View File

@ -7,6 +7,21 @@
<b style="#d2220d">{{ data.statename }}</b>
</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">
<img :src="$file(data.proimg)">
<div class="c">
@ -25,6 +40,12 @@
</div>
</div>
<div class="_remark" v-if="data.remark">
<p>买家留言: </p>
<span class="r">
{{ data.remark || '无' }}
</span>
</div>
<div class="_detail">
<div class="p">
<p>

View File

@ -13,113 +13,85 @@
<van-tab v-for="i in tradeStates" :title="i.label" :name="String(i.value)"></van-tab>
</van-tabs>
</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">
<template #right-icon>
<van-icon name="/img/sort-search.png" @click="onSearch"></van-icon>
</template>
</van-search>
<BaseList v-if="TradeArea !== 2" ref="baseList" url="/v1/client/FOrdersClient" :params="searchParams"
:parseData="res => res.data.items" style="padding: 3.33vw;" @refresh="onRefresh">
<BaseList ref="baseList" url="/v1/client/FOrdersClient" :params="searchParams" :parseData="parseData"
style="padding: 3.33vw;" @refresh="onRefresh">
<template #default="{ item }">
<div class="list">
<div class="order_box">
<span>
订单编号:{{ item.ordernum }}
</span>
<img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt="">
</div>
<div class="goods_box">
<img :src="$file(item.proimg)" alt="">
<div class="goods_info">
<div class="tit">{{ item.proname }}</div>
<div class="spec">
<span>{{ item.proskuname }}</span>
<p>x{{ item.buynums }}</p>
</div>
<div class="concession">
<span>¥{{ item.proskusaleprice?.toFixed(2) }}</span>
<p v-if="item.discountratio">{{ item.discountratio }}%让利</p>
<!-- 买单订单 -->
<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>
<div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div>
<div class="state_box">
<b :class="'b' + item.state">
{{ item.statename }}
</b>
<div class="btn_box">
<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 v-if="item.state === 3" @click="confirmReceipt(item)">确认收货</button>
<button v-if="item.state === 0" @click="$navigate(`Pay?ordernum=${item.ordernum}`)">立即支付</button>
<div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div>
</div>
</div>
</template>
</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 class="detail_box">
<div>
<p>{{ item.ordermoney?.toFixed(2) }}</p>
<span class="dr" v-if="item.discountratio">
{{ item.discountratio }}%让利
</span>
<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>
<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 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>
<span>下单时间:</span>
<span class="r">
{{ $formatGMT(item.addtime, 'yyyy-MM-dd HH:mm:ss') }}
</span>
</template>
<!-- 商城/礼包订单 -->
<template v-else>
<div class="order_box">
<span>订单编号:{{ item.ordernum }}</span>
<img src="/img/copy_b.png" @click="$copyText(item.ordernum); $showSuccessToast('复制成功')" alt="">
</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 class="goods_box">
<img :src="$file(item.proimg)" alt="">
<div class="goods_info">
<div class="tit">{{ item.proname }}</div>
<div class="spec">
<span>{{ item.proskuname }}</span>
<p>x{{ item.buynums }}</p>
</div>
<div class="concession">
<span>¥{{ item.proskusaleprice?.toFixed(2) }}</span>
<p v-if="item.discountratio">{{ item.discountratio }}%让利</p>
</div>
</div>
</div>
</div>
<div class="price">
实付<span><b>{{ item.realmoney?.toFixed(2) }}</b></span>
</div>
<div class="state_box">
<b :class="'b' + item.state">{{ item.statename }}</b>
<div class="btn_box">
<button v-if="item.state === 0" @click="cancelTrade(item)">取消订单</button>
<button @click="$navigate(`TradeDetail?ordernum=${item.ordernum}`)">查看详情</button>
<button v-if="item.state === 3" @click="confirmReceipt(item)">确认收货</button>
<button v-if="item.state === 0" @click="$navigate(`Pay?ordernum=${item.ordernum}`)">立即支付</button>
</div>
</div>
</template>
</div>
</template>
</BaseList>
</div>
</BasePage>
</template>
@ -130,15 +102,16 @@ export default {
data() {
return {
activeTab: '',
TradeArea: Number(this.$route.query.TradeArea) || 3,
searchParams: {
TradeArea: Number(this.$route.query.TradeArea) || 0,
_initialized: false,
_searchParams: {
ordernum: '',
state: '',
mallstate: Number(this.$route.query.TradeArea) || 3,
},
tradeStates: [
],
mallList: [
{ value: 0, label: '全部订单' },
{ value: 3, label: '商城订单' },
{ value: 1, label: '礼包订单' },
{ value: 2, label: '买单订单' },
@ -146,11 +119,45 @@ export default {
}
},
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: {
TradeArea(val) {
this.searchParams.mallstate = val;
this._searchParams.state = '';
this.activeTab = '';
},
'$route.query.state': {
handler(newVal) {
@ -168,31 +175,31 @@ export default {
this.$router.push('/My')
},
onTabChange(name) {
this.searchParams.state = name;
this._searchParams.state = name;
this.$refs.baseList?.refresh();
},
changeMall(name) {
this.searchParams.mallstate = Number(name) || 3;
this.searchParams.state = '';
this.$refs.baseList?.refresh();
if (this.TradeArea !== name) {
this.TradeArea = Number(name) || 0;
}
},
onSearch() {
this.$refs.baseList?.refresh();
},
onClear() {
this.searchParams.ordernum = '';
this._searchParams.ordernum = '';
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() {
this.$get('/v1/client/FOrdersClient/orderstate').then(res => {
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) => {
this.$showFailToast(err.message || '获取订单状态失败');
});

View File

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

View File

@ -43,7 +43,7 @@
<div @click="$navigate('CV')">
<div class="t">
<img src="/img/my_w2.png" alt="">
<span>会员卡额度</span>
<span>会员卡</span>
</div>
<b>{{ data.xiaofeiquan?.toFixed(2) }}</b>
</div>
@ -85,9 +85,9 @@
<p>待收货</p>
</div>
</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">
<p>已完成</p>
<p>全部订单</p>
</div>
</div>
</div>
@ -199,7 +199,7 @@
<van-dialog v-model:show="showFollow" :closeOnClickOverlay="false" :showConfirmButton="false"
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">
<span style="color: #fff">为了更好为您提供服务<br />请长按识别二维码关注公众号</span>
</div>
@ -227,6 +227,21 @@ export default {
},
mounted() {
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() {
window.removeEventListener('showManagerPopup', this.onShowManagerPopup)
@ -251,6 +266,7 @@ export default {
hfLoading: true,
isSendCode: false,
sendCodeTime: 0,
FollowQRCode: '',
}
},
methods: {
@ -262,23 +278,21 @@ export default {
}
window.addEventListener('showManagerPopup', this.onShowManagerPopup)
window.addEventListener('closeManagerPopup', this.onCloseManagerPopup)
Promise.all(
[
this.$get('/v1/client/DUsersClient').then(data => {
// console.log(data);
this.data = data.data;
this.$ls.set('cellphone', data.data.cellphone);
this.$ls.set('userimg', data.data.userimg);
this.$ls.set('nickname', data.data.nickname);
this.$ls.set('isshop', data.data.isshop);
this.$ls.set('iscenter', data.data.col2);
this.$ls.set('user_id', data.data.id);
this.$ls.set('huiyuankaid', data.data.huiyuankaid);
this.$ls.set('user_cv', data.data.xiaofeiquan);
this.$ls.set('user_point', data.data.xiaofeijifen);
}),
]
Promise.all([
this.$get('/v1/client/DUsersClient').then(data => {
// console.log(data);
this.data = data.data;
this.$ls.set('cellphone', data.data.cellphone);
this.$ls.set('userimg', data.data.userimg);
this.$ls.set('nickname', data.data.nickname);
this.$ls.set('isshop', data.data.isshop);
this.$ls.set('iscenter', data.data.col2);
this.$ls.set('user_id', data.data.id);
this.$ls.set('huiyuankaid', data.data.huiyuankaid);
this.$ls.set('user_cv', data.data.xiaofeiquan);
this.$ls.set('user_point', data.data.xiaofeijifen);
}),
]
)
},

View File

@ -75,7 +75,8 @@
<div class="list_title">
<!-- 直推好友列表({{ 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="'拓展的商家'"></van-tab>
<van-tab :title="'我的推荐人'"></van-tab>
@ -223,7 +224,7 @@ export default {
.merchantinfo img {
width: 12vw;
height: 12vw;
border-radius: 50%;
/* border-radius: 50%; */
}
.merchantinfo .inf {

View File

@ -17,7 +17,7 @@
<div class="db">
<div class="left">
<span></span>
<span></span>
<b>{{ data.totalsum?.toFixed(2) }}</b>
</div>
@ -52,7 +52,7 @@
<template #default="{ item }">
<div class="item">
<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 v-if="item.nums > 0">增加+</span>
<span v-else>减少</span>

View File

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

View File

@ -5,7 +5,7 @@
<div class="tit">
被赠送人账号
</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>
<span class="errorinfo">{{ errorInfo }}</span>
</div>
@ -36,8 +36,8 @@
<div class="quota_box">
<div class="title">
<b>赠送</b>
<span class="r">
<b>赠送</b>
<span class="r" @click="showTerm = true">
<van-icon name="info-o" />
赠送说明
</span>
@ -52,6 +52,11 @@
</div>
</div>
</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>
<script>
@ -103,6 +108,7 @@ export default {
amount: 500.00,
checked: 'balance',
checkedCH: "余额",
showTerm: false,
left: 0,
loading: false,
toUser: { NickName: null },
@ -176,6 +182,7 @@ export default {
}).then(data => {
if (data.status === 200) {
this.$showSuccessToast('赠卡成功!')
this.$navigate('CertificateRecord')
}
}).catch(err => {
this.$showFailToast(err.message);