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

337 lines
8.0 KiB

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