幼教产品B2B生态平台小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
5.1 KiB

12 months ago
<template>
11 months ago
<view class="page">
12 months ago
<view class="block">
12 months ago
<view class="form-list edit-form">
12 months ago
<view class="line with-arrow">
<view class="name">LOGO</view>
11 months ago
<image class="avatar" :src="logo" @click="uploadLogo"></image>
12 months ago
</view>
<view class="line with-arrow">
<view class="name">幼儿园名称</view>
12 months ago
<input type="text" placeholder="请输入幼儿园名称" />
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
12 months ago
</view>
<view class="line with-arrow">
<view class="name">标签</view>
12 months ago
<input type="text" placeholder="请输入标签" />
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
12 months ago
</view>
<view class="line textarea-line">
<view class="name">幼儿园slogan</view>
<textarea placeholder="请输入幼儿园slogan"></textarea>
</view>
11 months ago
<view class="line with-arrow">
<view class="name">省份</view>
<view class="inline">
<text v-if="disabled" class="name">{{ provinceName }}</text>
<uni-data-picker v-else class="picker-input" :clear-icon="false" :readonly="disabled" placeholder="请选择省份" popup-title="请选择省份" preload :localdata="provinces" :map="{text: 'provinceName', value: 'provinceId'}" v-model="provinceId" @change="getCity"></uni-data-picker>
</view>
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
</view>
12 months ago
<view class="line textarea-line">
<view class="name">地址</view>
<textarea placeholder="请输入地址"></textarea>
</view>
11 months ago
<view class="line textarea-line no-bd">
12 months ago
<view class="name">幼儿园简介</view>
<textarea placeholder="请输入幼儿园简介"></textarea>
</view>
11 months ago
<view class="py">
<uni-file-picker v-model="desPics" limit="3" title="最多选择3张图片" :auto-upload="false" @select="select" ></uni-file-picker>
</view>
12 months ago
</view>
</view>
11 months ago
<view class="block">
<view class="form-list edit-form">
<view class="line textarea-line">
<view class="name">地址</view>
<textarea placeholder="请输入地址"></textarea>
</view>
<view class="line with-arrow">
<view class="name">联系电话</view>
<input type="text" placeholder="请输入联系电话" />
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
</view>
<view class="py">
<uni-file-picker v-model="desPics" limit="3" title="请上传二维码,最多选择3张图片" :auto-upload="false" @select="select" ></uni-file-picker>
</view>
</view>
12 months ago
</view>
<view class="btn-wrap">
<view class="btn" @click="submit">保存</view>
</view>
</view>
</template>
<script>
import { my } from '@/apis/modules/parner.js'
11 months ago
import { queryProvince, queryCity, updateAvatars, getUserRolesPermissionMenu } from '@/apis/modules/user.js'
12 months ago
import OSS from '@/libs/Oss/upload'
12 months ago
export default {
data() {
return {
11 months ago
logo: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
disabled: true,
provinces: [],
cities: [],
provinceId: '',
cityId: '',
provinceName: '',
cityName: '',
desPics: []
12 months ago
}
},
onShow() {
12 months ago
// this.getInfo()
11 months ago
this.getProvince()
12 months ago
},
methods: {
// 获取个人信息
getInfo() {
const { partnerId, teamId } = uni.getStorageSync('team')
my({
partnerId,
teamId
}).then(({ my }) => {
this.info = my.info
}).catch(e => {})
},
11 months ago
// 获取省份
getProvince() {
queryProvince().then(({ list }) => {
if (this.disabled) {
const { provinceId } = this
if (provinceId) this.provinceName = list.find(e => e.provinceId == provinceId).provinceName
} else {
this.provinces = list
}
}).catch(res => {})
},
// 获取城市
getCity(val) {
if (this.provinceId) {
queryCity({
provinceId: this.provinceId
}).then(({ list }) => {
if (this.disabled) {
const { cityId } = this
if (cityId) this.cityName = list.find(e => e.cityId == cityId).cityName
} else {
this.cities = list
}
}).catch(res => {})
} else {
this.cities = []
}
if (val) this.cityId = ''
},
select(e){
console.log('选择文件:',e)
OSS(e.tempFilePaths[0], (res) => {
this.desPics.push({
name: res.name,
extname: res.ext,
url: res.url,
})
})
},
12 months ago
// 上传logo
uploadLogo() {
const that = this
uni.chooseImage({
success: (res) => {
const file = res.tempFilePaths[0];
11 months ago
OSS(file, ({ url }) => {
that.logo = url
12 months ago
})
}
});
},
12 months ago
onEditorReady() {
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
},
12 months ago
// 提交
submit() {
}
}
}
</script>
<style scoped lang="scss">
11 months ago
.page {
padding-bottom: 170rpx;
-webkit-overflow-scrolling: touch;
}
12 months ago
.avatar {
width: 80rpx;
height: 80rpx;
border: 0;
border-radius: 50%;
}
.info {
position: relative;
padding: 24rpx;
.line {
margin: 20rpx 0;
font-size: 26rpx;
color: #333;
}
.qrcode {
position: absolute;
top: 30rpx;
right: 30rpx;
width: 120rpx;
height: 120rpx;
}
}
</style>