提交修改

This commit is contained in:
aixianling
2024-10-12 13:57:09 +08:00
parent b04a3f42a3
commit 0881d0c473

View File

@@ -4,7 +4,7 @@
<u-form :model="forms" ref="uForm" label-width="auto">
<u-form-item label="内容" prop="content" required label-position="top">
<u-input v-model="forms.content" :focus="true" placeholder="请输入内容(300字以内)" type="textarea" auto-height
height="100" maxlength="300"/>
height="100" maxlength="300"/>
</u-form-item>
<u-form-item label="类型" prop="type" required>
<div class="right" @click="showType=true">
@@ -13,7 +13,7 @@
<u-icon name="arrow-right" color="#CCCCCC" class="right-icon"></u-icon>
</div>
<u-select v-model="showType" :list="$dict.getDict('wyGirdNewsType')" value-name="dictValue" label-name="dictName"
@confirm="selectType"></u-select>
@confirm="selectType"></u-select>
</u-form-item>
<u-form-item label="地址" prop="address">
<div class="right">
@@ -22,7 +22,7 @@
</u-form-item>
<u-form-item label="图片(最多9张)" prop="files" class="avatars" label-position="top">
<AiUploader :def.sync="forms.files" multiple placeholder="上传图片" :limit="9"
action="/admin/file/add2"></AiUploader>
action="/admin/file/add2"></AiUploader>
</u-form-item>
</u-form>
</div>
@@ -70,7 +70,6 @@ export default {
},
methods: {
...mapActions(['injectJWeixin', 'agentSign']),
submit() {
if (this.flag) return
if (!this.forms.content) {
@@ -80,7 +79,6 @@ export default {
if (this.forms.typeName === '') {
return this.$u.toast('请选择类型')
}
this.$http.post(`/app/appgirdnews/addOrUpdate`, {...this.forms}).then((res) => {
if (res.code == 0) {
uni.$emit('update')
@@ -92,26 +90,25 @@ export default {
}
})
},
selectType(e) {
this.forms.type = e[0].value
this.forms.typeName = e[0].label
},
getLocation () {
this.injectJWeixin(['getLocation']).then(() => {
wx.getLocation({
getLocation() {
this.injectJWeixin('getLocation').then(() => {
uni.getLocation({
type: 'wgs84',
success: res2 => {
alert(res2)
this.forms.lng = res2.longitude
this.forms.lat = res2.latitude
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${this.forms.lat},${this.forms.lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
if (res.code == 0) {
alert(res)
this.$http.post('/api/appdvcpconfig/apiForward', null, {
params: {
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${this.forms.lat},${this.forms.lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`
}
}).then(res => {
console.log("获取详细地址信息:", res)
if (res?.code == 0) {
this.forms.address = res.data.result.address
}else {
alert(res)
}
})
},