insureDetail.vue
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<template>
<div style="padding: 0 10px">
<div class="first-header-class">
<swiper height="150px" dots-position="center" :loop="true" :auto="true" :show-dots="false">
<swiper-item v-for="(item,index) in companyData.imgList" :key="index" >
<img :src="item" class="img-class-all" />
</swiper-item>
</swiper>
</div>
<!--<flexbox>-->
<!--<flexbox-item v-for="i in companyData.imgList">-->
<!--<div class="flex-demo">-->
<!--<img :src="i" alt="">-->
<!--</div>-->
<!--</flexbox-item>-->
<!--<!–<flexbox-item>–>-->
<!--<!–<div class="flex-demo">–>-->
<!--<!–<img src="../../assets/images/service/insure2.png" alt="">–>-->
<!--<!–</div>–>-->
<!--<!–</flexbox-item>–>-->
<!--<!–<flexbox-item>–>-->
<!--<!–<div class="flex-demo">–>-->
<!--<!–<img src="../../assets/images/service/insure3.png" alt="">–>-->
<!--<!–</div>–>-->
<!--<!–</flexbox-item>–>-->
<!--</flexbox>-->
<p style="margin-top: 15px;">{{companyData.companyName}}</p>
<p>{{companyData.serviceCommitment}}</p>
<p>公司地址:{{companyData.companyAddress}}</p>
<p>电话:{{companyData.contactTel}}</p>
<p style="margin: 40px 0 20px;color: red;text-align: center">
若有业务咨询,请预留电话,客服人员会尽快联系到您
</p>
<!--<x-input title="手机号码格式化" mask="999 9999 9999" v-model="maskValue" :max="13" is-type="china-mobile"></x-input>-->
<group title=" ">
<x-input v-model="phoneValue" title="手机号码" name="mobile" placeholder="请输入手机号码" keyboard="number"
is-type="china-mobile"></x-input>
</group>
<x-button type="primary" style="margin-top: 20px" @click.native="submitPhone">确定</x-button>
</div>
</template>
<script>
import { queryInsuranceCompanyInfo, saveInsuranceCompanyInfo } from "@/api/service/service.js";
import { Toast } from "mint-ui";
export default {
name: "insureDetail",
data() {
return {
phoneValue: "",
companyData: {}
};
},
created() {
let id = this.$route.query.id;
console.log(id);
this.queryInsuranceCompanyInfo(id);
},
methods: {
queryInsuranceCompanyInfo: function(_id) {
let salt = this.$utils.myCommonSalt(32);
let jsondata = {
app_id: this.$utils.myVarAppid,
deviceInfo: this.$utils.myDeviceInfo,
salt: salt,
sign_type: "md5",
orgId: this.$utils.myOrgId,
id: _id
};
jsondata.sign = this.$utils.signObject(jsondata);
queryInsuranceCompanyInfo(jsondata).then(response => {
console.log(response);
this.companyData = response.data;
});
},
submitPhone: function() {
console.log(this.phoneValue);
// console.log(this.$utils.testPhone(this.phoneValue))
let reg = /^1[0-9]{10}$/;
if (this.phoneValue == "" || this.phoneValue.length <= 10 || !reg.test(this.phoneValue)) {
Toast("请输入正确的手机号");
return false;
}
let salt = this.$utils.myCommonSalt(32);
let jsondata = {
app_id: this.$utils.myVarAppid,
deviceInfo: this.$utils.myDeviceInfo,
salt: salt,
sign_type: "md5",
orgId: this.$utils.myOrgId,
companyNo: this.companyData.companyNo,
companyName: this.companyData.companyName,
userTel: this.phoneValue
};
jsondata.sign = this.$utils.signObject(jsondata);
saveInsuranceCompanyInfo(jsondata).then(response => {
console.log(response);
if(response.code == 0){
Toast("联系方式提交成功");
}
});
}
}
};
</script>
<style scoped lang="scss">
.first-header-class{
img{
img {
width: 100%;
height: 100%;
}
}
}
.flex-demo {
text-align: center;
color: #fff;
background-color: #20b907;
border-radius: 4px;
background-clip: padding-box;
height: 100px;
img {
width: 100%;
height: 100%;
}
}
</style>