save
@ -1,2 +1,2 @@
|
|||||||
VITE_API_URL = "http://zy.weishke.com"
|
VITE_API_URL = "http://m.taigurun.cn"
|
||||||
VITE_OSS_URL = "http://zy.weishke.com"
|
VITE_OSS_URL = "http://m.taigurun.cn"
|
||||||
@ -1,2 +1,2 @@
|
|||||||
VITE_API_URL = "http://zy.weishke.com"
|
VITE_API_URL = "http://m.taigurun.cn"
|
||||||
VITE_OSS_URL = "http://zy.weishke.com"
|
VITE_OSS_URL = "http://m.taigurun.cn"
|
||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app" v-cloak></div>
|
<div id="app" v-cloak></div>
|
||||||
|
<script src="/js/html2canvas.min.js"></script>
|
||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.js"></script>
|
||||||
<style>
|
<style>
|
||||||
[v-cloak] {
|
[v-cloak] {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
public/img/addr.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/img/aliicon.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/img/bankcardicon.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/img/bs-banner.jpg
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
public/img/col-bg-i1.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
public/img/col-bg-i2.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
public/img/col-bg-i3.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
public/img/de-i1.png
Normal file
|
After Width: | Height: | Size: 649 B |
BIN
public/img/de-i2.png
Normal file
|
After Width: | Height: | Size: 331 B |
BIN
public/img/gt-i1.png
Normal file
|
After Width: | Height: | Size: 557 B |
BIN
public/img/hot.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 13 KiB |
BIN
public/img/label-1.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/img/label-2.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/img/label-3.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 339 KiB |
|
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 354 B |
|
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 732 B After Width: | Height: | Size: 517 B |
|
Before Width: | Height: | Size: 1001 B After Width: | Height: | Size: 977 B |
BIN
public/img/login-i5.png
Normal file
|
After Width: | Height: | Size: 864 B |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 329 B |
BIN
public/img/my_f1.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/img/my_f2.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/img/my_f3.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
public/img/my_f4.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/img/my_o1.png
Normal file
|
After Width: | Height: | Size: 836 B |
BIN
public/img/my_o2.png
Normal file
|
After Width: | Height: | Size: 765 B |
BIN
public/img/my_o3.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/img/my_o4.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/img/my_s1.png
Normal file
|
After Width: | Height: | Size: 527 B |
BIN
public/img/my_s2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/img/my_s3.png
Normal file
|
After Width: | Height: | Size: 838 B |
BIN
public/img/my_s4.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/img/my_u1.png
Normal file
|
After Width: | Height: | Size: 505 B |
BIN
public/img/my_u2.png
Normal file
|
After Width: | Height: | Size: 617 B |
BIN
public/img/my_u3.png
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
public/img/my_u4.png
Normal file
|
After Width: | Height: | Size: 495 B |
BIN
public/img/my_u5.png
Normal file
|
After Width: | Height: | Size: 532 B |
BIN
public/img/my_u6.png
Normal file
|
After Width: | Height: | Size: 595 B |
BIN
public/img/my_w1.png
Normal file
|
After Width: | Height: | Size: 792 B |
BIN
public/img/my_w2.png
Normal file
|
After Width: | Height: | Size: 735 B |
BIN
public/img/my_w3.png
Normal file
|
After Width: | Height: | Size: 735 B |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
public/img/pay_bankcard.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
public/img/point_icon.png
Normal file
|
After Width: | Height: | Size: 735 B |
BIN
public/img/pro.png
Normal file
|
After Width: | Height: | Size: 876 B |
BIN
public/img/safity.png
Normal file
|
After Width: | Height: | Size: 900 B |
|
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 834 B |
BIN
public/img/set-i3.png
Normal file
|
After Width: | Height: | Size: 714 B |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 1.0 KiB |
BIN
public/img/share.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
public/img/spec.png
Normal file
|
After Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
public/img/tomall_i2.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/img/vb-home.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/img/vb-service.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/img/vb-share.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/img/vip_icon.png
Normal file
|
After Width: | Height: | Size: 735 B |
32
src/App.vue
@ -1,3 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view />
|
<router-view />
|
||||||
|
<ManagerPopup v-model="managerPopupVisible" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref, watch } from 'vue'
|
||||||
|
import ManagerPopup from "./components/ManagerPopup.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
components: { ManagerPopup },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
managerPopupVisible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
window.addEventListener('showManagerPopup', this.onShowManagerPopup)
|
||||||
|
window.addEventListener('closeManagerPopup', this.onCloseManagerPopup)
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
window.removeEventListener('showManagerPopup', this.onShowManagerPopup)
|
||||||
|
window.removeEventListener('closeManagerPopup', this.onCloseManagerPopup)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onShowManagerPopup() {
|
||||||
|
this.managerPopupVisible = true
|
||||||
|
},
|
||||||
|
onCloseManagerPopup() {
|
||||||
|
this.managerPopupVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-nav-bar class="b_l_w" v-if="!$isWechatMini()" fixed :title="$isWechat() ? '' : title || $route.meta.title"
|
<van-nav-bar fixed :title="$isWechat() ? '' : title || $route.meta.title" :safe-area-inset-top="true" placeholder
|
||||||
:safe-area-inset-top="true" placeholder left-arrow left-text="返回" @click-left="back ? back() : $router.back();"
|
left-arrow left-text="返回" @click-left="back ? back() : $router.back();"
|
||||||
:class="$isWechat() ? 'wechat-nav' : ''">
|
:class="$isWechat() ? 'wechat-nav' : ''">
|
||||||
<template #right>
|
<template #right>
|
||||||
<slot v-if="$slots.right" name="right" />
|
<slot v-if="$slots.right" name="right" />
|
||||||
|
|||||||
170
src/components/ManagerPopup.vue
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
<template>
|
||||||
|
<van-popup v-model:show="visible" position="right" :style="{ width: '60%', height: '100%' }">
|
||||||
|
<div class="manager_container">
|
||||||
|
<div class="manager_dbox">
|
||||||
|
<div @click="goInfo">
|
||||||
|
<img src="/img/my_u1.png" alt="">
|
||||||
|
<span>个人管理中心</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div @click="navigateAndClose('Merchant')">
|
||||||
|
<img src="/img/my_u2.png" alt="">
|
||||||
|
<span>商家中心</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src="/img/my_u3.png" alt="">
|
||||||
|
<span>运营中心</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="manager_dbox">
|
||||||
|
<div @click="navigateAndClose('Home')">
|
||||||
|
<img src="/img/my_u4.png" alt="">
|
||||||
|
<span>首页</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div @click="navigateAndClose('Gift')">
|
||||||
|
<img src="/img/my_u5.png" alt="">
|
||||||
|
<span>礼包</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div @click="navigateAndClose('Mall')">
|
||||||
|
<img src="/img/my_u6.png" alt="">
|
||||||
|
<span>商城</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button @click="visible = false">
|
||||||
|
返回
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 个人管理中心弹窗 -->
|
||||||
|
<van-action-sheet v-model:show="showInfo" title="个人信息">
|
||||||
|
<van-form @submit="save">
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field name="uploader" label="头像" required>
|
||||||
|
<template #input>
|
||||||
|
<van-uploader v-model="tempData.AvatarUploader" :after-read="upload" :max-count="1" upload-text="头像" />
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field v-model="tempData.nickname" label="昵称" placeholder="请输入昵称"
|
||||||
|
:rules="[{ required: true, message: '请填写昵称' }]" clearable required />
|
||||||
|
<van-field v-model="tempData.cellphone" label="手机号" readonly>
|
||||||
|
<template #button>
|
||||||
|
更改联系平台
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-cell>
|
||||||
|
<template #title>
|
||||||
|
<van-button style="width: 100%" color="#ea3e23" round type="primary" native-type="save"
|
||||||
|
:loading="saving">保存</van-button>
|
||||||
|
</template>
|
||||||
|
</van-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</van-form>
|
||||||
|
</van-action-sheet>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ManagerPopup',
|
||||||
|
props: {
|
||||||
|
modelValue: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emits: ['update:modelValue'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showInfo: false,
|
||||||
|
saving: false,
|
||||||
|
tempData: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
visible: {
|
||||||
|
get() {
|
||||||
|
return this.modelValue
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit('update:modelValue', val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
navigateAndClose(route) {
|
||||||
|
this.visible = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$navigate(route)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
goInfo() {
|
||||||
|
this.visible = false
|
||||||
|
this.loadUserInfo()
|
||||||
|
this.showInfo = true
|
||||||
|
},
|
||||||
|
loadUserInfo() {
|
||||||
|
this.$get('/v1/client/DUsersClient').then(data => {
|
||||||
|
this.tempData = {}
|
||||||
|
Object.assign(this.tempData, data.data)
|
||||||
|
this.tempData.AvatarUploader = [{ url: this.$file(data.data.userimg), isImage: true }]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
upload(file) {
|
||||||
|
this.tempData.userimg = file.file
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
if (this.tempData.userimg instanceof File) {
|
||||||
|
const fd = new FormData()
|
||||||
|
fd.append('file', this.tempData.userimg)
|
||||||
|
fetch(`${import.meta.env.VITE_API_URL}/v1/client/DUsersClient/userimg`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Authorization': `Bearer ${localStorage.getItem('token')}` },
|
||||||
|
body: fd,
|
||||||
|
}).then(res => res.json()).then(res => {
|
||||||
|
if (res.status !== 200) throw new Error(res.errmsg)
|
||||||
|
this.tempData.userimg = res.data
|
||||||
|
}).then(() => {
|
||||||
|
return this.$put('/v1/client/DUsersClient', {
|
||||||
|
nickname: this.tempData.nickname,
|
||||||
|
cellphone: this.tempData.cellphone,
|
||||||
|
})
|
||||||
|
}).then(() => {
|
||||||
|
this.$showSuccessToast('保存成功')
|
||||||
|
this.showInfo = false
|
||||||
|
window.location.reload()
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg || err.message || '保存失败')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$put('/v1/client/DUsersClient', {
|
||||||
|
nickname: this.tempData.nickname,
|
||||||
|
cellphone: this.tempData.cellphone,
|
||||||
|
}).then(() => {
|
||||||
|
this.$showSuccessToast('保存成功')
|
||||||
|
this.showInfo = false
|
||||||
|
window.location.reload()
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg || '保存失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
22
src/main.js
@ -5,8 +5,6 @@ import { routes } from "./router";
|
|||||||
import less from "less";
|
import less from "less";
|
||||||
import "./styles/ch.less";
|
import "./styles/ch.less";
|
||||||
|
|
||||||
import VueQr from "vue-qr";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
showToast,
|
showToast,
|
||||||
showLoadingToast,
|
showLoadingToast,
|
||||||
@ -26,13 +24,8 @@ import "vant/es/image-preview/style";
|
|||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
// app.component("BasePage", BasePage)
|
import VueQr from "vue-qr";
|
||||||
// .component("VueQr", VueQr)
|
app.component("VueQr", VueQr);
|
||||||
// .component("BaseList", BaseList)
|
|
||||||
// .component("AddressSelector", AddressSelector)
|
|
||||||
// .component("BaseSkeleton", BaseSkeleton)
|
|
||||||
// .component("CountDown", CountDown)
|
|
||||||
// .component("BindPhone", BindPhone)
|
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
@ -157,7 +150,7 @@ app.config.globalProperties.$token = (e) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
app.config.globalProperties.$file = (e) => {
|
app.config.globalProperties.$file = (e) => {
|
||||||
e = e || 'base/avatar.png';
|
if (!e) return '/img/avatar.png';
|
||||||
if (e.startsWith('http://') || e.startsWith('https://'))
|
if (e.startsWith('http://') || e.startsWith('https://'))
|
||||||
return e;
|
return e;
|
||||||
else
|
else
|
||||||
@ -207,16 +200,16 @@ app.config.globalProperties.$compressFiles = (files) => {
|
|||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
};
|
};
|
||||||
|
|
||||||
app.config.globalProperties.$uploadFiles = (files) => {
|
app.config.globalProperties.$uploadFiles = (files, uploadUrl) => {
|
||||||
let fd = new FormData();
|
let fd = new FormData();
|
||||||
files.forEach(x => {
|
files.forEach(x => {
|
||||||
fd.append('file', x.file, x.file.name);
|
fd.append('file', x.file, x.file.name);
|
||||||
});
|
});
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fetch(`${import.meta.env.VITE_API_URL}File/MemberUpload`, {
|
fetch(`${import.meta.env.VITE_API_URL}${uploadUrl}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'token': localStorage.getItem('token'),
|
'Authorization': `Bearer ${localStorage.getItem('token')}`,
|
||||||
},
|
},
|
||||||
body: fd,
|
body: fd,
|
||||||
}).then(rep => {
|
}).then(rep => {
|
||||||
@ -332,5 +325,8 @@ app.config.globalProperties.$request = request;
|
|||||||
app.config.globalProperties.$isLogin = isLogin;
|
app.config.globalProperties.$isLogin = isLogin;
|
||||||
app.config.globalProperties.$formatGMT = formatGMT;
|
app.config.globalProperties.$formatGMT = formatGMT;
|
||||||
|
|
||||||
|
// ManagerPopup 通过 window 事件触发
|
||||||
|
app.config.globalProperties.$showManagerPopup = () => { window.dispatchEvent(new Event('showManagerPopup')) }
|
||||||
|
app.config.globalProperties.$closeManagerPopup = () => { window.dispatchEvent(new Event('closeManagerPopup')) }
|
||||||
|
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
|
|||||||
@ -20,12 +20,6 @@ const routes = [
|
|||||||
component: () => import('./views/Tabbars/Gift.vue'),
|
component: () => import('./views/Tabbars/Gift.vue'),
|
||||||
meta: { title: '礼品区', cache: true }
|
meta: { title: '礼品区', cache: true }
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/Agriculture',
|
|
||||||
name: 'Agriculture',
|
|
||||||
component: () => import('./views/Tabbars/Agriculture.vue'),
|
|
||||||
meta: { title: '助农区', cache: true }
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/Mall',
|
path: '/Mall',
|
||||||
name: 'Mall',
|
name: 'Mall',
|
||||||
@ -56,7 +50,7 @@ const routes = [
|
|||||||
name: 'ResetPwd',
|
name: 'ResetPwd',
|
||||||
component: () => import('./views/Account/ResetPwd.vue'),
|
component: () => import('./views/Account/ResetPwd.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '修改密码',
|
title: '找回密码',
|
||||||
noLogin: true,
|
noLogin: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -133,9 +127,9 @@ const routes = [
|
|||||||
meta: { title: '我的好友' }
|
meta: { title: '我的好友' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/AliPayAccount',
|
path: '/CashoutAccount',
|
||||||
name: 'AliPayAccount',
|
name: 'CashoutAccount',
|
||||||
component: () => import('./views/User/AliPayAccount.vue'),
|
component: () => import('./views/User/CashoutAccount.vue'),
|
||||||
meta: { title: '提现账号' }
|
meta: { title: '提现账号' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -153,7 +147,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: '/TradeList',
|
path: '/TradeList',
|
||||||
name: 'TradeList',
|
name: 'TradeList',
|
||||||
component: () => import('./views/Trade/Tradelist.vue'),
|
component: () => import('./views/Trade/NTradeList.vue'),
|
||||||
meta: { title: '订单列表' }
|
meta: { title: '订单列表' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -195,7 +189,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: '/GoodsDetail',
|
path: '/GoodsDetail',
|
||||||
name: 'GoodsDetail',
|
name: 'GoodsDetail',
|
||||||
component: () => import('./views/Goods/GoodsDetail.vue'),
|
component: () => import('./views/Goods/NGoodsDetail.vue'),
|
||||||
meta: { title: '商品详情' }
|
meta: { title: '商品详情' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -274,6 +268,12 @@ export { routes }
|
|||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes,
|
routes,
|
||||||
|
scrollBehavior(to, from, savedPosition) {
|
||||||
|
if (savedPosition) {
|
||||||
|
return savedPosition;
|
||||||
|
}
|
||||||
|
return { top: 0 };
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
1238
src/styles/ch.less
@ -1,99 +1,121 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login" style="padding-bottom: 50vw;">
|
<div class="login" style="padding-bottom: 50vw;">
|
||||||
<div class="logo">
|
<!-- Logo 区域 -->
|
||||||
|
<div class="logo" v-if="!isReg">
|
||||||
<img src="/img/login-logo.png" />
|
<img src="/img/login-logo.png" />
|
||||||
</div>
|
</div>
|
||||||
<div class="k">
|
<div class="logo" v-else>
|
||||||
<div class="input">
|
<div class="fonts">
|
||||||
<div>
|
<b>注册账号</b>
|
||||||
<div class="img">
|
<p>欢迎注册泰古润</p>
|
||||||
<img src="/img/login-i1.png" />
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contaiar">
|
||||||
|
<div class="lg_box">
|
||||||
|
<!-- 登录方式切换 tabs -->
|
||||||
|
<van-tabs color="#841e36" line-height="1.07vw" line-width="12vw" v-model:active="active" v-if="!isReg">
|
||||||
|
<van-tab title="账号登录"></van-tab>
|
||||||
|
<van-tab title="手机号登录"></van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<div class="form-content">
|
||||||
|
<!-- 手机号 -->
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
|
||||||
<input type="phone" :placeholder="active ? '请输入手机号码作为账号' : '请输入手机号'" v-model="data.Phone"
|
<!-- 验证码 (手机号登录或注册时显示) -->
|
||||||
onblur="window.scrollTo(0, 0);" />
|
<div class="line" v-if="active === 1 || isReg">
|
||||||
<van-icon @click="data.Phone = ''" name="cross" size="5vw"></van-icon>
|
<div class="title">
|
||||||
</div>
|
<img src="/img/login-i2.png" alt="">
|
||||||
<!-- <div v-if="active == 1">
|
<span>验证码</span>
|
||||||
<div class="img">
|
</div>
|
||||||
<img src="/img/login-i2.png" />
|
<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)` : '获取验证码' }}
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
|
||||||
<input type="text" placeholder="请输入验证码" v-model="data.SmsCode" :disabled="!isSend" maxlength="6"
|
<!-- 密码 (账号登录或注册时显示) -->
|
||||||
onblur="window.scrollTo(0, 0);" />
|
<div class="line" v-if="active === 0 || isReg">
|
||||||
<van-button class="hqyzm" @click="getSmsCode" :disabled="isSend">
|
<div class="title">
|
||||||
{{ isSend ? `已发送(${remainTime}s)` : "获取验证码" }}
|
<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'"
|
||||||
|
size="5vw"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 确认密码 (仅注册时显示) -->
|
||||||
|
<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"
|
||||||
|
:name="showConfirmPassword ? 'closed-eye' : 'eye-o'" size="5vw"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 邀请人 (仅注册时显示) -->
|
||||||
|
<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" placeholder="请填写邀请人账号(选填)" v-model="formData.Recommend" />
|
||||||
|
<van-icon v-if="formData.Recommend" @click="formData.Recommend = ''" name="cross" size="5vw"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 提交按钮 -->
|
||||||
|
<van-button class="submit" type="commit" @click="handleSubmit" :loading="loading" loading-text="提交中..">
|
||||||
|
{{ isReg ? '注册' : '登录' }}
|
||||||
</van-button>
|
</van-button>
|
||||||
</div> -->
|
|
||||||
<div v-if="active == 0">
|
|
||||||
<div class="img">
|
|
||||||
<img src="/img/login-i3.png" />
|
|
||||||
</div>
|
|
||||||
<p></p>
|
|
||||||
<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>
|
|
||||||
<van-icon @click="show1 = false" name="closed-eye" size="5vw" v-else></van-icon>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="active == 1">
|
|
||||||
<div class="img">
|
<!-- 用户协议 -->
|
||||||
<img src="/img/login-i3.png" />
|
<van-checkbox icon-size="2.667vw" class="agreement" v-model="checked" checked-color="#841e36">
|
||||||
|
选中即代表同意<a @click.stop="showContract = true">《用户协议》</a>和<a @click.stop="showPolicy = true">《隐私政策》</a>
|
||||||
|
</van-checkbox>
|
||||||
|
|
||||||
|
<!-- 底部链接 -->
|
||||||
|
<div class="toLogin">
|
||||||
|
<div class="ct1" v-if="isReg" @click="isReg = false">
|
||||||
|
已有账号,立即登录
|
||||||
|
<van-icon name="arrow"></van-icon>
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
<div class="box ct2" v-else>
|
||||||
<input :type="show1 ? 'text' : 'password'" placeholder="请输入密码" v-model="data.Password"
|
<div @click.stop="$navigate('/ResetPwd')">忘记密码</div>
|
||||||
onblur="window.scrollTo(0, 0);" />
|
<p>|</p>
|
||||||
<van-icon @click="show1 = true" name="eye-o" size="5vw" v-if="!show1"></van-icon>
|
<span @click="isReg = true">立即注册</span>
|
||||||
<van-icon @click="show1 = false" name="closed-eye" size="5vw" v-else></van-icon>
|
|
||||||
</div>
|
|
||||||
<div v-if="active == 1">
|
|
||||||
<div class="img">
|
|
||||||
<img src="/img/login-i3.png" />
|
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
|
||||||
<input :type="show2 ? 'text' : 'password'" placeholder="请再次输入密码" v-model="data.RePassword"
|
|
||||||
onblur="window.scrollTo(0, 0);" />
|
|
||||||
<van-icon @click="show2 = true" name="eye-o" size="5vw" v-if="!show2"></van-icon>
|
|
||||||
<van-icon @click="show2 = false" name="closed-eye" size="5vw" v-else></van-icon>
|
|
||||||
</div>
|
|
||||||
<div v-if="active == 1">
|
|
||||||
<div class="img">
|
|
||||||
<img src="/img/login-i4.png" />
|
|
||||||
</div>
|
|
||||||
<p></p>
|
|
||||||
<input type="text" placeholder="请填写邀请人账号(选填)" v-model="data.Recommend" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-button class="submit" v-if="active == 0" @click="login" :loading="loading" loading-text="提交中..">登
|
|
||||||
录</van-button>
|
|
||||||
<van-button class="submit" v-else @click="reg" :loading="loading" loading-text="提交中..">注册</van-button>
|
|
||||||
|
|
||||||
<van-checkbox icon-size="2.667vw" class="agreement" v-model="checked" checked-color="#177142">
|
|
||||||
选中即代表同意<a @click.stop="showContract = true">《用户协议》</a>和<a @click.stop="showPolicy = true">《隐私政策》</a>
|
|
||||||
</van-checkbox>
|
|
||||||
|
|
||||||
<div class="b_l_w w100 mx-auto box box-center-center changeat">
|
|
||||||
<div class="ct1" v-if="active == 1" @click="active = 0">已有账号,立即登录
|
|
||||||
<van-icon name="arrow"></van-icon>
|
|
||||||
</div>
|
|
||||||
<div class="box ct2" v-if="active == 0" @click="active = 1">
|
|
||||||
<div @click.stop="$navigate('/ResetPwd')">
|
|
||||||
忘记密码
|
|
||||||
</div>
|
|
||||||
<span>|</span>
|
|
||||||
立即注册
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <div class="b_l_w center" v-if="active == 0" style="margin: 4vw 0 0">
|
|
||||||
<a href="https://beian.miit.gov.cn/#/Integrated/index">
|
|
||||||
<img src="/img/beian.png" width="14" height="14" style="vertical-align: top; display: inline-block" />
|
|
||||||
粤ICP备12345678号
|
|
||||||
</a>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 用户协议弹窗 -->
|
||||||
<van-action-sheet v-model:show="showContract" safe-area-inset-bottom title="用户协议" closeable
|
<van-action-sheet v-model:show="showContract" safe-area-inset-bottom title="用户协议" closeable
|
||||||
style="min-height: 50%; padding: 0px 10px 10px 10px">
|
style="min-height: 50%; padding: 0px 10px 10px 10px">
|
||||||
<div class="w100 html">
|
<div class="w100 html">
|
||||||
@ -101,6 +123,8 @@
|
|||||||
<p>这里是用户协议的详细条款...</p>
|
<p>这里是用户协议的详细条款...</p>
|
||||||
</div>
|
</div>
|
||||||
</van-action-sheet>
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<!-- 隐私政策弹窗 -->
|
||||||
<van-action-sheet v-model:show="showPolicy" safe-area-inset-bottom title="隐私政策" closeable
|
<van-action-sheet v-model:show="showPolicy" safe-area-inset-bottom title="隐私政策" closeable
|
||||||
style="min-height: 50%; padding: 0px 10px 10px 10px">
|
style="min-height: 50%; padding: 0px 10px 10px 10px">
|
||||||
<div class="w100 html">
|
<div class="w100 html">
|
||||||
@ -115,135 +139,196 @@ import { useUserStore } from '@/stores/user'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: {
|
formData: {
|
||||||
Phone: '',
|
Phone: '',
|
||||||
SmsCode: '',
|
SmsCode: '',
|
||||||
Password: '',
|
Password: '',
|
||||||
RePassword: '',
|
RePassword: '',
|
||||||
Recommend: localStorage.getItem('recommend') || ''
|
Recommend: localStorage.getItem('recommend') || ''
|
||||||
},
|
},
|
||||||
|
isReg: false,
|
||||||
active: 0,
|
active: 0,
|
||||||
checked: false,
|
checked: false,
|
||||||
show1: false,
|
showPassword: false,
|
||||||
show2: false,
|
showConfirmPassword: false,
|
||||||
showContract: false,
|
showContract: false,
|
||||||
showPolicy: false,
|
showPolicy: false,
|
||||||
isSend: false,
|
|
||||||
remainTime: 0,
|
|
||||||
loading: false,
|
loading: false,
|
||||||
|
smsCode: '', // 接口返回的验证码
|
||||||
|
countdown: {
|
||||||
|
isCounting: false,
|
||||||
|
seconds: 0,
|
||||||
|
timer: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
if (this.$isLogin?.()) {
|
if (this.$isLogin?.()) {
|
||||||
location.replace('#/');
|
location.replace('#/')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$closeSkeleton?.();
|
this.$closeSkeleton?.()
|
||||||
|
|
||||||
},
|
},
|
||||||
login() {
|
validatePhone(phone) {
|
||||||
if (!this.data.Phone) {
|
if (!phone) {
|
||||||
this.$showFailToast?.('请输入手机号');
|
this.$showFailToast?.('请输入手机号')
|
||||||
return;
|
return false
|
||||||
}
|
}
|
||||||
if (!this.$validPhone?.(this.data.Phone)) {
|
if (!this.$validPhone?.(phone)) {
|
||||||
this.$showFailToast?.('手机号格式错误');
|
this.$showFailToast?.('手机号格式错误')
|
||||||
return;
|
return false
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
validateAgreement() {
|
||||||
if (!this.checked) {
|
if (!this.checked) {
|
||||||
this.$showFailToast?.('请选中"同意《用户协议》和《隐私政策》"');
|
this.$showFailToast?.('请选中"同意《用户协议》和《隐私政策》"')
|
||||||
return;
|
return false
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
getSmsCode() {
|
||||||
|
if (!this.validatePhone(this.formData.Phone)) return
|
||||||
|
|
||||||
this.$post('/v1/client/AuthClient/login', {
|
// 开始倒计时
|
||||||
"username": this.data.Phone,
|
this.countdown.isCounting = true
|
||||||
"userpwd": this.data.Password
|
this.countdown.seconds = 60
|
||||||
}).then(data => {
|
this.countdown.timer = setInterval(() => {
|
||||||
this.loading = false;
|
if (this.countdown.seconds > 0) {
|
||||||
// console.log(data);
|
this.countdown.seconds--
|
||||||
|
} else {
|
||||||
|
this.countdown.isCounting = false
|
||||||
|
clearInterval(this.countdown.timer)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
if (data.status !== 200) {
|
this.$post('/v1/client/AuthClient/sendcode', this.formData.Phone).then(data => {
|
||||||
this.$showFailToast(data.message);
|
if (data.status === 200) {
|
||||||
|
this.$showSuccessToast?.('发送成功')
|
||||||
|
this.smsCode = data.data // 保存接口返回的验证码
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.countdown.isCounting = false
|
||||||
|
clearInterval(this.countdown.timer)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
if (!this.validatePhone(this.formData.Phone)) return
|
||||||
|
if (!this.validateAgreement()) return
|
||||||
|
|
||||||
|
if (this.isReg) {
|
||||||
|
this.handleRegister()
|
||||||
|
} else {
|
||||||
|
this.handleLogin()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleLogin() {
|
||||||
|
// 账号密码登录
|
||||||
|
if (this.active === 0) {
|
||||||
|
if (!this.formData.Password) {
|
||||||
|
this.$showFailToast?.('请输入密码')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.loading = true
|
||||||
const userStore = useUserStore()
|
this.$post('/v1/client/AuthClient/loginpwd', {
|
||||||
userStore.setToken(data.data.token)
|
cellphone: this.formData.Phone,
|
||||||
this.$showSuccessToast(data.message);
|
userpwd: this.formData.Password
|
||||||
location.replace('#/My');
|
}).then(data => {
|
||||||
})
|
this.loading = false
|
||||||
|
if (data.status !== 200) {
|
||||||
|
this.$showFailToast?.(data.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const userStore = useUserStore()
|
||||||
|
userStore.setToken(data.data.token)
|
||||||
|
this.$showSuccessToast?.(data.message)
|
||||||
|
location.replace('#/My')
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
this.$showFailToast?.(err.message || '登录失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 手机验证码登录
|
||||||
|
else {
|
||||||
|
if (!this.formData.SmsCode) {
|
||||||
|
this.$showFailToast?.('请输入验证码')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
this.$post('/v1/client/AuthClient/logincode', {
|
||||||
|
cellphone: this.formData.Phone,
|
||||||
|
code: this.formData.SmsCode,
|
||||||
|
pcellphone: this.formData.Recommend
|
||||||
|
}).then(data => {
|
||||||
|
this.loading = false
|
||||||
|
if (data.status !== 200) {
|
||||||
|
this.$showFailToast?.(data.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const userStore = useUserStore()
|
||||||
|
userStore.setToken(data.data.token)
|
||||||
|
this.$showSuccessToast?.(data.message)
|
||||||
|
location.replace('#/My')
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
this.$showFailToast?.(err.message || '登录失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
reg() {
|
handleRegister() {
|
||||||
if (!this.data.Phone) {
|
if (!this.formData.SmsCode) {
|
||||||
this.$showFailToast?.('请设置至少6位字母或数字的账号');
|
this.$showFailToast?.('请输入验证码')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
if (this.data.Phone.length < 6) {
|
// 验证用户输入的验证码与接口返回的是否一致
|
||||||
this.$showFailToast?.('请设置至少6位字母或数字的账号');
|
if (this.formData.SmsCode !== this.smsCode) {
|
||||||
return;
|
this.$showFailToast?.('验证码错误')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (!this.$validPhone?.(this.data.Phone)) {
|
if (!this.formData.Password) {
|
||||||
this.$showFailToast?.('手机号格式错误');
|
this.$showFailToast?.('请输入密码')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
// if (!this.data.SmsCode) {
|
if (this.formData.Password !== this.formData.RePassword) {
|
||||||
// this.$showFailToast?.('请输入验证码');
|
this.$showFailToast?.('两次密码输入不一致')
|
||||||
// return;
|
return
|
||||||
// }
|
|
||||||
if (!this.data.Password) {
|
|
||||||
this.$showFailToast?.('请输入密码');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (this.data.Password !== this.data.RePassword) {
|
if (this.formData.Password.length < 6) {
|
||||||
this.$showFailToast?.('两次密码输入不一致');
|
this.$showFailToast?.('密码至少6位')
|
||||||
return;
|
return
|
||||||
}
|
|
||||||
if (!this.checked) {
|
|
||||||
this.$showFailToast?.('请选中"同意《用户协议》和《隐私政策》"');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.loading = true
|
||||||
this.$post('/v1/client/AuthClient/register', {
|
this.$post('/v1/client/AuthClient/register', {
|
||||||
"username": this.data.Phone,
|
cellphone: this.formData.Phone,
|
||||||
"userpwd": this.data.Password,
|
userpwd: this.formData.Password,
|
||||||
"phone": this.data.Recommend
|
pcellphone: this.formData.Recommend
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
|
this.loading = false
|
||||||
if (data.status !== 200) {
|
if (data.status !== 200) {
|
||||||
this.$showFailToast(data.message);
|
this.$showFailToast?.(data.message)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
userStore.setToken(data.data.token)
|
userStore.setToken(data.data.token)
|
||||||
this.$showSuccessToast('注册成功');
|
this.$showSuccessToast?.('注册成功')
|
||||||
location.replace('#/My');
|
location.replace('#/My')
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
this.$showFailToast?.(err.message || '注册失败')
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
// getSmsCode() {
|
},
|
||||||
// if (!this.$validPhone?.(this.data.Phone)) {
|
mounted() {
|
||||||
// this.$showFailToast?.('手机号格式错误');
|
this.init()
|
||||||
// return;
|
},
|
||||||
// }
|
beforeUnmount() {
|
||||||
|
if (this.countdown.timer) {
|
||||||
// // 静态模拟发送验证码
|
clearInterval(this.countdown.timer)
|
||||||
// this.isSend = true;
|
}
|
||||||
// this.remainTime = 60;
|
|
||||||
// this.$showSuccessToast?.('发送成功');
|
|
||||||
|
|
||||||
// const timer = setInterval(() => {
|
|
||||||
// if (this.remainTime > 0) {
|
|
||||||
// this.remainTime--;
|
|
||||||
// } else {
|
|
||||||
// clearInterval(timer);
|
|
||||||
// this.isSend = false;
|
|
||||||
// }
|
|
||||||
// }, 1000);
|
|
||||||
// },
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,30 +1,77 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage />
|
<BasePage />
|
||||||
|
|
||||||
<div class="ResetPwd">
|
<div class="ResetPwd login">
|
||||||
<div class="R_round">
|
<div class="logo">
|
||||||
<div class="text">
|
<div class="fonts">
|
||||||
修改密码
|
<b>找回密码</b>
|
||||||
<!-- <p>密码需要6-12位数字或英文</p> -->
|
|
||||||
</div>
|
</div>
|
||||||
<van-field v-model="data.UserName" left-icon="/img/login-i1.png" placeholder="请输入账号" />
|
|
||||||
|
|
||||||
<!-- <van-field v-model="data.Phone" left-icon="/img/login_i1.png" placeholder="请输入已绑定的手机号" /> -->
|
|
||||||
<van-field v-model="data.SmsCode" type="number" left-icon="/img/login-i2.png" placeholder="请输入验证码">
|
|
||||||
<template #button>
|
|
||||||
<div @click="sendCode">
|
|
||||||
{{ isSend ? `已发送(${remainTime}s)` : "点击获取" }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</van-field>
|
|
||||||
<!-- <van-field v-model="data.OPassword" type="password" left-icon="/img/login-i3.png" placeholder="请输入旧密码" /> -->
|
|
||||||
|
|
||||||
<van-field v-model="data.Password" type="password" left-icon="/img/login-i3.png" placeholder="请输入密码" />
|
|
||||||
<van-field v-model="data.RePassword" type="password" left-icon="/img/login-i3.png" placeholder="请再次输入密码"
|
|
||||||
:error="inputError.password" />
|
|
||||||
|
|
||||||
<van-button block @click="reset">修改</van-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="contaiar">
|
||||||
|
<div class="lg_box">
|
||||||
|
<form action="">
|
||||||
|
<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.UserName"
|
||||||
|
onblur="window.scrollTo(0, 0);" />
|
||||||
|
<van-icon @click="data.UserName = ''" name="cross" size="5vw"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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.SmsCode" maxlength="6"
|
||||||
|
onblur="window.scrollTo(0, 0);" />
|
||||||
|
<van-button class="hqyzm" @click="sendCode" :disabled="isSend">
|
||||||
|
{{ isSend ? `已发送(${remainTime}s)` : "获取验证码" }}
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<van-icon @click="show1 = false" name="closed-eye" size="5vw" v-else></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<van-icon @click="show2 = false" name="closed-eye" size="5vw" v-else></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-button class="submit" type="commit" @click="reset" :loading="loading"
|
||||||
|
loading-text="提交中..">确认修改</van-button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -41,6 +88,8 @@ export default {
|
|||||||
isSend: false,
|
isSend: false,
|
||||||
remainTime: 0,
|
remainTime: 0,
|
||||||
inputError: {},
|
inputError: {},
|
||||||
|
show1: false,
|
||||||
|
show2: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -15,13 +15,13 @@
|
|||||||
<div class="b_l"
|
<div class="b_l"
|
||||||
style="background: #daa366;margin-left: 10px;width: 240px;padding: 5px 10px;border-radius: 10px;">
|
style="background: #daa366;margin-left: 10px;width: 240px;padding: 5px 10px;border-radius: 10px;">
|
||||||
<div class="b_l">
|
<div class="b_l">
|
||||||
<img :src="$file($ls.get('member_avatar'))" width="40" height="40"
|
<img :src="$file($ls.get('userimg'))" width="40" height="40"
|
||||||
style="border-radius: 100%; vertical-align: top" />
|
style="border-radius: 100%; vertical-align: top" />
|
||||||
</div>
|
</div>
|
||||||
<div class="b_l"
|
<div class="b_l"
|
||||||
style=" line-height: 40px;padding-left: 5px;font-size: 14px;font-weight: bold;color: #fff;">
|
style=" line-height: 40px;padding-left: 5px;font-size: 14px;font-weight: bold;color: #fff;">
|
||||||
{{ $ls.get('member_nickName')?.length > 8 ? $ls.get('member_nickName').substring(0, 6)
|
{{ $ls.get('nickname')?.length > 8 ? $ls.get('nickname').substring(0, 6)
|
||||||
+ "..." : $ls.get('member_nickName') }}
|
+ "..." : $ls.get('nickname') }}
|
||||||
友情推荐
|
友情推荐
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -217,6 +217,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { html2canvas, canvasToDataURL } from '@/utils/html2image';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GoodsDetail',
|
name: 'GoodsDetail',
|
||||||
emits: ['updateShare'],
|
emits: ['updateShare'],
|
||||||
@ -226,33 +228,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
id: 'static_goods_001',
|
|
||||||
name: '有机红富士苹果',
|
|
||||||
description: '源自新疆阿克苏,天然有机种植,皮薄肉脆,汁多味甜',
|
|
||||||
originalprice: 98.00,
|
|
||||||
saleprice: 68.00,
|
|
||||||
salenums: 1520,
|
|
||||||
img: '/img/goods-1.png',
|
|
||||||
imgs: '/img/goods-1.png;/img/goods-2.png',
|
|
||||||
contents: '<p style="text-align:center;"><img src="/img/goods-1.png" width="100%"/></p><p style="text-align:center;"><img src="/img/goods-2.png" width="100%"/></p><p style="text-align:center;color:#666;">有机红富士苹果产自新疆阿克苏地区,采用天然有机种植方式,不使用化学农药和化肥。</p><p style="text-align:center;color:#666;">特点:皮薄肉脆、汁多味甜、营养丰富</p>',
|
|
||||||
specSelect: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '规格',
|
|
||||||
specids: '3',
|
|
||||||
children: [
|
|
||||||
{ id: 3, name: '1kg', specids: null, children: [] },
|
|
||||||
{ id: 4, name: '2kg', specids: null, children: [] },
|
|
||||||
{ id: 5, name: '5kg', specids: null, children: [] }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
specCombinations: [
|
|
||||||
{ skuid: '3', skuname: '1kg', img: '/img/goods-1.png', originalprice: 68.00, saleprice: 68.00, saleleft: 100, ismain: true },
|
|
||||||
{ skuid: '4', skuname: '2kg', img: '/img/goods-1.png', originalprice: 128.00, saleprice: 128.00, saleleft: 80, ismain: false },
|
|
||||||
{ skuid: '5', skuname: '5kg', img: '/img/goods-1.png', originalprice: 298.00, saleprice: 298.00, saleleft: 50, ismain: false }
|
|
||||||
],
|
|
||||||
ForbiddenRule: []
|
|
||||||
},
|
},
|
||||||
specSelect: [],
|
specSelect: [],
|
||||||
specCombinations: [],
|
specCombinations: [],
|
||||||
@ -326,7 +301,7 @@ export default {
|
|||||||
onSelect(option, index) {
|
onSelect(option, index) {
|
||||||
this.showShare = false;
|
this.showShare = false;
|
||||||
if (option.name === "分享海报") {
|
if (option.name === "分享海报") {
|
||||||
this.showShareImg = true;
|
this.generateShareImg();
|
||||||
} else if (option.name == "复制链接") {
|
} else if (option.name == "复制链接") {
|
||||||
this.$copyText(location.href);
|
this.$copyText(location.href);
|
||||||
this.$showToast({ type: "success", message: "复制成功" });
|
this.$showToast({ type: "success", message: "复制成功" });
|
||||||
@ -344,6 +319,24 @@ export default {
|
|||||||
beforeShare() {
|
beforeShare() {
|
||||||
this.showShare = true;
|
this.showShare = true;
|
||||||
},
|
},
|
||||||
|
async generateShareImg() {
|
||||||
|
var shareContent = document.querySelector('#bsCard');
|
||||||
|
var width = shareContent.offsetWidth;
|
||||||
|
var height = shareContent.offsetHeight;
|
||||||
|
try {
|
||||||
|
var canvas = await html2canvas(shareContent, {
|
||||||
|
scale: 2,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
useCORS: true,
|
||||||
|
allowTaint: true,
|
||||||
|
});
|
||||||
|
this.ShareImg = canvasToDataURL(canvas, "image/png", 1.0);
|
||||||
|
this.showShareImg = true;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
formatTime(seconds) {
|
formatTime(seconds) {
|
||||||
const hours = Math.floor(seconds / 3600);
|
const hours = Math.floor(seconds / 3600);
|
||||||
const minutes = Math.floor((seconds % 3600) / 60);
|
const minutes = Math.floor((seconds % 3600) / 60);
|
||||||
|
|||||||
164
src/views/Goods/NGoodsDetail.vue
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<template>
|
||||||
|
<BasePage>
|
||||||
|
<div class="goodsdetails">
|
||||||
|
<div class="t">
|
||||||
|
<img :src="$file(data.img)" alt="">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="goodsshow">
|
||||||
|
<div class="t">
|
||||||
|
<div class="tit">
|
||||||
|
{{ data.name }}
|
||||||
|
</div>
|
||||||
|
<div class="desc" v-if="data.description">
|
||||||
|
{{ data.description }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="price_box">
|
||||||
|
<div class="price">
|
||||||
|
¥{{ data.saleprice?.toFixed(2) }}
|
||||||
|
</div>
|
||||||
|
<div class="oprice">
|
||||||
|
¥{{ data.originalprice?.toFixed(2) }}
|
||||||
|
</div>
|
||||||
|
<div class="sales r">
|
||||||
|
已售{{ data.salenums }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="deduct_box">
|
||||||
|
<div class="point">
|
||||||
|
<img src="/img/de-i1.png" alt="">
|
||||||
|
积分抵¥1999.00
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="vip">
|
||||||
|
<img src="/img/de-i2.png" alt="">
|
||||||
|
会员卡额度抵¥1999.00
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="gt">
|
||||||
|
<div>
|
||||||
|
<img src="/img/gt-i1.png" alt="">
|
||||||
|
正品保障
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img src="/img/gt-i1.png" alt="">
|
||||||
|
快速发货
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img src="/img/gt-i1.png" alt="">
|
||||||
|
售后无忧
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spec_box">
|
||||||
|
<img src="/img/spec.png" alt="">
|
||||||
|
<span>请选择规格分类</span>
|
||||||
|
<van-icon class="r" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="prodetail">
|
||||||
|
<div class="tit">
|
||||||
|
<img src="/img/pro.png" alt="">
|
||||||
|
<span>产品详情</span>
|
||||||
|
</div>
|
||||||
|
<div class="vhtml">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-action-bar safe-area-inset-bottom placeholder>
|
||||||
|
<van-action-bar-icon icon="/img/vb-home.png" text="首页" @click="$navigate('Home')" />
|
||||||
|
<van-action-bar-icon icon="/img/vb-service.png" text="客服" @click="$navigate('Service')" />
|
||||||
|
<van-action-bar-icon icon="/img/vb-share.png" text="分享" @click="showShare = true" />
|
||||||
|
<van-action-bar-button type="danger" text="立即购买" @click="showSpecs = true" />
|
||||||
|
</van-action-bar>
|
||||||
|
|
||||||
|
<van-share-sheet v-model:show="showShare" title="立即分享给好友" :options="options" @select="onSelect" />
|
||||||
|
|
||||||
|
<van-popup v-model:show="showSpecs" position="bottom" closeable round>
|
||||||
|
<div class="showspec">
|
||||||
|
<div class="goods">
|
||||||
|
<img :src="$file(data.img)" alt="">
|
||||||
|
<div>
|
||||||
|
<div class="s_price">¥</div>
|
||||||
|
<div class="s_stock">剩余:</div>
|
||||||
|
<div class="s_spec">已选:</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spec_box">
|
||||||
|
<span class="title">
|
||||||
|
基本规格
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="speccc">
|
||||||
|
<div class="spec_de">
|
||||||
|
瓶
|
||||||
|
</div>
|
||||||
|
<div class="spec_de">
|
||||||
|
瓶
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buynums">
|
||||||
|
<span class="title">
|
||||||
|
购买数量
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<van-stepper class="r" integer v-model="value" theme="round" button-size="22" disable-input />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-action-bar safe-area-inset-bottom placeholder>
|
||||||
|
<van-action-bar-button color="#ca2904" type="danger" text="立即购买" @click="showSpecs = true" />
|
||||||
|
</van-action-bar>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</BasePage>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'GoodsDetail',
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: {},
|
||||||
|
showShare: false,
|
||||||
|
showSpecs: false,
|
||||||
|
options: [
|
||||||
|
{ name: '分享海报', icon: '/img/share.png' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.$get(`/v1/client/EProsClient/${this.$route.query.id}`).then(res => {
|
||||||
|
this.data = res.data;
|
||||||
|
this.specSelect = this.data.specSelect || [];
|
||||||
|
this.specCombinations = this.data.specCombinations || [];
|
||||||
|
this.shareLink = `${location.origin}/GoodsDetail?id=${this.data.id}`;
|
||||||
|
this.$emit('updateShare', { title: this.data.name, imageUrl: this.data.img, link: this.shareLink });
|
||||||
|
// this.initDefaultSku();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
</keep-alive>
|
</keep-alive>
|
||||||
<component :is="Component" :key="route.name" v-if="!route.meta.cache" />
|
<component :is="Component" :key="route.name" v-if="!route.meta.cache" />
|
||||||
</router-view>
|
</router-view>
|
||||||
<van-tabbar v-model="DefaultActive" placeholder @change="changeActive" active-color="#077e43" inactive-color="#1b1b1b"
|
<van-tabbar v-model="DefaultActive" placeholder @change="changeActive" active-color="#841e36" inactive-color="#1b1b1b"
|
||||||
fixed>
|
fixed>
|
||||||
<van-tabbar-item v-for="item in Tabbars" :key="item.Name" :name="item.Name" :badge="getBadge(item)" :dot="item.Dot"
|
<van-tabbar-item v-for="item in Tabbars" :key="item.Name" :name="item.Name" :badge="getBadge(item)" :dot="item.Dot"
|
||||||
@click="onTabClick(item.Name)">
|
@click="onTabClick(item.Name)">
|
||||||
@ -36,12 +36,6 @@ export default {
|
|||||||
Icon_Active: '/img/Gift_Active.png',
|
Icon_Active: '/img/Gift_Active.png',
|
||||||
Icon_Inactive: '/img/Gift_Inactive.png',
|
Icon_Inactive: '/img/Gift_Inactive.png',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: 'Agriculture',
|
|
||||||
Label: '助农区',
|
|
||||||
Icon_Active: '/img/Agriculture_Active.png',
|
|
||||||
Icon_Inactive: '/img/Agriculture_Inactive.png',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: 'Mall',
|
Name: 'Mall',
|
||||||
Label: '商城',
|
Label: '商城',
|
||||||
@ -55,9 +49,7 @@ export default {
|
|||||||
Icon_Inactive: '/img/My_Inactive.png',
|
Icon_Inactive: '/img/My_Inactive.png',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
lastClickedTab: null,
|
}
|
||||||
clickTimer: null,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.path': {
|
'$route.path': {
|
||||||
@ -85,15 +77,12 @@ export default {
|
|||||||
return item.Badge || ''
|
return item.Badge || ''
|
||||||
},
|
},
|
||||||
onTabClick(name) {
|
onTabClick(name) {
|
||||||
if (this.lastClickedTab === name) {
|
if (this.$route.name === name) {
|
||||||
// 重复点击,刷新当前页面
|
// 当前路由,双击刷新
|
||||||
window.location.reload()
|
this.$router.replace({ name })
|
||||||
// this.$router.replace({ name })
|
|
||||||
} else {
|
} else {
|
||||||
// 正常切换 tab
|
|
||||||
this.$router.push({ name })
|
this.$router.push({ name })
|
||||||
}
|
}
|
||||||
this.lastClickedTab = name
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,11 +105,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="back" @click="$navigate('my')">
|
<button class="back" @click="$showManagerPopup()">
|
||||||
返回个人中心
|
返回个人中心
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -120,6 +123,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showInfo: false,
|
||||||
data: {
|
data: {
|
||||||
id: 'merchant_001',
|
id: 'merchant_001',
|
||||||
MerchantAvatar: '/img/co-1.png',
|
MerchantAvatar: '/img/co-1.png',
|
||||||
|
|||||||
@ -1,18 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage>
|
<BasePage>
|
||||||
<div class="Business_School">
|
<div class="Business_School">
|
||||||
|
<img class="banner" src="/img/bs-banner.jpg" alt="">
|
||||||
<div class="list_box">
|
<div class="list_box">
|
||||||
<img style="width: 26.4vw;" src="/img/bs-icon.png" alt="">
|
<!-- <img style="width: 26.4vw;" src="/img/bs-icon.png" alt=""> -->
|
||||||
<div style="margin-top: 3vw;" class="box box-align-center">
|
<div style="margin-top: 3vw;" class="box box-align-center">
|
||||||
<van-tabs style="max-width: 90%;" v-model:active="activeTab" color="#22b338" class="tabs"
|
<van-tabs v-model:active="activeTab" color="#ca2904" title-active-color="#ca2904" class="tabs"
|
||||||
line-height="0.67vw" line-width="8vw" :ellipsis="false" @click-tab="changeTab(category.id)">
|
line-height="0.67vw" line-width="8vw" :ellipsis="false" @click-tab="changeTab(category.id)">
|
||||||
<van-tab v-for="category in categories" :key="category.id" :name="category.id"
|
<van-tab v-for="category in categories" :key="category.id" :name="category.id"
|
||||||
:title="category.name"></van-tab>
|
:title="category.name"></van-tab>
|
||||||
</van-tabs>
|
</van-tabs>
|
||||||
<img class="r" @click="showLeft = true" style="height: 4vw;" src="/img/filter.png" alt="filter">
|
<!-- <img class="r" @click="showLeft = true" style="height: 4vw;" src="/img/filter.png" alt="filter"> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<BaseList :url="`/v1/client/CBusinessschoolsClient`" class="list_item">
|
<BaseList :url="`/v1/client/CBusinessschoolsClient`" :params="params" class="list_item">
|
||||||
<template #default="{ item }">
|
<template #default="{ item }">
|
||||||
<div class="school-list" :key="item.id" @click="$navigate(`/School_Detail?id=${item.id}`)">
|
<div class="school-list" :key="item.id" @click="$navigate(`/School_Detail?id=${item.id}`)">
|
||||||
<div class="img">
|
<div class="img">
|
||||||
@ -26,7 +27,7 @@
|
|||||||
{{ item.description }}
|
{{ item.description }}
|
||||||
</div>
|
</div>
|
||||||
<div class="times">
|
<div class="times">
|
||||||
<span>{{ $formatGMT(item.addtime, 'yyyy-MM-dd') }}</span>
|
<span>{{ $formatGMT(item.addtime, 'yyyy-MM-dd HH:mm:ss') }}</span>
|
||||||
<span>阅览量 {{ item.ReadCount }}</span>
|
<span>阅览量 {{ item.ReadCount }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -79,16 +80,24 @@ export default {
|
|||||||
activeTab: 1,
|
activeTab: 1,
|
||||||
showLeft: false,
|
showLeft: false,
|
||||||
categories: [],
|
categories: [],
|
||||||
|
params: {
|
||||||
|
pid: 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
params() {
|
||||||
|
return {
|
||||||
|
pid: this.activeTab
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.$get('/v1/client/CBusinessschoolcatesClient').then(res => {
|
this.$get('/v1/client/CBusinessschoolcatesClient',).then(res => {
|
||||||
this.categories = res.data;
|
this.categories = res.data;
|
||||||
console.log(this.categories);
|
console.log(this.categories);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="index-page">
|
<div class="index-page">
|
||||||
<van-swipe v-if="data && data.Carousel" @change="onSwipe" :autoplay="3000" indicator-color="white">
|
<van-swipe v-if="data && data.Carousel" @change="onSwipe" :autoplay="3000" indicator-color="white">
|
||||||
<van-swipe-item v-for="item in data.Carousel">
|
<van-swipe-item v-for="item in data.Carousel">
|
||||||
<a @click="item.link ? $openUrl(item.Url) : ''"><img :src="$file(item.img || 'base/avatar.png')"
|
<a @click="item.link ? $openUrl(item.Url) : ''"><img :src="$file(item.img) || '/img/avatar.png'"
|
||||||
width="100%"></a>
|
width="100%"></a>
|
||||||
</van-swipe-item>
|
</van-swipe-item>
|
||||||
</van-swipe>
|
</van-swipe>
|
||||||
@ -24,77 +24,61 @@
|
|||||||
</van-swipe>
|
</van-swipe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column4">
|
<div class="column3_part">
|
||||||
<div @click="$navigate('/ColumnDetail?id=1')">
|
<div class="p1" @click="$navigate('/ColumnDetail?id=1')">
|
||||||
<img src="/img/index-column-i1.png">
|
<img src="/img/index-column-i1.png">
|
||||||
<span>关于我们</span>
|
<span>公司介绍</span>
|
||||||
|
<p>了解泰古润</p>
|
||||||
</div>
|
</div>
|
||||||
<div @click="$navigate('/Business_School')">
|
<div class="p2" @click="$navigate('/Business_School')">
|
||||||
<img src="/img/index-column-i2.png">
|
<img src="/img/index-column-i2.png">
|
||||||
<span>商学院</span>
|
<span>商学院</span>
|
||||||
|
<p>学习知识</p>
|
||||||
</div>
|
</div>
|
||||||
<div @click="$navigate('/ColumnDetail?id=2')">
|
<!-- <div @click="$navigate('/ColumnDetail?id=2')">
|
||||||
<img src="/img/index-column-i3.png">
|
<img src="/img/index-column-i3.png">
|
||||||
<span>招商合作</span>
|
<span>招商合作</span>
|
||||||
</div>
|
</div> -->
|
||||||
<div @click="$navigate('/Column?pid=3')">
|
<div class="p3" @click="$navigate('/Column?pid=3')">
|
||||||
<img src="/img/index-column-i4.png">
|
<img src="/img/index-column-i4.png">
|
||||||
<span>保供动态</span>
|
<span>公司动态</span>
|
||||||
|
<p>最新动态资讯</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tomall">
|
<div class="tomall">
|
||||||
<div class="base_box left" @click="$navigate('Gift')">
|
<div class="base_box left" @click="$navigate('Gift')">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<b>商务专区</b>
|
<b>升级礼包</b>
|
||||||
<p>购买升级</p>
|
<span>购买即可升级</span>
|
||||||
|
<!-- <p>购买即可升级</p> -->
|
||||||
</div>
|
</div>
|
||||||
<img src="/img/tomall_i1.png" alt="">
|
<img src="/img/tomall_i1.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="base_box right">
|
<div class="base_box right" @click="$navigate('Mall')">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<b>商城钜惠</b>
|
<b>官方商城</b>
|
||||||
<p>大家都在买</p>
|
<span>享受更多优惠</span>
|
||||||
</div>
|
<!-- <p>大家都在买</p> -->
|
||||||
|
|
||||||
<div class="box box-pack-between img_box" style="width: 100%;">
|
|
||||||
<img src="/img/goods-1.png" alt="">
|
|
||||||
<img src="/img/goods-2.png" alt="">
|
|
||||||
</div>
|
</div>
|
||||||
|
<img src="/img/tomall_i2.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="k">
|
<div class="k">
|
||||||
<div class="tit mx-auto">
|
<div class="tit mx-auto">
|
||||||
<span style="margin-bottom: 3.467vw;">
|
<span style="margin-bottom: 3.467vw;">
|
||||||
<font>保供</font>视频
|
<!-- <font></font> -->
|
||||||
|
宣传视频
|
||||||
</span>
|
</span>
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="top">
|
|
||||||
<div class="video">
|
|
||||||
<div class="_c">
|
|
||||||
<video v-if="data.Video" :poster="$file(data.Video.poster)" controls="">
|
|
||||||
<source :src="$file(data.Video.url)" type="video/mp4" />
|
|
||||||
</video>
|
|
||||||
<video src=""></video>
|
|
||||||
<div class="video-btn">
|
|
||||||
<van-button @click="$navigate('ColumnDetail?id=Introduce')" round>
|
|
||||||
了解我们
|
|
||||||
</van-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<div class="video_box">
|
<div class="video_box">
|
||||||
|
<video v-if="data.Video" :src="$file(data.Video.filecover)" controls></video>
|
||||||
|
|
||||||
<div class="vd-bg">
|
<button @click="$navigate('/ColumnDetail?id=1')">了解我们</button>
|
||||||
<video v-if="data.Video" :src="$file(data.Video.filecover)" controls></video>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button>了解我们</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -102,7 +86,8 @@
|
|||||||
|
|
||||||
<div class="tit">
|
<div class="tit">
|
||||||
<span>
|
<span>
|
||||||
<font>保供</font>动态
|
<!-- <font>保供</font>动态 -->
|
||||||
|
平台动态
|
||||||
</span>
|
</span>
|
||||||
<p></p>
|
<p></p>
|
||||||
<a @click="$navigate('Column?id=Trends')">
|
<a @click="$navigate('Column?id=Trends')">
|
||||||
|
|||||||
@ -10,12 +10,12 @@
|
|||||||
<div class="banner">
|
<div class="banner">
|
||||||
<van-swipe :autoplay="3000" indicator-color="white">
|
<van-swipe :autoplay="3000" indicator-color="white">
|
||||||
<van-swipe-item v-for="item in data.Carousel">
|
<van-swipe-item v-for="item in data.Carousel">
|
||||||
<a @click="item.link ? $openUrl(item.link) : ''"><img :src="$file(item.img) || 'base/avatar.png'"
|
<a @click="item.link ? $openUrl(item.link) : ''"><img :src="$file(item.img) || '/img/avatar.png'"
|
||||||
width="100%"></a>
|
width="100%"></a>
|
||||||
</van-swipe-item>
|
</van-swipe-item>
|
||||||
</van-swipe>
|
</van-swipe>
|
||||||
</div>
|
</div>
|
||||||
<div class="label_box">
|
<!-- <div class="label_box">
|
||||||
<div class="">
|
<div class="">
|
||||||
<img src="/img/mall_i1.png" alt="">
|
<img src="/img/mall_i1.png" alt="">
|
||||||
<span>
|
<span>
|
||||||
@ -34,24 +34,36 @@
|
|||||||
售后无忧
|
售后无忧
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cg_bigbox">
|
||||||
|
<div class="top">
|
||||||
|
<div class="left_box">
|
||||||
|
<img src="/img/safity.png" alt="">
|
||||||
|
<span>安心购</span>
|
||||||
|
</div>
|
||||||
|
<div class="right_box">
|
||||||
|
<span>官方商城</span> | <span>正品保障</span> | <span>售后无忧</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="Category_box">
|
||||||
|
<div class="Category_item" v-for="item in data.SpuType?.slice(0, 9)"
|
||||||
|
@click="$navigate(`Category?id=${item.id}`)">
|
||||||
|
<img :src="$file(item.img)">
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="Category_item" @click="$navigate('Category')">
|
||||||
|
<img src="/img/mall_i15.png">
|
||||||
|
<span>全部分类</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="Category_box">
|
<!-- Style1 -->
|
||||||
<div class="Category_item" v-for="item in data.SpuType?.slice(0, 9)" @click="$navigate(`Category?id=${item.id}`)">
|
<!-- <div class="banner_style1" v-if="hotData.length > 0">
|
||||||
<img :src="$file(item.img)">
|
Style1
|
||||||
<span>{{ item.name }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="Category_item" @click="$navigate('Category')">
|
|
||||||
<img src="/img/mall_i15.png">
|
|
||||||
<span>全部分类</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<img class="b_l_w" style="width: 100%;margin: 2.8vw 0;" src="/img/toGift.png" @click="$navigate('/Gift')" alt="">
|
|
||||||
|
|
||||||
<div class="banner_box" v-if="hotData.length > 0">
|
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img src="/img/rexiao.png" alt="">
|
<img src="/img/rexiao.png" alt="">
|
||||||
@ -62,13 +74,14 @@
|
|||||||
<van-icon name="arrow" />
|
<van-icon name="arrow" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="banner">
|
<div class="banner">
|
||||||
<van-swipe class="my-swipe" :autoplay="3000" show-indicators indicator-color="#565656">
|
<van-swipe class="my-swipe" :autoplay="3000" show-indicators indicator-color="#565656">
|
||||||
<van-swipe-item v-for="item in hotData">
|
<van-swipe-item v-for="item in hotData">
|
||||||
<div class="item" v-for="list in item" @click="$navigate('GoodsDetail?id=' + list.id)">
|
<div class="item" v-for="list in item" @click="$navigate('GoodsDetail?id=' + list.id)">
|
||||||
<div class="_img">
|
<div class="_img">
|
||||||
<img :src="$file(list.img)" alt="">
|
<img :src="$file(list.img)" alt="">
|
||||||
<!-- v-if="list.MemberPoint > 0" -->
|
v-if="list.MemberPoint > 0"
|
||||||
<div class="_point_">
|
<div class="_point_">
|
||||||
<img src="/img/mall-hot-i.png">
|
<img src="/img/mall-hot-i.png">
|
||||||
<div>赠<b>{{ list.gongxianzhi }}</b>贡献值</div>
|
<div>赠<b>{{ list.gongxianzhi }}</b>贡献值</div>
|
||||||
@ -80,6 +93,9 @@
|
|||||||
<span class="sales">
|
<span class="sales">
|
||||||
已售 {{ list.salenums }}
|
已售 {{ list.salenums }}
|
||||||
</span>
|
</span>
|
||||||
|
<span class="oprice">
|
||||||
|
¥{{ list.originalprice.toFixed(2) }}
|
||||||
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<span class="price">
|
<span class="price">
|
||||||
<span class="money">¥</span>
|
<span class="money">¥</span>
|
||||||
@ -93,31 +109,45 @@
|
|||||||
</van-swipe>
|
</van-swipe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<!-- Style2 -->
|
||||||
|
<div class="banner_style2" v-if="hotData.length > 0">
|
||||||
|
<div class="top">
|
||||||
|
<img src="/img/hot.png" alt="">
|
||||||
|
<b>爆款好物</b>
|
||||||
|
<p>超多会员已购买</p>
|
||||||
|
<span class="r" @click="$navigate('Category?SortType=2')">
|
||||||
|
查看更多
|
||||||
|
<van-icon name="arrow" />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="banner">
|
||||||
|
<div class="item" v-for="list in hotData" @click="$navigate('GoodsDetail?id=' + list.id)">
|
||||||
|
<img :src="$file(list.img)" alt="">
|
||||||
|
<span class="title">
|
||||||
|
{{ list.name }}
|
||||||
|
</span>
|
||||||
|
<span class="oprice">
|
||||||
|
¥{{ list.originalprice?.toFixed(2) }}
|
||||||
|
</span>
|
||||||
|
<span class="price">
|
||||||
|
¥{{ list.saleprice?.toFixed(2) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="goods">
|
<div class="goods">
|
||||||
<van-tabs v-model:active="activeType" :ellipsis="false" @change="changeTab">
|
<van-tabs v-model:active="activeType" :ellipsis="false" @change="changeTab" line-height="2vw" line-width="10.67vw"
|
||||||
<van-tab name="">
|
color="#f48fa7" title-active-color="#000" title-inactive-color="#4e4e4e">
|
||||||
<template #title>
|
<van-tab name="" title="新品">
|
||||||
<div class="g_fonts">
|
|
||||||
<span class="g_f1">
|
|
||||||
猜你喜欢
|
|
||||||
</span>
|
|
||||||
<span class="g_f2">
|
|
||||||
为你推荐
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</van-tab>
|
</van-tab>
|
||||||
<van-tab v-for="item in typeData" :name="item.id" :title="item.name">
|
<van-tab v-for="item in typeData" :name="item.id" :title="item.name">
|
||||||
<!-- <template #title>
|
|
||||||
<div class="g_fonts">
|
|
||||||
<span class="g_f1" v-html="item.TypeName"></span>
|
|
||||||
<span class="g_f2" v-html="item.Remark"></span>
|
|
||||||
</div>
|
|
||||||
</template> -->
|
|
||||||
</van-tab>
|
</van-tab>
|
||||||
</van-tabs>
|
</van-tabs>
|
||||||
|
|
||||||
<BaseList ref="BaseList" url="/v1/client/EProsClient" :params="searchParams" :parseData="res => res.data.items"
|
<BaseList ref="BaseList" url="/v1/client/EProsClient" :params="searchParams" :parseData="res => res.data.items"
|
||||||
class="goods_box">
|
class="goods_box">
|
||||||
<template #default="{ item }">
|
<template #default="{ item }">
|
||||||
@ -127,12 +157,12 @@
|
|||||||
<span class="title">
|
<span class="title">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</span>
|
</span>
|
||||||
<div class="zeng_box">
|
<!-- <div class="zeng_box">
|
||||||
<span>赠</span>
|
<span>赠</span>
|
||||||
<div>
|
<div>
|
||||||
{{ item.gongxianzhi }}贡献值
|
{{ item.gongxianzhi }}贡献值
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<span class="oldprice">
|
<span class="oldprice">
|
||||||
¥{{ item.originalprice.toFixed(2) }}
|
¥{{ item.originalprice.toFixed(2) }}
|
||||||
</span>
|
</span>
|
||||||
@ -142,7 +172,7 @@
|
|||||||
<span v-html="$toMoney(item.saleprice, 'b')"></span>
|
<span v-html="$toMoney(item.saleprice, 'b')"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img style="width:5.6vw;height: 5.07vw;margin-bottom: 0;" class="r" src="/img/cart.png" alt="">
|
<!-- <img style="width:5.6vw;height: 5.07vw;margin-bottom: 0;" class="r" src="/img/cart.png" alt=""> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -221,7 +251,7 @@ export default {
|
|||||||
this.data.Carousel = res.data
|
this.data.Carousel = res.data
|
||||||
}),
|
}),
|
||||||
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
this.$get('/v1/client/EProsClient?recommend=true').then(res => {
|
||||||
this.hotData = this.groupItems(res.data?.items || [], 3)
|
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
|
this.typeData = res.data
|
||||||
|
|||||||
165
src/views/Trade/NTradeList.vue
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<BasePage>
|
||||||
|
<div class="tradelist">
|
||||||
|
<div class="tabs">
|
||||||
|
<van-tabs class="area" v-model:active="TradeArea" color="#f00" title-active-color="#222"
|
||||||
|
title-inactive-color="#999" line-width="0" line-height=".667vw" @change="changeMall">
|
||||||
|
<van-tab v-for="i in mallList" :title="i.label" :name="i.value"></van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
|
||||||
|
<van-tabs class="states" v-model:active="activeTab" color="#ca2904" title-active-color="#ca2904"
|
||||||
|
title-inactive-color="#000" line-width="4vw" line-height=".667vw" @change="onTabChange">
|
||||||
|
<van-tab title="全部" name=""></van-tab>
|
||||||
|
<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"
|
||||||
|
@clear="onClear">
|
||||||
|
<template #right-icon>
|
||||||
|
<van-icon name="/img/sort-search.png" @click="onSearch"></van-icon>
|
||||||
|
</template>
|
||||||
|
</van-search>
|
||||||
|
|
||||||
|
<BaseList ref="baseList" url="/v1/client/FOrdersClient" :params="searchParams" :parseData="res => res.data.items"
|
||||||
|
style="padding: 3.33vw;" @refresh="onRefresh">
|
||||||
|
<template #default="{ item }">
|
||||||
|
<div :key="item.ordernum" class="list">
|
||||||
|
<div class="code">
|
||||||
|
订单编号:{{ item.ordernum }}
|
||||||
|
<img src="/img/orderCopy.png" @click="$copyText(item.ordernum); $showSuccessToast('复制订单编号成功')" />
|
||||||
|
</div>
|
||||||
|
<div class="_info" v-for="list in (item.orderdetails || [])" :key="list.id">
|
||||||
|
<img :src="$file(list.proimg)">
|
||||||
|
<div class="_c">
|
||||||
|
<div class="_name">
|
||||||
|
<span>{{ list.proname }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="_spec">
|
||||||
|
<span>{{ list.proskuname?.split(';').join('/') }}</span>
|
||||||
|
<p>x{{ list.buynums }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="_price">
|
||||||
|
<span>¥{{ list.originalprice?.toFixed(2) }}</span>
|
||||||
|
<div>
|
||||||
|
<span style="margin-left: auto;">实付:</span>
|
||||||
|
<b><span>¥</span>{{ list.saleprice?.toFixed(2) }}</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p v-if="item.remark" style="margin-bottom: 3vw;">
|
||||||
|
订单备注:{{ item.remark }}
|
||||||
|
</p>
|
||||||
|
<div class="state">
|
||||||
|
<b :class="`b${item.state}`">
|
||||||
|
{{ item.statename }}
|
||||||
|
</b>
|
||||||
|
<div class="btn">
|
||||||
|
<a class="a2" v-if="item.state == 0" @click="cancelTrade(item)">
|
||||||
|
取消订单
|
||||||
|
</a>
|
||||||
|
<a class="a0" v-if="item.state == 0" @click="$navigate(`/Pay?ordernum=${item.ordernum}`)">
|
||||||
|
立即支付
|
||||||
|
</a>
|
||||||
|
<a class="a1" @click="$navigate(`/TradeDetail?ordernum=${item.ordernum}`)">
|
||||||
|
查看详情
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</BaseList>
|
||||||
|
</div>
|
||||||
|
</BasePage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'TradeList',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeTab: '',
|
||||||
|
TradeArea: Number(this.$route.query.TradeArea) || 3,
|
||||||
|
searchParams: {
|
||||||
|
ordernum: '',
|
||||||
|
state: '',
|
||||||
|
mallstate: Number(this.$route.query.TradeArea) || 3,
|
||||||
|
},
|
||||||
|
tradeStates: [
|
||||||
|
],
|
||||||
|
mallList: [
|
||||||
|
{ value: 3, label: '礼包订单' },
|
||||||
|
{ value: 2, label: '商城订单' },
|
||||||
|
{ value: 1, label: '买单订单' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getTradeStates();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
TradeArea(val) {
|
||||||
|
this.searchParams.mallstate = val;
|
||||||
|
},
|
||||||
|
'$route.query.state': {
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal !== undefined && newVal !== '') {
|
||||||
|
this.activeTab = String(newVal);
|
||||||
|
// this.getTradeStates();
|
||||||
|
} else {
|
||||||
|
this.activeTab = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
this.$router.push('/My')
|
||||||
|
},
|
||||||
|
onTabChange(name) {
|
||||||
|
this.searchParams.state = name;
|
||||||
|
this.$refs.baseList?.refresh();
|
||||||
|
},
|
||||||
|
changeMall(name) {
|
||||||
|
this.searchParams.mallstate = Number(name) || 3;
|
||||||
|
this.searchParams.state = '';
|
||||||
|
this.$refs.baseList?.refresh();
|
||||||
|
},
|
||||||
|
onSearch() {
|
||||||
|
this.$refs.baseList?.refresh();
|
||||||
|
},
|
||||||
|
onClear() {
|
||||||
|
this.searchParams.ordernum = '';
|
||||||
|
this.$refs.baseList?.refresh();
|
||||||
|
},
|
||||||
|
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 || '获取订单状态失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onRefresh() {
|
||||||
|
},
|
||||||
|
cancelTrade(item) {
|
||||||
|
this.$showConfirmDialog({
|
||||||
|
title: "是否确认取消订单",
|
||||||
|
}).then(() => {
|
||||||
|
this.$put(`/v1/client/FOrdersClient/${item.ordernum}/cancel`).then(() => {
|
||||||
|
this.$showSuccessToast('取消订单成功');
|
||||||
|
this.$refs.baseList?.refresh();
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg || '取消失败');
|
||||||
|
});
|
||||||
|
}).catch(() => { });
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -43,11 +43,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
|
|
||||||
<van-cell>
|
<van-cell title="快捷支付HJ(更顺畅)" is-link @click="payMethod = ['wechat']">
|
||||||
<van-button type="primary" size="large" style="width: 100%;" :disabled="payMethod.length !== 1"
|
<template #icon>
|
||||||
@click="doPay">立即支付</van-button>
|
<img class="pay-icon" src="/img/pay_bankcard.png" />
|
||||||
|
</template>
|
||||||
|
<template #right-icon>
|
||||||
|
<van-checkbox name="wechat" :class="{ selected: payMethod.includes('wechat') }" />
|
||||||
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
|
|
||||||
|
<van-button type="primary" size="large" round="" style="width: 100%;margin-top: 6.67vw;"
|
||||||
|
:disabled="payMethod.length !== 1" @click="doPay">立即支付</van-button>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<!-- 支付结果弹窗 -->
|
<!-- 支付结果弹窗 -->
|
||||||
@ -176,6 +183,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
:root {
|
||||||
|
--van-primary-color: #ca2904;
|
||||||
|
}
|
||||||
|
|
||||||
.pay {
|
.pay {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 16.667vw;
|
padding-top: 16.667vw;
|
||||||
@ -196,6 +207,11 @@ export default {
|
|||||||
|
|
||||||
.pay-method {
|
.pay-method {
|
||||||
margin-top: 9.667vw;
|
margin-top: 9.667vw;
|
||||||
|
|
||||||
|
.van-cell__title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pay-icon {
|
.pay-icon {
|
||||||
@ -207,7 +223,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
// align-items: flex-start !important;
|
align-items: flex-start !important;
|
||||||
font-size: 3.667vw;
|
font-size: 3.667vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage>
|
<BasePage>
|
||||||
<div class="b_l_w cart_tj_xzdz">
|
<div class="cart_tj_xzdz">
|
||||||
<div class="b_l_w xzdz" @click="$refs.ad_selector.showSelector()">
|
<div class="xzdz" @click="$refs.ad_selector.showSelector()">
|
||||||
|
<img src="/img/addr.png" alt="">
|
||||||
|
|
||||||
<span v-if="address.ReceiveName">
|
<span v-if="address.ReceiveName">
|
||||||
<p>
|
<p>
|
||||||
{{ address.ReceiveName }}
|
{{ address.ReceiveName }}
|
||||||
@ -14,49 +16,82 @@
|
|||||||
<span v-else>请选择收货地址</span>
|
<span v-else>请选择收货地址</span>
|
||||||
<van-icon name="arrow" />
|
<van-icon name="arrow" />
|
||||||
</div>
|
</div>
|
||||||
<div class="b_l_w cart_tj_xzdz_di"></div>
|
<!-- <div class="b_l_w cart_tj_xzdz_di"></div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="order-details f5">
|
<div class="tradeconfirm">
|
||||||
<div>
|
<div class="product">
|
||||||
<div style="font-size: 3.467vw;">
|
<img :src="$file(product.img)" />
|
||||||
<div class="product">
|
<div class="prodetail">
|
||||||
<div class="d">
|
<b>{{ product.name }}</b>
|
||||||
<img :src="$file(product.img)" />
|
<div>
|
||||||
<div class="c">
|
<p>{{ product.typename }}订单</p>
|
||||||
<b>{{ product.name }}</b>
|
|
||||||
<p>数量:{{ product.buynums }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="price">
|
|
||||||
<b><span>¥</span>{{ (product.saleprice || 0) * (product.buynums || 1) }}</b>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<van-stepper v-model="product.buynums" :min="1" :max="999" input-width="7vw"
|
<b class="r"><span>¥</span>{{ product.saleprice?.toFixed(2) }}</b>
|
||||||
button-size="6vw" integer></van-stepper>
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>规格:{{ product.skuname }}</p>
|
||||||
|
<van-stepper class="r" v-model="product.buynums" :min="1" :max="999" input-width="7vw"
|
||||||
|
button-size="6vw" integer></van-stepper>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="payway">
|
||||||
|
<div class="deduction">
|
||||||
|
<div class="top">
|
||||||
|
<span>商品金额</span>
|
||||||
|
<b class="r"><span>¥</span>{{ ((product.saleprice || 0) * (product.buynums || 1))?.toFixed(2)
|
||||||
|
}}</b>
|
||||||
|
</div>
|
||||||
|
<van-radio-group v-model="checked" checked-color="#ca2904">
|
||||||
|
<van-radio name="1" label-position="left">
|
||||||
|
<template #default>
|
||||||
|
<div class="way">
|
||||||
|
<div class="line">
|
||||||
|
<img src="/img/point_icon.png" alt="">
|
||||||
|
<span>使用积分抵扣</span>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
(当前可用:10.00)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</van-radio>
|
||||||
|
<van-radio name="2" label-position="left">
|
||||||
|
<template #default>
|
||||||
|
<div class="way">
|
||||||
|
<div class="line">
|
||||||
|
<img src="/img/vip_icon.png" alt="">
|
||||||
|
<span>使用会员卡抵扣</span>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
(当前可用:10.00)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</van-radio>
|
||||||
|
</van-radio-group>
|
||||||
|
<div class="count">
|
||||||
|
<div>
|
||||||
|
<span>运费</span>
|
||||||
|
<span class="price">
|
||||||
|
{{ product.expressprice ? '¥' + product.expressprice.toFixed(2) : '¥0.00' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>实付金额</span>
|
||||||
|
<span class="price">
|
||||||
|
{{ product.saleprice ? '¥' + (product.saleprice * product.buynums).toFixed(2) : '¥0.00'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="remark">
|
||||||
<p>
|
<van-field label="买家留言" autosize type="textarea" v-model="remark" placeholder="请输入买家留言" />
|
||||||
商品金额
|
|
||||||
<b>¥{{ totalPrice }}</b>
|
|
||||||
</p>
|
|
||||||
<!-- <van-cell clickable :title="`使用果实抵扣`"
|
|
||||||
:label="`剩余:${fruit}果实,果实单价¥${fruitData.TodayPrice},可抵¥${$trunc(useFruit / 100, 2)}`"
|
|
||||||
@click.stop="toggleClick">
|
|
||||||
<template #right-icon>
|
|
||||||
<van-checkbox v-model="isFruit" checked-color="#ee0a24" :disabled="fruit == 0" @click.stop />
|
|
||||||
</template>
|
|
||||||
</van-cell> -->
|
|
||||||
<p>
|
|
||||||
实付金额
|
|
||||||
<b class="red">¥{{ useFruitPrice }}</b>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-field v-if="product.id" label="买家留言" autosize type="textarea" v-model="remark" placeholder="请输入买家留言" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-submit-bar class="b_l_w" placeholder :price="useFruitPrice * 100" :tip="`商品总数:${totalQuantity}件`"
|
<van-submit-bar class="b_l_w" placeholder :price="useFruitPrice * 100" :tip="`商品总数:${totalQuantity}件`"
|
||||||
@ -91,6 +126,7 @@ export default {
|
|||||||
fruitData: {},
|
fruitData: {},
|
||||||
isFruit: false,
|
isFruit: false,
|
||||||
isloading: false,
|
isloading: false,
|
||||||
|
checked: 1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
@cancel="showRegion = false" />
|
@cancel="showRegion = false" />
|
||||||
</van-popup>
|
</van-popup>
|
||||||
<van-action-bar>
|
<van-action-bar>
|
||||||
<van-action-bar-button color="#222" text="新增地址" @click="beforeAdd" />
|
<van-action-bar-button color="#ca2904" text="新增地址" @click="beforeAdd" />
|
||||||
</van-action-bar>
|
</van-action-bar>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -108,7 +108,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AliPayAccount',
|
name: 'CashoutAccount',
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage :title="$route.query.Area ? '团金提现' : '余额提现'">
|
<BasePage title="余额提现">
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell is-link class="account-cell" @click="showCard = true;">
|
<van-cell is-link class="account-cell" @click="showCard = true;">
|
||||||
<template #title>
|
<template #title>
|
||||||
@ -7,11 +7,9 @@
|
|||||||
<span class="title">提现账户</span>
|
<span class="title">提现账户</span>
|
||||||
<div class="account">
|
<div class="account">
|
||||||
<div v-if="card" class="card">
|
<div v-if="card" class="card">
|
||||||
<img :src="card.bankid == '91' ? '/img/AliPay.png' : '/img/transfer-i2.png'" height="24"
|
<img :src="card.bankid == 91 ? '/img/aliicon.png' : '/img/bankcardicon.png'" height="24"
|
||||||
width="24" style="object-fit: cover;" />
|
width="24" style="object-fit: cover;" />
|
||||||
<span class="code">{{ card.realname || card.RealName }} {{ card.bankcellphone ||
|
<span class="code">{{ card.realname }} {{ card.bankcellphone }}</span>
|
||||||
card.CardCode
|
|
||||||
}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<span v-else class="card">请选择到账账户</span>
|
<span v-else class="card">请选择到账账户</span>
|
||||||
</div>
|
</div>
|
||||||
@ -23,11 +21,11 @@
|
|||||||
<span class="title">提现金额</span>
|
<span class="title">提现金额</span>
|
||||||
<div class="amount">
|
<div class="amount">
|
||||||
<span class="prefix">¥</span>
|
<span class="prefix">¥</span>
|
||||||
<van-field v-model="data.amount" type="number" />
|
<van-field v-model="form.amount" type="number" />
|
||||||
<a style="color: var(--van-danger-color);white-space: nowrap;font-size: 3.733vw;"
|
<a style="color: var(--van-danger-color);white-space: nowrap;font-size: 3.733vw;"
|
||||||
@click.stop="data.amount = $route.query.Area ? wallet.Funds : wallet.Balance">全部提现</a>
|
@click.stop="form.amount = wallet.Balance">全部提现</a>
|
||||||
</div>
|
</div>
|
||||||
<span class="desc">当前{{ $route.query.Area ? '团金:' + wallet.Funds : '余额:' + wallet.Balance }}</span>
|
<span class="desc">当前余额:{{ wallet.Balance }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cashout-remark">
|
<div class="cashout-remark">
|
||||||
<p>注:</p>
|
<p>注:</p>
|
||||||
@ -44,21 +42,19 @@
|
|||||||
:parseData="res => res.data">
|
:parseData="res => res.data">
|
||||||
<template v-slot="{ item }">
|
<template v-slot="{ item }">
|
||||||
<van-cell class="cashout-card" is-link
|
<van-cell class="cashout-card" is-link
|
||||||
@click="data = { ...data, ...item }; card = item; showCard = false;">
|
@click="selectCard(item)">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img :src="item.bankid == '91' ? '/img/AliPay.png' : '/img/transfer-i2.png'"
|
<img :src="item.bankid == 91 ? '/img/aliicon.png' : '/img/bankcardicon.png'"
|
||||||
height="30" width="30" style="object-fit: cover;" />
|
height="30" width="30" style="object-fit: cover;" />
|
||||||
<span class="code">{{ item.realname || item.RealName }} {{ item.bankcellphone
|
<span class="code">{{ item.realname }} {{ item.bankcellphone }}</span>
|
||||||
|| item.CardCode
|
|
||||||
}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</template>
|
</template>
|
||||||
</BaseList>
|
</BaseList>
|
||||||
<van-cell style="position: fixed; bottom: 3.333vw;" is-link title="新增提现账户" icon="peer-pay"
|
<van-cell style="position: fixed; bottom: 3.333vw;" is-link title="新增提现账户" icon="peer-pay"
|
||||||
@click="$router.push('/AliPayAccount')" />
|
@click="$router.push('/CashoutAccount')" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</van-action-sheet>
|
</van-action-sheet>
|
||||||
</BasePage>
|
</BasePage>
|
||||||
@ -72,61 +68,53 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: {
|
form: {
|
||||||
"amount": 0
|
amount: 0,
|
||||||
}, // 余额提现到银行卡
|
bankcardid: ''
|
||||||
cashoutConfig: {},
|
},
|
||||||
aliPayAccount: [],
|
cashoutConfig: {
|
||||||
|
CommissionRate: 0,
|
||||||
|
BaseCash: 0,
|
||||||
|
Cycle: 1
|
||||||
|
},
|
||||||
wallet: { Balance: 0 },
|
wallet: { Balance: 0 },
|
||||||
showCard: false,
|
showCard: false,
|
||||||
card: undefined,
|
card: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
Promise.all([
|
this.$get('/v1/client/DUsersClient').then(data => {
|
||||||
// this.$get('/v1/client/DUserbankcardsClient').then(data => {
|
this.wallet.Balance = data.data.zijin;
|
||||||
// this.cashoutConfig = data.data;
|
}).catch(err => {
|
||||||
// }),
|
|
||||||
this.$get('/v1/client/DUsersClient').then(data => {
|
|
||||||
this.wallet.Balance = data.data.zijin;
|
|
||||||
}),
|
|
||||||
]).catch(err => {
|
|
||||||
this.$showFailToast(err.errmsg);
|
this.$showFailToast(err.errmsg);
|
||||||
});
|
});
|
||||||
// this.$get('/v1/client/DUserbankcardsClient').then(data => {
|
},
|
||||||
// this.data = data.data;
|
selectCard(item) {
|
||||||
// }).catch(err => {
|
this.card = item;
|
||||||
// this.$showFailToast(err.errmsg);
|
this.form.bankcardid = item.id;
|
||||||
// });
|
this.showCard = false;
|
||||||
},
|
},
|
||||||
cashout() {
|
cashout() {
|
||||||
console.log(this.data);
|
if (!this.form.bankcardid) {
|
||||||
|
this.$showFailToast('请选择到账账户');
|
||||||
if ((!this.data.bankcellphone || !this.data.realname) && this.data.CashAccount == 'AliPay') {
|
|
||||||
this.$showFailToast('请选择到帐帐户');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if ((!this.data.RealName || !this.data.CardCode) && this.data.CashAccount == 'BankCard' || !this.data.CashAccount) {
|
if (!this.form.amount || this.form.amount < this.cashoutConfig.BaseCash) {
|
||||||
// this.$showFailToast('请选择到帐帐户');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
if (!this.data.amount || this.data.amount < this.cashoutConfig.BaseCash) {
|
|
||||||
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.BaseCash}`);
|
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.BaseCash}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const commission = (this.data.amount * this.cashoutConfig.CommissionRate).toFixed(2);
|
const commission = (this.form.amount * this.cashoutConfig.CommissionRate).toFixed(2);
|
||||||
this.$showConfirmDialog({
|
this.$showConfirmDialog({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
message: `您本次提现${this.data.amount
|
message: `您本次提现${this.form.amount}元${commission > 0 ? `,提现手续费${commission}元` : ''},是否确认提现?`,
|
||||||
}元${commission > 0 ? `,提现手续费${commission}元` : ''},是否确认提现?`,
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$post('/v1/client/DUserwithdrawsClient', {
|
this.$post('/v1/client/DUserwithdrawsClient', {
|
||||||
"bankcardid": this.data.id,
|
bankcardid: this.form.bankcardid,
|
||||||
"amount": this.data.amount,
|
amount: this.form.amount,
|
||||||
}).then(data => {
|
}).then(() => {
|
||||||
this.$showSuccessToast('提交成功');
|
this.$showSuccessToast('提交成功');
|
||||||
location.href = '#/CashoutRecord'
|
this.$router.replace('/CashoutRecord');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$showFailToast(err.errmsg);
|
this.$showFailToast(err.errmsg);
|
||||||
});
|
});
|
||||||
|
|||||||
252
src/views/User/CashoutAccount.vue
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
<template>
|
||||||
|
<BasePage>
|
||||||
|
<div class="cashoutaccount">
|
||||||
|
|
||||||
|
<div class="ca_content">
|
||||||
|
<van-cell-group class="list">
|
||||||
|
<van-swipe-cell v-for="i in data" :key="i.id">
|
||||||
|
<van-cell>
|
||||||
|
<template #title>
|
||||||
|
<div class="item">
|
||||||
|
<img :src="i.bankid === 91 ? '/img/aliicon.png' : '/img/bankcardicon.png'" alt="">
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
{{ i.bankid === 91 ? '支付宝账号' : '' }}({{ i.bankcellphone }})
|
||||||
|
</span>
|
||||||
|
<p>
|
||||||
|
2小时内到账
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</van-cell>
|
||||||
|
<template #right>
|
||||||
|
<van-button style="height: 100%;" square text="删除" type="danger" class="delete-button"
|
||||||
|
@click="deleted(i)" />
|
||||||
|
</template>
|
||||||
|
</van-swipe-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="ca_bottom">
|
||||||
|
<div class="tips">
|
||||||
|
<p>
|
||||||
|
<span>注意:</span>绑定添加银行卡必须保证银行卡号、银行预留手机号要同一个人信息才能添加成功,仅限 <span>“添加成功”</span> 状态的银行卡才可用于提现,添加不成功的银行卡无法用于提现!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn_box">
|
||||||
|
<button class="alipay" @click="showAddAliPayPopup = true">
|
||||||
|
添加支付宝
|
||||||
|
</button>
|
||||||
|
<button class="bankcard" @click="showAddPopup = true">
|
||||||
|
添加银行卡
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="toCashout" @click="$navigate('Cashout')">
|
||||||
|
<b>去提现</b>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-action-sheet v-model:show="showAddAliPayPopup" :title="'新增支付宝账户'" style="min-height: 70vw;">
|
||||||
|
<div class="bankcard-edit">
|
||||||
|
<van-form @submit="save" label-align="top">
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field v-model="tempData.Realname" label="真实姓名" placeholder="请输入支付宝账号绑定真实姓名"
|
||||||
|
:rules="[{ required: true, message: '请填写真实姓名' }]" clearable required />
|
||||||
|
<van-field v-model="tempData.Bankcellphone" label="支付宝账号" placeholder="请输入支付宝账号"
|
||||||
|
:rules="[{ required: true, message: '请填写支付宝账号' }]" clearable required />
|
||||||
|
<div class="w" style="position: fixed;left:0;bottom: 0;padding: 3.333vw;border-top:1px solid #f5f5f5">
|
||||||
|
<van-button color="#ea3e23" block round style="width: 100%" type="primary" native-type="save"
|
||||||
|
:loading="saving">保存</van-button>
|
||||||
|
</div>
|
||||||
|
</van-cell-group>
|
||||||
|
</van-form>
|
||||||
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<van-action-sheet v-model:show="showAddPopup" :title="'新增银行卡'">
|
||||||
|
<div class="bankcard-edit">
|
||||||
|
<van-form @submit="saveBanks" label-align="top">
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field v-model="tempData.realname" label="姓名" placeholder="请输入真实姓名"
|
||||||
|
:rules="[{ required: true, message: '请填写真实姓名' }]" clearable required />
|
||||||
|
<van-field v-model="tempData.idnumber" label="身份证" placeholder="请输入身份证号"
|
||||||
|
:rules="[{ required: true, message: '请输入身份证号' }]" clearable required :formatter="formatter" />
|
||||||
|
<van-field v-model="tempData.certbegindate" label="身份证起始日期" placeholder="请选择身份证起始日期"
|
||||||
|
:rules="[{ required: true, message: '请选择身份证起始日期' }]" clearable required is-link
|
||||||
|
@click="tempData.obj = 'certbegindate'; showDate = true;" readonly />
|
||||||
|
|
||||||
|
<van-field class="maxDate" name="radio" label="身份证截止日期" required>
|
||||||
|
<template #input>
|
||||||
|
<van-radio-group v-model="checked" direction="horizontal">
|
||||||
|
<van-radio :name="0">短期</van-radio>
|
||||||
|
<van-radio :name="1">长期</van-radio>
|
||||||
|
</van-radio-group>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field v-model="tempData.certenddate" v-if="!checked" label=" " placeholder="请选择身份证截止日期"
|
||||||
|
:rules="[{ required: true, message: '请选择身份证起截止日期' }]" clearable is-link
|
||||||
|
@click="tempData.obj = 'certenddate'; showDate = true;" readonly />
|
||||||
|
<van-field v-model="tempData.bankcellphone" label="手机号" placeholder="请输入手机号"
|
||||||
|
:rules="[{ required: true, message: '请填写手机号' }]" type="phone" clearable required
|
||||||
|
: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="regionName" label="开户地区" placeholder="请选择开户地区"
|
||||||
|
:rules="[{ required: true, message: '请选择开户地区' }]" clearable required is-link @click="showRegion = true;"
|
||||||
|
readonly />
|
||||||
|
<van-cell>
|
||||||
|
<template #title>
|
||||||
|
<van-button color="#ea3e23" style="width: 100%" round type="primary" native-type="saveBanks"
|
||||||
|
:loading="saving">保存</van-button>
|
||||||
|
</template>
|
||||||
|
</van-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</van-form>
|
||||||
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<van-popup v-model:show="showDate" position="bottom">
|
||||||
|
<van-date-picker v-model="currentDate" title="选择年月日" :columns-type="['year', 'month', 'day']"
|
||||||
|
:min-date="minDate" :max-date="maxDate" @confirm="onconfirm" @cancel="showDate = false" />
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<van-popup v-model:show="showRegion" round position="bottom">
|
||||||
|
<van-cascader v-model="region" title="请选择地区" :options="areaList" :field-names="defaultProps" @change="onChange"
|
||||||
|
@finish="onFinish" @close="showRegion = false" />
|
||||||
|
</van-popup>
|
||||||
|
</div>
|
||||||
|
</BasePage>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { useCascaderAreaData } from '@vant/area-data'
|
||||||
|
export default {
|
||||||
|
name: 'CashoutAccount',
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showAddAliPayPopup: false,
|
||||||
|
showAddPopup: false,
|
||||||
|
tempData: {},
|
||||||
|
saving: false,
|
||||||
|
checked: 0,
|
||||||
|
data: {},
|
||||||
|
showDate: false,
|
||||||
|
showRegion: false,
|
||||||
|
currentDate: [`${new Date().getFullYear()}`, `${new Date().getMonth() + 1}`],
|
||||||
|
minDate: new Date('1900/01/01'),
|
||||||
|
maxDate: new Date('2099/12/31'),
|
||||||
|
regionName: '',
|
||||||
|
region: '',
|
||||||
|
areaList: useCascaderAreaData(),
|
||||||
|
defaultProps: {
|
||||||
|
text: 'text',
|
||||||
|
value: 'value',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.$get('/v1/client/DUserbankcardsClient').then(data => {
|
||||||
|
this.data = data.data;
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formatter(value) {
|
||||||
|
return value.replace(/\s/g, '');
|
||||||
|
},
|
||||||
|
onChange({ selectedOptions }) {
|
||||||
|
this.tempData.provid = selectedOptions[0]?.value || '';
|
||||||
|
},
|
||||||
|
onFinish({ selectedOptions }) {
|
||||||
|
this.showRegion = false;
|
||||||
|
this.regionName = selectedOptions.map(item => item.text).join('/');
|
||||||
|
this.tempData.provid = selectedOptions[0]?.value || '';
|
||||||
|
this.tempData.areaid = selectedOptions[1]?.value || selectedOptions[0]?.value || '';
|
||||||
|
},
|
||||||
|
onconfirm({ selectedValues }) {
|
||||||
|
const date = selectedValues.join('-');
|
||||||
|
if (this.tempData.obj === 'certbegindate') {
|
||||||
|
this.tempData.certbegindate = date;
|
||||||
|
} else if (this.tempData.obj === 'certenddate') {
|
||||||
|
this.tempData.certenddate = date;
|
||||||
|
}
|
||||||
|
this.showDate = false;
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
this.saving = true;
|
||||||
|
this.$post('/v1/client/DUserbankcardsClient', { ...this.tempData, Bankid: 91 }).then(data => {
|
||||||
|
this.$showSuccessToast('添加成功');
|
||||||
|
this.tempData = {};
|
||||||
|
// this.$refs.BaseList.refresh();
|
||||||
|
this.showAddAliPayPopup = false;
|
||||||
|
this.init();
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg);
|
||||||
|
}).finally(() => {
|
||||||
|
this.saving = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveBanks() {
|
||||||
|
if (!this.$validPhone(this.tempData.bankcellphone)) {
|
||||||
|
this.$showFailToast('手机号格式错误');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.$validIdCard(this.tempData.idnumber)) {
|
||||||
|
this.$showFailToast('身份证格式错误');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saving = true;
|
||||||
|
const params = {
|
||||||
|
realname: this.tempData.realname,
|
||||||
|
idnumber: this.tempData.idnumber,
|
||||||
|
bankid: this.tempData.bankid || 0,
|
||||||
|
bankname: this.tempData.bankname || '',
|
||||||
|
bankcardnumber: this.tempData.bankcardnumber,
|
||||||
|
bankcellphone: this.tempData.bankcellphone,
|
||||||
|
sort: 0,
|
||||||
|
certtype: this.tempData.certtype || '',
|
||||||
|
certvaliditytype: this.checked === 1 || '',
|
||||||
|
certbegindate: this.tempData.certbegindate ? this.tempData.certbegindate.replaceAll('-', '') : '',
|
||||||
|
certenddate: this.checked === 1 ? '' : (this.tempData.certenddate ? this.tempData.certenddate.replaceAll('-', '') : ''),
|
||||||
|
cardtype: this.tempData.cardtype || '',
|
||||||
|
provid: this.tempData.provid || '',
|
||||||
|
areaid: this.tempData.areaid || ''
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$post('/v1/client/DUserbankcardsClient', params).then(res => {
|
||||||
|
this.$showSuccessToast('添加成功');
|
||||||
|
this.tempData = {};
|
||||||
|
this.init();
|
||||||
|
this.showAddPopup = false;
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg);
|
||||||
|
}).finally(() => {
|
||||||
|
this.saving = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleted(e) {
|
||||||
|
this.$del(`/v1/client/DUserbankcardsClient/${e.id}`).then(data => {
|
||||||
|
this.$showSuccessToast('删除成功');
|
||||||
|
this.init();
|
||||||
|
}).catch(err => {
|
||||||
|
this.$showFailToast(err.errmsg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||