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

476 lines
13 KiB

7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
2 weeks ago
7 months ago
7 months ago
2 weeks ago
7 months ago
7 months ago
2 weeks ago
7 months ago
7 months ago
6 months ago
6 months ago
2 weeks ago
7 months ago
6 months ago
6 months ago
2 weeks ago
6 months ago
7 months ago
6 months ago
6 months ago
2 weeks ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
2 weeks ago
7 months ago
6 months ago
7 months ago
2 weeks ago
7 months ago
2 weeks ago
6 months ago
2 weeks ago
7 months ago
2 weeks ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
2 weeks ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
2 weeks ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
2 weeks ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <view class="head-box"></view>
  4. <uv-navbar autoBack
  5. :title="$t('pages_zlx.zlx_form.title')"
  6. leftIconColor="#fff"
  7. :bgColor="bgColor"
  8. height="100rpx"
  9. :titleStyle="{color:'#fff'}"></uv-navbar><!-- -->
  10. <view class="content">
  11. <view class="user-box">
  12. <uv-avatar :src="userInfo.headImage" size="98rpx" shape="circle"></uv-avatar>
  13. <view class="user-msg">
  14. <view class="user-msg-top">
  15. <view>{{userInfo.nickName}}</view>
  16. <!-- <view class="level-box">普通用户</view> -->
  17. </view>
  18. <view class="id-box">
  19. <text>ID:{{userInfo.id}}</text>
  20. <text class="copy-text" @click.stop="copy">{{$t('pages_zlx.zlx_form.copy')}}</text><!-- 复制 -->
  21. </view>
  22. </view>
  23. </view>
  24. <view class="base-msg">
  25. <view class="title-box">{{$t('pages_zlx.zlx_form.basic_info')}}</view><!-- 基础信息 -->
  26. <view class="form-box">
  27. <view class="form-box-line">
  28. <view class="label-box">{{$t('pages_zlx.zlx_form.real_name')}}</view><!-- 真实姓名 -->
  29. <view class="value-box">
  30. <uv-input :placeholder="$t('pages_zlx.zlx_form.enter_real_name')" v-model="info.name" border="none" color="#fff" :disabled="info.state == 0"></uv-input><!-- 请输入真实姓名 -->
  31. </view>
  32. </view>
  33. <view class="form-box-line">
  34. <view class="label-box">{{$t('pages_zlx.zlx_form.contact_info')}}</view><!-- 联系方式 -->
  35. <view class="value-box">
  36. <uv-input :placeholder="$t('pages_zlx.zlx_form.enter_contact_info')" v-model="info.phone" type="number" border="none" color="#fff" :disabled="info.state == 0"></uv-input><!-- 请输入联系方式 -->
  37. </view>
  38. </view>
  39. <view class="form-box-line">
  40. <view class="label-box">{{$t('pages_zlx.zlx_form.id_card')}}</view><!-- 身份证号 -->
  41. <view class="value-box">
  42. <uv-input :placeholder="$t('pages_zlx.zlx_form.enter_id_card')" type="idcard" v-model="info.cardNo" border="none" color="#fff" :disabled="info.state == 0"></uv-input><!-- 请输入身份证号 -->
  43. </view>
  44. </view>
  45. <view class="form-box-line">
  46. <view class="label-box">{{$t('pages_zlx.zlx_form.resume_attachment')}}</view><!-- 简历附件 -->
  47. <view class="value-box">
  48. <!-- <uv-input placeholder=" "
  49. v-model="info.image"
  50. border="none"
  51. color="#fff"></uv-input> -->
  52. <view class="docx-title"
  53. @click="openDocument(info.image)">
  54. {{ info.image || '' }}
  55. </view>
  56. <view class="upload-btn"
  57. @click="info.state != 0 ? uploadFile() : null"
  58. :class="{'disabled': info.state == 0}">{{$t('pages_zlx.zlx_form.upload_resume')}}</view><!-- 上传简历 -->
  59. </view>
  60. </view>
  61. <view class="form-box-line">
  62. <view class="label-box">{{$t('pages_zlx.zlx_form.wechat_qr_code')}}</view><!-- 微信二维码 -->
  63. <view class="value-box">
  64. <view style="width: 80rpx;height: 80rpx;">
  65. <uv-image v-if="info.img" :src="info.img" width="80rpx" height="80rpx" @click="bigImg"></uv-image>
  66. </view>
  67. <view class="upload-btn"
  68. @click="info.state != 0 ? upImg() : null"
  69. :class="{'disabled': info.state == 0}">{{$t('pages_zlx.zlx_form.upload_image')}}</view><!-- 上传图片 -->
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="xie-box">
  75. <view class="title-box">{{$t('pages_zlx.zlx_form.personal_photos_title')}}</view><!-- 个人生活照片含全身照 -->
  76. <view class="xie-box-val">
  77. <uv-upload
  78. :fileList="fileList"
  79. multiple
  80. :maxCount="9"
  81. width="180rpx"
  82. height="180rpx"
  83. :disabled="info.state == 0"
  84. @afterRead="afterRead"
  85. @delete="deleteImage">
  86. </uv-upload>
  87. </view>
  88. </view>
  89. <view class="xie-box">
  90. <view class="title-box">{{$t('pages_zlx.zlx_form.agreement_title')}}</view><!-- 阅读并同意协议 -->
  91. <view class="xie-box-val">
  92. <view class="val-text">
  93. <view>{{$t('pages_zlx.zlx_form.agreement_text')}}</view><!-- 我已经阅读并同意 -->
  94. <view class="xieyi-val"
  95. @click="$utils.navigateTo('/pages_login/yinsixieyi?key=vip_text')">{{$t('pages_zlx.zlx_form.agreement_link')}}</view><!-- 主理人协议 -->
  96. </view>
  97. <view class="choose-box"
  98. @click="info.state != 0 ? (isAgree = !isAgree) : null"
  99. :class="{'disabled': info.state == 0}">
  100. <view class="normol-box" v-if="!isAgree"></view>
  101. <image src="./static/choose-icon.png" mode="widthFix" v-else></image>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 审核中状态 -->
  107. <view class="btn-box" v-if="info.state == 0">
  108. <uv-button :text="$t('pages_zlx.zlx_form.reviewing')" color="#999999" shape="circle" :customStyle="reviewingBtnStyle"></uv-button><!-- -->
  109. </view>
  110. <!-- 已审核通过状态 -->
  111. <view class="btn-box" v-else-if="info.state == 1">
  112. <uv-button :text="$t('pages_zlx.zlx_form.approved')" color="#381615" shape="circle" :customStyle="btnCustomStyle"></uv-button><!-- -->
  113. </view>
  114. <!-- 驳回状态或初始状态可以提交 -->
  115. <view class="btn-box" v-else>
  116. <uv-button :text="$t('pages_zlx.zlx_form.save')" color="#381615" shape="circle" :customStyle="btnCustomStyle" @click="confrim"></uv-button><!-- 保存 -->
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. export default{
  122. data() {
  123. return {
  124. isAgree:false,
  125. btnCustomStyle:{
  126. color:'#FF5858'
  127. },
  128. reviewingBtnStyle:{
  129. color:'#999999'
  130. },
  131. info:{
  132. name:'',
  133. phone:'',
  134. cardNo:'',
  135. img:'',
  136. image : '',
  137. },
  138. bgColor : 'transparent',
  139. fileList : [],
  140. }
  141. },
  142. onPageScroll(e) {
  143. if(e.scrollTop > 50) {
  144. this.bgColor = '#49070c'
  145. }else{
  146. this.bgColor = 'transparent'
  147. }
  148. },
  149. computed: {
  150. },
  151. onLoad() {
  152. this.getjoinRecruitInfo()
  153. this.$store.commit('getUserInfo')
  154. },
  155. methods:{
  156. bigImg() {
  157. uni.previewImage({
  158. urls:[this.info.img],
  159. current:0
  160. })
  161. },
  162. openDocument(Path){
  163. if(!Path){
  164. return
  165. }
  166. wx.openDocument({
  167. filePath: Path,
  168. showMenu: true,
  169. success: function (res) {
  170. // console.log('打开成功');
  171. // util.hideLoading()
  172. }
  173. })
  174. },
  175. uploadFile() {
  176. let that = this
  177. uni.chooseMessageFile({
  178. count: 1, //一次可以上传多少个
  179. type: 'file',
  180. extension: ['.doc', '.pdf', '.docx'], //文件类型
  181. success(res) {
  182. console.log(res);
  183. that.$Oss.ossUpload(res.tempFiles[0].path)
  184. .then(url => {
  185. that.info.image = url
  186. })
  187. },
  188. fail: (err) => {
  189. console.log(err, 'err');
  190. }
  191. });
  192. },
  193. upImg() {
  194. uni.chooseImage({
  195. count: 1, // 默认9, 设置图片的选择数量
  196. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  197. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  198. success: (res) => {
  199. // 返回选定照片的本地文件路径列表 tempFilePaths
  200. this.$Oss.ossUpload(res.tempFilePaths[0])
  201. .then(url => {
  202. this.info.img = url
  203. this.$api('updateInfo',this.info, res => {
  204. if (res.code == 200) {
  205. uni.showToast({
  206. title: this.$t('pages_zlx.zlx_form.save_success'), // 保存成功
  207. icon:'none'
  208. })
  209. }
  210. })
  211. })
  212. // 根据需要进行后续处理,例如上传图片等
  213. },
  214. fail: (err) => {
  215. // 处理错误情况
  216. console.log('选择图片失败', err);
  217. }
  218. });
  219. },
  220. getjoinRecruitInfo() {
  221. this.$api('joinRecruitInfo',res=>{
  222. if(res.code == 200 && res.result) {
  223. this.info = res.result
  224. this.fileList = this.info.images ?
  225. this.info.images.split(',').map(url => {
  226. return {
  227. url
  228. }
  229. }) : []
  230. }
  231. })
  232. },
  233. copy() {
  234. uni.setClipboardData({
  235. data:this.userInfo.id,
  236. success: () => {
  237. uni.showToast({
  238. title: this.$t('pages_zlx.zlx_form.copy_success'), // 复制成功
  239. icon:'none'
  240. })
  241. }
  242. })
  243. },
  244. confrim() {
  245. if(!this.isAgree) return this.$Toast(this.$t('pages_zlx.zlx_form.please_agree_agreement')) // 请先阅读并同意《主理人协议》
  246. if(!this.info.name) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_name')) // 请输入姓名
  247. if(!this.info.phone) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_contact')) // 请输入联系方式
  248. if(!this.$utils.verificationPhone(this.info.phone)) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_correct_contact')) // 请输入正确的联系方式
  249. if(!this.info.cardNo) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_id_card')) // 请输入身份证号
  250. if(this.info.cardNo.length != 18) return this.$Toast(this.$t('pages_zlx.zlx_form.please_enter_correct_id_card')) // 请输入正确的身份证号
  251. if(!this.info.img) return this.$Toast(this.$t('pages_zlx.zlx_form.please_upload_wechat_qr_code')) // 请上传微信二维码
  252. let params = {
  253. name:this.info.name,
  254. phone:this.info.phone,
  255. cardNo:this.info.cardNo,
  256. img:this.info.img,
  257. image:this.info.image,
  258. id:this.info.id || '',
  259. images : this.fileList.map((item) => item.url).join(",")
  260. }
  261. // if(!this.info.image) return this.$Toast('请输入姓名')
  262. this.$api('joinRecruit',params,res=>{
  263. if(res.code == 200) {
  264. this.$Toast(this.$t('pages_zlx.zlx_form.submit_success')) // 提交成功
  265. setTimeout(uni.navigateBack, 800, -1)
  266. }
  267. })
  268. },
  269. deleteImage(e){
  270. this.fileList.splice(e.index, 1)
  271. },
  272. afterRead(e){
  273. let self = this
  274. e.file.forEach(file => {
  275. self.$Oss.ossUpload(file.url).then(url => {
  276. self.fileList.push({
  277. url
  278. })
  279. })
  280. })
  281. },
  282. }
  283. }
  284. </script>
  285. <style lang="scss">
  286. page {
  287. background-color: #060504;
  288. }
  289. </style>
  290. <style lang="scss" scoped>
  291. .page{
  292. }
  293. .head-box {
  294. background: url('@/static/image/nav-bg.png') no-repeat;
  295. background-size: 100% 100%;
  296. width: 100%;
  297. height: 534rpx;
  298. position: absolute;
  299. z-index: -1;
  300. }
  301. .content {
  302. margin-top: 40rpx;
  303. padding-bottom: 100rpx;
  304. padding: 0 30rpx;
  305. padding-top: calc(var(--status-bar-height) + 110rpx);
  306. .user-box {
  307. display: flex;
  308. align-items: center;
  309. margin-bottom: 74rpx;
  310. .user-msg {
  311. margin-left: 20rpx;
  312. .user-msg-top {
  313. font-weight: 600;
  314. font-size: 32rpx;
  315. color: #E6E6E6;
  316. display: flex;
  317. align-items: center;
  318. .level-box {
  319. width: 108rpx;
  320. height: 31rpx;
  321. background: RGBA(40, 19, 4, 1);
  322. border-radius: 16rpx;
  323. font-weight: 400;
  324. font-size: 20rpx;
  325. color: #FF9C00;
  326. text-align: center;
  327. margin-left: 14rpx;
  328. }
  329. }
  330. .id-box {
  331. color: #999999;
  332. font-size: 22rpx;
  333. margin-top: 20rpx;
  334. .copy-text {
  335. font-weight: 400;
  336. font-size: 22rpx;
  337. color: #E6E6E6;
  338. margin-left: 18rpx;
  339. }
  340. }
  341. }
  342. }
  343. .title-box {
  344. display: inline-block;
  345. font-weight: bold;
  346. font-size: 29rpx;
  347. color: #FFFFFF;
  348. position: relative;
  349. z-index: 2;
  350. &::after{
  351. content: "";
  352. position: absolute;
  353. bottom: 0;
  354. left: 0;
  355. width: 100%;
  356. height: 9rpx;
  357. background: #FF2828;
  358. border-radius: 4rpx 4rpx 4rpx 4rpx;
  359. opacity: 0.2;
  360. z-index: 1;
  361. }
  362. }
  363. .base-msg {
  364. .form-box {
  365. background: #1B1713;
  366. border-radius: 27rpx;
  367. padding:0 40rpx;
  368. margin-top: 20rpx;
  369. .form-box-line {
  370. min-height: 112rpx;
  371. border-bottom: 1px solid #403D3A;
  372. display: flex;
  373. align-items: center;
  374. &:last-child {
  375. border: none;
  376. }
  377. .label-box {
  378. font-weight: 500;
  379. font-size: 29rpx;
  380. color: #FFFFFF;
  381. margin-right: 34rpx;
  382. }
  383. .value-box {
  384. display: flex;
  385. align-items: center;
  386. justify-content: space-between;
  387. flex:1;
  388. .upload-btn {
  389. font-weight: 400;
  390. font-size: 28rpx;
  391. color: #FF5858;
  392. &.disabled {
  393. color: #999999;
  394. cursor: not-allowed;
  395. }
  396. }
  397. }
  398. .docx-title{
  399. font-size: 20rpx;
  400. color: #999999;
  401. width: 340rpx;
  402. overflow:hidden; //超出的文本隐藏
  403. text-overflow:ellipsis; //溢出用省略号显示
  404. white-space:nowrap; //溢出不换行
  405. }
  406. }
  407. }
  408. }
  409. .xie-box {
  410. margin-top:37rpx;
  411. .xie-box-val {
  412. margin-top: 25rpx;
  413. // height: 116rpx;
  414. background: #1B1713;
  415. border-radius: 27rpx 27rpx 27rpx 27rpx;
  416. display: flex;
  417. align-items: center;
  418. justify-content: space-between;
  419. padding: 36rpx 36rpx;
  420. .val-text {
  421. font-weight: 400;
  422. font-size: 25rpx;
  423. color: #FFFFFF;
  424. display: flex;
  425. align-items: center;
  426. .xieyi-val {
  427. color: #FF5858;
  428. }
  429. }
  430. .choose-box {
  431. .normol-box {
  432. width: 31rpx;
  433. height: 31rpx;
  434. border: 1px solid #fff;
  435. border-radius: 5rpx;
  436. }
  437. image {
  438. width: 31rpx;
  439. height: 31rpx;
  440. }
  441. &.disabled {
  442. opacity: 0.5;
  443. cursor: not-allowed;
  444. }
  445. }
  446. }
  447. }
  448. }
  449. .btn-box {
  450. // position: fixed;
  451. // bottom: 70rpx;
  452. // left: 0;
  453. // right: 0;
  454. padding: 0 40rpx;
  455. margin-top: 20rpx;
  456. height: 200rpx;
  457. }
  458. </style>