作者 “关晓峰”

fix

<script>
export default {
onLaunch: function() {
let token = uni.getStorageSync('reToken')
if(token == ''){
let reToken = uni.getStorageSync('reToken')
let token = uni.getStorageSync('token')
if(reToken){
if(token){
uni.switchTab({
url:'/pages/index/buy'
})
}else{
uni.redirectTo({
url:'/pages/index/login'
})
}
}else{
uni.authorize({
scope: 'scope.userLocation',
success: function () {
... ... @@ -12,11 +24,6 @@
uni.redirectTo({
url:'/pages/index/adIndex'
})
}else{
console.log(123);
uni.redirectTo({
url:'/pages/index/login'
})
}
},
... ...
... ... @@ -66,7 +66,7 @@
<u-button type="info" size="small" v-if="info.status === 2 || info.status === 1 || info.status === 3" text="关闭信息" @click="close"></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>
<u-button type="primary" size="small" text="修改信息" @click="goPublish1"></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>
... ...
... ... @@ -55,11 +55,21 @@
}
},
methods: {
checkboxChange(){
checkboxChange(e){
if(e.length>3){
this.checkboxValue1 = e.pop()
uni.showToast({
title:'最多勾选三项'
})
return
}
},
goIndex(val) {
if(this.checkboxValue1.length > 3){
uni.showToast({
title:'最多勾选三项,请取消多余勾选后重试'
})
}else{
uni.$u.http.post('/api/common/add_category_rec', {
ids: this.checkboxValue1.toString()
}).then(res => {
... ... @@ -76,6 +86,8 @@
}).catch(err => {
console.log(err);
})
}
},
checked(idx) {
... ...
... ... @@ -104,9 +104,16 @@
})
},
go(item) {
if(item.title == '联系客服'){
uni.makePhoneCall({
phoneNumber: this.info.cooperation_phone //仅为示例
});
}else{
uni.navigateTo({
url: item.route
})
}
},
goEdit() {
uni.navigateTo({
... ...
... ... @@ -125,9 +125,9 @@
<view class="" style="width: 35vw;" @click="gotosearch">
<u-input placeholder="请输入" disabled prefixIcon="search" border="surround" v-model="keyword" shape="circle"
>
<view slot="prefix" style="display: flex; align-items: center; justify-content: center;">
<view slot="prefix" class="oneh" style="display: flex; align-items: center; justify-content: center;">
<text style="font-size: 24rpx; margin-right: 6rpx;"
<text class="oneh" style="font-size: 24rpx; margin-right: 6rpx;"
@click="goRot('/pages/subPages/moreChoose')">{{city_name ? city_name : '城市'}}</text>
<u-icon name="arrow-down-fill" size="20rpx"></u-icon>
</view>
... ... @@ -426,11 +426,13 @@
font-size: 28rpx;
font-weight: 400;
}
/deep/ .u-input__content__prefix-icon{
width: 52%;
}
.oneh {
display: inline-block;
white-space: nowrap;
width: 100%;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
... ...
... ... @@ -50,12 +50,31 @@
</view>
<view class="icon" > <image src="/static/my/ic-arrow(1).png" style="width: 20rpx;height: 36rpx;"></image> </view>
</view>
<view class="groupItem" @click="goOut">
<view class="groupItem" @click="show = true">
<view class="item">
<view class="leftTitle">退出登录</view>
</view>
<view class="icon"> <image src="/static/my/ic-arrow(1).png" style="width: 20rpx;height: 36rpx;"></image> </view>
</view>
<view class="" >
<u-popup :round="10" style="padding: 40rpx;" :show="show" mode="center" @close="close" @open="open">
<view class="" style="display: flex; align-items: center; flex-direction: column; justify-content: center;" >
<view style="margin-bottom: 30rpx;">
<text>确定退出登录吗?</text>
</view>
<view class="" style="display: flex; align-items: center;justify-content: space-evenly;">
<view class="" style="margin-right: 20rpx;">
<u-button size="small" text="取消" type="info" @click="close()"></u-button>
</view>
<view class="">
<u-button size="small" text="确定" type="primary" @click="goOut()"></u-button>
</view>
</view>
</view>
</u-popup>
</view>
</view>
</view>
... ... @@ -67,6 +86,7 @@
export default {
data() {
return {
show:false,
info:{
nickname:''
},
... ... @@ -91,6 +111,13 @@
})
},
open() {
// console.log('open');
},
close() {
this.show = false
// console.log('close');
},
editUserName(){
uni.navigateTo({
url:`/pages/subPages/editName?name=${this.info.nickname}`
... ... @@ -203,7 +230,9 @@
height: 160rpx;
border-radius: 50%;
}
/deep/ .u-popup__content{
padding: 80rpx;
}
.avatar .camera {
width: 48rpx;
height: 48rpx;
... ...
... ... @@ -41,16 +41,26 @@
</view>
</u-form-item>
<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;'">
{{model1.userInfo.year}}
</view>
<view class="">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</picker>
<!-- <u--input v-model="model1.userInfo.year" placeholder="请输入" border="none"></u--input> -->
<u--input v-model="model1.userInfo.year" disabled disabledColor="#ffffff" placeholder="请选择"
<!-- <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-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item>
<u-datetime-picker
<!-- <u-datetime-picker
:show="show"
v-model="model1.userInfo.year"
mode="year-month"
></u-datetime-picker>
></u-datetime-picker> -->
<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>
... ... @@ -77,6 +87,9 @@
import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPage';
export default {
data() {
const currentDate = this.getDate({
format: true
})
return {
flag: String,
... ... @@ -85,7 +98,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
showSex: false,
userInfo: {
name: '',
year: '',
year: '请选择',
region: '',
price: 0,
day: '',
... ... @@ -152,6 +165,24 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
url: '/pages/sellAndBuy/logo'
})
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
bindDateChange: function(e) {
this.model1.userInfo.year = e.detail.value
},
goNum() {
uni.navigateTo({
url: '/pages/sellAndBuy/chooseNum'
... ... @@ -205,4 +236,11 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
height: 24rpx;
position: absolute;
}
.uni-input{
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
\ No newline at end of file
... ...
... ... @@ -26,51 +26,56 @@
fileList1: [],
info: {},
flag: null,
fileList: [{
id: 3,
title: '整机左前45°',
url: []
},
{
id: 3,
title: '整机右后45°',
url: []
},
{
id: 3,
title: '发动机左侧',
url: []
},
{
id: 3,
title: '发动机右侧',
url: []
},
{
id: 3,
title: '变速箱°',
url: []
},
{
id: 3,
title: '驾驶室工作台',
url: []
},
{
id: 3,
title: '工作装置整体',
url: []
},
{
id: 3,
title: '整机铭牌',
url: []
},
{
id: 3,
title: '环保信息铭牌',
url: []
}
fileList: [
// {
// id: 3,
// title: '整机左前45°',
// url: [
// {
// url:'https://shebeiwang.oss-cn-zhangjiakou.aliyuncs.com/uploads/20230710/a9c9acd8ae4a905c3a60335661a099e5.png'
// }
// ]
// },
// {
// id: 3,
// title: '整机右后45°',
// url: []
// },
// {
// id: 3,
// title: '发动机左侧',
// url: []
// },
// {
// id: 3,
// title: '发动机右侧',
// url: []
// },
// {
// id: 3,
// title: '变速箱°',
// url: []
// },
// {
// id: 3,
// title: '驾驶室工作台',
// url: []
// },
// {
// id: 3,
// title: '工作装置整体',
// url: []
// },
// {
// id: 3,
// title: '整机铭牌',
// url: []
// },
// {
// id: 3,
// title: '环保信息铭牌',
// url: []
// }
],
}
},
... ... @@ -84,9 +89,22 @@
}
console.log(this.info);
}
// uni.$u.http.get('/api/equip/equip_image').then(res => {
// console.log(res);
// })
uni.$u.http.post('/api/equip/equip_image',{
category_id: this.info.category_id
}).then(res => {
console.log(res);
this.fileList = res.data[0].image_arr.map(item => {
return{
title: item.value,
url:[
{
url:item.pic
}
]
}
})
})
// this.fileList = JSON.parse(this.info.images_json)
// console.log(this.fileList);
// let arr
... ... @@ -152,7 +170,10 @@
},
// 删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
console.log(event);
console.log(this.fileList);
let idx = this.fileList.findIndex(item => item.url[0].url == event.file.url)
this.fileList[idx].url = []
},
// 新增图片
async afterRead(event, item, index) {
... ...
... ... @@ -16,7 +16,7 @@
<image src="/static/need.png" style="width: 56rpx;height: 32rpx;margin-right: 8rpx;" mode="" v-else>
</image>
<p style=" color: #000000e6;font-size: 34rpx;font-weight: 500;">
{{info.category.name + info.brand.name + info.xinghao.name}}
{{ info.brand.name + info.xinghao.name + info.category.name }}
</p>
</view>
<view class="flexBox" style="justify-content: space-between;">
... ... @@ -87,7 +87,7 @@
</view> -->
<view class="">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="/static/col.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode="">
<image src="/static/ld.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode="">
</image>
<p style=" color: #000000e6;font-size: 32rpx;font-weight: 500;">设备亮点</p>
</view>
... ... @@ -97,22 +97,34 @@
</view>
</view>
<view class="box flexBox" style="height: 128rpx;display: flex;justify-content: space-between;">
<view class="flexBox">
<view class="" style="margin-right: 24rpx;">
<image src="../../static/gj.png" style="width: 80rpx;height: 80rpx;" mode=""></image>
</view>
<view class="" style="display: flex; flex-direction: column;">
<p style=" color: #000000e6;font-size: 28rpx;font-weight: 500;">设备乐管家</p>
<p style=" color: #00000066;font-size: 24rpx;font-weight: 400;">专注建筑工程设备经理</p>
</view>
<view class="" @click="call">
<u-button text="立即联系" type="primary"></u-button>
</view>
<view class="phonebox" @click="call" >
<image src="../../static/dh.png" style="width: 24rpx; height: 24rpx; margin-right: 4rpx;" mode=""></image>
<text style="color:#3375D8">立即联系</text>
</view>
</view>
<view class="box">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="/static/col.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode="">
<image src="/static/tp.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode="">
</image>
<p style=" color: #000000e6;font-size: 32rpx;font-weight: 500;">设备图片</p>
</view>
<view class="imgbox" v-for="item in info.image_list">
<image :src="item" mode=""></image>
<image :src="item" mode="" @click="preImg = true; imgDes = item"></image>
</view>
<view class="" v-if="info.image_list.length == 0">
<u-empty>
</u-empty>
</view>
</view>
<p style="color: #000000e6;font-size: 32rpx;font-weight: 500;margin-bottom: 24rpx;">相似设备</p>
... ... @@ -122,7 +134,7 @@
<item-sell v-else :info="item"></item-sell>
</view>
</view>
<view class="box" v-else>
<view class="box" style="padding-bottom:120rpx;" v-else>
<u-empty>
</u-empty>
</view>
... ... @@ -156,20 +168,36 @@
></u-button>
</view>
</view>
<u-popup :show="isShowAddGroup" round="true" closeable="true" @close="onClose">
<view class="addGroup1">
<image src="/static/code1.png"
style="width: 354rpx;height: 354rpx; position: absolute; top: 330rpx; left: 134rpx;" mode="">
<!-- <u-popup closeable="true" :show="preImg" round="true" :closeable="true" @close="onClose">
<view class="warp" style="margin-bottom: 64rpx;">
<image :src="imgDes" mode="" style="height: 80vh;">
</image>
</view>
</u-popup> -->
<u-overlay :show="preImg" @click="preImg = false">
<view class="warp" >
<image :src="imgDes" mode="" style="max-height: 80vh;">
</image>
</view>
</u-popup>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="show = false">
<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">
<view class="warp">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style="">
<view class="">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style="max-height: 80vh;">
</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>
</view>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="show = false">
<image src="../../static/close@2x.png" style="width: 40rpx;height: 40rpx;margin-top: 20rpx;" mode=""></image>
</view>
</u-overlay>
</view>
</template>
... ... @@ -186,9 +214,11 @@
return {
info: {},
show: false,
isShowAddGroup: false,
preImg:false,
imgDes:'',
list1: [],
images: [],
wechat:{},
isFill: false,
resList: [],
call2: '',
... ... @@ -204,7 +234,7 @@
});
},
onClose() {
this.preImg = false
},
//立即联系
call(val) {
... ... @@ -213,7 +243,31 @@
});
},
goQun() {
// this.show = true
this.show = true
},
// 长按保存功能--保存部分
saveImgInner (url) {
wx.getImageInfo({
src: url,
success: (res) => {
let path = res.path;
wx.saveImageToPhotosAlbum({
filePath: path,
success: (res) => {
console.log(res);
wx.showToast({
title: '已保存到相册',
})
},
fail: (res) => {
console.log(res);
}
})
},
fail: (res) => {
console.log(res);
}
})
},
goStar() {
uni.$u.http.post('/api/common/favorite', {
... ... @@ -225,6 +279,10 @@
this.getList()
})
},
click(e){
this.preImg = true
this.imgDes = this.info.image_list[e]
},
appShare(scene) {
let that = this
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
... ... @@ -262,6 +320,8 @@
}).then(res => {
console.log(res);
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
... ... @@ -284,6 +344,7 @@
onLoad(option) {
this.info.id = option.id
this.getList()
console.log(this.info);
}
}
</script>
... ... @@ -332,7 +393,19 @@
}
}
}
.phonebox{
width: 144rpx;
height: 56rpx;
border-radius: 8rpx;
opacity: 1;
background: #ecf2feff;
font-size: 24rpx;
line-height: 56rpx;
padding: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.itembox {
width: 152rpx;
height: 112rpx;
... ... @@ -358,7 +431,13 @@
font-weight: 400;
}
}
.bbox{
width: 80rpx;
height: 80rpx;
border-radius: 8rpx;
opacity: 1;
background: #ffffff47;
}
.title {
color: #00000066;
font-size: 26rpx;
... ... @@ -393,8 +472,11 @@
.warp {
display: flex;
position: relative;
justify-content: center;
margin-top: 15%;
backdrop-filter: blur(24rpx);
margin-top: 8%;
margin-left: 64rpx;
margin-right: 64rpx;
}
</style>
\ No newline at end of file
... ...
<template>
<view class="main">
<view class="flexB" style="padding: 24rpx;">
<view class="" style="width: 100%;">
<view class="searchcity">
<view class="flexB oneh" style="justify-content: center;" @click.stop="goRot('/pages/subPages/moreChoose')">
<view class="city " style="max-width: 120rpx;overflow: hidden;text-overflow: ellipsis;">
{{city_name ? city_name : '城市'}}
</view>
<image class="img1" src="/static/icon/xia.png" mode=""></image>
</view>
<view class="searchline">
|
</view>
<image class="img2" src="/static/icon/search.png" mode=""></image>
<u-input type="text" placeholder="输入关键词搜索" confirm-type="search" style="border: none;" @confirm="confirm" v-model="keyword" placeholder-style="font-size: 26rpx;font-weight: 400;" />
</view>
</view>
</view>
<!--
<view class="flexB" style="padding: 24rpx;justify-content: space-between;">
<view class="flexB" style="width: 100%;height: 64rpx;">
<u-input placeholder="请输入" prefixIcon="search" confirm-type="search" @confirm="confirm" border="surround" v-model="keyword" shape="circle"
... ... @@ -13,7 +32,8 @@
</u-input>
</view>
</view>
</view> -->
<view class="page">
<scroll-view id="left-scroll" class="left-box" :scroll-y="true" :scroll-top="leftTop">
<view class="left-box_item" :class="{'left-box_active':index==current}" v-for="(item,index) in category"
... ... @@ -65,7 +85,9 @@
value:'',
list:[],
category: [],
flag:null
flag:null,
city_id:'',
city_name:''
}
},
methods: {
... ... @@ -152,7 +174,15 @@
console.log(option);
this.flag = option.val
this.getList()
}
},
onShow() {
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
console.log('option:', currentPage) //获取页面传递的信息
this.city_id = currentPage.$vm.city_id
this.city_name = currentPage.$vm.city_name
this.getList()
},
}
</script>
... ... @@ -235,7 +265,9 @@
font-size: 24rpx;
}
}
/deep/ .u-border{
border: none;
}
.seeIn{
width: 142rpx;
height: 48rpx;
... ... @@ -248,4 +280,50 @@
align-items: center;
justify-content: center;
}
.oneh{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.searchcity {
display: flex;
align-items: center;
width: 100%;
height: 68rpx;
border-radius: 48rpx;
opacity: 1;
border: 1rpx solid #c1ddedff;
background: #ffffffff;
padding: 32rpx 24rpx;
box-sizing: border-box;
.city {
color: #000000e6;
font-size: 26rpx;
font-weight: 400;
}
.img1 {
margin-left: 4rpx;
width: 32rpx;
height: 32rpx;
}
.searchline {
opacity: 0.6;
margin:0 10rpx;
}
.img2 {
margin-left: 4rpx;
margin-top: 4rpx;
width: 40rpx;
height: 40rpx;
}
input{
margin-top: 4rpx;
flex:1;
margin-left: 16rpx;
}
}
</style>
... ...
... ... @@ -18,7 +18,7 @@
<view class="flexB" style="margin-bottom: 24rpx; justify-content: space-between;">
<view class="flexB">
<view class="tip" style="margin-right: 8rpx;">
<u-icon name="search" style="width: 32rpx; height: 32rpx;"></u-icon>
<image src="../../static/ic-loc@2x.png" style="width: 32rpx; height: 32rpx;margin-top: 4rpx;" mode=""></image>
</view>
<p>定位/最近访问</p>
</view>
... ... @@ -37,7 +37,7 @@
</view>
<view style="margin-bottom: 32rpx;padding: 24rpx;">
<view class="flexB" style="margin-bottom: 24rpx;">
<view class="tip">
<view class="tip" style="margin-right: 8rpx;">
<image src="../../static/huo.png" style="width: 32rpx; height: 32rpx;" mode=""></image>
</view>
<p>热门城市</p>
... ... @@ -104,8 +104,10 @@
this.historyList = []
},
confirm(e) {
console.log(e);
this.getList()
this.historyList.push(e)
uni.setStorageSync('cityContent', JSON.stringify(this.historyList))
},
goRot(url) {
uni.navigateTo({
... ...