瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
4.8 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <!-- 实名认证 -->
  3. <uv-popup ref="popup" :round="30">
  4. <view class="page">
  5. <!-- <view class="info-tips">
  6. 完成认证<text>您将获得实名认证平台特权</text>
  7. </view> -->
  8. <uv-tabs :list="tags" @click="tagsClick"
  9. :activeStyle="{color : '#5baaff', fontWeight : 900}"
  10. lineHeight="0"
  11. lineWidth="50rpx"></uv-tabs>
  12. <view class="form"
  13. v-if="type == 0">
  14. <view class="form-item">
  15. <view class="label">
  16. 姓名
  17. </view>
  18. <input type="text" class="form-input"
  19. placeholder="请输入姓名"
  20. v-model="form.name"/>
  21. </view>
  22. <view class="form-item">
  23. <view class="label">
  24. 身份证号码
  25. </view>
  26. <input type="text" class="form-input"
  27. placeholder="请输入身份证号码"
  28. v-model="form.card"/>
  29. </view>
  30. </view>
  31. <view class="form"
  32. v-if="type == 1">
  33. <view class="form-item">
  34. <view class="label">
  35. 店铺名称
  36. </view>
  37. <input type="text" class="form-input"
  38. placeholder="请输入姓名"
  39. v-model="form.name"/>
  40. </view>
  41. <view class="form-item">
  42. <view class="label">
  43. 联系方式
  44. </view>
  45. <input type="text" class="form-input"
  46. placeholder="请输入联系方式"
  47. v-model="form.phone"/>
  48. </view>
  49. <view class="form-item">
  50. <view class="title">
  51. 请上传营业执照
  52. </view>
  53. <view class="tips">
  54. 信息仅用身份核实上传后可增加曝光机会
  55. </view>
  56. </view>
  57. <view class="form-item">
  58. <uv-upload
  59. :fileList="fileList"
  60. :maxCount="1"
  61. width="600rpx"
  62. height="280rpx"
  63. multiple
  64. @afterRead="afterRead"
  65. @delete="deleteImage">
  66. <view class="upload">
  67. <image src="/static/image/home/photo.png"
  68. mode="aspectFit"
  69. style="width: 390rpx;height: 280rpx;" />
  70. <view class="btn-add">
  71. 点击上传
  72. </view>
  73. </view>
  74. </uv-upload>
  75. </view>
  76. <view class="form-item">
  77. <view class="tips"
  78. style="text-align: center;padding: 20rpx 0;">
  79. (确保文字清晰可辨避免遮挡不全反光)
  80. </view>
  81. </view>
  82. </view>
  83. <view class="uni-color-btn"
  84. @click="submit">
  85. 认证
  86. </view>
  87. </view>
  88. </uv-popup>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. checkboxValue : [],
  95. form : {},
  96. fileList: [],
  97. type : 0,
  98. tags : [
  99. {
  100. name : '个人认证',
  101. },
  102. {
  103. name : '店铺认证',
  104. },
  105. ],
  106. }
  107. },
  108. methods: {
  109. deleteImage(e){
  110. this.fileList.splice(e.index, 1)
  111. },
  112. afterRead(e){
  113. let self = this
  114. e.file.forEach(file => {
  115. self.$Oss.ossUpload(file.url).then(url => {
  116. self.fileList.push({
  117. url
  118. })
  119. })
  120. })
  121. },
  122. open(){
  123. this.$refs.popup.open()
  124. },
  125. tagsClick({index}){
  126. this.type = index
  127. },
  128. submit(){
  129. let data = {
  130. ...this.form,
  131. image : this.fileList.map((item) => item.url).join(","),
  132. }
  133. if(this.type == 0){
  134. if (this.$utils.verificationAll(data, {
  135. name: '说点什么吧',
  136. card : '请输入身份证号',
  137. })) {
  138. return
  139. }
  140. }else{
  141. if (this.$utils.verificationAll(data, {
  142. name: '请输入店铺名称',
  143. phone: '请输入联系方式',
  144. image: '请上传营业执照',
  145. })) {
  146. return
  147. }
  148. }
  149. this.$api([
  150. 'personalAuthentication',
  151. 'companyAuthentication',
  152. ][this.type], data, res => {
  153. if(res.code == 200){
  154. uni.showToast({
  155. title: '提交成功!',
  156. icon: 'none'
  157. })
  158. this.$store.commit('getUserInfo')
  159. this.$refs.popup.close()
  160. }
  161. })
  162. },
  163. }
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .page{
  168. width: 700rpx;
  169. .info-tips{
  170. width: 100%;
  171. padding: 30rpx 0;
  172. background-color: #f3f3f3;
  173. text-align: center;
  174. text{
  175. color: $uni-color;
  176. }
  177. }
  178. .form {
  179. padding: 30rpx;
  180. .form-item{
  181. .label{
  182. padding: 20rpx 0;
  183. }
  184. .form-input{
  185. border: 1px solid $uni-color;
  186. background: rgba($uni-color, 0.1);
  187. padding: 10rpx 20rpx;
  188. font-size: 28rpx;
  189. }
  190. .title{
  191. font-weight: 900;
  192. margin-top: 50rpx;
  193. padding: 10rpx 0;
  194. }
  195. .tips{
  196. font-size: 26rpx;
  197. color: #777;
  198. padding-bottom: 20rpx;
  199. }
  200. }
  201. .upload{
  202. display: flex;
  203. justify-content: center;
  204. align-items: center;
  205. width: 690rpx;
  206. background-color: #f3f3f3;
  207. border-radius: 10rpx;
  208. .btn-add{
  209. margin: auto;
  210. padding: 10rpx 20rpx;
  211. background-color: $uni-color;
  212. color: #fff;
  213. border-radius: 10rpx;
  214. }
  215. }
  216. }
  217. .config{
  218. font-size: 26rpx;
  219. line-height: 40rpx;
  220. width: 100%;
  221. display: flex;
  222. justify-content: center;
  223. .content{
  224. width: 100%;
  225. display: flex;
  226. flex-direction: column;
  227. align-items: center;
  228. }
  229. text{
  230. color: $uni-color;
  231. }
  232. }
  233. }
  234. </style>