index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <!-- 证件识别 -->
  2. <template>
  3. <view class="authentication" :style="[{height: `${windowHeight}px`}]">
  4. <view class="r_flex_wrap logo-box">
  5. <img class="logo-img" src="/static/background/gs-logo-z.png" style="width: 200rpx; height: 200rpx" />
  6. <view class="r_margin_10 logo-text"> 信飞通 </view>
  7. </view>
  8. <view class="container">
  9. <!-- 输入您的姓名 -->
  10. <view class="cu-bar bg-white qyyyzz">
  11. <view class="action sub-title">
  12. <text class="text-xl text-bold text-blue text-shadow">输入您的企业码</text>
  13. <text class="text-ABC text-blue">enterprise </text>
  14. </view>
  15. </view>
  16. <view class="input_box">
  17. <input class="input" placeholder="企业码(必填)" v-model="formData.code" />
  18. <view class="uploadText">当前客户端未激活,请联系企业管理员获取企业码完成激活</view>
  19. </view>
  20. <view class="submitBtn" @click="upFormData">验 证 激 活</view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import * as AppApi from '@/api/app'
  26. import request from '@/utils/request'
  27. import storage from '@/utils/storage'
  28. import * as Verify from '@/utils/verify'
  29. const apiUrl = 'https://hnapi.kdboss.cn'
  30. export default {
  31. data() {
  32. return {
  33. list: ['隐私说明:请按要求上传真实的证件照片,您所上传的行驶证仅用于平台账户绑定,请放心上传'],
  34. // ../static/me/zjx_me_bg6.jpg
  35. imgUrl1: '',
  36. imgUrl2: '',
  37. imgUrl3: '',
  38. formData: {
  39. code: ''
  40. },
  41. imgList: [],
  42. imgss: [],
  43. fileList: '',
  44. windowHeight: ''
  45. }
  46. },
  47. watch: {},
  48. onReady() {
  49. // 获取屏幕高度
  50. uni.getSystemInfo({
  51. success: (res) => {
  52. const app = this
  53. app.windowHeight = res.windowHeight
  54. }
  55. })
  56. },
  57. mounted() {
  58. let baseUrl = apiUrl + '/api/attachment/addtoPath?pagevalue=300'
  59. this.fileList = baseUrl
  60. },
  61. methods: {
  62. //头像上传
  63. uploadImg(url, formData) {
  64. const app = this
  65. // 选择图片并上传
  66. uni.chooseImage({
  67. count: 1, // 可选择图片的数量
  68. success: function (chooseResult) {
  69. var tempFilePaths = chooseResult.tempFilePaths
  70. // 上传图片
  71. let baseUrl = apiUrl + '/api/attachment/addtoPath?pagevalue=300'
  72. uni.uploadFile({
  73. url: baseUrl, // 上传图片的服务器接口
  74. filePath: tempFilePaths[0],
  75. name: 'file',
  76. formData: formData, // 证件 身份证 正面
  77. success: function (uploadResult) {
  78. let res = JSON.parse(uploadResult.data)
  79. if (res.Status == 0) {
  80. app[url] = res.Data
  81. console.log(app[url], 'imgUrl1')
  82. app.$toast('上传成功')
  83. } else {
  84. app.$toast('上传失败')
  85. }
  86. // 上传成功后的处理
  87. },
  88. fail: function (error) {
  89. console.log('上传失败', error)
  90. // 上传失败后的处理
  91. }
  92. })
  93. }
  94. })
  95. },
  96. async upFormData() {
  97. const app = this
  98. if (Verify.isEmpty(app.formData.code)) {
  99. this.$toast('请填写企业码激活')
  100. return false
  101. }
  102. const params = {
  103. // 客户id
  104. customerid: storage.get('wx_userid'),
  105. // wx_openid
  106. openid: storage.get('wx_openid'),
  107. qym: app.formData.code
  108. }
  109. const Data = await AppApi.bindqym(params)
  110. if (Data.Status == 0) {
  111. app.$toast('认证成功')
  112. storage.set('wx_qym', app.formData.code)
  113. setTimeout(() => {
  114. this.$navTo('pages/index/index')
  115. }, 1000)
  116. }
  117. }
  118. },
  119. onPullDownRefresh() {
  120. console.log('下拉')
  121. // 获取首页数据
  122. uni.stopPullDownRefresh()
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .logo-box {
  128. margin-top: 150rpx;
  129. .logo-text {
  130. font-weight: 900;
  131. font-size: 50rpx;
  132. color: #00569f;
  133. }
  134. }
  135. .authentication {
  136. height: 100%;
  137. width: 100%;
  138. background: url('/static/background/zjx-bg.jpeg') #fff;
  139. background-size: 100%;
  140. background-repeat: no-repeat;
  141. background-position: top;
  142. overflow: hidden;
  143. }
  144. .container {
  145. background: #ffffff;
  146. margin: 100rpx 30rpx 0rpx;
  147. padding-top: 30rpx;
  148. box-shadow: #b6b6b6 10rpx 10rpx 20rpx;
  149. border-radius: 30rpx;
  150. overflow: hidden;
  151. }
  152. .input_box {
  153. padding: 0 30rpx;
  154. .input {
  155. background: #007aec0a;
  156. border: 1rpx solid #007aec;
  157. border-radius: 10rpx;
  158. margin: 10rpx 0rpx 26rpx;
  159. padding: 20rpx 26rpx;
  160. height: auto;
  161. }
  162. }
  163. .uploadText {
  164. color: #aaaaaa;
  165. font-size: 30rpx;
  166. background: #ffffff;
  167. }
  168. .uploadBox {
  169. padding: 15rpx 80rpx 40rpx;
  170. background-color: #ffffff;
  171. display: flex;
  172. justify-content: space-between;
  173. .leftBtn {
  174. width: 100%;
  175. height: 75rpx;
  176. line-height: 75rpx;
  177. background-color: #007aec;
  178. border-radius: 0 0 12rpx 12rpx;
  179. }
  180. .uploadItem {
  181. width: 100%;
  182. height: 200rpx;
  183. background-color: #f1f7ff;
  184. border-radius: 15rpx;
  185. padding: 30rpx;
  186. position: relative;
  187. .imgUrl {
  188. width: 100%;
  189. height: 100%;
  190. position: absolute;
  191. left: 0;
  192. top: 0;
  193. }
  194. .imgBox {
  195. width: 100%;
  196. height: 100%;
  197. position: relative;
  198. }
  199. .imgEx1 {
  200. background: url('/static/discern/ex1.png');
  201. background-size: 82%;
  202. background-repeat: no-repeat;
  203. background-position: center;
  204. }
  205. .imgEx2 {
  206. background: url('/static/discern/ex2.png');
  207. background-size: 82%;
  208. background-repeat: no-repeat;
  209. background-position: center;
  210. }
  211. .imgEx3 {
  212. background: url('/static/background/wendang.png');
  213. background-size: 82%;
  214. background-repeat: no-repeat;
  215. background-position: center;
  216. }
  217. .leftTop {
  218. height: 28rpx;
  219. width: 4rpx;
  220. background-color: #007aec;
  221. position: absolute;
  222. left: 0;
  223. }
  224. .leftTop2 {
  225. height: 4rpx;
  226. width: 28rpx;
  227. background-color: #007aec;
  228. position: absolute;
  229. top: 0;
  230. }
  231. .leftbottom {
  232. height: 28rpx;
  233. width: 4rpx;
  234. background-color: #007aec;
  235. position: absolute;
  236. bottom: 0;
  237. }
  238. .leftbottom2 {
  239. height: 4rpx;
  240. width: 28rpx;
  241. background-color: #007aec;
  242. position: absolute;
  243. bottom: 0;
  244. }
  245. .rightTop {
  246. height: 28rpx;
  247. width: 4rpx;
  248. background-color: #007aec;
  249. position: absolute;
  250. right: 0;
  251. }
  252. .rightTop2 {
  253. height: 4rpx;
  254. width: 28rpx;
  255. background-color: #007aec;
  256. position: absolute;
  257. right: 0;
  258. top: 0;
  259. }
  260. .rightbottom {
  261. height: 28rpx;
  262. width: 4rpx;
  263. background-color: #007aec;
  264. position: absolute;
  265. right: 0;
  266. bottom: 0;
  267. }
  268. .rightbottom2 {
  269. height: 4rpx;
  270. width: 28rpx;
  271. background-color: #007aec;
  272. position: absolute;
  273. right: 0;
  274. bottom: 0;
  275. }
  276. }
  277. .qyyyzz_uploadItem {
  278. height: 255rpx;
  279. }
  280. }
  281. .distinguishBox {
  282. padding: 5rpx 30rpx 20rpx;
  283. background: white;
  284. view {
  285. margin-bottom: 20rpx;
  286. }
  287. }
  288. .disLabel {
  289. text-align-last: justify;
  290. text-align: justify;
  291. text-justify: distribute-all-lines;
  292. min-width: 142rpx;
  293. display: inline-block;
  294. margin-right: 5rpx;
  295. }
  296. .requirement {
  297. padding: 10rpx 30rpx 26rpx;
  298. background: white;
  299. view {
  300. margin-bottom: 10rpx;
  301. }
  302. .errorBox {
  303. display: flex;
  304. justify-content: space-between;
  305. margin-top: 30rpx;
  306. view {
  307. width: 23%;
  308. height: 100rpx;
  309. }
  310. .item1 {
  311. background-image: url('/static/discern/yes.png');
  312. background-repeat: no-repeat;
  313. background-size: 100%;
  314. position: relative;
  315. }
  316. .item2 {
  317. background-image: url('/static/discern/error1.png');
  318. background-repeat: no-repeat;
  319. background-size: 100%;
  320. position: relative;
  321. }
  322. .item3 {
  323. background-image: url('/static/discern/error2.png');
  324. background-repeat: no-repeat;
  325. background-size: 100%;
  326. position: relative;
  327. }
  328. .item4 {
  329. background-image: url('/static/discern/error3.png');
  330. background-repeat: no-repeat;
  331. background-size: 100%;
  332. position: relative;
  333. }
  334. .iconImg {
  335. width: 60rpx;
  336. position: absolute;
  337. bottom: -10px;
  338. left: 50%;
  339. margin-left: -30rpx;
  340. }
  341. }
  342. }
  343. .submitBtn {
  344. width: 90%;
  345. height: 90rpx;
  346. background: #007aec;
  347. line-height: 90rpx;
  348. margin: 50rpx auto;
  349. text-align: center;
  350. font-size: 34rpx;
  351. color: #fff;
  352. border-radius: 12rpx;
  353. }
  354. </style>