宗法
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
<view class="create-type">
|
||||
<view class="create-type-title">选择业务类型</view>
|
||||
<block v-for="(item, index) in businessArr" :key="index">
|
||||
<view class="create-type-item" :class="{'active': item.business_id == businessId}" @click="onBusiness(item.business_id)">
|
||||
<image class="create-type-icon" :src="item.cover_url" mode="aspectFill"></image>
|
||||
<view class="create-type-item" :class="{'active': (item.business_id == businessId || item.synthesis_id == businessId) && item.self_type == selfType}" @click="onBusiness(item.business_id || item.synthesis_id, item.self_type)">
|
||||
<image class="create-type-icon" :src="item.cover_url || item.cover" mode="aspectFill"></image>
|
||||
<view class="create-type-text">
|
||||
<view class="title nowrap">{{item.title || '-'}}</view>
|
||||
<view class="submit nowrap">{{item.subtitle || '-'}}</view>
|
||||
<view class="submit nowrap">{{item.self_type == 'synthesis' ? '相关个人法律咨询服务' : item.subtitle || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -36,12 +36,14 @@
|
||||
|
||||
<script>
|
||||
import { business } from '@/apis/interfaces/business.js'
|
||||
import { synthList } from '@/apis/interfaces/synthesis.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
createType : '',
|
||||
businessArr: [],
|
||||
businessId : '',
|
||||
selfType : '',
|
||||
user : ''
|
||||
};
|
||||
},
|
||||
@@ -54,19 +56,32 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
business().then(res => {
|
||||
this.businessArr = res
|
||||
this.businessId = res[0].business_id
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
|
||||
Promise.all([business(), synthList()]).then(res => {
|
||||
let businessData = res[0]
|
||||
let synthListData = res[1]
|
||||
|
||||
this.businessArr = this.createType === 'other' ? businessData : businessData.concat(synthListData)
|
||||
this.businessId = this.businessArr[0].business_id
|
||||
this.selfType = this.businessArr[0].self_type
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 选择业务类型
|
||||
onBusiness(id){
|
||||
onBusiness(id, type){
|
||||
this.selfType = type
|
||||
this.businessId = id
|
||||
},
|
||||
// 创建业务单
|
||||
@@ -78,6 +93,39 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
// 个人综法业务
|
||||
if(this.selfType === 'synthesis'){
|
||||
let synthesisArr = []
|
||||
let synthesisObj = {}
|
||||
for(let val of this.businessArr){
|
||||
if(val.self_type == 'synthesis'){
|
||||
synthesisArr.push(val)
|
||||
}
|
||||
}
|
||||
synthesisObj = synthesisArr.find(val => val.synthesis_id === this.businessId)
|
||||
if(synthesisObj.can.buy){
|
||||
console.log('提交免费咨询')
|
||||
// this.$Router.replace({
|
||||
// name: 'PersonWrite'
|
||||
// })
|
||||
return
|
||||
}
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '开通个人365会员,尊享全年不限次数免费法律咨询,是否立即开通?',
|
||||
confirmText : '开通会员',
|
||||
cancelText : '稍后开通',
|
||||
success : modalRes => {
|
||||
if(modalRes.confirm){
|
||||
this.$Router.replace({
|
||||
name: 'PersonWrite'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
// 金法业务
|
||||
let busines = this.businessArr.find(val => val.business_id === this.businessId)
|
||||
this.$Router.replace({
|
||||
name : 'WorkGenerate',
|
||||
@@ -97,7 +145,8 @@
|
||||
.create-page{
|
||||
padding: 50rpx;
|
||||
box-sizing: border-box;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
.create-title{
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
Reference in New Issue
Block a user