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

447 lines
10 KiB

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