作者 “关晓峰”

fix

... ... @@ -42,7 +42,7 @@
<view class="font" style="justify-content: flex-end; " :style="!isBtn ? 'width: 100%' : ''">
<text>{{info.price}}</text>
<!-- <text>**</text> -->
<text style="font-size: 26rpx;">万/月</text>
<text style="font-size: 26rpx;">{{info.category.price_unit}}/{{info.category.day_unit}}</text>
</view>
</view>
... ... @@ -65,7 +65,7 @@
<view class="font" style="justify-content: flex-end;" v-if="info.price">
<text>{{info.price}}</text>
<!-- <text>**</text> -->
<text style="font-size: 26rpx;">万/月</text>
<text style="font-size: 26rpx;">{{info.category.price_unit}}/{{info.category.day_unit}}</text>
</view>
</view>
<view class="flexBox">
... ... @@ -95,17 +95,17 @@
</view>
<view class="flexBox" style="justify-content: flex-end !important; padding-bottom: 16rpx; width: 100%;" v-else>
<view style="display: flex;justify-content: end;">
<view class="" style="margin-right: 16rpx;">
<u-button type="info" size="small" v-if="info.status === 2 || info.status === 1 || info.status === 3" text="关闭信息" @click="close"></u-button>
<view class="" style="margin-right: 16rpx;" @click="close">
<u-button type="info" size="small" v-if="info.status === 2 || info.status === 1 || info.status === 3" text="关闭信息"></u-button>
</view>
<view class="" style="margin-right: 16rpx;" v-if="info.status === 2">
<u-button type="primary" size="small" text="修改信息" @click="goPublish1"></u-button>
<view class="" style="margin-right: 16rpx;" v-if="info.status === 2" @click="goPublish1()">
<u-button type="primary" size="small" text="修改信息" ></u-button>
</view>
<view class="" style="margin-right: 16rpx;" v-if="info.status === 2">
<u-button type="dark" size="small" text="设备估价" @click="goPrice()"></u-button>
<view class="" style="margin-right: 16rpx;" v-if="info.status === 2" @click="goPrice()">
<u-button type="dark" size="small" text="设备估价"></u-button>
</view>
<view class="" v-if="info.status === 4" style="margin-right: 16rpx;">
<u-button type="primary" size="small" text="重新发布" @click="goPublish()"></u-button>
<view class="" v-if="info.status === 4" style="margin-right: 16rpx;" @click="goPublish()">
<u-button type="primary" size="small" text="重新发布" ></u-button>
</view>
</view>
... ...
... ... @@ -14,7 +14,7 @@
<view class="font oneh" style="width: 30vw;" v-if="info.price && info.price !== ''">
<!-- <text>{{info.price}}</text> -->
<text>**</text>
<text style="font-size: 26rpx;">万/月</text>
<text style="font-size: 26rpx;">{{info.category.price_unit}}/{{info.category.day_unit}}</text>
</view>
</view>
<view class="listBox_top" style="justify-content: space-between; margin-top: 28rpx; margin-bottom: 46rpx;" v-if="info.tag_list.length > 0" >
... ...
... ... @@ -7,37 +7,46 @@
<view class="" style="padding: 32rpx; background: white;position: relative;">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
<u-form-item label="设备信息" labelWidth="200rpx" prop="userInfo.category_id" borderBottom ref="item1" @click="goChoose" style="position: relative;">
<u--input v-model="model1.userInfo.name" disabled disabledColor="#ffffff" placeholder="请选择设备" style="position: relative;"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox" style="top:32rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
<view class="flexb posa">
<u--input v-model="model1.userInfo.name" disabled disabledColor="#ffffff" placeholder="请选择设备" style="position: relative;"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox posb" >
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
</u-form-item>
<u-form-item label="设备品牌" labelWidth="200rpx" prop="userInfo.brand_name" borderBottom
@click="goLogo" ref="item1">
<u--input v-model="model1.userInfo.brand_name" disabled disabledColor="#ffffff"
placeholder="请选择" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox" style="top:112rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
<view class="flexb posa">
<u--input v-model="model1.userInfo.brand_name" disabled disabledColor="#ffffff"
placeholder="请选择" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox posb" >
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
</u-form-item>
<u-form-item label="设备型号" labelWidth="200rpx" prop="userInfo.xh_name" borderBottom @click="goNum"
ref="item1">
<u--input v-model="model1.userInfo.xh_name" disabled disabledColor="#ffffff" placeholder="请选择"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox" style="top:190rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
<view class="flexb posa">
<u--input v-model="model1.userInfo.xh_name" disabled disabledColor="#ffffff" placeholder="请选择"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox posb" >
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
</u-form-item>
<u-form-item label="设备停放地" labelWidth="200rpx" prop="userInfo.region" borderBottom ref="item1" @click="goMap">
<view class="">
<view class="flexb posa" style="position: relative;">
<u--input v-model="model1.userInfo.region" disabled disabledColor="#ffffff" placeholder="请选择"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="posBox" style="top:270rpx; left:32rpx">
<view class="posBox posb">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
... ... @@ -66,10 +75,16 @@
<u--input v-model="model1.userInfo.hours" border="none"></u--input>
</u-form-item> -->
<u-form-item label="意向价格" labelWidth="200rpx" prop="userInfo.price" borderBottom ref="item1">
<view class="flexb">
<u--input type="number" v-model="model1.userInfo.price" border="none"></u--input>
<text>万元</text>
<view class="flexb posa">
<view class="flexb" style="width: 100%;">
<u--input type="number" v-model="model1.userInfo.price" border="none"></u--input>
<text>{{model1.userInfo.price_unit}}</text>
</view>
<view class="posBox posb">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
</u-form-item>
<u-form-item label="设备亮点" labelWidth="200rpx" prop="userInfo.bright" labelPosition="top" borderBottom ref="item1">
<u--input v-model="model1.userInfo.bright" border="none"></u--input>
... ... @@ -139,6 +154,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
bright: "",
brand_name:'',
xh_name:'',
price_unit:'',
dList:[],
xhList:[],
},
... ... @@ -208,6 +224,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
this.model1.userInfo.brand_name = currentPage.$vm.brand_name || (this.model1.userInfo.brand && this.model1.userInfo.brand.name) || ''
this.model1.userInfo.xinghao_id = currentPage.$vm.xh_id || (this.model1.userInfo.xinghao && this.model1.userInfo.xinghao.id) || ''
this.model1.userInfo.xh_name = currentPage.$vm.xh_name || (this.model1.userInfo.xinghao && this.model1.userInfo.xinghao.name) || ''
this.model1.userInfo.price_unit = currentPage.$vm.price_unit || '万元'
console.log(this.model1.userInfo);
if(currentPage.$vm.isFlash !== 1){
this.getCate()
... ... @@ -218,7 +235,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
methods: {
goLogo() {
uni.navigateTo({
url: '/pages/sellAndBuy/logo'
url: '/pages/sellAndBuy/logo?category_id=' + this.model1.userInfo.category_id
})
},
getCate(){
... ... @@ -265,6 +282,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
this.model1.userInfo.year = e.detail.value
},
goNum() {
console.log(this.model1.userInfo.category_id);
uni.navigateTo({
url: '/pages/sellAndBuy/chooseNum'
})
... ... @@ -298,10 +316,18 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
this.$refs.uForm.validateField('userInfo.sex')
},
goUpload(val){
console.log(this.model1);
uni.navigateTo({
url:`/pages/sellAndBuy/upload?info=${JSON.stringify(this.model1.userInfo)}&val=${val}`
})
if(this.model1.userInfo.price == 0){
uni.showToast({
title:'意向价格需大于0',
icon:'none'
})
}else{
console.log(this.model1);
uni.navigateTo({
url:`/pages/sellAndBuy/upload?info=${JSON.stringify(this.model1.userInfo)}&val=${val}`
})
}
}
},
onReady() {
... ... @@ -328,4 +354,12 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
align-items: center;
justify-content: space-between;
}
.posa{
position: relative;
}
.posb{
position: absolute;
top: -25rpx;
left: -200rpx;
}
</style>
\ No newline at end of file
... ...
... ... @@ -52,18 +52,24 @@
</u-form-item>
<u-form-item v-if="nav == '发布求租'" label="租赁时间" labelWidth="200rpx" prop="userInfo.day" borderBottom
ref="item1">
<u--input v-model="model1.userInfo.day" border="none" @click="showTime = true"></u--input>
<view class="flexb" style="width: 100%;">
<u--input v-model="model1.userInfo.day" border="none" ></u--input>
<text>{{model1.userInfo.day_unit || '天'}}</text>
</view>
<view class="posBox" style="top:60.5%; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</u-form-item>
<u-form-item label="设备预算" labelWidth="200rpx" prop="userInfo.price" labelPosition="top" borderBottom
<u-form-item label="设备预算" labelWidth="200rpx" prop="userInfo.price" borderBottom
ref="item1">
<u--input type="number" v-model="model1.userInfo.price" border="none"></u--input>
<view class="flexb" style="width: 100%;">
<u--input v-model="model1.userInfo.price" border="none" ></u--input>
<text>{{model1.userInfo.price_unit || '万元'}}</text>
</view>
</u-form-item>
</u--form>
<u-datetime-picker :show="showTime" v-model="model1.userInfo.day" mode="date"></u-datetime-picker>
<!-- <u-datetime-picker :show="showTime" v-model="model1.userInfo.day" mode="date"></u-datetime-picker> -->
</view>
</view>
<view class="bom">
... ... @@ -185,52 +191,60 @@
},
submit() {
let p = {
category_id: this.model1.userInfo.category_id,
brand_id: this.model1.userInfo.brand_id,
xinghao_id: this.model1.userInfo.xinghao_id,
day: this.model1.userInfo.day,
price: this.model1.userInfo.price,
region: this.model1.userInfo.region.slice(6,9),
province: this.model1.userInfo.region.slice(0, 3),
city: this.model1.userInfo.region.slice(3, 6),
address: this.model1.userInfo.region
}
uni.$u.http.post(this.nav == '发布求购' ? '/api/equip/add_equip_buy' : '/api/equip/add_equip_zu', p).then(
res => {
if(this.model1.userInfo.price == 0){
uni.showToast({
title:'设备预算需大于0',
icon:'none'
})
}else{
let p = {
category_id: this.model1.userInfo.category_id,
brand_id: this.model1.userInfo.brand_id,
xinghao_id: this.model1.userInfo.xinghao_id,
day: this.model1.userInfo.day,
price: this.model1.userInfo.price,
region: this.model1.userInfo.region.slice(6,9),
province: this.model1.userInfo.region.slice(0, 3),
city: this.model1.userInfo.region.slice(3, 6),
address: this.model1.userInfo.region
}
uni.$u.http.post(this.nav == '发布求购' ? '/api/equip/add_equip_buy' : '/api/equip/add_equip_zu', p).then(
res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
console.log('option:', currentPage) //获取页面传递的信息
currentPage.$vm.category_id = ''
currentPage.$vm.name = ''
currentPage.$vm.brand_id = ''
currentPage.$vm.brand_name = ''
currentPage.$vm.xh_id = ''
currentPage.$vm.xh_name = ''
if (res.code == 1) {
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1500)
}
}).catch(err => {
uni.showToast({
title: res.msg,
title: err.msg,
icon: 'none'
})
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
console.log('option:', currentPage) //获取页面传递的信息
currentPage.$vm.category_id = ''
currentPage.$vm.name = ''
currentPage.$vm.brand_id = ''
currentPage.$vm.brand_name = ''
currentPage.$vm.xh_id = ''
currentPage.$vm.xh_name = ''
if (res.code == 1) {
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1500)
}
}).catch(err => {
uni.showToast({
title: err.msg,
icon: 'none'
})
}).finally(() => {
uni.reLaunch({
url: 'pages/index/buy'
}).finally(() => {
uni.reLaunch({
url: 'pages/index/buy'
})
})
})
}
},
click(item) {
this.active = item
... ... @@ -298,4 +312,9 @@
padding-bottom: 15rpx;
border-bottom: 1px solid #3375D8;
}
.flexb{
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
\ No newline at end of file
... ...
... ... @@ -25,21 +25,27 @@
</u-index-item>
</view>
</u-index-list> -->
<u-index-list :index-list="indexList">
<template v-for="(item, index) in itemArr">
<u-index-item>
<u-index-anchor :text="item.word"></u-index-anchor>
<view class="list-cell" v-for="(cell, index1) in item.list" @click="backHub(cell,index1)">
{{cell.name}}
<!-- <view class="" v-for="item1 in cell">
{{item1.short_name}}
</view> -->
</view>
</u-index-item>
</template>
</u-index-list>
<view class="" v-if="indexList && indexList.length>0">
<u-index-list :index-list="indexList">
<template v-for="(item, index) in itemArr">
<u-index-item>
<u-index-anchor :text="item.word"></u-index-anchor>
<view class="list-cell" v-for="(cell, index1) in item.list" @click="backHub(cell,index1)">
{{cell.name}}
<!-- <view class="" v-for="item1 in cell">
{{item1.short_name}}
</view> -->
</view>
</u-index-item>
</template>
</u-index-list>
</view>
<view class="" style="margin-top: 30%;" v-else>
<u-empty></u-empty>
</view>
</view>
</template>
... ... @@ -71,8 +77,9 @@
});
}
},
onLoad() {
uni.$u.http.get('/api/index/brand_list').then(res => {
onLoad(option) {
console.log(option);
uni.$u.http.get(`/api/index/brand_list?category_id=${option.category_id}`).then(res => {
console.log(res);
this.indexList = res.data.word;
this.itemArr = res.data.list
... ...
... ... @@ -30,7 +30,7 @@
</view>
</view>
<view class="" style="color:#E63D27">
**万/月
{{info.price}}{{info.category.price_unit}}/{{info.category.day_unit}}
</view>
</view>
<view class="flexBox" style="justify-content: space-evenly;margin-top: 40rpx;">
... ...
... ... @@ -185,7 +185,9 @@
.font {
position: absolute;
bottom: 66rpx;
left: 135rpx;
width: 100%;
text-align: center;
color: #ffffffff;
font-size: 40rpx;
font-weight: 700;
... ...
... ... @@ -116,6 +116,7 @@
let prevPage = pages[ pages.length - 2 ]; //上一页页面实例
prevPage.$vm.category_id = item.id;
prevPage.$vm.name = item.name;
prevPage.$vm.price_unit = item.price_unit;
uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
delta: 1
});
... ...