This commit is contained in:
yanran200730
2021-12-03 15:05:29 +08:00
parent 56e99d1411
commit 821a946859
3 changed files with 179 additions and 13 deletions

View File

@@ -11,6 +11,7 @@
<script>
import Tabbar from './components/Tabbar.vue'
import AddForm from './components/AddForm.vue'
import Result from './components/Result.vue'
export default {
name: 'AppAskForm',
@@ -25,6 +26,7 @@
components: {
Tabbar,
Result,
AddForm
},

View File

@@ -117,16 +117,16 @@
</div>
<div class="detail" v-if="isShowConfig">
<component
:is="component"
:index="filedIndex"
:filed="filed"
@change="onChange"
:targetListData="targetList"
:formData="form"
:filedType="filedType"
@back="isShowConfig = false"
:id="id"
:formConfig="formConfig">
:is="component"
:index="filedIndex"
:filed="filed"
@change="onChange"
:targetListData="targetList"
:formData="form"
:filedType="filedType"
@back="isShowConfig = false"
:id="id"
:formConfig="formConfig">
</component>
</div>
</div>
@@ -328,6 +328,7 @@ export default {
}
})
this.$loading()
this.$http.post(`/app/appquestionnairetemplate/addOrUpdate`, {
...this.form,
fields,
@@ -338,11 +339,15 @@ export default {
templateType: 0
}).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
this.$emit('change', {
type: 'Tabbar'
type: 'Result',
params: {
linkUrl: res.data.linkUrl,
tableExplain: this.form.title,
tableExplain: this.form.tableExplain,
headPicture: this.form.headPicture
}
})
}, 600)
}

View File

@@ -0,0 +1,159 @@
<template>
<div class="result">
<image class="result-success" :src="`${$cdn}form/result-success.png`"/>
<h2>创建成功</h2>
<p>表单创建成功您现在可以把表单分享给更多的好友来填写数据</p>
<div class="result-btn" @click="confirm">确定</div>
<div class="result-footer">
<div class="result-footer__item" @click="copy">
<div>
<image :src="`${$cdn}form/form-copylink.png`"/>
</div>
<h3>复制链接</h3>
</div>
<div class="result-footer__item" @click="shareWechat">
<div>
<image :src="`${$cdn}form/form-wechat.png`"/>
</div>
<h3>微信好友</h3>
</div>
<div class="result-footer__item" @click="share">
<div>
<image :src="`${$cdn}form/form-share.png`"/>
</div>
<h3>分享</h3>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Result',
props: ['params'],
mounted () {
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact'])
console.log(this.params)
},
methods: {
copy() {
let oInput = document.createElement('input')
oInput.value = this.params.linkUrl
document.body.appendChild(oInput)
oInput.select()
document.execCommand('Copy')
this.$u.toast('已复制')
oInput.remove()
},
share () {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareAppMessage', {
title: this.params.title,
desc: this.params.tableExplain,
link: res.params.linkUrl,
imgUrl: this.params.headPicture
}])
})
},
shareWechat () {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareWechatMessage', {
title: this.params.title,
desc: this.params.tableExplain,
link: res.params.linkUrl,
imgUrl: this.params.headPicture
}])
})
},
confirm () {
this.$emit('change', {
type: 'Tabbar'
})
}
}
}
</script>
<style lang="scss" scoped>
.result {
min-height: 100vh;
padding: 0 96px;
text-align: center;
background: #fff;
.result-footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 96px;
.result-footer__item {
flex: 1;
text-align: center;
div {
display: flex;
align-items: center;
justify-content: center;
width: 100px;
height: 100px;
margin: 0 auto 16px;
border-radius: 50%;
background: #F4F6FA;
image {
width: 100px;
height: 100px;
}
}
h3 {
color: #666666;
font-size: 24px;
font-weight: normal;
}
}
}
.result-success {
display: block;
width: 192px;
height: 192px;
margin: 96px auto 16px;
}
p {
margin: 16px 0 32px;
color: #999999;
font-size: 30px;
}
.result-btn {
width: 100%;
height: 88px;
line-height: 88px;
text-align: center;
font-size: 36px;
color: #fff;
background: #197DF0;
box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.02);
border-radius: 4px;
&:active {
opacity: 0.8;
}
}
h2 {
color: #333333;
font-size: 36px;
font-weight: 700;
}
}
</style>