Compare commits

...

7 Commits

Author SHA1 Message Date
songyang dbf31c9cb1 Merge branch 'dev-songyang' 2023-12-09 22:59:13 +08:00
13218645326 74d44e2965 初始化 2023-12-09 22:32:31 +08:00
13218645326 f5232f86b2 Merge branch 'main' of http://192.168.0.56:3000/bonus/Zlpt_Portal 2023-12-09 22:32:17 +08:00
wlikett bb6b47ba84 Merge branch 'dev-wangyiming' 2023-12-09 22:30:42 +08:00
13218645326 ebdadba43e Merge branch 'dev-sjf-2023-12-5' 2023-12-09 22:30:20 +08:00
13218645326 91da4dae26 自定义指令auth 封装 2023-12-09 22:29:54 +08:00
wlikett 0d31a3c58f 需求修改 2023-12-09 22:29:42 +08:00
8 changed files with 70 additions and 23 deletions

8
components.d.ts vendored
View File

@ -11,30 +11,22 @@ declare module 'vue' {
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
ElUpload: typeof import('element-plus/es')['ElUpload']
EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipDetailTable: typeof import('./src/components/equipDetailTable.vue')['default']
FooterInfo: typeof import('./src/components/FooterInfo/index.vue')['default']

4
env/.env.dev vendored
View File

@ -5,9 +5,9 @@ VITE_BUILD_MODE = 'dev'
VITE_API_URL = '/proxyApi'
# 开发环境接口地址
# VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭
VITE_proxyTarget = 'http://10.40.92.186:8080' # 赵福海 (登录)
# VITE_proxyTarget = 'http://10.40.92.186:8080' # 赵福海 (登录)
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
# VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证)

View File

@ -29,7 +29,7 @@
</el-table-column>
<el-table-column prop="name" label="租金" min-width="80" >
<template #default="scope">
{{ scope.row.price }}{{ scope.row.unit }}
{{ scope.row.price }}/{{ scope.row.unit }}
</template>
</el-table-column>
<el-table-column prop="company" label="供应商" min-width="120" />

View File

@ -10,6 +10,7 @@ import router from './router'
import 'element-plus/dist/index.css'
import './style/css/reset.css'
import registerDirectives from 'utils/directive'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
@ -19,3 +20,6 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.use(pinia)
app.use(router)
app.mount('#app')
registerDirectives(app)

View File

@ -0,0 +1,27 @@
import { ElMessage } from "element-plus"
import { useStore } from 'store/main'
import router from "@/router"
export default function (app: any) {
app.directive("authBtn", {
mounted(el: any, binding: any, vnode: any) {
console.log("binding", binding.value)
const store = useStore()
if (!store.token) {
el.addEventListener("click", () => {
ElMessage({
type: "warning",
message: '暂无访问权限'
})
setTimeout(() => {
router.push('/login')
}, 300);
})
}else{
el.addEventListener("click", binding.value())
}
}
})
}

View File

@ -0,0 +1,5 @@
import registerFocus from './authBtn'; // 获取焦点
export default function registerDirectives(app: any) {
registerFocus(app);
}

View File

@ -12,7 +12,7 @@
<div class="name">{{ pageData.modelName }}{{ pageData.deviceName }}</div>
<div class="tag">
<div class="item">{{ pageData.maStatusStr }}</div>
<div class="item otherItem" v-if="pageData.isAudit == 1">已审核</div>
<div class="item otherItem">已审核</div>
</div>
</div>
<div class="viewNnum">浏览{{ pageData.searchNum }}</div>
@ -35,7 +35,7 @@
<span>{{ pageData.monthLeasePrice }}</span>
/
</div>
<div class="collect" @click="collectChange">
<div class="collect" v-authBtn="()=>collectChange" >
<el-icon class="no" v-show="!isCollect">
<Star/>
</el-icon>
@ -47,7 +47,7 @@
</div>
<div class="options">
<div class="item contact" @click="openPhone">联系商家</div>
<div class="item applyFor" @click="openLease">我要租</div>
<div class="item applyFor" v-authBtn="()=>openLease">我要租</div>
</div>
</div>
</div>
@ -105,7 +105,7 @@
:key="i"
:url="v.picUrl"
:name="`${v.modelName}${v.deviceName}`"
:tags="[v.maStatus,v.location]"
:tags="[v.maStatusStr,v.cityStr]"
:company="v.companyName"
:price="v.monthLeasePrice"
timeUnit="月"
@ -211,7 +211,7 @@
</el-form>
</el-config-provider>
<equipDetailTable
:price="`${priceChange}元`"
:price="`${ruleForm.durationUnit == '1' ? pageData.monthLeasePrice : pageData.dayLeasePrice }`"
:name="`${pageData.modelName}${pageData.deviceName}`"
:company="pageData.companyName"
:url="pageData.picUrl"
@ -221,8 +221,11 @@
:position="pageData.location"
:specifications="pageData.specification"
:type="pageData.typeName"
unit=""
:unit="ruleForm.durationUnit == '1' ? '月' : '天'"
></equipDetailTable>
<div class="countPrice">
合计总价<span>{{ priceChange }}</span>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit">
@ -330,7 +333,7 @@ const equipDetailKeyList = reactive([
arg: ''
},
{
label: '规格/操作重量',
label: '规格',
key: 'specification',
fn: '',
arg: ''
@ -608,7 +611,8 @@ const submit = async () => {
invoiceType: ruleForm.value.invoiceType,
description: ruleForm.value.projectDescription,
durationType: ruleForm.value.durationUnit,
cost: priceChange.value
cost: priceChange.value,
maId: pageData.value.maId
}
const res = await apiSubmitLease(params)
@ -644,6 +648,16 @@ init()
}
}
.countPrice {
padding: 10px;
text-align: right;
span {
color: red;
font-weight: 600;
}
}
.equipDetail {
user-select: none;
margin-top: 20px;
@ -922,14 +936,19 @@ init()
.label {
color: #8e8e8e;
width: 100px;
}
.value {
color: #333333;
flex: 1;
word-break: break-all;
font-family: 'fangsong';
}
.fnValue {
color: #0087cd;
font-family: 'fangsong';
}
}
}

View File

@ -329,13 +329,13 @@
}
.equip-pic {
height: 160px;
display: flex;
justify-content: space-between;
align-items: center;
li {
width: 340px;
width: calc((100% - 30px) / 3);
&:nth-child(2n){
margin: 0 15px;
}
}
}