推广小程序前端代码
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.

360 lines
8.6 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="">
  3. <view class="head-box"></view>
  4. <uv-navbar autoBack title="主理人认证" leftIconColor="#fff" bgColor="transparent" height="100rpx" :titleStyle="{color:'#fff'}"></uv-navbar>
  5. <view class="content">
  6. <view class="user-box">
  7. <uv-avatar :src="userInfo.headImage" size="98rpx" shape="circle"></uv-avatar>
  8. <view class="user-msg">
  9. <view class="user-msg-top">
  10. <view>{{userInfo.nickName}}</view>
  11. <!-- <view class="level-box">普通用户</view> -->
  12. </view>
  13. <view class="id-box">
  14. <text>ID:{{userInfo.id}}</text>
  15. <text class="copy-text" @click.stop="copy">复制</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="base-msg">
  20. <view class="title-box">基础信息</view>
  21. <view class="form-box">
  22. <view class="form-box-line">
  23. <view class="label-box">真实姓名</view>
  24. <view class="value-box">
  25. <uv-input placeholder="请输入真实姓名" v-model="info.name" border="none" color="#fff"></uv-input>
  26. </view>
  27. </view>
  28. <view class="form-box-line">
  29. <view class="label-box">联系方式</view>
  30. <view class="value-box">
  31. <uv-input placeholder="请输入联系方式" v-model="info.phone" type="number" border="none" color="#fff"></uv-input>
  32. </view>
  33. </view>
  34. <view class="form-box-line">
  35. <view class="label-box">身份证号</view>
  36. <view class="value-box">
  37. <uv-input placeholder="请输入身份证号" type="idcard" v-model="info.cardNo" border="none" color="#fff"></uv-input>
  38. </view>
  39. </view>
  40. <view class="form-box-line">
  41. <view class="label-box">简历附件</view>
  42. <view class="value-box">
  43. <uv-input placeholder=" " v-model="info.image" border="none" color="#fff"></uv-input>
  44. <view class="upload-btn"
  45. @click="uploadFile">上传简历</view>
  46. </view>
  47. </view>
  48. <view class="form-box-line">
  49. <view class="label-box">微信二维码</view>
  50. <view class="value-box">
  51. <view style="width: 80rpx;height: 80rpx;">
  52. <uv-image v-if="info.img" :src="info.img" width="80rpx" height="80rpx" @click="bigImg"></uv-image>
  53. </view>
  54. <view class="upload-btn" @click="upImg">上传图片</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="xie-box">
  60. <view class="title-box">阅读并同意协议</view>
  61. <view class="xie-box-val">
  62. <view class="val-text">
  63. <view>我已经阅读并同意</view>
  64. <view class="xieyi-val">主理人协议</view>
  65. </view>
  66. <view class="choose-box" @click="isAgree = !isAgree">
  67. <view class="normol-box" v-if="!isAgree"></view>
  68. <image src="@/static/image/member/choose-icon.png" mode="widthFix" v-else></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="btn-box" v-if="info.state != 1">
  74. <uv-button text="保存" color="#381615" shape="circle" :customStyle="btnCustomStyle" @click="confrim"></uv-button>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import { mapGetters } from 'vuex'
  80. export default{
  81. data() {
  82. return {
  83. isAgree:false,
  84. btnCustomStyle:{
  85. color:'#FF5858'
  86. },
  87. info:{
  88. name:'',
  89. phone:'',
  90. cardNo:'',
  91. img:''
  92. }
  93. }
  94. },
  95. computed: {
  96. ...mapGetters(["userInfo"]),
  97. },
  98. onLoad() {
  99. this.getjoinRecruitInfo()
  100. },
  101. methods:{
  102. bigImg() {
  103. uni.previewImage({
  104. urls:[this.info.img],
  105. current:0
  106. })
  107. },
  108. uploadFile() {
  109. let that = this
  110. uni.chooseMessageFile({
  111. count: 1, //一次可以上传多少个
  112. type: 'file',
  113. extension: ['.doc', '.pdf', '.docx'], //文件类型
  114. success(res) {
  115. console.log(res);
  116. that.$Oss.ossUpload(res.tempFiles[0].path)
  117. .then(url => {
  118. console.log(url);
  119. uni.showModal({
  120. title: url
  121. })
  122. })
  123. },
  124. fail: (err) => {
  125. console.log(err, 'err');
  126. }
  127. });
  128. },
  129. upImg() {
  130. uni.chooseImage({
  131. count: 1, // 默认9, 设置图片的选择数量
  132. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  133. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  134. success: (res) => {
  135. // 返回选定照片的本地文件路径列表 tempFilePaths
  136. this.$Oss.ossUpload(res.tempFilePaths[0])
  137. .then(url => {
  138. this.info.img = url
  139. this.$api('updateInfo',this.info, res => {
  140. if (res.code == 200) {
  141. uni.showToast({
  142. title:'保存成功',
  143. icon:'none'
  144. })
  145. }
  146. })
  147. })
  148. // 根据需要进行后续处理,例如上传图片等
  149. },
  150. fail: (err) => {
  151. // 处理错误情况
  152. console.log('选择图片失败', err);
  153. }
  154. });
  155. },
  156. getjoinRecruitInfo() {
  157. this.$api('joinRecruitInfo',res=>{
  158. if(res.code == 200) {
  159. this.info = res.result
  160. }
  161. })
  162. },
  163. copy() {
  164. uni.setClipboardData({
  165. data:this.userInfo.id,
  166. success: () => {
  167. uni.showToast({
  168. title:'复制成功',
  169. icon:'none'
  170. })
  171. }
  172. })
  173. },
  174. confrim() {
  175. if(!this.isAgree) return this.$Toast('请先阅读并同意《主理人协议》')
  176. if(!this.info.name) return this.$Toast('请输入姓名')
  177. if(!this.info.phone) return this.$Toast('请输入联系方式')
  178. if(!this.info.cardNo) return this.$Toast('请输入身份证号')
  179. let params = {
  180. name:this.info.name,
  181. phone:this.info.phone,
  182. cardNo:this.info.cardNo,
  183. img:this.info.img,
  184. image:this.info.image,
  185. id:this.info.id || ''
  186. }
  187. // if(!this.info.image) return this.$Toast('请输入姓名')
  188. this.$api('joinRecruit',params,res=>{
  189. if(res.code == 200) {
  190. this.$Toast('认证成功')
  191. }
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. page {
  199. background-color: #060504;
  200. }
  201. </style>
  202. <style lang="scss" scoped>
  203. .head-box {
  204. background: url('@/static/image/nav-bg.png') no-repeat;
  205. background-size: 100% 100%;
  206. width: 100%;
  207. height: 534rpx;
  208. position: absolute;
  209. z-index: -1;
  210. }
  211. .content {
  212. margin-top: 40rpx;
  213. padding: 0 30rpx;
  214. padding-top: calc(var(--status-bar-height) + 110rpx);
  215. .user-box {
  216. display: flex;
  217. align-items: center;
  218. margin-bottom: 74rpx;
  219. .user-msg {
  220. margin-left: 20rpx;
  221. .user-msg-top {
  222. font-weight: 600;
  223. font-size: 32rpx;
  224. color: #E6E6E6;
  225. display: flex;
  226. align-items: center;
  227. .level-box {
  228. width: 108rpx;
  229. height: 31rpx;
  230. background: RGBA(40, 19, 4, 1);
  231. border-radius: 16rpx;
  232. font-weight: 400;
  233. font-size: 20rpx;
  234. color: #FF9C00;
  235. text-align: center;
  236. margin-left: 14rpx;
  237. }
  238. }
  239. .id-box {
  240. color: #999999;
  241. font-size: 22rpx;
  242. margin-top: 20rpx;
  243. .copy-text {
  244. font-weight: 400;
  245. font-size: 22rpx;
  246. color: #E6E6E6;
  247. margin-left: 18rpx;
  248. }
  249. }
  250. }
  251. }
  252. .title-box {
  253. display: inline-block;
  254. font-weight: bold;
  255. font-size: 29rpx;
  256. color: #FFFFFF;
  257. position: relative;
  258. z-index: 2;
  259. &::after{
  260. content: "";
  261. position: absolute;
  262. bottom: 0;
  263. left: 0;
  264. width: 100%;
  265. height: 9rpx;
  266. background: #FF2828;
  267. border-radius: 4rpx 4rpx 4rpx 4rpx;
  268. opacity: 0.2;
  269. z-index: 1;
  270. }
  271. }
  272. .base-msg {
  273. .form-box {
  274. background: #1B1713;
  275. border-radius: 27rpx;
  276. padding:0 40rpx;
  277. margin-top: 20rpx;
  278. .form-box-line {
  279. min-height: 112rpx;
  280. border-bottom: 1px solid #403D3A;
  281. display: flex;
  282. align-items: center;
  283. &:last-child {
  284. border: none;
  285. }
  286. .label-box {
  287. font-weight: 500;
  288. font-size: 29rpx;
  289. color: #FFFFFF;
  290. margin-right: 34rpx;
  291. }
  292. .value-box {
  293. display: flex;
  294. align-items: center;
  295. justify-content: space-between;
  296. flex:1;
  297. .upload-btn {
  298. font-weight: 400;
  299. font-size: 28rpx;
  300. color: #FF5858;
  301. }
  302. }
  303. }
  304. }
  305. }
  306. .xie-box {
  307. margin-top:37rpx;
  308. .xie-box-val {
  309. margin-top: 25rpx;
  310. height: 116rpx;
  311. background: #1B1713;
  312. border-radius: 27rpx 27rpx 27rpx 27rpx;
  313. display: flex;
  314. align-items: center;
  315. justify-content: space-between;
  316. padding: 0 36rpx;
  317. .val-text {
  318. font-weight: 400;
  319. font-size: 25rpx;
  320. color: #FFFFFF;
  321. display: flex;
  322. align-items: center;
  323. .xieyi-val {
  324. color: #FF5858;
  325. }
  326. }
  327. .choose-box {
  328. .normol-box {
  329. width: 31rpx;
  330. height: 31rpx;
  331. border: 1px solid #fff;
  332. border-radius: 5rpx;
  333. }
  334. image {
  335. width: 31rpx;
  336. height: 31rpx;
  337. }
  338. }
  339. }
  340. }
  341. }
  342. .btn-box {
  343. position: fixed;
  344. bottom: 70rpx;
  345. left: 0;
  346. right: 0;
  347. padding: 0 40rpx;
  348. }
  349. </style>