save
This commit is contained in:
parent
1585a8c74b
commit
a496b528c3
Binary file not shown.
|
Before Width: | Height: | Size: 593 KiB |
BIN
public/img/point.png
Normal file
BIN
public/img/point.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 649 B |
BIN
public/img/pointmall_bg.jpg
Normal file
BIN
public/img/pointmall_bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@ -18,7 +18,7 @@ const routes = [
|
|||||||
path: '/Gift',
|
path: '/Gift',
|
||||||
name: 'Gift',
|
name: 'Gift',
|
||||||
component: () => import('./views/Tabbars/Gift.vue'),
|
component: () => import('./views/Tabbars/Gift.vue'),
|
||||||
meta: { title: '礼品区', cache: true }
|
meta: { title: '礼包区', cache: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Mall',
|
path: '/Mall',
|
||||||
@ -26,6 +26,12 @@ const routes = [
|
|||||||
component: () => import('./views/Tabbars/Mall.vue'),
|
component: () => import('./views/Tabbars/Mall.vue'),
|
||||||
meta: { title: '商城', cache: true }
|
meta: { title: '商城', cache: true }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/PointMall',
|
||||||
|
name: 'PointMall',
|
||||||
|
component: () => import('./views/Tabbars/PointMall.vue'),
|
||||||
|
meta: { title: '积分区', cache: true }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/My',
|
path: '/My',
|
||||||
name: 'My',
|
name: 'My',
|
||||||
@ -184,13 +190,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, cache: true }
|
meta: { title: '商学院', noLogin: 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, cache: true }
|
meta: { title: '商学院详情', noLogin: true, }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/School_Category',
|
path: '/School_Category',
|
||||||
@ -202,13 +208,13 @@ 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, cache: true }
|
meta: { title: '栏目列表', noLogin: 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, cache: true }
|
meta: { title: '栏目详情', noLogin: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/GoodsDetail',
|
path: '/GoodsDetail',
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { get } from '@/api/http'
|
import { get } from '@/api/http'
|
||||||
|
|
||||||
// Module level cache for quick access
|
|
||||||
export let dictCache = {}
|
export let dictCache = {}
|
||||||
|
|
||||||
|
const SESSION_KEY = 'dict_cache'
|
||||||
|
|
||||||
export const useDatadicStore = defineStore('datadic', {
|
export const useDatadicStore = defineStore('datadic', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
dicts: {},
|
dicts: {},
|
||||||
@ -20,6 +21,18 @@ export const useDatadicStore = defineStore('datadic', {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async init() {
|
async init() {
|
||||||
|
// 优先从 sessionStorage 读取缓存
|
||||||
|
const cached = sessionStorage.getItem(SESSION_KEY)
|
||||||
|
if (cached) {
|
||||||
|
try {
|
||||||
|
dictCache = JSON.parse(cached)
|
||||||
|
this.dicts = dictCache
|
||||||
|
this.loaded = true
|
||||||
|
return
|
||||||
|
} catch (e) {
|
||||||
|
sessionStorage.removeItem(SESSION_KEY)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.loaded) return
|
if (this.loaded) return
|
||||||
try {
|
try {
|
||||||
const res = await get('/v1/client/CDatadicsClient')
|
const res = await get('/v1/client/CDatadicsClient')
|
||||||
@ -29,6 +42,7 @@ export const useDatadicStore = defineStore('datadic', {
|
|||||||
})
|
})
|
||||||
this.dicts = dictCache
|
this.dicts = dictCache
|
||||||
this.loaded = true
|
this.loaded = true
|
||||||
|
sessionStorage.setItem(SESSION_KEY, JSON.stringify(dictCache))
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('数据字典加载失败', e)
|
console.error('数据字典加载失败', e)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { post } from '@/api/http';
|
import { get } from '@/api/http';
|
||||||
|
|
||||||
export const useUserStore = defineStore('user', {
|
export const useUserStore = defineStore('user', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
@ -64,7 +64,7 @@ export const useUserStore = defineStore('user', {
|
|||||||
*/
|
*/
|
||||||
async fetchUserInfo() {
|
async fetchUserInfo() {
|
||||||
try {
|
try {
|
||||||
const res = await post('/v1/client/UserClient/info');
|
const res = await get('/v1/client/DUsersClient');
|
||||||
if (res.status === 200 && res.data) {
|
if (res.status === 200 && res.data) {
|
||||||
this.setUser(res.data);
|
this.setUser(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -384,10 +384,17 @@
|
|||||||
|
|
||||||
.fast_to {
|
.fast_to {
|
||||||
.box;
|
.box;
|
||||||
|
.box-tb;
|
||||||
.box-pack-between;
|
.box-pack-between;
|
||||||
flex-wrap: wrap;
|
width: 100%;
|
||||||
gap: 2.4vw;
|
gap: 2.4vw;
|
||||||
|
|
||||||
|
>div {
|
||||||
|
.box;
|
||||||
|
gap: 2.4vw;
|
||||||
|
// margin-bottom: 2.4vw;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 44.8vw;
|
width: 44.8vw;
|
||||||
height: 17.33vw;
|
height: 17.33vw;
|
||||||
@ -2073,6 +2080,7 @@
|
|||||||
.banner img {
|
.banner img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 3.07vw;
|
margin-top: 3.07vw;
|
||||||
|
border-radius: 2.2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label_box {
|
.label_box {
|
||||||
@ -2146,6 +2154,7 @@
|
|||||||
img {
|
img {
|
||||||
margin: 3.33vw 0 1.87vw;
|
margin: 3.33vw 0 1.87vw;
|
||||||
height: 14.4vw;
|
height: 14.4vw;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2457,6 +2466,7 @@
|
|||||||
.box;
|
.box;
|
||||||
.box-pack-between;
|
.box-pack-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
.good {
|
.good {
|
||||||
|
|||||||
@ -894,6 +894,29 @@ img {
|
|||||||
padding-bottom: 2.53vw;
|
padding-bottom: 2.53vw;
|
||||||
border-bottom: 1px solid #f5f5f580;
|
border-bottom: 1px solid #f5f5f580;
|
||||||
|
|
||||||
|
.state {
|
||||||
|
.box;
|
||||||
|
.box-center-center;
|
||||||
|
.bs;
|
||||||
|
height: 4.67vw;
|
||||||
|
padding: 0 1.2vw;
|
||||||
|
border-radius: 1.07vw;
|
||||||
|
margin-right: 1.2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state1 {
|
||||||
|
background-color: #2990f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state3 {
|
||||||
|
background-color: #ea4747;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.state4 {
|
||||||
|
background-color: #229427;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 3.2vw;
|
width: 3.2vw;
|
||||||
height: 3.2vw;
|
height: 3.2vw;
|
||||||
@ -903,6 +926,7 @@ img {
|
|||||||
|
|
||||||
.goods_box {
|
.goods_box {
|
||||||
.box;
|
.box;
|
||||||
|
.box-align-center;
|
||||||
margin-top: 2.8vw;
|
margin-top: 2.8vw;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
@ -914,9 +938,9 @@ img {
|
|||||||
.goods_info {
|
.goods_info {
|
||||||
.box;
|
.box;
|
||||||
.box-tb;
|
.box-tb;
|
||||||
.box-pack-around;
|
.box-pack-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 21.33vw;
|
height: 18.33vw;
|
||||||
|
|
||||||
|
|
||||||
>div {
|
>div {
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 用户协议 -->
|
<!-- 用户协议 -->
|
||||||
<van-checkbox icon-size="2.667vw" class="agreement" v-model="checked" checked-color="#841e36">
|
<van-checkbox icon-size="3.2vw" class="agreement" v-model="checked" checked-color="#841e36">
|
||||||
选中即代表同意<a @click.stop="showContract = true">《用户协议》</a>和<a @click.stop="showPolicy = true">《隐私政策》</a>
|
选中即代表同意<a @click.stop="showContract = true">《用户协议》</a>和<a @click.stop="showPolicy = true">《隐私政策》</a>
|
||||||
</van-checkbox>
|
</van-checkbox>
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ export default {
|
|||||||
this.formData.Recommend = inviteCode;
|
this.formData.Recommend = inviteCode;
|
||||||
localStorage.setItem('recommend', inviteCode);
|
localStorage.setItem('recommend', inviteCode);
|
||||||
// 有邀请码时自动切换到注册模式
|
// 有邀请码时自动切换到注册模式
|
||||||
this.isReg = true;
|
// this.isReg = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
|
|||||||
@ -6,12 +6,12 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
const url = new URL(window.location.href)
|
const url = new URL(window.location.href)
|
||||||
const code = url.searchParams.get('code')
|
const code = url.searchParams.get('code')
|
||||||
|
const inviteCode = url.searchParams.get('invite')
|
||||||
|
|
||||||
if (code) {
|
if (code) {
|
||||||
sessionStorage.setItem('wx_callback_code', code)
|
sessionStorage.setItem('wx_callback_code', code)
|
||||||
sessionStorage.setItem('wx_code_processed', '1')
|
// 带上 invite 参数一起跳转,Login mounted 时读取
|
||||||
// 跳转到登录页,让用户完成注册/登录
|
this.$router.replace('/Login' + (inviteCode ? `?invite=${inviteCode}` : ''))
|
||||||
this.$router.replace('/Login')
|
|
||||||
} else {
|
} else {
|
||||||
this.$router.replace('/')
|
this.$router.replace('/')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,15 +11,8 @@
|
|||||||
<img :src="i.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'" alt="">
|
<img :src="i.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'" alt="">
|
||||||
<div>
|
<div>
|
||||||
<span>
|
<span>
|
||||||
{{ i.bankspname === '支付宝' ? '支付宝账号' : i.bankspname }}({{ i.bankid === 91 ? i.bankcellphone
|
{{ i.realname }}({{ i.bankcardnumber }})
|
||||||
: i.bankcardnumber }})
|
|
||||||
</span>
|
</span>
|
||||||
<p v-if="i.bankid === 91">
|
|
||||||
2小时内到账
|
|
||||||
</p>
|
|
||||||
<p v-else>
|
|
||||||
{{ i.realname }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -100,9 +93,10 @@
|
|||||||
: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: '请选择银行名称' }]" readonly required is-link
|
:rules="[{ required: true, message: '请选择银行名称' }]" readonly required is-link
|
||||||
@click="showBankPicker = true" />
|
@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 />
|
||||||
@ -127,9 +121,9 @@
|
|||||||
@finish="onFinish" @close="showRegion = false" />
|
@finish="onFinish" @close="showRegion = false" />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup v-model:show="showBankPicker" round position="bottom">
|
<!-- <van-popup v-model:show="showBankPicker" round position="bottom">
|
||||||
<van-picker title="选择银行" :columns="bankColumns" @confirm="onBankConfirm" @cancel="showBankPicker = false" />
|
<van-picker title="选择银行" :columns="bankColumns" @confirm="onBankConfirm" @cancel="showBankPicker = false" />
|
||||||
</van-popup>
|
</van-popup> -->
|
||||||
</div>
|
</div>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
|
|
||||||
@ -142,13 +136,11 @@ export default {
|
|||||||
name: 'CashoutAccount',
|
name: 'CashoutAccount',
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
this.getBankId()
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showAddAliPayPopup: false,
|
showAddAliPayPopup: false,
|
||||||
showAddPopup: false,
|
showAddPopup: false,
|
||||||
showBankPicker: false,
|
|
||||||
tempData: {},
|
tempData: {},
|
||||||
saving: false,
|
saving: false,
|
||||||
checked: 0,
|
checked: 0,
|
||||||
@ -160,7 +152,6 @@ export default {
|
|||||||
maxDate: new Date('2099/12/31'),
|
maxDate: new Date('2099/12/31'),
|
||||||
regionName: '',
|
regionName: '',
|
||||||
region: '',
|
region: '',
|
||||||
bankidGroup: {},
|
|
||||||
areaList: useCascaderAreaData(),
|
areaList: useCascaderAreaData(),
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
text: 'text',
|
text: 'text',
|
||||||
@ -170,9 +161,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bankColumns() {
|
|
||||||
return this.bankidGroup.map(item => ({ text: item.name, value: item.id }));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
@ -185,11 +173,6 @@ export default {
|
|||||||
formatter(value) {
|
formatter(value) {
|
||||||
return value.replace(/\s/g, '');
|
return value.replace(/\s/g, '');
|
||||||
},
|
},
|
||||||
getBankId() {
|
|
||||||
this.$get('/v1/client/DBanksClient').then(res => {
|
|
||||||
this.bankidGroup = res.data;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onChange({ selectedOptions }) {
|
onChange({ selectedOptions }) {
|
||||||
this.tempData.provid = selectedOptions[0]?.value || '';
|
this.tempData.provid = selectedOptions[0]?.value || '';
|
||||||
},
|
},
|
||||||
@ -199,14 +182,6 @@ 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') {
|
||||||
@ -245,7 +220,7 @@ export default {
|
|||||||
"realname": this.tempData.realname,
|
"realname": this.tempData.realname,
|
||||||
"idnumber": this.tempData.idnumber,
|
"idnumber": this.tempData.idnumber,
|
||||||
"bankid": this.tempData.bankid || 0,
|
"bankid": this.tempData.bankid || 0,
|
||||||
"bankname": this.tempData.bankname || '',
|
// "bankname": this.tempData.bankname || '',
|
||||||
"bankcardnumber": this.tempData.bankcardnumber,
|
"bankcardnumber": this.tempData.bankcardnumber,
|
||||||
"bankcellphone": this.tempData.bankcellphone,
|
"bankcellphone": this.tempData.bankcellphone,
|
||||||
"sort": 0,
|
"sort": 0,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage>
|
<BasePage :title="data.name || '产品详情'">
|
||||||
<div class="goodsdetails">
|
<div class="goodsdetails">
|
||||||
<div class="t">
|
<div class="t">
|
||||||
<img :src="$file(data.img)" alt="">
|
<img :src="$file(data.img)" alt="">
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<BasePage :title="currentColumn.name || '平台动态'">
|
<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 b_l_w" v-if="articleList.length > 0">
|
||||||
<div>
|
<div>
|
||||||
<div v-if="articleList.length > 0" @click="$navigate(`/ColumnDetail?id=${item.id}`)" class="column"
|
<div @click="$navigate(`/ColumnDetail?id=${item.id}`)" class="column" v-for="item in articleList"
|
||||||
v-for="item in articleList" :key="item.id">
|
:key="item.id">
|
||||||
<img :src="$file(item.img)" class="icon" />
|
<img v-if="item.img" :src="$file(item.img)" class="icon" />
|
||||||
<div class="overview">
|
<div class="overview">
|
||||||
<span class="title">{{ item.name }}</span>
|
<span class="title">{{ item.name }}</span>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <van-empty v-else class="b_l_w" description="暂无数据" /> -->
|
<van-empty v-else class="b_l_w" description="暂无数据" />
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<!-- <van-empty v-else class="b_l_w" description="栏目不存在" /> -->
|
<!-- <van-empty v-else class="b_l_w" description="栏目不存在" /> -->
|
||||||
</BasePage>
|
</BasePage>
|
||||||
@ -30,24 +30,10 @@ export default {
|
|||||||
name: 'Column',
|
name: 'Column',
|
||||||
emits: ['updateShare'],
|
emits: ['updateShare'],
|
||||||
mounted() {
|
mounted() {
|
||||||
const cacheKey = 'Column_articleList'
|
this.$get(`/v1/client/CNewsClient?pid=${this.pid}`).then(data => {
|
||||||
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);
|
// console.log(data);
|
||||||
this.articleList = data.data.items;
|
this.articleList = data.data.items;
|
||||||
this.currentColumn.name = data.data.items[0].pidname;
|
this.currentColumn.name = data.data.items[0].pidname;
|
||||||
sessionStorage.setItem(cacheKey, JSON.stringify({
|
|
||||||
articleList: this.articleList,
|
|
||||||
columnName: this.currentColumn.name
|
|
||||||
}))
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -56,6 +42,7 @@ export default {
|
|||||||
articles: [],
|
articles: [],
|
||||||
articleList: [],
|
articleList: [],
|
||||||
currentColumn: {},
|
currentColumn: {},
|
||||||
|
pid: this.$route.query.pid || 3,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -63,8 +50,11 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped>
|
||||||
.column-list {
|
.column-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.column {
|
.column {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 3.333vw;
|
padding: 3.333vw;
|
||||||
|
|||||||
@ -25,17 +25,9 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
const id = this.$route.query.id
|
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.$get(`/v1/client/CBusinessschoolsClient/${id}`).then(res => {
|
||||||
this.article = res.data;
|
this.article = res.data;
|
||||||
sessionStorage.setItem(cacheKey, JSON.stringify(res.data))
|
// sessionStorage.setItem(cacheKey, JSON.stringify(res.data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -45,26 +37,26 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setupImagePreview() {
|
// setupImagePreview() {
|
||||||
const contentEl = this.$refs.contentRef;
|
// const contentEl = this.$refs.contentRef;
|
||||||
if (!contentEl) return;
|
// if (!contentEl) return;
|
||||||
|
|
||||||
const images = contentEl.querySelectorAll('img');
|
// const images = contentEl.querySelectorAll('img');
|
||||||
this.imageUrls = Array.from(images).map(img => img.src);
|
// this.imageUrls = Array.from(images).map(img => img.src);
|
||||||
|
|
||||||
images.forEach((img, index) => {
|
// images.forEach((img, index) => {
|
||||||
img.addEventListener('click', () => {
|
// img.addEventListener('click', () => {
|
||||||
this.previewImages(index);
|
// this.previewImages(index);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
previewImages(startPosition) {
|
// previewImages(startPosition) {
|
||||||
this.$showImagePreview({
|
// this.$showImagePreview({
|
||||||
images: this.imageUrls,
|
// images: this.imageUrls,
|
||||||
startPosition,
|
// startPosition,
|
||||||
closeable: true,
|
// closeable: true,
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -148,7 +148,7 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
<b>{{ item.name }}</b>
|
<b>{{ item.name }}</b>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
{{ item.skuname }}
|
{{ item.description }}
|
||||||
<b style="line-height: 5.6vw;">
|
<b style="line-height: 5.6vw;">
|
||||||
<span><span>¥</span>{{ item.saleprice }}</span>
|
<span><span>¥</span>{{ item.saleprice }}</span>
|
||||||
<!-- <span> /{{ item.skuname }}</span> -->
|
<!-- <span> /{{ item.skuname }}</span> -->
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="(group, index) in trendsGrouped"
|
<van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="(group, index) in trendsGrouped"
|
||||||
:key="index">
|
:key="index">
|
||||||
<template v-for="item in group">
|
<template v-for="item in group">
|
||||||
<a @click="$navigate(`/Column?pid=3`)">
|
<a @click="$navigate(`/Column?pid=2`)">
|
||||||
<span></span>{{ item.name }}
|
<span></span>{{ item.name }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -15,26 +15,7 @@
|
|||||||
</van-swipe-item>
|
</van-swipe-item>
|
||||||
</van-swipe>
|
</van-swipe>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="label_box">
|
|
||||||
<div class="">
|
|
||||||
<img src="/img/mall_i1.png" alt="">
|
|
||||||
<span>
|
|
||||||
官方商城
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="">
|
|
||||||
<img src="/img/mall_i2.png" alt="">
|
|
||||||
<span>
|
|
||||||
正品保障
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="">
|
|
||||||
<img src="/img/mall_i3.png" alt="">
|
|
||||||
<span>
|
|
||||||
售后无忧
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cg_bigbox">
|
<div class="cg_bigbox">
|
||||||
@ -218,26 +199,15 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'Mall',
|
name: 'Mall',
|
||||||
// emits: ['changeTabbar'],
|
|
||||||
activated() {
|
|
||||||
if (this._skipActivatedRefresh) {
|
|
||||||
this._skipActivatedRefresh = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$refs.BaseList?.refresh()
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeType: '',
|
activeType: '',
|
||||||
_skipActivatedRefresh: true,
|
|
||||||
searchParams: {
|
searchParams: {
|
||||||
mallstate: 3,
|
mallstate: 3,
|
||||||
pid: '',
|
pid: '',
|
||||||
|
Key: '',
|
||||||
},
|
},
|
||||||
show: true,
|
|
||||||
data: {
|
data: {
|
||||||
Carousel: [],
|
Carousel: [],
|
||||||
SpuType: [],
|
SpuType: [],
|
||||||
@ -247,65 +217,66 @@ export default {
|
|||||||
bgcolor: '',
|
bgcolor: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
activated() {
|
||||||
|
this.$refs.BaseList?.refresh()
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
this.$get(`/v1/client/EProcatesClient`).then(res => {
|
this.$get('/v1/client/EProcatesClient').then(res => {
|
||||||
this.data.SpuType = res.data
|
this.data.SpuType = res.data.filter(i => i.homeshowed)
|
||||||
}),
|
}),
|
||||||
this.$get(`/v1/client/CSlidesClient?pid=2`).then(res => {
|
this.$get('/v1/client/CSlidesClient?pid=2').then(res => {
|
||||||
this.data.Carousel = res.data
|
this.data.Carousel = res.data
|
||||||
if (res.data?.[0]?.bgcolor) {
|
this.bgcolor = res.data?.[0]?.bgcolor || ''
|
||||||
this.bgcolor = res.data[0].bgcolor
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
||||||
this.hotData = res.data.items;
|
this.hotData = res.data.items || []
|
||||||
}),
|
}),
|
||||||
this.$get('/v1/client/EProcatesClient/1').then(res => {
|
this.$get('/v1/client/EProcatesClient/1').then(res => {
|
||||||
this.typeData = res.data
|
const filtered = res.data.filter(i => i.homeshowed)
|
||||||
this.searchParams.pid = res.data?.[0]?.id || ''
|
this.typeData = filtered
|
||||||
|
if (filtered.length > 0) {
|
||||||
|
this.activeType = filtered[0].id
|
||||||
|
this.searchParams.pid = filtered[0].id
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
]).then(() => {
|
]).catch(err => {
|
||||||
// 初始化完成后,允许 activated 触发 refresh
|
|
||||||
this._skipActivatedRefresh = false
|
|
||||||
}).catch(err => {
|
|
||||||
this.$showFailToast(err.message || '加载失败')
|
this.$showFailToast(err.message || '加载失败')
|
||||||
});
|
})
|
||||||
},
|
|
||||||
groupItems(items, num) {
|
|
||||||
const grouped = [];
|
|
||||||
for (let i = 0; i < items.length; i += num) {
|
|
||||||
grouped.push(items.slice(i, i + num));
|
|
||||||
}
|
|
||||||
return grouped;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
changeTab(type) {
|
changeTab(type) {
|
||||||
this.searchParams.pid = type;
|
this.searchParams.pid = type
|
||||||
this.$refs.BaseList.refresh()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onSwipeChange(index) {
|
onSwipeChange(index) {
|
||||||
const item = this.data.Carousel[index]
|
this.bgcolor = this.data.Carousel[index]?.bgcolor || ''
|
||||||
this.bgcolor = item?.bgcolor || ''
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onSearch() {
|
||||||
|
this.$refs.BaseList?.refresh()
|
||||||
|
},
|
||||||
|
|
||||||
|
onClear() {
|
||||||
|
this.searchParams.Key = ''
|
||||||
|
this.$refs.BaseList?.refresh()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
bgStyle() {
|
bgStyle() {
|
||||||
if (this.bgcolor) {
|
return this.bgcolor ? { background: `linear-gradient(${this.bgcolor}, #f5f5f5)` } : {}
|
||||||
return {
|
|
||||||
background: `linear-gradient(${this.bgcolor}, #f5f5f5)`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
},
|
},
|
||||||
btnStyle() {
|
btnStyle() {
|
||||||
if (this.bgcolor) {
|
return this.bgcolor ? { background: this.bgcolor } : {}
|
||||||
return {
|
},
|
||||||
background: this.bgcolor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
290
src/views/Tabbars/PointMall.vue
Normal file
290
src/views/Tabbars/PointMall.vue
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
<template>
|
||||||
|
<div class="pointmall">
|
||||||
|
<div class="top">
|
||||||
|
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
|
||||||
|
<van-swipe-item>
|
||||||
|
<img style="width: 100%;" src="/img/pointmall_bg.jpg" alt="">
|
||||||
|
</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
<!-- <div class="search">
|
||||||
|
<img src="/img/search-w.png" alt="">
|
||||||
|
<input type="text" placeholder="搜索您想要的产品">
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contaiar">
|
||||||
|
<div class="tabs">
|
||||||
|
<van-tabs style="max-width: 90%;" background="transparent" line-height="0.8vw" line-width="9.33vw;"
|
||||||
|
v-model:active="active" :ellipsis="false" color="#ca2904" title-active-color="#ca2904"
|
||||||
|
title-inactive-color="#4e4e4e">
|
||||||
|
<van-tab title="新品" name=""></van-tab>
|
||||||
|
<van-tab v-for="i in tabs" :name="i.id" :title="i.name"></van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
<img @click="showLeft = true" class="filter_img" style="width: 5.4vw;" src="/img/filter.png" alt="">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <BaseList url="/v1/client/EProsClient" class="goods_list" :params="{ mallstate: 2, pid: active }">
|
||||||
|
<template #default="{ item }">
|
||||||
|
<div class="goods_item" :key="item.id" @click="toDetail(item.id)">
|
||||||
|
<img :src="$file(item.img)" alt="">
|
||||||
|
<div>
|
||||||
|
<span class="title">{{ item.name }}</span>
|
||||||
|
<p>¥{{ item.originalprice }}</p>
|
||||||
|
<div class="money">
|
||||||
|
<div>
|
||||||
|
<span>¥
|
||||||
|
<b>{{ item.saleprice }}</b>.00
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<img class="r" style="width: 5.6vw;" src="/img/cart.png" alt="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</BaseList> -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="goods_list">
|
||||||
|
<div class="goods_item" v-for="item in goods" :key="item.id" @click="toDetail(item.id)">
|
||||||
|
<img :src="item.Icon" alt="">
|
||||||
|
<div>
|
||||||
|
<span class="title">{{ item.SubTitle }}</span>
|
||||||
|
<div class="point_box">
|
||||||
|
<img style="width: 3.33vw;height: 3.2vw;" src="/img/point.png" alt="">
|
||||||
|
<span style="font-size: 3.2vw; color: #d9a452;">积分可抵¥500.00</span>
|
||||||
|
</div>
|
||||||
|
<!-- <p>¥{{ item.OPrice }}</p> -->
|
||||||
|
<div class="money">
|
||||||
|
<div>
|
||||||
|
<span>¥</span>
|
||||||
|
<b>{{ item.Price }}</b>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="oprice">
|
||||||
|
¥{{ item.OPrice }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup v-model:show="showLeft" position="left" :style="{ width: '30%', height: '100%' }">
|
||||||
|
<div v-for="i in tabs">
|
||||||
|
<div @click="changeTab(i.id)" style="height: 10vw;width: 100%;border-bottom: solid 1px #f5f5f5;"
|
||||||
|
class="box box-center-center">
|
||||||
|
{{ i.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'PointMall',
|
||||||
|
activated() {
|
||||||
|
this.getTab()
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
active: '',
|
||||||
|
showLeft: false,
|
||||||
|
tabs: [],
|
||||||
|
goods: [
|
||||||
|
{
|
||||||
|
id: 1, Icon:
|
||||||
|
'/img/avatar.png', SubTitle:
|
||||||
|
'积分礼品测试商品1', OPrice: '99.00',
|
||||||
|
Price: '9.90'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2, Icon:
|
||||||
|
'/img/avatar.png', SubTitle:
|
||||||
|
'积分礼品测试商品2', OPrice:
|
||||||
|
'199.00', Price: '19.90'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3, Icon:
|
||||||
|
'/img/avatar.png', SubTitle:
|
||||||
|
'积分礼品测试商品3', OPrice:
|
||||||
|
'299.00', Price: '29.90'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getTab()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTab() {
|
||||||
|
this.$get('/v1/client/EProcatesClient/2').then(res => {
|
||||||
|
this.tabs = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeTab(id) {
|
||||||
|
this.active = id;
|
||||||
|
this.showLeft = false;
|
||||||
|
},
|
||||||
|
toDetail(e) {
|
||||||
|
this.$navigate(`/GoodsDetail?id=${e}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
filteredGoods() {
|
||||||
|
// if (this.active === 0) {
|
||||||
|
// return this.goods
|
||||||
|
// }
|
||||||
|
// const categoryId = this.active
|
||||||
|
// return this.goods.filter(item => item.CategoryId === categoryId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.pointmall {
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
background: #f5f5f5;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.finished-text {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contaiar {
|
||||||
|
position: relative;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 8vw 8vw 0vw 0vw;
|
||||||
|
margin-top: -12vw;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 5vw;
|
||||||
|
margin-top: 4vw;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.filter_img {
|
||||||
|
width: 5.4vw;
|
||||||
|
height: 5.4vw;
|
||||||
|
position: absolute;
|
||||||
|
right: 5vw;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods_list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 4vw;
|
||||||
|
margin-top: 4vw;
|
||||||
|
|
||||||
|
.goods_item {
|
||||||
|
background-color: #fefefe;
|
||||||
|
border-radius: 2vw;
|
||||||
|
margin-bottom: 4vw;
|
||||||
|
width: 44.8vw;
|
||||||
|
max-width: 44.8vw;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 44.8vw;
|
||||||
|
height: 44.8vw;
|
||||||
|
background-color: #fefefe;
|
||||||
|
border-radius: 2vw 2vw 0vw 0vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
>div {
|
||||||
|
padding: 3.2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 38.4vw;
|
||||||
|
max-width: 38.4vw;
|
||||||
|
font-size: 3.47vw;
|
||||||
|
overflow: hidden !important;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box !important;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
line-clamp: 2;
|
||||||
|
line-height: 4vw;
|
||||||
|
height: 8vw;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 3.2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point_box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 3.2vw;
|
||||||
|
height: 5.33vw;
|
||||||
|
background-color: #fff6dd;
|
||||||
|
border-radius: 0.8vw;
|
||||||
|
border: solid 0.27vw #f1c98c;
|
||||||
|
padding: 0 2vw;
|
||||||
|
width: fit-content;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 3.33vw;
|
||||||
|
height: 3.2vw;
|
||||||
|
margin-right: 1.6vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 3.2vw;
|
||||||
|
color: #d9a452;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: #ea3e23;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #ca2904;
|
||||||
|
text-decoration: line-through;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
b {
|
||||||
|
font-size: 4vw;
|
||||||
|
color: #ea3e23;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oprice {
|
||||||
|
font-size: 3.2vw;
|
||||||
|
color: #b1b1b1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -138,6 +138,7 @@ export default {
|
|||||||
Paychannel: paychannel,
|
Paychannel: paychannel,
|
||||||
Openid: method === 'wechat' ? openid : ''
|
Openid: method === 'wechat' ? openid : ''
|
||||||
});
|
});
|
||||||
|
// alert(JSON.stringify(res));
|
||||||
if (res.data && res.data.startsWith('http')) {
|
if (res.data && res.data.startsWith('http')) {
|
||||||
// 返回链接则跳转
|
// 返回链接则跳转
|
||||||
location.href = res.data;
|
location.href = res.data;
|
||||||
|
|||||||
@ -64,9 +64,13 @@
|
|||||||
实付金额
|
实付金额
|
||||||
<b style="color: #f00;">¥{{ data.realmoney?.toFixed(2) }}</b>
|
<b style="color: #f00;">¥{{ data.realmoney?.toFixed(2) }}</b>
|
||||||
</p>
|
</p>
|
||||||
|
<p v-if="data.paychannelname">
|
||||||
|
支付方式
|
||||||
|
<span>{{ data.paychannelname }}</span>
|
||||||
|
</p>
|
||||||
<p v-if="data.zongsongjifen">
|
<p v-if="data.zongsongjifen">
|
||||||
赠送积分
|
赠送积分
|
||||||
<span>{{ data.zongsongjifen }}</span>
|
<span>{{ data.zongsongjifen?.toFixed(2) }}</span>
|
||||||
</p>
|
</p>
|
||||||
<hr style="margin:1.67vw 0;height: 1px;border: none;background: #f5f5f580;">
|
<hr style="margin:1.67vw 0;height: 1px;border: none;background: #f5f5f580;">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage>
|
<BasePage :back="back">
|
||||||
<div class="tradelist">
|
<div class="tradelist">
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
<van-tabs class="area" v-model:active="TradeArea" color="#f00" title-active-color="#222"
|
<van-tabs class="area" v-model:active="TradeArea" color="#f00" title-active-color="#222"
|
||||||
@ -24,50 +24,16 @@
|
|||||||
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 :class="'state' + item.mallstate" class="state">{{ item.mallstatename.slice(0, 2) }}</span>
|
||||||
<span>订单编号:{{ item.ordernum }}</span>
|
<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.shopimg || item.proimg)" alt="">
|
||||||
<div class="goods_info">
|
<div class="goods_info">
|
||||||
<div class="tit">{{ item.proname }}</div>
|
<div class="tit">{{ item.shopname || item.proname }}</div>
|
||||||
<div class="spec">
|
<div class="spec" v-if="!item.shopname">
|
||||||
<span>{{ item.proskuname }}</span>
|
<span>{{ item.proskuname }}</span>
|
||||||
<p>x{{ item.buynums }}</p>
|
<p>x{{ item.buynums }}</p>
|
||||||
</div>
|
</div>
|
||||||
@ -84,12 +50,13 @@
|
|||||||
<b :class="'b' + item.state">{{ item.statename }}</b>
|
<b :class="'b' + item.state">{{ 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 @click="$navigate(`TradeDetail?ordernum=${item.ordernum}`)">查看详情</button>
|
<button v-if="!item.shopname" @click="$navigate(`TradeDetail?ordernum=${item.ordernum}`)">查看详情</button>
|
||||||
|
<button v-else @click="$navigate(`MerchantTradeDetail?id=${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>
|
||||||
@ -100,156 +67,155 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'TradeList',
|
name: 'TradeList',
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeTab: '',
|
TradeArea: this.$route.query.TradeArea || 0,
|
||||||
TradeArea: 0,
|
activeTab: this.$route.query.state || '',
|
||||||
_initialized: false,
|
|
||||||
_searchParams: {
|
_searchParams: {
|
||||||
ordernum: '',
|
ordernum: '',
|
||||||
state: '',
|
state: '',
|
||||||
},
|
},
|
||||||
tradeStates: [
|
tradeStates: [
|
||||||
|
{
|
||||||
|
"value": 0,
|
||||||
|
"label": "待付款"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 1,
|
||||||
|
"label": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 3,
|
||||||
|
"label": "待收货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 4,
|
||||||
|
"label": "已完成"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
mallList: [
|
mallList: [
|
||||||
|
{ value: 0, label: '全部订单' },
|
||||||
|
{
|
||||||
|
"value": 1,
|
||||||
|
"label": "礼包订单"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 3,
|
||||||
|
"label": "商城订单"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 4,
|
||||||
|
"label": "买单订单"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
|
_initializing: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
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 || [])];
|
|
||||||
// 先标记跳过,等 watch 触发完再刷新
|
|
||||||
if (this.$refs.baseList) {
|
|
||||||
this.$refs.baseList._skipWatch = true
|
|
||||||
}
|
|
||||||
const areaFromRoute = this.$route.query.TradeArea;
|
|
||||||
if (areaFromRoute !== undefined && areaFromRoute !== '') {
|
|
||||||
this.TradeArea = Number(areaFromRoute) || 0;
|
|
||||||
} else {
|
|
||||||
this.TradeArea = 0;
|
|
||||||
}
|
|
||||||
const stateFromRoute = this.$route.query.state;
|
|
||||||
if (stateFromRoute !== undefined && stateFromRoute !== '') {
|
|
||||||
this.activeTab = String(stateFromRoute);
|
|
||||||
this._searchParams.state = stateFromRoute;
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.baseList) {
|
|
||||||
this.$refs.baseList._skipWatch = false
|
|
||||||
this.$refs.baseList.refresh()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch((err) => {
|
|
||||||
this.$showFailToast(err.message || '加载失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
parseData() {
|
parseData() {
|
||||||
return res => res.data.items;
|
return res => res.data.items
|
||||||
},
|
|
||||||
parseData2() {
|
|
||||||
return res => res.data.items;
|
|
||||||
},
|
},
|
||||||
searchParams() {
|
searchParams() {
|
||||||
const params = {
|
const params = {
|
||||||
ordernum: this._searchParams.ordernum,
|
ordernum: this._searchParams.ordernum,
|
||||||
state: this._searchParams.state,
|
state: this._searchParams.state === '' ? '' : Number(this._searchParams.state),
|
||||||
};
|
}
|
||||||
if (this.TradeArea !== 0) {
|
if (this.TradeArea !== 0) {
|
||||||
params.mallstate = this.TradeArea;
|
params.mallstate = this.TradeArea
|
||||||
}
|
|
||||||
return params;
|
|
||||||
}
|
}
|
||||||
|
return params
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
// TradeArea(val) {
|
|
||||||
// this._searchParams.state = '';
|
|
||||||
// this.activeTab = '';
|
|
||||||
// },
|
|
||||||
'$route.query.state': {
|
|
||||||
handler(newVal) {
|
|
||||||
if (newVal !== undefined && newVal !== '') {
|
|
||||||
this.activeTab = String(newVal);
|
|
||||||
// this.getTradeStates();
|
|
||||||
} else {
|
|
||||||
this.activeTab = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'$route.query.TradeArea': {
|
'$route.query.TradeArea': {
|
||||||
handler(newVal) {
|
handler(val) {
|
||||||
if (newVal !== undefined && newVal !== '') {
|
this.TradeArea = val !== undefined ? Number(val) : 0
|
||||||
this.TradeArea = Number(newVal) || 0;
|
},
|
||||||
} else {
|
immediate: true
|
||||||
this.TradeArea = 0;
|
},
|
||||||
}
|
'$route.query.state': {
|
||||||
|
handler(val) {
|
||||||
|
this.activeTab = val || ''
|
||||||
|
this._searchParams.state = val || ''
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
back() {
|
// 加载订单状态和类型列表
|
||||||
this.$router.push('/My')
|
// async loadFilterOptions() {
|
||||||
},
|
// try {
|
||||||
|
// const [stateRes, areaRes] = await Promise.all([
|
||||||
|
// this.$get('/v1/client/FOrdersClient/orderstate'),
|
||||||
|
// this.$get('/v1/client/EProsClient/mallstate'),
|
||||||
|
// ])
|
||||||
|
// this.tradeStates = stateRes.data || []
|
||||||
|
// this.mallList = [{ value: 0, label: '全部订单' }, ...(areaRes.data || [])]
|
||||||
|
// this._initializing = false
|
||||||
|
// } catch (err) {
|
||||||
|
// this.$showFailToast(err.message || '加载失败')
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
// Tab 切换 - 订单状态
|
||||||
onTabChange(name) {
|
onTabChange(name) {
|
||||||
this._searchParams.state = name;
|
this._searchParams.state = name
|
||||||
this.$refs.baseList?.refresh();
|
// this.$refs.baseList?.refresh()
|
||||||
},
|
},
|
||||||
changeMall(name) {
|
|
||||||
if (this.TradeArea !== name) {
|
// Tab 切换 - 订单类型
|
||||||
this.TradeArea = Number(name) || 0;
|
changeMall(val) {
|
||||||
}
|
this.TradeArea = val
|
||||||
|
this._searchParams.state = ''
|
||||||
|
this.activeTab = ''
|
||||||
|
// 不需要手动 refresh,BaseList 的 watch params 会自动触发
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 搜索 & 清除
|
||||||
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() {
|
|
||||||
this.$get('/v1/client/FOrdersClient/orderstate').then(res => {
|
|
||||||
this.tradeStates = res.data;
|
|
||||||
}).catch((err) => {
|
|
||||||
this.$showFailToast(err.message || '获取订单状态失败');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onRefresh() {
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 确认收货
|
||||||
confirmReceipt(item) {
|
confirmReceipt(item) {
|
||||||
this.$showConfirmDialog({
|
this.$showConfirmDialog({ title: '是否确认收货' })
|
||||||
title: "是否确认收货",
|
.then(() => this.$put(`/v1/client/FOrdersClient/${item.ordernum}/receipt`))
|
||||||
}).then(() => {
|
.then(() => {
|
||||||
this.$put(`/v1/client/FOrdersClient/${item.ordernum}/receipt`).then(() => {
|
this.$showSuccessToast('确认收货成功')
|
||||||
this.$showSuccessToast('确认收货成功');
|
this.$refs.baseList?.refresh()
|
||||||
this.$refs.baseList?.refresh();
|
})
|
||||||
}).catch(err => {
|
.catch(err => this.$showFailToast(err.message || '操作失败'))
|
||||||
this.$showFailToast(err.message || '操作失败');
|
|
||||||
});
|
|
||||||
}).catch(() => { });
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 取消订单
|
||||||
cancelTrade(item) {
|
cancelTrade(item) {
|
||||||
this.$showConfirmDialog({
|
this.$showConfirmDialog({ title: '是否确认取消订单' })
|
||||||
title: "是否确认取消订单",
|
.then(() => this.$put(`/v1/client/FOrdersClient/${item.ordernum}/cancel`))
|
||||||
}).then(() => {
|
.then(() => {
|
||||||
this.$put(`/v1/client/FOrdersClient/${item.ordernum}/cancel`).then(() => {
|
this.$showSuccessToast('取消订单成功')
|
||||||
this.$showSuccessToast('取消订单成功');
|
this.$refs.baseList?.refresh()
|
||||||
this.$refs.baseList?.refresh();
|
})
|
||||||
}).catch(err => {
|
.catch(err => this.$showFailToast(err.message || '取消失败'))
|
||||||
this.$showFailToast(err.message || '取消失败');
|
},
|
||||||
});
|
|
||||||
}).catch(() => { });
|
back() {
|
||||||
|
this.$navigate('/My');
|
||||||
|
},
|
||||||
|
|
||||||
|
onRefresh() { },
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -68,36 +68,40 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="c">
|
<div class="c">
|
||||||
<van-badge :dot="data.ordercountdaifukuan > 0" :offset="[3, -3]">
|
<van-badge :dot="data.ordercountdaifukuan > 0" :offset="[3, -3]">
|
||||||
<div class="st_box" @click="$navigate(`TradeList?TradeArea=3&state=0`)">
|
<div class="st_box" @click="$navigate(`/TradeList?state=0`)">
|
||||||
<img src="/img/my_o1.png">
|
<img src="/img/my_o1.png">
|
||||||
<p>待付款</p>
|
<p>待付款</p>
|
||||||
</div>
|
</div>
|
||||||
</van-badge>
|
</van-badge>
|
||||||
<van-badge :dot="data.ordercountdaifahuo > 0" :offset="[3, -3]">
|
<van-badge :dot="data.ordercountdaifahuo > 0" :offset="[3, -3]">
|
||||||
<div class="st_box" @click="$navigate(`TradeList?TradeArea=3&state=1`)">
|
<div class="st_box" @click="$navigate(`/TradeList?state=1`)">
|
||||||
<img src="/img/my_o2.png">
|
<img src="/img/my_o2.png">
|
||||||
<p>待发货</p>
|
<p>待发货</p>
|
||||||
</div>
|
</div>
|
||||||
</van-badge>
|
</van-badge>
|
||||||
<van-badge :dot="data.ordercountdaishouhuo > 0" :offset="[3, -3]">
|
<van-badge :dot="data.ordercountdaishouhuo > 0" :offset="[3, -3]">
|
||||||
<div class="st_box" @click="$navigate(`TradeList?TradeArea=3&state=3`)">
|
<div class="st_box" @click="$navigate(`/TradeList?state=3`)">
|
||||||
<img src="/img/my_o3.png">
|
<img src="/img/my_o3.png">
|
||||||
<p>待收货</p>
|
<p>待收货</p>
|
||||||
</div>
|
</div>
|
||||||
</van-badge>
|
</van-badge>
|
||||||
<div class="st_box" @click="$navigate(`TradeList?TradeArea=0`)">
|
<div class="st_box" @click="$navigate(`/TradeList?state=4`)">
|
||||||
<img src="/img/my_o4.png">
|
<img src="/img/my_o4.png">
|
||||||
<p>全部订单</p>
|
<p>已完成</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fast_to">
|
<div class="fast_to">
|
||||||
|
<div>
|
||||||
<img src="/img/my_f1.jpg" @click="toInvite()" alt="">
|
<img src="/img/my_f1.jpg" @click="toInvite()" alt="">
|
||||||
<img src="/img/my_f2.jpg" @click="$navigate('Team')" alt="">
|
<img src="/img/my_f2.jpg" @click="$navigate('Team')" alt="">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<img src="/img/my_f3.jpg" @click="$navigate('Allow')" alt="">
|
<img src="/img/my_f3.jpg" @click="$navigate('Allow')" alt="">
|
||||||
<img src="/img/my_f4.jpg" @click="$navigate('Certificate')" alt="">
|
<img src="/img/my_f4.jpg" @click="$navigate('Certificate')" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="service_center">
|
<div class="service_center">
|
||||||
<div class="tit">
|
<div class="tit">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user