|
|
@@ -0,0 +1,320 @@
|
|
|
+<template>
|
|
|
+ <view class="content">
|
|
|
+ <view class="yz-wrap">
|
|
|
+ <view class="top-wrap flex">
|
|
|
+ <view class="top-left">
|
|
|
+ 选择套餐<text>*</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="sr-wrap flex">
|
|
|
+ <view class="sr-tit">
|
|
|
+ 姓名
|
|
|
+ </view>
|
|
|
+ <input type="text" class="sr-inp" placeholder="请输入姓名">
|
|
|
+ </view>
|
|
|
+ <view class="sr-wrap flex">
|
|
|
+ <view class="sr-tit">
|
|
|
+ 手机号
|
|
|
+ </view>
|
|
|
+ <input type="text" class="sr-inp" placeholder="请输入手机号">
|
|
|
+ </view>
|
|
|
+ <view class="sr-wrap flex">
|
|
|
+ <view class="sr-tit">
|
|
|
+ 验证码
|
|
|
+ </view>
|
|
|
+ <input type="text" class="sr-inp" placeholder="请输入验证码">
|
|
|
+ <view class="sr-btn">
|
|
|
+ 点击获取
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="yz-wrap">
|
|
|
+ <view class="top-wrap flex">
|
|
|
+ <view class="top-left">
|
|
|
+ 上传身份证照片<text>*</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="sfz flex">
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
+ <image class="" :src="sfzz||this.urlFile + '/static/img/sfzz.png'" mode="widthFix" @click="navCroper(664,414,'sfzz')"></image>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifndef H5 -->
|
|
|
+ <image class="" :src="sfzz||'/static/img/sfzz.png'" mode="widthFix" @click="navCroper(664,414,'sfzz')"></image>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
+ <image class="" :src="sfzf||this.urlFile + '/static/img/sfzf.png'" mode="widthFix" @click="navCroper(664,414,'sfzf')"></image>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifndef H5 -->
|
|
|
+ <image class="" :src="sfzf||'/static/img/sfzf.png'" mode="widthFix" @click="navCroper(664,414,'sfzf')"></image>
|
|
|
+ <!-- #endif -->
|
|
|
+ <view class="">
|
|
|
+ 个人信息面
|
|
|
+ </view>
|
|
|
+ <view class="">
|
|
|
+ 国徽面
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="yz-wrap">
|
|
|
+ <view class="sr-wrap flex">
|
|
|
+ <view class="sr-tit">
|
|
|
+ 绑定邀请码
|
|
|
+ </view>
|
|
|
+ <input type="text" class="sr-inp" placeholder="请输入绑定邀请码(非必填)">
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btm-btn">
|
|
|
+ 提交认证
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapState
|
|
|
+ } from "vuex"
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ sfzz: '',
|
|
|
+ sfzf: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // #ifdef H5
|
|
|
+ ...mapState(['urlFile']),
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ upLoad(path) {
|
|
|
+ // #ifdef H5
|
|
|
+ console.log(path,'h5');
|
|
|
+ // #endif
|
|
|
+ uni.showLoading({
|
|
|
+ title: '图片上传中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ return new Promise((resolve, error) => {
|
|
|
+ uni.uploadFile({
|
|
|
+ url: this.baseURL + '/api/upload/image', //仅为示例,非真实的接口地址
|
|
|
+ filePath: path,
|
|
|
+ name: 'file',
|
|
|
+ header: {
|
|
|
+ "Authori-zation": 'Bearer ' + uni.getStorageSync('token')
|
|
|
+ },
|
|
|
+ success: (uploadFileRes) => {
|
|
|
+ if ("string" === typeof uploadFileRes.data) {
|
|
|
+ resolve(JSON.parse(uploadFileRes.data).data)
|
|
|
+ } else {
|
|
|
+ resolve(uploadFileRes.data.data)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ complete() {
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ chooseImage: function(index) {
|
|
|
+ const _this = this
|
|
|
+ return new Promise((ok, error) => {
|
|
|
+ // 从相册/相机选择
|
|
|
+ // 如需直接开相机或直接选相册,请只使用一个选项
|
|
|
+ const sourceType = index === 0 ? ['camera'] : ['album']
|
|
|
+ uni.chooseImage({
|
|
|
+ count: 1, //默认9
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
+ sourceType: sourceType,
|
|
|
+ success: function(res) {
|
|
|
+ ok(res.tempFilePaths[0])
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '文件打开错误',
|
|
|
+ content: '请设置授权文件存储权限',
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ error(e)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ onImg(type) {
|
|
|
+ const _this = this
|
|
|
+ return new Promise((ok, erro) => {
|
|
|
+ // 判断是否需要选择
|
|
|
+ if(type==1){
|
|
|
+ uni.showActionSheet({
|
|
|
+ itemList: ['拍照', '选择一张照片'],
|
|
|
+ success: function(res) {
|
|
|
+ _this.chooseImage(res.tapIndex).then((url) => {
|
|
|
+ ok(url)
|
|
|
+ }).catch((res) => {
|
|
|
+ erro(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ erro(res)
|
|
|
+ console.log(res.errMsg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 判断是否只需要拍照
|
|
|
+ if(type==2){
|
|
|
+ _this.chooseImage(0).then((url) => {
|
|
|
+ ok(url)
|
|
|
+ }).catch((res) => {
|
|
|
+ erro(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 图片裁切
|
|
|
+ /**
|
|
|
+ * @param {Number} w 裁切宽度比例
|
|
|
+ * @param {Number} h 裁切高度比例
|
|
|
+ * @param {Number} mw 图片最小宽度
|
|
|
+ * @param {Number} mh 图片最小高度
|
|
|
+ * @param {String} url url修改
|
|
|
+ */
|
|
|
+ navCroper(w, h, type) {
|
|
|
+ let that = this;
|
|
|
+ let tt = (type == 'upimg' ? 2 : 1)
|
|
|
+ this.onImg(tt).then((url) => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/user_home/realName/cropper?width=${w}&height=${h}`,
|
|
|
+ events: {
|
|
|
+ uploadSuccess(res) {
|
|
|
+ that.upLoad(res).then((urldata) => {
|
|
|
+ that[type] = urldata.url;
|
|
|
+ })
|
|
|
+ // console.log(e, '接受数据');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res,'success');
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit('urlNext', {
|
|
|
+ url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ page {
|
|
|
+ padding-top: 1rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .yz-wrap {
|
|
|
+ background-color: #fff;
|
|
|
+ margin: 20rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-wrap {
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 25rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #00001A;
|
|
|
+ height: 85rpx;
|
|
|
+
|
|
|
+ .top-left {
|
|
|
+ text {
|
|
|
+ color: #FF6B2E;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-right {
|
|
|
+ text {
|
|
|
+ font-size: 25rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+
|
|
|
+ image {
|
|
|
+ height: 22rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .sr-wrap {
|
|
|
+ border-top: #fafafa 1rpx solid;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ width: 690rpx;
|
|
|
+ height: 114rpx;
|
|
|
+ line-height: 114rpx;
|
|
|
+ margin: auto;
|
|
|
+
|
|
|
+ .sr-tit {
|
|
|
+ width: 170rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ color: #00001A;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sr-inp {
|
|
|
+ flex-grow: 1;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .sr-btn {
|
|
|
+ color: #52C696;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .sfz {
|
|
|
+ padding: 30rpx;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex-wrap: wrap;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 332rpx;
|
|
|
+ height: 207rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ view {
|
|
|
+ width: 332rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #5C5C5C;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btm-btn {
|
|
|
+ width: 686rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ background: linear-gradient(-38deg, #6CDBC3, #6DD6B8);
|
|
|
+ border-radius: 15rpx;
|
|
|
+ margin: 113rpx auto 0;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #FFFFFF;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 86rpx;
|
|
|
+ }
|
|
|
+</style>
|