作者 “关晓峰”

fix

... ... @@ -5,12 +5,12 @@
let token = uni.getStorageSync('token')
if(reToken){
if(token){
uni.switchTab({
uni.switchTab({
url:'/pages/index/buy'
})
}else{
uni.redirectTo({
url:'/pages/index/login'
url:'/pages/index/adIndex'
})
}
}else{
... ...
... ... @@ -35,12 +35,14 @@
</view>
</view>
<view class=" flexBox" >
<view class="tips" v-if="isBtn">
{{info.province}} {{info.province !=='' ? '-' : ''}} {{info.city}} {{info.city !=='' ? '-' : ''}} 距您{{info.distance || '0'}}km
<view class=" flexBox" style="width: 100%;">
<view class="tips" v-if="isBtn" style="width: 70%;">
{{info.province}} {{info.province !=='' ? '-' : ''}} {{info.city}} {{(info.city !=='' && !isBtn) ? '-' : ''}} <text v-if="!isBtn">距您{{info.distance || '0'}}km</text>
</view>
<view class="font" style="justify-content: flex-end; width: 100%;">
<text>{{info.price}}</text> <text style="font-size: 26rpx;">/月</text>
<view class="font" style="justify-content: flex-end; " :style="!isBtn ? 'width: 100%' : ''">
<text>{{info.price}}</text>
<!-- <text>**</text> -->
<text style="font-size: 26rpx;">万/月</text>
</view>
</view>
... ... @@ -61,7 +63,9 @@
</view>
<view class="font" style="justify-content: flex-end;" v-if="info.price">
<text>{{info.price}}</text> <text style="font-size: 26rpx;">/月</text>
<text>{{info.price}}</text>
<!-- <text>**</text> -->
<text style="font-size: 26rpx;">万/月</text>
</view>
</view>
<view class="flexBox">
... ...
... ... @@ -12,7 +12,9 @@
</view>
</view>
<view class="font oneh" style="width: 30vw;" v-if="info.price && info.price !== ''">
{{info.price}} <text style="font-size: 26rpx;">/月</text>
<!-- <text>{{info.price}}</text> -->
<text>**</text>
<text style="font-size: 26rpx;">万/月</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" >
... ...
... ... @@ -319,6 +319,15 @@
}
}
,{
"path" : "addUs",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}],
"globalStyle": {
... ...
... ... @@ -3,7 +3,7 @@
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Frame3007@2x.png"
style="width: 100vw;height: 100vh;" mode=""></image>
<view class="btn">
<u-button @click="go" style="width: 30%;" text="点击进入" shape="circle" type="primary"></u-button>
<u-button @click="go" style="width: 80%;" text="点击进入" shape="circle" type="primary"></u-button>
</view>
<view class="btn1">
<u-button @click="goindex" text="跳过" shape="circle" type="info" :plain="true"></u-button>
... ... @@ -20,7 +20,7 @@
methods: {
go() {
uni.reLaunch({
url: '/pages/index/login'
url: '/pages/index/index'
})
},
goindex() {
... ... @@ -38,10 +38,12 @@
.btn {
width: 100%;
position: absolute;
bottom: 94rpx;
bottom: 80rpx;
height: 112rpx;
// background: linear-gradient(134.7deg, #46baecff 0%, #2f67d3ff 100%);
// box-shadow: 0 16rpx 24rpx 0 #1d6bbb5e;
/deep/ .u-button {
width: 30% !important;
width: 80% !important;
}
}
... ...
... ... @@ -12,9 +12,7 @@
<view class="" style="width: 65vw;" @click.stop="goRot('/pages/subPages/moreSearch')">
<view class="searchcity">
<view class="flexBox oneh" style="justify-content: center;" @click.stop="goRot('/pages/subPages/moreChoose')">
<view class="city " style="max-width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;">
<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>
... ...
... ... @@ -4,16 +4,17 @@
<view class="desc">
为您推荐更多相关信息
</view>
<!-- <view class="content">
<view class="content">
<u-grid :col="3">
<view class="box" v-for="(item,index) in list" :class="isActive===index? 'click-hover':''"
<view class="box" style="position: relative;" v-for="(item,index) in list" :class="item.isCheck ? 'click-hover':''"
@click="checked(index)">
<image style="width: 150rpx; height: 150rpx;" :src="item.image_url" mode=""></image>
<image src="/static/Frame@2x (1).png" v-if="item.isCheck" style="width: 32rpx; height: 32rpx; position: absolute; top: 0; right: 0;" mode=""></image>
<p style="color: #3375d8ff;font-size: 30rpx;font-weight: 400;">{{item.name}}</p>
</view>
</u-grid>
</view> -->
<view class="" >
</view>
<!-- <view class="" >
<u-checkbox-group
v-model="checkboxValue1"
placement="column"
... ... @@ -32,7 +33,7 @@
</view>
</u-checkbox-group>
</view>
</view> -->
<view class="bom">
<u-button type="primary" @click="goIndex">进入平台</u-button>
</view>
... ... @@ -48,6 +49,7 @@
return {
isActive: 0,
flag: '',
arr:[],
checkboxValue1:'',
list: [
... ... @@ -58,31 +60,37 @@
checkboxChange(e){
if(e.length == 0){
uni.showToast({
title:'请勾选选项后重试'
title:'请勾选选项后重试',
icon:'none'
})
}else if(e.length>3){
this.checkboxValue1 = e.pop()
uni.showToast({
title:'最多勾选三项'
title:'最多勾选三项',
icon:'none'
})
return
}
},
goIndex(val) {
console.log(this.checkboxValue1)
if(this.checkboxValue1.length == 0){
if(this.arr.length == 0){
uni.showToast({
title:'请勾选后重试'
title:'请勾选后重试',
icon:'none'
})
}else if(this.checkboxValue1.length > 3){
}else if(this.arr.length > 3){
uni.showToast({
title:'最多勾选三项,请取消多余勾选后重试'
title:'最多勾选三项,请取消多余勾选后重试',
icon:'none'
})
}else{
uni.$u.http.post('/api/common/add_category_rec', {
ids: this.checkboxValue1.toString()
}).then(res => {
console.log(this.flag);
let arrs = this.arr.map(item => item.id)
console.log(arrs.toString());
// uni.$u.http.post('/api/common/add_category_rec', {
// ids: this.checkboxValue1.toString()
// }).then(res => {
// console.log(this.flag);
if (this.flag == '买') {
uni.switchTab({
url: '/pages/index/buy'
... ... @@ -92,23 +100,43 @@
url: '/pages/index/sell'
})
}
}).catch(err => {
console.log(err);
})
// }).catch(err => {
// console.log(err);
// })
}
},
checked(idx) {
this.isActive = idx
console.log(idx);
// console.log(this.list[idx].isCheck);
if(!this.list[idx].isCheck){
this.arr = this.list.filter(item => item.isCheck == true)
// console.log(this.arr);
if(this.arr.length > 2){
uni.showToast({
title:'最多勾选三项,请取消多余勾选后重试',
icon:'none'
})
return
}
this.list[idx].isCheck = !this.list[idx].isCheck
}else{
this.list[idx].isCheck = !this.list[idx].isCheck
}
}
},
onLoad(option) {
console.log(option);
this.flag = option.val
uni.$u.http.get('/api/common/category_rec').then(res => {
this.list = res.data
this.list = res.data.map(item => {
return{
...item,
isCheck: false
}
})
}).catch(err => {
console.log(err);
})
... ... @@ -163,11 +191,13 @@
}
.click-hover {
background-color: #ecf2feff;
border: 2rpx solid #3375d8ff;
background: #ecf2feff;
}
.imgbox{
background-image: url('/static/Frame@2x (1).png');
}
.bom {
margin-bottom: 16rpx;
position: fixed;
... ...
... ... @@ -20,22 +20,22 @@ height: 320rpx;" mode=""></image>
}
},
onShow() {
wx.login({
provider: 'weixin', //使用微信登录
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
this.code = res.code
uni.$u.http.get(`/api/common/code?code=${this.code}`).then((res) => {
uni.hideLoading()
uni.setStorageSync('token', res.data.token || '')
}).catch(err => {
console.log(err);
})
}
});
// wx.login({
// provider: 'weixin', //使用微信登录
// success(res) {
// console.log(res);
// },
// complete(res) {
// console.log(res);
// this.code = res.code
// uni.$u.http.get(`/api/common/code?code=${this.code}`).then((res) => {
// uni.hideLoading()
// uni.setStorageSync('token', res.data.token || '')
// }).catch(err => {
// console.log(err);
// })
// }
// });
},
methods: {
have(val) {
... ...
... ... @@ -20,7 +20,7 @@
</button>
<button v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" @click="mobileLogin" class="loginBtn">一键授权登录
</button>
<!-- <view class="codeLogin" @click="goCodeLoGin">短信验证码登录 </view> -->
<view class="codeLogin" @click="goCodeLoGin">短信验证码登录 </view>
</view>
<view class="agree">
<u-checkbox-group @change="checkboxGroupChange">
... ... @@ -106,6 +106,7 @@
provider: 'weixin', //使用微信登录
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
... ... @@ -114,8 +115,30 @@
uni.hideLoading()
uni.setStorageSync('token', res.data.token || '')
uni.setStorageSync('reToken', res.data.token || '')
uni.navigateTo({
url: "/pages/index/index"
uni.$u.http.post(`/api/common/mobile`,{
code: e.detail.code
}).then(res => {
console.log(res);
})
uni.switchTab({
url: "/pages/index/buy"
})
let ids = uni.getStorageSync('ids')
uni.$u.http.post('/api/common/add_category_rec', {
ids: ids
}).then(res => {
// console.log(this.flag);
// if (this.flag == '买') {
// uni.switchTab({
// url: '/pages/index/buy'
// })
// } else {
// uni.switchTab({
// url: '/pages/index/sell'
// })
// }
}).catch(err => {
console.log(err);
})
}).catch(err => {
console.log(err);
... ...
<template>
<view class="main">
<u-swiper
:list="imgList"
@change="change"
@click="click"
></u-swiper>
<u-swiper :list="imgList" @change="change" @click="click"></u-swiper>
<view class="items" v-for="item in list">
<view class="">
<image src="/static/icon/1816.png" v-if="item.type == 1"
... ... @@ -36,7 +32,7 @@
data() {
return {
list: [],
imgList:[],
imgList: [],
status: 'loadmore',
loadText: {
loadmore: '轻轻上拉加载更多...',
... ... @@ -55,54 +51,54 @@
const formattedDate = `${year}-${month}-${day}`;
return formattedDate
},
change(){
change() {
},
click(e){
click(e) {
console.log(e);
if(this.imgList[e].type == 2){
if (this.imgList[e].type == 2) {
uni.navigateTo({
url: `/pages/subPages/outer?url=${this.imgList[e].image}`
url: `/pages/subPages/outer?url=${this.imgList[e].image}`
})
}else{
} else {
uni.navigateTo({
url: `/pages/subPages/detail?id=${this.imgList[e].equip_id}`
url: `/pages/subPages/detail?id=${this.imgList[e].equip_id}`
})
}
},
getList() {
uni.$u.http.post('/api/message/msg_list', {
page: this.page,
pagenum: 10
}).then(res => {
this.status ='loadmore'
if (this.page === 1) {
this.list = []
}
res.data.data.forEach(data => {
this.list.push(data)
})
this.status = 'loadmore'
if (this.page === 1) {
this.list = []
}
res.data.data.forEach(data => {
this.list.push(data)
})
if (this.list.length < 10) this.status = 'nomore';
else this.status = 'loading';
else this.status = 'loading';
}).catch(err => {
console.log(err);
})
},
getBanner(){
uni.$u.http.get('/api/message/banner').then(res => {
console.log(res);
this.imgList = res.data.map(item => {
return{
url: item.image_url,
image: item.url,
equip_id: item.equip_id,
type: item.type
}
})
}).catch(err => {
console.log(err);
getBanner() {
uni.$u.http.get('/api/message/banner').then(res => {
console.log(res);
this.imgList = res.data.map(item => {
return {
url: item.image_url,
image: item.url,
equip_id: item.equip_id,
type: item.type
}
})
}).catch(err => {
console.log(err);
})
}
},
... ... @@ -113,8 +109,23 @@
},
onLoad() {
this.getList()
this.getBanner()
let token = uni.getStorageSync('token')
if (token) {
this.getList()
this.getBanner()
} else {
uni.showToast({
title: '请登陆后重试',
icon: 'none'
})
setTimeout(() => {
uni.redirectTo({
url: '/pages/index/login'
})
}, 2000)
}
}
}
</script>
... ...
... ... @@ -125,6 +125,8 @@
console.log(res);
if(res.code == 1){
this.info = res.data
uni.setStorageSync('phone',res.data.mobile)
uni.setStorageSync('kfphone',res.data.cooperation_phone)
}else{
this.info = {}
}
... ...
... ... @@ -95,7 +95,7 @@
- {{item.city}}</p>
<p class="oneh"
style=" color: #e63d27ff;font-weight: 600;font-size: 32rpx;width: 15vw;">
{{item.price}}万</p>
**万</p>
</view>
</view>
... ...
... ... @@ -230,7 +230,7 @@
border-radius: 50%;
}
/deep/ .u-popup__content{
padding: 80rpx;
padding: 80rpx 80rpx 0 80rpx;;
}
.avatar .camera {
width: 48rpx;
... ...
... ... @@ -207,11 +207,26 @@
console.log(this.model1.userInfo);
},
onLoad(option) {
console.log(option);
let info = JSON.parse(option.info)
this.model1.userInfo = info
this.model1.userInfo.name = info.brand.name
console.log(this.model1.userInfo);
let token = uni.getStorageSync('token')
if (token) {
console.log(option);
let info = JSON.parse(option.info)
this.model1.userInfo = info
this.model1.userInfo.name = info.brand.name
console.log(this.model1.userInfo);
} else {
uni.showToast({
title: '请登陆后重试',
icon: 'none'
})
setTimeout(() => {
uni.redirectTo({
url: '/pages/index/login'
})
}, 2000)
}
},
}
</script>
... ...
<template>
<view style="margin: 24rpx 0;">
<view class="u-page__item">
<u-collapse
accordion
v-for="item in itemArr"
@close="close"
>
<view class="" @click="backHub(item)">
<u-collapse-item
:title="item.name"
>
<text class="u-collapse-content" v-if="item.children && item.children.length>0" v-for="item1 in item.children" @click="backHub1(item1)">{{item1.name}}</text>
</u-collapse-item>
</view>
</u-collapse>
</view>
<!-- <view style="margin: 24rpx 0;">
<u-index-list :index-list="indexList">
<template v-for="(item, index) in itemArr">
<!-- #ifdef APP-NVUE -->
<u-index-anchor :text="indexList[index]"></u-index-anchor>
<!-- #endif -->
<u-index-item>
<!-- #ifndef APP-NVUE -->
<!-- <u-index-anchor :text="indexList[index]"></u-index-anchor> -->
<!-- <u-index-item> --> -->
<!-- #ifndef APP-NVUE
<u-index-anchor :text="indexList[index]"></u-index-anchor>
<!-- #endif -->
<view class="list-cell" v-for="(cell, index1) in item.list" @click="backHub(cell)">
<!-- #endif --> -->
<!-- <view class="list-cell" v-for="(cell, index1) in item.list" @click="backHub(cell)">
{{cell.name}}
</view>
</u-index-item>
</template>
</u-index-list>
</u-index-list> -->
</view>
</template>
... ... @@ -23,6 +39,7 @@
data() {
return {
indexList: [],
itemArr: [
]
... ... @@ -30,20 +47,27 @@
},
methods: {
backHub(item){
//选择品牌后跳转
let pages = getCurrentPages(); //获取所有页面栈实例列表
let prevPage = pages[ pages.length - 2 ]; //上一页页面实例
prevPage.$vm.xh_id = item.id;
prevPage.$vm.xh_name = item.name;
uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
delta: 1
});
if(item.children && item.children.length > 0){
return
}else{
this.backHub1(item)
}
},
backHub1(item){
let pages = getCurrentPages(); //获取所有页面栈实例列表
let prevPage = pages[ pages.length - 2 ]; //上一页页面实例
prevPage.$vm.xh_id = item.id;
prevPage.$vm.xh_name = item.name;
uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
delta: 1
});
},
open(e) {
// console.log('open', e)
},
close(e) {
// console.log('close', e)
console.log('close', e)
},
change(e) {
// console.log('change', e)
... ... @@ -51,8 +75,8 @@
},
onLoad() {
uni.$u.http.get('/api/index/xinghao_list').then(res => {
this.indexList = res.data.word
this.itemArr = res.data.list
// this.indexList = res.data.word
this.itemArr = res.data.data
}).catch(err => {
console.log(err);
})
... ... @@ -77,4 +101,28 @@
line-height: 24px;
background-color: #fff;
}
.u-page {
padding: 0;
&__item {
&__title {
color: $u-tips-color;
background-color: $u-bg-color;
padding: 15px;
font-size: 15px;
&__slot-title {
color: $u-primary;
font-size: 14px;
}
}
}
}
.u-collapse-content {
color: $u-tips-color;
font-size: 14px;
margin: 15rpx 10rpx;
}
</style>
... ...
... ... @@ -28,17 +28,20 @@
<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:194rpx; left:32rpx">
<view class="posBox" style="top:190rpx; 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.region" borderBottom ref="item1" @click="goMap">
<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:276rpx; left:32rpx">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
<view class="">
<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">
<image src="../../static/Group 193@2x.png" style="width: 40rpx;height: 24rpx;" mode=""></image>
</view>
</view>
</u-form-item>
... ... @@ -62,8 +65,11 @@
<!-- <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 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 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>
</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>
... ... @@ -165,18 +171,31 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
}
},
onLoad(option) {
console.log(option);
this.flag = option.val
if(option.info){
let info = JSON.parse(option.info)
console.log(info);
this.model1.userInfo = info
this.model1.userInfo.name = (info.brand && info.brand.name)
console.log(this.model1.userInfo);
}
console.log(option);
this.flag = option.val
let token = uni.getStorageSync('token')
if(token){
if(option.info){
let info = JSON.parse(option.info)
console.log(info);
this.model1.userInfo = info
this.model1.userInfo.name = (info.brand && info.brand.name)
console.log(this.model1.userInfo);
}
}else{
uni.showToast({
title:'请登陆后重试',
icon:'none'
})
setTimeout(() => {
uni.redirectTo({
url:'/pages/index/login'
})
}, 2000)
}
},
onShow() {
... ... @@ -208,6 +227,7 @@ import loadingPage from '../../uni_modules/uview-ui/libs/config/props/loadingPag
}).then(res => {
this.model1.userInfo.dList = []
console.log(res);
res && res.data && res.data.forEach(item => {
this.model1.userInfo.dList.push({...item, value:''})
})
... ...
... ... @@ -135,9 +135,24 @@
this.nav = '发布求租'
}
}
let info = JSON.parse(option && option.info)
this.model1.userInfo = info
this.model1.userInfo.name = info.brand.name
let token = uni.getStorageSync('token')
if (token) {
let info = JSON.parse(option && option.info)
this.model1.userInfo = info
this.model1.userInfo.name = info.brand.name
} else {
uni.showToast({
title: '请登陆后重试',
icon: 'none'
})
setTimeout(() => {
uni.redirectTo({
url: '/pages/index/login'
})
}, 2000)
}
},
onShow() {
... ...
<template>
<view class="main" style="display: flex; flex-wrap: wrap; margin-top: 40rpx;">
<view class="box" v-for="(item,index) in fileList">
<u-upload :fileList="item.url" @afterRead="(event) => afterRead(event,item,index)" @delete="deletePic"
width="200rpx" height="200rpx" name="1" multiple :maxCount="1"></u-upload>
<u-upload :fileList="item.url" @afterRead="(event) => afterRead(event,item,index)" @delete="(event) => deletePic(event,index)"
width="200rpx" height="200rpx" name="1" multiple :maxCount="1">
<image :src="imggList[index].url"
mode="widthFix" style="width: 220rpx;height:220rpx;"></image>
</u-upload>
<!-- <u-upload ref="uUpload" :action="action" :auto-upload="true" ></u-upload> -->
<!-- <u-upload
:action="action" :auto-upload="true" :fileList="item.url"
... ... @@ -24,6 +28,7 @@
return {
action: config.baseUrl + '/api/common/upload',
fileList1: [],
imggList:[],
info: {},
flag: null,
fileList: [
... ... @@ -103,14 +108,16 @@
icon:'none'
})
}
this.imggList = res.data[0].image_arr.map(item => {
return{
url: item.pic
}
})
this.fileList = res.data[0].image_arr.map(item => {
return{
title: item.value,
url:[
{
url:item.pic
}
]
}
})
... ... @@ -206,10 +213,7 @@
})
},
// 删除图片
deletePic(event) {
console.log(event);
console.log(this.fileList);
let idx = this.fileList.findIndex(item => item.url[0].url == event.file.url)
deletePic(event,idx) {
this.fileList[idx].url = []
},
// 新增图片
... ...
<template>
<view>
<image src="../../static/img-brand@2x.png" style="width: 100%; height: 438rpx;" mode=""></image>
<view class="box">
<view class="" style="padding: 32rpx; background: white;position: relative;">
<u--form labelPosition="left" :model="info" :rules="rules" ref="uForm">
<u-form-item label="公司名称" labelWidth="200rpx" prop="userInfo.name" borderBottom ref="item1">
<u--input v-model="info.name" placeholder="请输入公司名称" border="none"></u--input>
</u-form-item>
<u-form-item label="公司类型" labelWidth="200rpx" prop="userInfo.contract_name" borderBottom
ref="item1">
<u--input v-model="info.contract_name" placeholder="请选择公司类型" border="none"></u--input>
</u-form-item>
<u-form-item label="主营产品" labelWidth="200rpx" prop="userInfo.product_ids" borderBottom ref="item1">
<u--input v-model="info.product_ids" placeholder="请选择主营产品" border="none"></u--input>
</u-form-item>
<u-form-item label="营业执照" labelWidth="200rpx" prop="userInfo.product_ids" borderBottom ref="item1">
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="1" width="250" height="150">
<image src="/static/img-zhizhao@2x.png" mode="widthFix" style="width: 250px;height: 150px;">
</image>
</u-upload>
</u-form-item>
<u-form-item label="公司资质" labelWidth="200rpx" prop="userInfo.product_ids" borderBottom ref="item1">
<u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple
:maxCount="1" width="250" height="150">
<image src="/static/img-zhizhao@2x(1).png" mode="widthFix"
style="width: 250px;height: 150px;"></image>
</u-upload>
</u-form-item>
</u--form>
<view style="margin-top: 40rpx;">
<u-button text="提交" type="primary" @click="submit"></u-button>
</view>
</view>
</view>
</view>
</template>
<script>
import config from '@/common/config'
export default {
data() {
return {
info:{},
action: config.baseUrl + '/api/common/upload',
fileList1: [],
fileList2: [],
}
},
onShow() {
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
console.log('option:', currentPage) //获取页面传递的信息
this.model1.userInfo.category_id = currentPage.$vm.category_id || (this.model1.userInfo.category && this.model1.userInfo.category.id) || ''
this.model1.userInfo.name = currentPage.$vm.name || (this.model1.userInfo.category && this.model1.userInfo.category.name) || ''
},
methods: {
submit(){
console.log(this.info);
},
goChoose(){
uni.navigateTo({
url: '/pages/subPages/more?val=2'
})
},
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
console.log(event);
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.action, // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
resolve(JSON.parse(res.data).data.fullurl)
}, 1000)
}
});
})
},
}
}
</script>
<style scoped lang="scss">
.box {
border-radius: 20rpx 20rpx 0 0;
opacity: 1;
background: #ffffffff;
}
</style>
\ No newline at end of file
... ...
... ... @@ -101,13 +101,14 @@
title: '加载中'
})
uni.$u.http.post('/api/sms/send', {
event: 'register',
event: 'mobilelogin',
mobile: this.phone
}).then(r => {
uni.hideLoading()
console.log(r);
uni.showToast({
title: r.msg,
icon: 'none'
})
if (r.code == 1) {
... ... @@ -136,6 +137,7 @@
uni.navigateBack()
},
login() {
console.log(this.type);
if (!this.phone.length) return uni.showToast({
title: '请先输入手机号',
... ... @@ -160,34 +162,63 @@
uni.showLoading({
title: '加载中'
})
uni.$u.http.post('/api/user/mobilelogin', {
mobile: this.phone,
captcha: this.code
}).then(r => {
uni.hideLoading()
console.log(r);
uni.showToast({
title:r.msg
})
if (r.code == 1) {
let that = this
wx.login({
provider: 'weixin', //使用微信登录
success(res) {
console.log(res);
// console.log(r);
uni.setStorageSync('userInfo', r.data.userinfo)
uni.setStorageSync('token', r.data.userinfo.token)
uni.removeStorageSync('ScanningId')
console.log('type:', this.type, '用户信息:', r.data.userinfo);
if (this.type && r.data.userinfo.authentication != '已认证') {
uni.reLaunch({
url: `/pages/index/index`
},
complete(res) {
console.log(res);
uni.$u.http.get(`/api/common/code?code=${res.code}`).then((res) => {
// console.log(res);
// uni.hideLoading()
uni.setStorageSync('token', res.data.token || '')
uni.setStorageSync('reToken', res.data.token || '')
uni.$u.http.post('/api/user/mobilelogin', {
mobile: that.phone,
captcha: that.code
}).then(r => {
uni.hideLoading()
// console.log(r);
if(r.code == 1){
uni.switchTab({
url: "/pages/index/buy"
})
}else{
uni.showToast({
title:r.msg,
icon:'none'
})
}
})
} else {
uni.navigateBack({
delta: 2,
let ids = uni.getStorageSync('ids')
uni.$u.http.post('/api/common/add_category_rec', {
ids: ids
}).then(res => {
// console.log(this.flag);
// if (this.flag == '买') {
// uni.switchTab({
// url: '/pages/index/buy'
// })
// } else {
// uni.switchTab({
// url: '/pages/index/sell'
// })
// }
}).catch(err => {
console.log(err);
})
}
}).catch(err => {
console.log(err);
})
}
})
});
},
}
}
... ...
... ... @@ -30,7 +30,7 @@
</view>
</view>
<view class="" style="color:#E63D27">
{{info.price}}/月
**万/月
</view>
</view>
<view class="flexBox" style="justify-content: space-evenly;margin-top: 40rpx;">
... ... @@ -122,9 +122,11 @@
<view class="imgbox" v-for="item in info.image_list">
<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 class="flexBox" style="justify-content: center; flex-direction: column;" v-if="info.image_list.length == 0">
<image src="../../static/Group@2x.png" mode="" style="width: 200rpx; height: 200rpx;"></image>
<view class="" style="color: #3a4b63ff;font-size: 20rpx;font-weight: 400;">
车主还没有上传图片~~
</view>
</view>
</view>
<p style="color: #000000e6;font-size: 32rpx;font-weight: 500;margin-bottom: 24rpx;">相似设备</p>
... ...
<template>
<view style="height: 100vh;">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/bg0.png" style="width: 100%; height:100vh;" mode=""></image>
<view class="box" style="position: absolute;top:60%; padding: 32rpx;">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/bg0.png" style="width: 100%; height:100vh;"
mode=""></image>
<view class="box" style="position: absolute;top:740rpx; padding: 32rpx;">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
<u-form-item label="公司名称" labelWidth="200rpx" prop="userInfo.name" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" placeholder="请输入" border="none"></u--input>
<view>
<u--input v-model="model1.userInfo.name1" @input="inputCorpName" placeholder="请输入公司名称"
border="none"></u--input>
</view>
<!-- -->
<view class="select_box" v-if="select">
<view v-for="item in filterArr" >
<view class="select_one" @click="mySelect">
<rich-text ></rich-text>
</view>
</view>
</view>
</u-form-item>
<u-form-item label="主营产品" labelWidth="200rpx" prop="userInfo.product_ids" borderBottom ref="item1">
<u--input v-model="model1.userInfo.product_ids" placeholder="请输入" border="none"></u--input>
<u-form-item label="主营产品" labelWidth="200rpx" prop="userInfo.product_ids" borderBottom @click="goChoose"
ref="item1">
<u--input v-model="model1.userInfo.name" disabled placeholder="请选择主营产品" disabledColor="#ffffffeb"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="联系人" labelWidth="200rpx" prop="userInfo.contract_name" borderBottom ref="item1">
<u--input v-model="model1.userInfo.contract_name" placeholder="请输入" border="none"></u--input>
<u--input v-model="model1.userInfo.contract_name" placeholder="请输入联系人姓名" border="none"></u--input>
</u-form-item>
<u-form-item label="联系电话" labelWidth="200rpx" prop="userInfo.contract_mobile" borderBottom ref="item1">
<u--input v-model="model1.userInfo.contract_mobile" placeholder="请输入" border="none"></u--input>
<u--input v-model="model1.userInfo.contract_mobile" placeholder="请输入联系人电话" border="none"></u--input>
</u-form-item>
</u--form>
<view style="margin-top: 40rpx;">
<u-button text="提交" type="primary" @click="submit"></u-button>
</view>
</view>
<view class="font">
合作加盟: {{kfPhone}}
</view>
</view>
</template>
... ... @@ -27,38 +47,155 @@
export default {
data() {
return {
model1:{
userInfo:{
isSelect: '',
select: false,
kfPhone:'',
filterArr: [],
model1: {
userInfo: {
name: '',
contract_mobile: ''
}
}
}
},
onShow() {
let pagearr = getCurrentPages(); //获取应用页面栈
let currentPage = pagearr[pagearr.length - 1]; //获取当前页面信息
console.log('option:', currentPage) //获取页面传递的信息
this.model1.userInfo.product_ids = currentPage.$vm.category_id || ''
this.model1.userInfo.name = currentPage.$vm.name || ''
this.model1.userInfo.contract_mobile = uni.getStorageSync('phone')
this.kfPhone = uni.getStorageSync('kfphone')
},
methods: {
submit(){
uni.$u.http.post('/api/user/company_join',this.model1.userInfo).then(res => {
// 修改企业名称
inputCorpName(e) {
console.log(e);
this.isSelect= false
this.select= true
let value = e;
this.model1.userInfo.name1 = value
this.filterArr= []
if (value == '') {
this.filterArr = []
}
// 获取企业
this.getCom(value)
},
getCom(value) {
// 调取企业接口
wx.showLoading({
title: '加载中',
})
uni.$u.http.post('/manager/common/tianyanchaSearch', {
word: value
}).then(r => {
wx.hideLoading()
if (r.code == 1) {
r.data.forEach((item, index) => {
if (item.name.includes(value)) {
this.filterArr = [...this.data.filterArr, {
filter_text: this.join(item.name, value),
filter_name: item.name,
filter_id: item.id,
creditCode: item.creditCode
}]
}
});
}
})
},
mySelect(e) {
console.log(e);
// 当前选中的值值
console.log(e.currentTarget.dataset.name, "9999999999999");
this.select=false
this.isSelect= true //选择了公司
this.model1.userInfo.name1 = e.currentTarget.dataset.name
this.recordCom(e.currentTarget.dataset.name)
},
recordCom(value) {
uni.$u.http.post('/manager/common/tianyanchaBaseinfo', {
company_name: value
}).then(r => {
if (r.code == 1) {
console.log('记录成功', r)
}
})
},
goChoose() {
uni.navigateTo({
url: '/pages/subPages/more?val=2'
})
},
submit() {
delete this.model1.userInfo.name1
uni.$u.http.post('/api/user/company_join', this.model1.userInfo).then(res => {
uni.showToast({
title:res.msg,
icon:'none'
title: res.msg,
icon: 'none'
})
if(res.code == 1){
if (res.code == 1) {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
}
}
</script>
<style scoped>
.box{
width: 82vw;
border-radius: 16rpx;
background: #ffffffeb;
margin-left:5%;
}
</style>
<style scoped lang="scss">
.select_box {
background-color: #fff;
padding: 0 20rpx;
width: 100%;
position: absolute;
right: 0;
top: 101%;
z-index: 1;
overflow: hidden;
text-align: left;
animation: myfirst 0.5s;
font-size: 30rpx;
}
.select_one {
padding-left: 20rpx;
text-align: right;
width: 100%;
height: 60rpx;
position: relative;
line-height: 60rpx;
border-bottom: 1px solid #efebeb;
}
.box {
width: 82vw;
border-radius: 16rpx;
background: #ffffffeb;
margin-left: 5%;
}
.font {
position: absolute;
bottom: 66rpx;
left: 135rpx;
color: #ffffffff;
font-size: 40rpx;
font-weight: 700;
font-family: "Alibaba PuHuiTi";
text-align: center;
line-height: 44rpx;
letter-spacing: 0.6rpx;
}
/deep/ .u-input {
background: rgb(236, 238, 241) !important;
}
</style>
\ No newline at end of file
... ...