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

451 lines
12 KiB

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