123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <view class="container ask-container">
- <view class="advice-ipt-cont">
- <u-input
- v-model="advice_content"
- type="textarea"
- maxlength="100"
- :clearable="false"
- :placeholder="titlePlaceholder"
- height="300"
- class="ipt"/>
- <text class="num-tag">{{advice_content.length}}/100</text>
- </view>
- <view class="btn-cont" @click="submitHandle">
- 提交
- </view>
- </view>
- </template>
- <script>
- import { activity,Report } from "@/config/api.js"
- export default {
- data() {
- return {
- advice_content:'',
- id:'',
- type:''
- };
- },
- computed:{
- titlePlaceholder(){
- return this.type=='文章'?'请描述您的问题,销售会跟进问题,后期在线下为您解答':'请描述您的问题,分析师会代您向专家提问。'
- }
- },
- methods:{
- submitHandle(){
- if(this.type=='文章') {
- Report.articleAskAdd({
- ArticleId:Number(this.id),
- Content:this.advice_content
- }).then(res=>{
- if(res.Ret === 200) {
- this.$util.toast('提交成功')
- this.advice_content=''
- setTimeout(()=>{
- uni.navigateBack()
- },500)
- }
-
- })
- }else {
- activity.activityAskAdd({
- ActivityId:Number(this.id),
- Content:this.advice_content
- }).then(res=>{
- if(res.Ret === 200) {
- this.$util.toast('提交成功')
- this.advice_content=''
- setTimeout(()=>{
- uni.navigateBack()
- },500)
- }
-
- })
- }
-
- }
- },
- onLoad(option){
- this.id=option.id
- this.type=option.type ||''
- uni.setNavigationBarTitle({
- title: this.type=='文章'?'提问':'帮我代问'
- })
- },
- }
- </script>
- <style scoped lang="scss">
- .ask-container{
- background-color: #fff;
- padding: 30rpx 34rpx;
- .advice-ipt-cont {
- height: 420rpx;
- border: 1rpx solid #D0CFD5;
- border-radius: 8rpx;
- padding: 30rpx;
- position: relative;
- font-size: 28rpx;
- color: #D0CFD5;
- .num-tag {
- position: absolute;
- bottom: 30rpx;
- right: 30rpx;
- }
- }
- .btn-cont {
- margin: 80rpx auto;
- width: 368rpx;
- height: 80rpx;
- font-size: 34rpx;
- line-height: 80rpx;
- text-align: center;
- color: #FFFFFF;
- background: linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%);
- opacity: 1;
- border-radius: 4rpx;
- }
- }
- </style>
|