settleIn.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <u--form
  5. labelPosition="left"
  6. :model="model1"
  7. ref="uForm"
  8. labelWidth="100"
  9. >
  10. <u-form-item
  11. :label="i18n.name"
  12. prop="userInfo.name"
  13. borderBottom
  14. ref="item1"
  15. >
  16. <u--input
  17. inputAlign="right"
  18. v-model="model1.name"
  19. :placeholder="i18n.pleaseName"
  20. border="none"
  21. ></u--input>
  22. </u-form-item>
  23. <u-form-item
  24. :label="i18n.IDCard"
  25. prop="userInfo.name"
  26. borderBottom
  27. ref="item1"
  28. >
  29. <u--input
  30. inputAlign="right"
  31. v-model="model1.idcard"
  32. type="idcard"
  33. :placeholder="i18n.enterCard"
  34. border="none"
  35. ></u--input>
  36. </u-form-item>
  37. <u-form-item
  38. :label="i18n.backCard"
  39. prop="userInfo.name"
  40. borderBottom
  41. ref="item1"
  42. >
  43. <u--input
  44. inputAlign="right"
  45. v-model="model1.card_number"
  46. type="number"
  47. :placeholder="i18n.pleaseBackCard"
  48. border="none"
  49. ></u--input>
  50. </u-form-item>
  51. <u-form-item
  52. :label="i18n.phone"
  53. prop="userInfo.name"
  54. borderBottom
  55. ref="item1"
  56. >
  57. <u--input
  58. inputAlign="right"
  59. v-model="model1.phone"
  60. type="number"
  61. :placeholder="i18n.pleasePhone"
  62. border="none"
  63. ></u--input>
  64. </u-form-item>
  65. <u-form-item :label="i18n.QRCode" borderBottom ref="item1">
  66. <view style="display: flex; align-items: center">
  67. <u--input
  68. inputAlign="right"
  69. v-model="model1.code"
  70. :placeholder="i18n.pleaseQrCode"
  71. border="none"
  72. ></u--input>
  73. <view style="color: #f83224; font-weight: 600; margin-left: 50rpx">
  74. {{ i18n.getQrCode }}
  75. </view>
  76. </view>
  77. </u-form-item>
  78. </u--form>
  79. </view>
  80. <view class="bottom-1">
  81. <u-checkbox-group>
  82. <u-checkbox
  83. v-model="radiovalue1"
  84. shape="circle"
  85. activeColor="#f83224"
  86. @change="radioChange"
  87. ></u-checkbox>
  88. </u-checkbox-group>
  89. {{ i18n.readandAgree
  90. }}<text style="color: #f83224" @click="toUserAgreement"
  91. >《{{ i18n.userServiceAgreement }}》</text
  92. >{{ i18n.and }}
  93. <text style="color: #f83224" @click="toPrivacy"
  94. >《{{ i18n.privacy }}》</text
  95. >
  96. </view>
  97. <button class="btn" @click="submit">{{ i18n.startVerification }}</button>
  98. </view>
  99. </template>
  100. <script>
  101. import { startEid } from "../../mp_ecard_sdk/main";
  102. export default {
  103. data() {
  104. return {
  105. model1: {
  106. name: "",
  107. idcard: "",
  108. phone: "",
  109. card_number: "",
  110. code: "",
  111. },
  112. radiovalue1: false,
  113. };
  114. },
  115. computed: {
  116. i18n() {
  117. return this.$t("index");
  118. },
  119. },
  120. methods: {
  121. radioChange() {
  122. console.log(this.radiovalue1);
  123. this.radiovalue1 = !this.radiovalue1;
  124. },
  125. submit() {
  126. console.log(this.radiovalue1);
  127. if (!this.radiovalue1) {
  128. uni.showToast({
  129. title: `${this.i18n.checkFirst}《${this.i18n.userServiceAgreement}》${this.i18n.and}《${this.i18n.privacy}》`,
  130. icon: "none",
  131. });
  132. return;
  133. }
  134. delete this.model1.code;
  135. if (!this.model1.name) {
  136. uni.showToast({
  137. title: this.i18n.pleaseName,
  138. icon: "none",
  139. });
  140. return;
  141. } else if (!this.model1.idcard) {
  142. uni.showToast({
  143. title: this.i18n.enterCard,
  144. icon: "none",
  145. });
  146. return;
  147. } else if (!this.model1.phone) {
  148. uni.showToast({
  149. title: this.i18n.pleasePhone,
  150. icon: "none",
  151. });
  152. return;
  153. } else if (!this.model1.card_number) {
  154. uni.showToast({
  155. title: this.i18n.pleaseBackCard,
  156. icon: "none",
  157. });
  158. return;
  159. }
  160. uni.$u.http.get(`/api/identify/identify`).then((res) => {
  161. startEid({
  162. data: {
  163. token: res.EidToken,
  164. needJumpPage: false,
  165. },
  166. verifyDoneCallback(res) {
  167. const { token, verifyDone } = res;
  168. if (verifyDone) {
  169. uni.$u.http
  170. .post("/api/merchant/apply", this.model1)
  171. .then((res) => {
  172. uni.showToast({
  173. title: this.i18n.applicationResult,
  174. });
  175. uni.navigateTo({
  176. url: "/pages/mine/mine",
  177. });
  178. });
  179. } else {
  180. uni.showToast({
  181. title: this.i18n.pleaseIdentity,
  182. });
  183. }
  184. },
  185. });
  186. });
  187. },
  188. getTeamStatus() {},
  189. toPrivacy() {
  190. uni.navigateTo({
  191. url: "/pageC/privacyPolicy/privacyPolicy",
  192. });
  193. },
  194. toUserAgreement() {
  195. uni.navigateTo({
  196. url: "/pageD/userAgreement/userAgreement",
  197. });
  198. },
  199. },
  200. mounted() {
  201. this.getTeamStatus();
  202. uni.setNavigationBarTitle({
  203. title: this.i18n.teamSettle,
  204. });
  205. },
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .page {
  210. padding: 20rpx 24rpx;
  211. .content {
  212. padding: 0 20rpx;
  213. background-color: #fff;
  214. border-radius: 16rpx;
  215. }
  216. .bottom-1 {
  217. font-size: 20rpx;
  218. margin-top: 68rpx;
  219. color: #555;
  220. display: flex;
  221. justify-content: flex-start;
  222. align-items: center;
  223. width: 70%;
  224. .radio {
  225. width: 24rpx;
  226. height: 24rpx;
  227. }
  228. }
  229. .btn {
  230. color: #fff;
  231. background-color: #f83224;
  232. border-radius: 44rpx;
  233. margin-top: 28rpx;
  234. height: 88rpx;
  235. font-size: 32rpx;
  236. }
  237. }
  238. </style>