作者 lusheng

首页开始修改

... ... @@ -61,7 +61,8 @@
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#CDE1F0"
"navigationBarBackgroundColor": "#CDE1F0",
"navigationStyle": "custom"
}
},
... ...
<template>
<view>
<view class="nevbg">
<view class="back"
:style="[{paddingTop:titleTop+'rpx'},{height:bgHeight+'rpx'},{lineheight:titleHeight+'rpx'}]">
<image src="/static/back2.png" mode="" @click="back"></image>
<text>卖设备</text>
</view>
<image src="@/static/image/Rectangle 16.png"
style="height: 400rpx;width: 100vw; position: absolute;top:0;z-index: -1;" mode=""></image>
</view>
<view class="top">
<view class="flexBox" style="padding: 24rpx 24rpx 0 24rpx;">
<view class="" style="width: 65vw;" @click="goRot('/pages/subPages/moreSearch')">
<u-input placeholder="请输入" prefixIcon="search" border="surround" v-model="keyword" shape="circle"
@change="change" >
<view slot="prefix" style="display: flex; align-items: center; justify-content: center;"
>
<text style="font-size: 24rpx; margin-right: 6rpx;" @click="goRot('/pages/subPages/moreChoose')">{{city_name ? city_name : '城市'}}</text>
@change="change">
<view slot="prefix" style="display: flex; align-items: center; justify-content: center;">
<text 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>
... ... @@ -17,8 +26,7 @@
<button style="width: 30vw;" shape="circle" class="btn" size="small" @click="goHub">免费发布</button>
</view>
<image src="@/static/image/Rectangle 16.png"
style="height: 300rpx;width: 100vw; position: absolute;top:0;z-index: -1;" mode=""></image>
<view class="boxs" style="padding: 0 24rpx; justify-content: space-evenly">
<view class="item" v-for="item in list.slice(0,3)" @click="goRot(item.route)">
<image :src="item.icon_url" class="img" mode=""></image>
... ... @@ -42,16 +50,16 @@
</view>
<view class="">
<view class="" v-if="list1 && list1.length>0">
<view class="list" v-for="item in list1">
<view class="list" v-for="item in list1">
<item :info="item"></item>
</view>
</view>
<view v-else class="" style="margin-top: 30%;">
<u-empty></u-empty>
</view>
</view>
<u-overlay :show="show" @click="show = false">
<view class="warp">
... ... @@ -90,6 +98,10 @@
},
data() {
return {
//顶部文字
titleTop: '',
titleHeight: '',
bgHeight: '',
keyword: '',
show: false,
city_id: null,
... ... @@ -98,18 +110,26 @@
type: 3,
active: '出租',
list: [
],
list1: [],
lat:'',
lng:''
lat: '',
lng: ''
}
},
methods: {
// 标题文字居中
getWxTitleTop() {
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.titleTop = (menuButtonInfo.top) //标题文字的position:top
this.titleHeight = (menuButtonInfo.height) //标题文字的高度
//背景的高度=top+height+需要的下方高度
this.bgHeight = (menuButtonInfo.top) + (menuButtonInfo.height) + 75
},
goHub() {
this.show = true
},
goRot(url, val) {
uni.navigateTo({
url: url + '?val=' + val
... ... @@ -119,15 +139,15 @@
change() {
this.getList()
},
getList(){
getList() {
uni.$u.http.post('/api/equip/equip_list', {
orderby: 1,
// page: 1,
// pagenum: 10,
lat: this.lat,
lng: this.lng,
keyword : this.keyword,
type : this.type
keyword: this.keyword,
type: this.type
}).then(res => {
console.log(res);
this.list1 = res.data.data
... ... @@ -148,15 +168,16 @@
},
onLoad(option) {
console.log(option);
if(option.val = '买'){
if (option.val = '买') {
uni.switchTab({
url:'/pages/index/buy'
url: '/pages/index/buy'
})
}else{
} else {
uni.switchTab({
url:'/pages/index/sell'
url: '/pages/index/sell'
})
}
this.getWxTitleTop()
this.getList()
uni.$u.http.get('/api/index/rec_index').then(res => {
console.log(res);
... ... @@ -171,9 +192,47 @@
<style scoped lang="scss">
.top {
padding-top: 200rpx;
height: 300rpx;
}
.nevbg {
position: fixed;
height: 196rpx;
width: 100%;
z-index: 99;
height: 224rpx;
opacity: 1;
overflow: hidden;
// background: linear-gradient(180deg, #ffffff4a 0%, #ffffff12 100%);
}
.back {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
width: 100%;
image {
position: absolute;
top: 50%;
left: 32rpx;
transform: translate(-50%);
width: 48rpx;
height: 48rpx;
}
text {
color: #ffffffff;
font-size: 32rpx;
font-weight: 500;
font-family: "PingFang SC";
text-align: center;
}
}
.flexBox {
display: flex;
align-items: center;
... ... @@ -301,9 +360,11 @@
align-items: center;
justify-content: center;
}
.activeBox{
.activeBox {
background: url("/static/image/Rectangle 38.png");
}
.right {
width: 50%;
height: 132rpx;
... ...
... ... @@ -113,11 +113,10 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
this.flag = option.val
if(option.info){
let info = JSON.parse(option.info)
this.model1.userInfo = info
console.log(info);
this.model1.userInfo = info
this.model1.userInfo.name = info.brand && info.brand.name
console.log(this.model1.userInfo);
}
},
... ...
<template>
<view style="background-color: white;padding: 24rpx;">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
<u-form-item labelWidth="200rpx" label="原手机号" prop="userInfo.mobile" borderBottom ref="item1">
<u--input v-model="model1.userInfo.mobile" border="none"></u--input>
</u-form-item>
<u-form-item labelWidth="200rpx" label="新手机号" prop="userInfo.mobile" borderBottom ref="item1">
<u--input v-model="model1.userInfo.newmobile" border="none"></u--input>
</u-form-item>
<u-form-item labelWidth="200rpx" label="验证码" prop="userInfo.mobile" borderBottom ref="item1">
<view class="" style="display: flex; align-items: center; justify-content: space-between;">
<u--input v-model="model1.userInfo.code" placeholder="" style="width: 70vw;"></u--input>
<u-button text="获取验证码" @click="code" style="width: 20vw;">></u-button>
<view class="codestyle">
<view class="bar mot">
<view class="barleft">
原手机号
</view>
<view class="barright">
<input type="number" disabled v-model="model1.userInfo.mobile">
</view>
</view>
<view class="bar mot bot">
<view class="barleft">
新手机号
</view>
<view class="barright">
<input type="number" v-model="model1.userInfo.newmobile" placeholder="请输入新手机号"
placeholder-style="font-size: 28rpx; font-weight: 400;">
</view>
</view>
<view class="bar">
<view class="barleft">
验证码
</view>
<view class="barright codeinput">
<input type="text" v-model="model1.userInfo.code" placeholder="请输入验证码"
placeholder-style="font-size: 28rpx; font-weight: 400;">
<view class="scode" @click="code" v-if="iscode">
获取验证码
</view>
<view class="scode" @click="code" v-else>
{{newcode}}
</view>
</view>
</view>
<view class="barbtn">
保存
</view>
<!-- <view style="background-color: white;padding: 24rpx;">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
<u-form-item labelWidth="200rpx" label="原手机号" prop="userInfo.mobile" borderBottom ref="item1">
<u--input v-model="model1.userInfo.mobile" border="none"></u--input>
</u-form-item>
<u-form-item labelWidth="200rpx" label="新手机号" prop="userInfo.mobile" borderBottom ref="item1">
<u--input v-model="model1.userInfo.newmobile" border="none"></u--input>
</u-form-item>
<u-form-item labelWidth="200rpx" label="验证码" prop="userInfo.mobile" borderBottom ref="item1">
<view class="" style="display: flex; align-items: center; justify-content: space-between;">
<u--input v-model="model1.userInfo.code" placeholder="" style="width: 70vw;"></u--input>
<u-button text="获取验证码" @click="code" style="width: 20vw;">></u-button>
</view>
</u-form-item>
</u--form>
<view class="" style="margin-top: 60rpx;">
<u-button text="保存" type="primary" @click="submit"></u-button>
</u-form-item>
</u--form>
<view class="" style="margin-top: 60rpx;">
<u-button text="保存" type="primary" @click="submit"></u-button>
</view>
</view>
-->
</view>
</template>
<script>
... ... @@ -34,6 +73,9 @@
}
},
tips: '获取验证码',
interval: "",
newcode: 60,
iscode: true,
rules: {
'userInfo.mobile': [{
type: 'string',
... ... @@ -56,6 +98,9 @@
},
}
},
onUnload() {
clearInterval(this.interval)
},
methods: {
submit() {
let p = {
... ... @@ -74,11 +119,16 @@
})
}, 1500)
}
})
},
code() {
if (!this.model1.userInfo.newmobile) {
uni.showToast({
title: "请输入手机号",
icon: "none"
})
return
}
uni.showLoading({
title: '正在获取验证码'
})
... ... @@ -87,38 +137,23 @@
event: 'changemobile'
}).then(res => {
console.log(res);
if (res.code == 1) {
this.iscode = false
this.interval = setInterval(() => {
this.newcode--
if (this.newcode == 0) {
this.iscode = true
clearInterval(this.interval)
}
}, 1000)
}
uni.hideLoading()
uni.showToast({
title: res.msg
})
})
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
})
uni.$u.http.post('/api/sms/send', {
mobile: this.model1.userInfo.newmobile,
event: 'changemobile'
}).then(res => {
console.log(res);
})
// setTimeout(() => {
// uni.hideLoading();
// // 这里此提示会被this.start()方法中的提示覆盖
// uni.$u.toast('验证码已发送');
// // 通知验证码组件内部开始倒计时
// this.$refs.uCode.start();
// }, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
},
onLoad(option) {
this.model1.userInfo.mobile = option.mobile
... ... @@ -131,6 +166,84 @@
}
</script>
<style>
<style lang="scss">
.page {
background-color: #F5F7FA;
}
.codestyle {
.bar {
display: flex;
align-items: center;
padding: 48rpx 24rpx;
box-sizing: border-box;
background-color: #ffffff;
.barleft {
width: 188rpx;
color: #0d1013e6;
font-size: 28rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
}
.barright {
width: 100%;
height: 100%;
color: #0d1013e6;
font-size: 28rpx;
font-weight: 500;
position: relative;
right: 0;
.scode {
position: absolute;
right: 32rpx;
top: -8rpx;
z-index: 99;
width: 144rpx;
height: 56rpx;
line-height: 56rpx;
color: #3375d8ff;
font-size: 24rpx;
font-weight: 500;
font-family: "PingFang SC";
text-align: center;
border-radius: 8rpx;
opacity: 1;
background: #ecf2feff;
}
}
.codeinput {
input {
width: 460rpx;
}
}
}
.bot {
border-bottom: 1px solid #F5F7FA;
}
.mot {
margin-top: 16rpx;
}
.barbtn {
color: #ffffffff;
font-size: 32rpx;
font-weight: 500;
font-family: "PingFang SC";
text-align: center;
width: 702rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 16rpx;
opacity: 1;
background: #3375d8ff;
margin: 40rpx auto 0 auto;
}
}
</style>
\ No newline at end of file
... ...