作者 “关晓峰”

fix

<template>
<view>
<view class="listBox" @click="goDetail">
<view class="listBox_top">
<view class="listBox" :style="info.image ? 'min-height: 340rpx;' : 'min-height: 0'" @click="goDetail">
<view class="listBox_top" v-if="info.image">
<view class="" style="margin-right: 24rpx;position: relative;">
<image :src="info.image" style="width: 202rpx; height: 202rpx;" mode="">
</image>
... ... @@ -14,7 +14,7 @@
</view>
<view class="listBox_right" >
<view class="flexBox">
<p style=" color: #000000e6;font-size: 34rpx;font-weight: 600;">{{ info.brand.name + info.xinghao.name + info.category.name}}</p>
<p :class="isBtn ? 'oneh' : ''" :style="isBtn ? 'width: 75%;' : ''" style=" color: #000000e6;font-size: 34rpx;font-weight: 600;">{{ info.brand.name + info.xinghao.name + info.category.name}}</p>
<view v-if="isBtn">
<p style="font-size: 28rpx; color: #3375D8;" v-if="info.status == 2">已发布</p>
<p style="font-size: 28rpx; color: #3375D8;" v-if="info.status == 1">审核中</p>
... ... @@ -48,6 +48,35 @@
</view>
</view>
<view class="noPhoto" v-else>
<view class="flexBox" style="margin-right: 8rpx;justify-content: space-between">
<view class="flexBox" style="justify-content: start;">
<view class="chuzu" style="position: relative;margin-right: 8rpx;" v-if="info.type == 3">
出租
</view>
<view class="chushou" style="position: relative;margin-right: 8rpx;" v-else>
出售
</view>
<p class="oneh" style=" color: #000000e6;font-size: 34rpx;font-weight: 600;">{{ info.brand.name + info.xinghao.name + info.category.name}}</p>
</view>
<view class="font" style="justify-content: flex-end;" v-if="info.price">
<text>{{info.price}}</text> <text style="font-size: 26rpx;">/月</text>
</view>
</view>
<view class="flexBox">
<image src="../../static/image/2.png" style="width: 164rpx; height: 44rpx;" mode="" v-if="info.is_license == 1">
</image>
<view style="display: flex; align-items: center; margin-bottom: 8rpx;" v-if="info.tag_list && info.tag_list.length> 0">
<view style="margin:0 5rpx " v-for="item in info.tag_list">
<u-tag :text="item.name" plain size="mini" type="info"></u-tag>
</view>
</view>
</view>
<view class="oneh" style="width: 85%; color: #00000099;font-size: 26rpx;font-weight: 400;" v-if="info.bright">
{{info.bright}}
</view>
</view>
<view class="line">
</view>
... ... @@ -180,7 +209,6 @@
}
.listBox {
min-height: 340rpx;
border-radius: 8rpx;
opacity: 1;
background: #ffffffff;
... ... @@ -190,7 +218,7 @@
.oneh{
display: inline-block;
white-space: nowrap;
width: 100%;
width: 85%;
overflow: hidden;
text-overflow:ellipsis;
}
... ...
... ... @@ -56,7 +56,11 @@
},
methods: {
checkboxChange(e){
if(e.length>3){
if(e.length == 0){
uni.showToast({
title:'请勾选选项后重试'
})
}else if(e.length>3){
this.checkboxValue1 = e.pop()
uni.showToast({
title:'最多勾选三项'
... ... @@ -65,7 +69,12 @@
}
},
goIndex(val) {
if(this.checkboxValue1.length > 3){
console.log(this.checkboxValue1)
if(this.checkboxValue1.length == 0){
uni.showToast({
title:'请勾选后重试'
})
}else if(this.checkboxValue1.length > 3){
uni.showToast({
title:'最多勾选三项,请取消多余勾选后重试'
})
... ...
... ... @@ -60,9 +60,16 @@
},
click(e){
console.log(e);
if(this.imgList[e].type == 2){
uni.navigateTo({
url: `/pages/subPages/outer?url=${this.imgList[e].image}`
})
}else{
uni.navigateTo({
url: `/pages/subPages/detail?id=${this.imgList[e].equip_id}`
})
}
},
getList() {
uni.$u.http.post('/api/message/msg_list', {
... ... @@ -88,7 +95,9 @@
this.imgList = res.data.map(item => {
return{
url: item.image_url,
image: item.url
image: item.url,
equip_id: item.equip_id,
type: item.type
}
})
}).catch(err => {
... ...
... ... @@ -80,7 +80,7 @@
</view>
</view>
<view class="">
<p style=" color: #000000e6;font-size: 28rpx;font-weight: 400;">
<p class="oneh" style=" color: #000000e6;font-size: 28rpx;font-weight: 400;">
{{item.category.name + item.brand.name + item.xinghao.name}}</p>
<view class="flexBox" style="margin: 8rpx 0 24rpx 0;">
<p class="font" style="border-right: 1px solid #00000042; padding: 0 8rpx;">
... ...
... ... @@ -71,7 +71,6 @@
</view>
</view>
</view>
</u-popup>
</view>
... ... @@ -135,7 +134,7 @@
},
editPhone(){
uni.navigateTo({
url:`/pages/subPages/editPhone?mobile=${this.info.cooperation_phone}`
url:`/pages/subPages/editPhone?mobile=${this.info.mobile}`
})
},
getList(){
... ...
... ... @@ -19,7 +19,7 @@
<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:12.5%; left:32rpx">
<view class="posBox" style="top:112rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</u-form-item>
... ... @@ -28,7 +28,7 @@
<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:22%; left:32rpx">
<view class="posBox" style="top:194rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</u-form-item>
... ... @@ -36,11 +36,13 @@
<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:31.5%; left:32rpx">
<view class="posBox" style="top:276rpx; 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.year" borderBottom @click="show = true;" ref="item1">
<!-- <u-form-item label="出厂年限" labelWidth="200rpx" prop="userInfo.year" borderBottom @click="show = true;" ref="item1">
<picker mode="date" :value="model1.userInfo.year" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="uni-input">
<view class="" :style="model1.userInfo.year == '请选择' ? 'color: rgb(192, 196, 204);' : 'color: #303133;'">
... ... @@ -50,26 +52,52 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</picker>
</picker> -->
<!-- <u--input v-model="model1.userInfo.year" placeholder="请输入" border="none"></u--input> -->
<!-- <u--input v-model="model1.userInfo.year" disabled disabledColor="#ffffff" placeholder="请选择"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item>
<!-- <u-datetime-picker
:show="show"
v-model="model1.userInfo.year"
mode="year-month"
></u-datetime-picker> -->
<u-form-item label="表显小时数" labelWidth="200rpx" prop="userInfo.hours" borderBottom ref="item1">
<!-- </u-form-item> -->
<!-- <u-form-item label="表显小时数" labelWidth="200rpx" prop="userInfo.hours" borderBottom ref="item1">
<u--input v-model="model1.userInfo.hours" border="none"></u--input>
</u-form-item>
</u-form-item> -->
<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>
</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>
</u-form-item>
<u-form-item v-for="item in model1.userInfo.dList" :label="item.name" labelWidth="200rpx" borderBottom ref="item1">
<view class="flexb">
<u--input :type="item.type === 1 ? 'number' : item.type === 2 ? 'digit' : 'text'" v-model="item.value" border="none"></u--input>
<view class="" v-if="item.unit">
{{item.unit}}
</view>
</view>
<!-- <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:39%; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view> -->
</u-form-item>
<u-form-item v-for="item in model1.userInfo.xhList" :label="item.name" labelWidth="200rpx" borderBottom ref="item1">
<view class="flexb">
<u--input :type="item.type === 1 ? 'number' : item.type === 2 ? 'digit' : 'text'" v-model="item.value" border="none"></u--input>
<view class="" v-if="item.unit">
{{item.unit}}
</view>
</view>
<!-- <u--input :type="item.type == 1 ? number : text" v-model="model1.userInfo[item.id]" border="none"></u--input> --> <!-- <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:39%; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view> -->
</u-form-item>
</u--form>
<view class="" v-if="flag == 1" style="width: 60%;margin-top: 50rpx;display: flex;justify-content: center;margin-left: 20%;">
<u-button shape="circle" text="上传设备照片" style="color: white;" color="linear-gradient(to right, #46BAEC,#2F67D3)"
... ... @@ -98,14 +126,15 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
showSex: false,
userInfo: {
name: '',
year: '请选择',
region: '',
price: 0,
day: '',
hours:'',
bright: "",
brand_name:'',
xh_name:''
xh_name:'',
dList:[],
xhList:[],
},
},
actions: [{
... ... @@ -146,7 +175,10 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
console.log(this.model1.userInfo);
}
},
onShow() {
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
... ... @@ -158,6 +190,11 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
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) || ''
console.log(this.model1.userInfo);
if(currentPage.$vm.isFlash !== 1){
this.getCate()
this.getXh()
}
},
methods: {
goLogo() {
... ... @@ -165,6 +202,30 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
url: '/pages/sellAndBuy/logo'
})
},
getCate(){
uni.$u.http.post('/api/equip/get_category_fields',{
category_id: this.model1.userInfo.category_id
}).then(res => {
this.model1.userInfo.dList = []
console.log(res);
res && res.data && res.data.forEach(item => {
this.model1.userInfo.dList.push({...item, value:''})
})
console.log(this.model1.userInfo.dList);
})
},
getXh(){
uni.$u.http.post('/api/equip/get_xinghao_fields',{
xinghao_id: this.model1.userInfo.xinghao_id
}).then(res => {
console.log(res);
this.model1.userInfo.xhList = []
res && res.data && res.data.forEach(item => {
this.model1.userInfo.xhList.push({...item, value:''})
})
})
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
... ... @@ -236,6 +297,10 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
height: 24rpx;
position: absolute;
}
.flexb{
display: flex;
align-items: center;
}
.uni-input{
font-size: 30rpx;
... ...
... ... @@ -80,6 +80,10 @@
}
},
onLoad(option) {
let pages = getCurrentPages(); //获取所有页面栈实例列表
let prevPage = pages[ pages.length - 2 ]; //上一页页面实例
prevPage.$vm.isFlash = 1;
console.log(option);
this.flag = option.val
if (option.info) {
... ... @@ -93,6 +97,13 @@
category_id: this.info.category_id
}).then(res => {
console.log(res);
if(res.code == 0){
uni.showToast({
title:res.msg,
icon:'none'
})
}
this.fileList = res.data[0].image_arr.map(item => {
return{
title: item.value,
... ... @@ -104,6 +115,10 @@
}
})
}).catch(err => {
uni.showToast({
title:err.msg
})
})
// this.fileList = JSON.parse(this.info.images_json)
// console.log(this.fileList);
... ... @@ -119,7 +134,7 @@
},
methods: {
submit() {
let p = this.info
let p = JSON.parse(JSON.stringify(this.info))
delete p.name
delete p.brand_name
delete p.xh_name
... ... @@ -128,11 +143,33 @@
// [item.title]: item.url && item.url[0] && item.url[0].thumb || ''
// }
// });
let ads = JSON.parse(JSON.stringify(p))
p.address = ads.region
p.province = ads.region.slice(0, 3)
p.city = ads.region.slice(3, 6)
p.region = ads.region.slice(6, 9)
let curAds = this.info
if((uni.getStorageSync('detailAds') == '') || (uni.getStorageSync('detailAds') !== curAds) ){
uni.setStorageSync('detailAds',this.info.region)
}
let ads = uni.getStorageSync('detailAds')
p.dList.forEach(item => {
if(item.type == 1 ){
item.value = parseInt(item.value)
}else if(item.type == 2){
item.value = parseFloat(item.value)
}
})
p.xhList.forEach(item => {
if(item.type == 1 ){
item.value = parseInt(item.value)
}else if(item.type == 2){
item.value = parseFloat(item.value)
}
})
p.category_fields_json = JSON.stringify(p.dList)
p.xinghao_fields_json = JSON.stringify(p.xhList)
delete p.dList
delete p.xhList
p.address = ads
p.province = ads.slice(0, 3)
p.city = ads.slice(3, 6)
p.region = ads.slice(6, 9)
uni.$u.http.post(this.flag === "sale" ? '/api/equip/add_equip_sale' : '/api/equip/add_equip_hire', {
...p,
images_json: JSON.stringify(this.fileList)
... ...
... ... @@ -175,27 +175,27 @@
</image>
</view>
</u-popup> -->
<u-overlay :show="preImg" @click="preImg = false">
<u-overlay :show="preImg" @click="onClose">
<view class="warp" >
<image :src="imgDes" mode="" style="max-height: 80vh;">
</image>
</view>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="show = false">
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="onClose">
<image src="../../static/close@2x.png" style="width: 40rpx;height: 40rpx;margin-top: 20rpx;" mode=""></image>
</view>
</u-overlay>
<u-overlay :show="show" @click="show = false">
<u-overlay :show="show" @click="onClose1">
<view class="warp">
<view class="">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style="max-height: 80vh;">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style="height: 950rpx;">
</image>
</view>
<image :src="wechat.qrcode_url" @longpress="saveImgInner(wechat.qrcode_url)" style="position: absolute;top:330rpx;left: 23%; width: 350rpx;height: 350rpx;" mode=""></image>
<image :src="wechat.qrcode_url" @longpress="saveImgInner(wechat.qrcode_url)" style="position: absolute;top:330rpx;left: 148rpx; width: 350rpx;height: 350rpx;" mode=""></image>
</view>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="show = false">
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="onClose1">
<image src="../../static/close@2x.png" style="width: 40rpx;height: 40rpx;margin-top: 20rpx;" mode=""></image>
</view>
</u-overlay>
... ... @@ -229,13 +229,24 @@
methods: {
//咨询
gophone() {
if(this.call1){
uni.makePhoneCall({
phoneNumber: this.call1 //仅为示例
});
}else{
uni.showToast({
title:'暂无联系电话',
icon: 'none'
})
}
},
onClose() {
this.preImg = false
},
onClose1() {
this.show = false
},
//立即联系
call(val) {
uni.makePhoneCall({
... ... @@ -319,13 +330,19 @@
lng: ''
}).then(res => {
console.log(res);
if(res.code == 0){
uni.showToast({
title:res.msg,
icon: 'none'
})
}
this.info = res.data.data
console.log(this.info);
this.wechat = res.data.wechat
this.phone = res.data.contract
this.resList = res.data.rec_list.data
this.call2 = res.data.contract
this.call1 = res.data.ask_phone || res.data.contract
this.call1 = res.data.ask_phone
let imgs = JSON.parse(res.data.data.images_json)
this.isFill = res.data.data
imgs.forEach(item => {
... ... @@ -474,7 +491,6 @@
display: flex;
position: relative;
justify-content: center;
backdrop-filter: blur(24rpx);
margin-top: 8%;
margin-left: 64rpx;
margin-right: 64rpx;
... ...