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

452 lines
11 KiB

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