接口调用

main
123456 2 months ago
parent e80be64426
commit 86d7ec8d70
  1. 40
      api/index.js
  2. 14
      api/request.js
  3. 2
      components/unverified.vue
  4. 18
      manifest.json
  5. 26
      pages.json
  6. 23
      pages/index/city.vue
  7. 49
      pages/index/citySearch.vue
  8. 21
      pages/index/index.vue
  9. 7
      pages/login/avatar.vue
  10. 27
      pages/login/index.vue
  11. 13
      pages/login/mima.vue
  12. 16
      pages/login/password.vue
  13. 18
      pages/login/reg.vue
  14. 80
      pages/user/index.vue
  15. 688
      pages/users/personal/index.vue
  16. 37
      pages/users/renzheng/index.vue
  17. 110
      pages/users/renzheng/phone.vue
  18. 103
      pages/users/renzheng/shiming.vue
  19. 28
      pages/users/renzheng/zhenren.vue
  20. 302
      uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-shiming.vue
  21. 4
      unpackage/dist/dev/app-plus/app-config-service.js
  22. 3694
      unpackage/dist/dev/app-plus/app-service.js
  23. 3967
      unpackage/dist/dev/app-plus/app-view.js
  24. 2
      unpackage/dist/dev/app-plus/manifest.json

@ -1,5 +1,37 @@
import { request } from './request'
const api = {
//手机认证
phoneAuth(data) {
return request({
url: 'api/user/phoneAuth',
method: 'post',
data
})
},
//实名认证
realNameAuth(data) {
return request({
url: 'api/user/realNameAuth',
method: 'post',
data
})
},
//手机认证
phoneAuth(data) {
return request({
url: 'api/user/phoneAuth',
method: 'post',
data
})
},
//查询个人信息
findUserInfo(data) {
return request({
url: 'api/user/findUserInfo',
method: 'post',
data
})
},
//忘记密码/修改密码
forgetPsw(data) {
return request({
@ -24,6 +56,14 @@ const api = {
data
})
},
//注册账号
regByCode(data) {
return request({
url: 'api/regByCode',
method: 'post',
data
})
},
//账号登录
loginForPsw(data) {
return request({

@ -1,25 +1,23 @@
import Vue from 'vue'
let baseUrl = 'https://lyiyuan.cn';
let baseUrl = 'https://api.lyiyuan.cn';
Vue.prototype.$baseUrl = baseUrl;
export function request(prams) {
return new Promise((resolve, reject) => {
let url;
url = baseUrl+"/prod-api/"+prams.url;
console.log(url)
let url = baseUrl+"/prod-api/"+prams.url;
console.log(url,prams)
uni.request({
url: url,
url,
data: prams.data,
method: prams.method,
header: {
"token": uni.getStorageSync("userInfo").token,
"Content-type": "application/json",
"deviceSn": uni.getStorageSync("deviceSn"),
"token": uni.getStorageSync('userInfo').token,
"Content-type": "application/json"
},
success: (res) => {
if (res.data.code == 200){
resolve(res.data);
console.log(prams.data+"返回结果:"+res.data)
}else if(res.data.code == 401){
uni.showModal({
title: "温馨提示",

@ -16,7 +16,7 @@
methods: {
confirm() {
uni.navigateTo({
url: "/pages/users/verifyUser/index"
url: "/pages/users/renzheng/index"
})
}
}

@ -21,7 +21,8 @@
"Geolocation" : {},
"OAuth" : {},
"Camera" : {},
"Maps" : {}
"Maps" : {},
"Payment" : {}
},
/* */
"distribute" : {
@ -64,7 +65,12 @@
"appkey_android" : "d2e40f882c2fde0f3724791cb82cbd9c"
}
},
"oauth" : {},
"oauth" : {
"weixin" : {
"appid" : "wx3024f118e0e78f2f",
"UniversalLinks" : ""
}
},
"ad" : {},
"maps" : {
"amap" : {
@ -72,6 +78,14 @@
"appkey_ios" : "49e860f8b39479b15db1110fb3e62286",
"appkey_android" : "d2e40f882c2fde0f3724791cb82cbd9c"
}
},
"share" : {},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wx3024f118e0e78f2f",
"UniversalLinks" : ""
}
}
},
"splashscreen" : {

@ -1,18 +1,18 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
}
},{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path" : "pages/login/reg",
"style" :
@ -472,12 +472,26 @@
"navigationBarBackgroundColor": "#000000"
}
},
{
"path": "uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-shiming",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
},
{
"path" : "pages/login/mima",
"style" :
{
"navigationBarTitleText" : "密码登录"
}
},
{
"path" : "pages/users/personal/index",
"style" :
{
"navigationStyle": "custom"
}
}
],
"globalStyle": {

@ -24,8 +24,19 @@
};
},
onReady() {
this.jingweiInfo = uni.getStorageSync("jingweiInfo");
this.city = this.jingweiInfo.city
const that = this;
that.jingweiInfo = uni.getStorageSync("jingweiInfo");
that.city = this.jingweiInfo.city;
console.log(uni.getStorageSync("jingweiInfo"))
uni.$on("clickTap", res=>{
that.jingweiInfo.formatted = res.name
that.jingweiInfo.latitude = res.latitude
that.jingweiInfo.longitude = res.longitude
uni.setStorageSync("jingweiInfo",that.jingweiInfo)
});
uni.$on("watchCity", res=>{
that.city = res.name
});
},
methods: {
getLocation() {
@ -60,6 +71,14 @@
uni.navigateTo({
url: "/pages/index/citySearch?city="+this.city
})
// uni.chooseLocation({
// keyword: "",
// latitude: this.jingweiInfo.latitude,
// longitude: this.jingweiInfo.longitude,
// success(res) {
// console.log(res)
// }
// })
}
}
}

@ -6,7 +6,10 @@
<image class="clear" src="@/static/city-close.png"></image>
</view>
<view class="city-bd">
<view class="empty">
<view class="list">
<view class="item" v-for="(a,index) in list" :key="index" @click="clickTap(a)">{{a.name}}</view>
</view>
<view class="empty" v-if="isShow">
<image src="@/static/empty.png"></image>
<view class="txt">暂无数据</view>
</view>
@ -18,20 +21,43 @@
export default {
data() {
return {
isShow: false,
city: "",
keyword: ""
keyword: "",
list: []
};
},
onLoad(o) {
this.city = decodeURIComponent(o.city);
console.log(this.city)
},
methods: {
changeInput() {
console.log(111)
clickTap(a){
uni.$emit("clickTap", a);
this.city = "";
this.keyword= "";
this.list = [];
this.isShow = false;
uni.navigateBack({
delta:1
})
},
changeInput(e) {
const that = this;
that.keyword = e.detail.value
uni.request({
url: 'https://restapi.amap.com/v3/assistant/inputtips?datatype=all&type=050301&city='+this.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+this.keyword,
complete(res) {
console.log(res)
url: 'https://restapi.amap.com/v3/assistant/inputtips?datatype=all&type=分类代码&city='+that.city+'&key=4a6e2ba8eac3864f0d88f9b5abd026e6&keywords='+that.keyword,
success(res) {
console.log(res.data.tips)
if(res.data.tips && res.data.tips.length > 0){
that.list = res.data.tips;
that.isShow = false;
console.log(22233)
}else{
that.list = []
that.isShow = true;
console.log(222)
}
}
})
}
@ -76,6 +102,15 @@
&-bd{
padding: 0 25rpx 25rpx;
overflow: hidden;
.list{
margin-top: 20rpx;
overflow: hidden;
.item{
padding: 15rpx 0;
font-size: 28rpx;
color: #222222;
}
}
.empty{
padding: 150rpx 0;
text-align: center;

@ -71,15 +71,36 @@
},2000)
},
onLoad() {
const that = this;
this.getLocation();
uni.$on("clickTap", res=>{
that.city = res.name
});
},
methods: {
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
uni.setStorageSync("userInfo",data);
if(data.realnameFlag == 0){
this.isPopup = true
}
}else{
uni.showToast({
title: mgs,
position: "bottom",
icon: "none",
})
}
},
getLocation() {
const that = this;
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true,
success(res1) {
console.log(res1)
let latitude = res1.latitude,longitude = res1.longitude;
let url = `https://restapi.amap.com/v3/geocode/regeo?output=json&location=${longitude},${latitude}&key=4a6e2ba8eac3864f0d88f9b5abd026e6&radius=1000`
uni.request({

@ -178,10 +178,11 @@
}
const { code, data, mssg } = await this.$api.registerEditUser({
id: uni.getStorageSync("userInfo").id,
phone: uni.getStorageSync("userInfo").phone,
img: uni.getStorageSync("userInfo").id,
phone: uni.getStorageSync("userInfo").account,
img: uni.getStorageSync("userInfo").img,
birthday: uni.getStorageSync("userInfo").birthday,
id: uni.getStorageSync("userInfo").id,
nickname: uni.getStorageSync("userInfo").nickname,
sex: uni.getStorageSync("userInfo").sex=='男'?1:2,
})
if(code == 200){
uni.showToast({

@ -1,5 +1,5 @@
<template>
<view class="login">
<view class="login" v-if="isShow1">
<view class="login-hd">您好欢迎登录</view>
<view class="login-bd">
<view class="item">
@ -38,11 +38,20 @@
phone: "",
code: "",
password: "",
count: 60
count: 60,
isShow1: true
};
},
onLoad() {
uni.setStorageSync("deviceSn",uni.getSystemInfoSync().deviceId)
if(uni.getStorageSync("userInfo").token){
this.isShow1 = true
uni.switchTab({
url:"/pages/index/index"
})
}else{
this.isShow1 = false
}
},
methods: {
// App
@ -117,6 +126,11 @@
});
if(code == 200){
that.isClick = false;
uni.showToast({
icon: "none",
position: "bottom",
title: "发送成功"
})
timer = setInterval(()=>{
if(that.count == 0){
clearInterval(timer);
@ -126,11 +140,6 @@
that.count --
}
},1000)
uni.showToast({
icon: "none",
position: "bottom",
title: "发送成功"
})
}else{
that.isClick = true;
}
@ -138,10 +147,6 @@
//
async toLogin() {
const that = this;
uni.switchTab({
url: "/pages/index/index"
})
return ;
if(that.isCheck){
uni.showToast({
icon: "none",

@ -6,7 +6,8 @@
<input v-model="phone" placeholder="请输入手机号" type="number" />
</view>
<view class="item">
<input v-model="password" placeholder="请输入密码" type="isShow?'password':'text'" />
<input v-model="password" placeholder="请输入密码" v-if="isShow" type="password" />
<input v-model="password" placeholder="请输入密码" v-else type="text" />
<view class="txt">
<image @click="onToggle()" v-if="isShow" src="@/static/icon-bi.png"></image>
<image @click="onToggle()" v-else src="@/static/icon-bi-on.png"></image>
@ -21,7 +22,7 @@
<view class="login-fd">
<u-divider half-width="280">其他登录</u-divider>
<view class="b">
<image src="@/static/wx.png"></image>
<image src="@/static/wx.png" @click="wxLogin()"></image>
</view>
<view class="c">
<image @click="clickCheck()" v-if="isCheck" src="@/static/icon-select.png"></image><image @click="clickCheck()" v-else src="@/static/icon-select-on.png"></image>我已阅读并同意<text>APP用户协议</text><text>APP隐私条款</text>
@ -59,6 +60,10 @@
})
}
},
clickCheck() {
this.isCheck = !this.isCheck
},
onToggle(){
this.isShow = !this.isShow
},
@ -128,8 +133,8 @@
title: "登录成功"
})
setTimeout(()=>{
uni.navigateBack({
delta: 1
uni.switchTab({
url: "/pages/user/index"
})
},2000)
}else{

@ -13,23 +13,26 @@
</view>
<view class="item">
<view class="txt">新密码</view>
<input v-model="password" placeholder="请输入密码" :type="isShow?'password':'text'" />
<input v-model="password" placeholder="请输入密码" v-if="isShow" type="password" />
<input v-model="password" placeholder="请输入密码" v-else type="text" />
<image @click="onToggle()" v-if="isShow" class="img1" src="@/static/icon-bi.png"></image>
<image @click="onToggle()" v-else class="img1" src="@/static/icon-bi-on.png"></image>
</view>
<view class="item">
<view class="txt">确认密码</view>
<input v-model="apassword" :type="isShow?'password':'text'" placeholder="请再次输入新密码" />
<input v-model="apassword" placeholder="请输入密码" v-if="isShow" type="password" />
<input v-model="apassword" placeholder="请输入密码" v-else type="text" />
</view>
<view class="tips">密码必须为8-16位的数字字符组合(不能为纯数字)</view>
</view>
<view class="login-fd">
<view class="btn">确认重置</view>
<view class="btn" @click="toReg">确认重置</view>
</view>
</view>
</template>
<script>
let timer = null;
export default {
data() {
return {
@ -150,7 +153,7 @@
const {code, data, msg} = await this.$api.forgetPsw({
phone: this.phone,
code: this.code,
passsword: this.passsword
password: this.password
})
if(code == 200){
this.phone = ""
@ -162,7 +165,7 @@
})
setTimeout(()=>{
uni.reLaunch({
url: "/pages/login/index"
url: "/pages/login/mima"
})
},2000)
}else{
@ -179,6 +182,9 @@
clickCheck() {
this.isCheck = !this.isCheck
},
},
destroyed() {
clearInterval(timer)
}
}
</script>

@ -13,13 +13,15 @@
</view>
<view class="item">
<view class="txt">新密码</view>
<input v-model="password" placeholder="请输入密码" :type="isShow?'password':'text'" />
<input v-model="password" placeholder="请输入密码" v-if="isShow" type="password" />
<input v-model="password" placeholder="请输入密码" v-else type="text" />
<image @click="onToggle()" v-if="isShow" class="img1" src="@/static/icon-bi.png"></image>
<image @click="onToggle()" v-else class="img1" src="@/static/icon-bi-on.png"></image>
</view>
<view class="item">
<view class="txt">确认密码</view>
<input v-model="apassword" :type="isShow?'password':'text'" placeholder="请再次输入新密码" />
<input v-model="apassword" placeholder="请输入密码" v-if="isShow" type="password" />
<input v-model="apassword" placeholder="请输入密码" v-else type="text" />
</view>
<view class="tips">密码必须为8-16位的数字字符组合(不能为纯数字)</view>
<view class="item">
@ -35,6 +37,7 @@
</template>
<script>
let timer = null
export default {
data() {
return {
@ -153,9 +156,11 @@
})
return
}
const {code, data, msg} = await this.$api.toLogin({
phone: this.phone,
code: this.code
const {code, data, msg} = await that.$api.regByCode({
phone: that.phone,
code: that.code,
passsword: that.password,
invitationCode: that.invitationCode
})
if(code == 200){
this.phone = ""
@ -185,6 +190,9 @@
clickCheck() {
this.isCheck = !this.isCheck
},
},
destroyed() {
clearInterval(timer)
}
}
</script>

@ -3,7 +3,7 @@
<view class="user-navbar">
<u-navbar :is-back="false" title="我的" :background="background">
<view slot="right">
<view class="search">
<view class="search" @click="openPage(1)">
<image src="@/static/icon-edit.png"></image>
</view>
</view>
@ -11,26 +11,27 @@
</view>
<view class="user-info">
<view class="a">
<view class="pic">
<image src="@/static/nan.png"></image>
<view class="pic" @click="openPage(2)">
<image :src="baseUrl+userInfo.img"></image>
</view>
<view class="info">
<view class="name">幽默的先生
<view class="vip">vip1</view>
<view class="status"><text></text>接单中</view>
<view class="info" @click="openPage(2)">
<view class="name">{{userInfo.nickname}}
<view class="vip" v-if="userInfo.memberflag>=1">vip{{userInfo.memberflag}}</view>
<view class="status" v-if="userInfo.acceptStatus == 1"><text></text>接单中</view>
</view>
<view class="id">ID:1008692068</view>
<view class="id">ID:{{userInfo.id}}</view>
</view>
<view class="sign">签到</view>
<view class="sign" @click="openPage(3)" v-if="userInfo.isSign == 0">签到</view>
<view class="sign" v-if="userInfo.isSign == 1">已签到</view>
</view>
<view class="b">
<view class="li">28<text>好友</text></view>
<view class="li">28<text>关注</text></view>
<view class="li">28<text>粉丝</text></view>
<view class="li">28<text>访客</text></view>
<view class="li">{{userInfo.friendNum}}<text>好友</text></view>
<view class="li">{{userInfo.careNum}}<text>关注</text></view>
<view class="li">{{userInfo.fansNum}}<text>粉丝</text></view>
<view class="li">{{userInfo.visitorNum}}<text>访客</text></view>
</view>
<view class="c">
<view class="dt">VIP会员中心<text>2024-09-09到期</text></view>
<view class="dt">VIP会员中心<text v-if="userInfo.memberflag>=1">{{userInfo.memberEndTime}}到期</text></view>
<view class="dd">
<view class="item">
<image src="@/static/hongbao.png"></image>
@ -77,7 +78,7 @@
</view>
</view>
</view>
<view class="user-menu1">
<view class="user-menu1" v-if="userInfo.role == 2">
<view class="title">
陪玩师订单
<view class="more">
@ -109,7 +110,7 @@
<image src="@/static/icon-user-01.png"></image>美颜设置
</view>
<view class="item">
<image src="@/static/icon-user-02.png"></image>认证中心<view class="status">已认证</view>
<image src="@/static/icon-user-02.png"></image>认证中心<view v-if="userInfo.realnameFlag == 1" class="status">已认证</view>
</view>
<view class="item">
<image src="@/static/icon-user-03.png"></image>陪玩设置
@ -150,12 +151,12 @@
<view class="invite" v-if="show">
<view class="body">
<view class="content">
<image class="avatar" src="/static/pic.jpg"></image>
<view class="name">用户1SDTUT789876</view>
<image class="avatar" :src="userInfo.img"></image>
<view class="name">{{userInfo.id}}</view>
<image class="txt" src="@/static/txt.png"></image>
<image class="code" src="@/static/code.png"></image>
<view class="txt1">-长按识别图中二维码-</view>
<view class="id">邀请码WQ31230</view>
<view class="id">邀请码{{userInfo.invitationCode}}</view>
<image class="zw" src="@/static/zw.png"></image>
</view>
<view class="btns">
@ -164,6 +165,8 @@
</view>
</view>
</view>
<unverified :isPopup="isPopup" />
<insufficient :isCoins="isCoins" />
</view>
</template>
@ -171,17 +174,48 @@
export default {
data() {
return {
isCoins: false,
isPopup: false,
show: false,
background: {
"background-color": "rgba(0, 0, 0, 0)"
}
},
userInfo: {},
baseUrl: ""
}
},
onLoad() {
onShow() {
this.baseUrl = this.$baseUrl;
this.getUserInfo();
},
methods: {
openPage(index){
if(index == 1){
uni.navigateTo({
url: "/pages/users/edit/index"
})
}else if(index == 2){
uni.navigateTo({
url: "/pages/users/personal/index"
})
}
},
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
uni.setStorageSync("userInfo",data);
if(data.realnameFlag == 0){
this.isPopup = true
}
}else{
uni.showToast({
title: mgs,
position: "bottom",
icon: "none",
})
}
},
}
}
</script>

@ -0,0 +1,688 @@
<template>
<view class="user" :style="{'padding-bottom': current == 2?'0rpx':'130rpx'}">
<view class="user-navbar">
<u-navbar :title="title" back-icon-color="#333333" :immersive="true" :background="background"></u-navbar>
</view>
<view class="user-pic">
<image mode="widthFix" src="@/static/pic.jpg"></image>
</view>
<view class="user-hd">
<view class="a">
<view class="title">李大花</view>
<view class="vip">VIP1</view>
<image class="sex" v-if="true" src="@/static/peiwan-nv.png"></image>
<image class="sex" v-else src="@/static/peiwan-nan.png"></image>
<view class="city"><image class="location" src="@/static/dingwei2.png"></image>江苏 · 南京</view>
</view>
<view class="b">
<view class="tag">26</view>
<view class="tag">172cm</view>
<view class="tag">65kg</view>
<view class="tag">互联网测试</view>
</view>
<view class="c">
#交友宣言世间无敌舍我其谁霸气长存风云变色
</view>
<view class="d" :class="isPlay?'d-on':''" @click="toToggle()">
288
</view>
</view>
<view class="user-tab">
<view class="tab">
<u-tabs :list="list" bg-color="transparent" :is-scroll="false" active-color="#222222" inactive-color="#666666" font-size="30" :active-item-style="activeStyle" bar-height="10" bar-width="60" v-model="current" @change="changeTabs"></u-tabs>
</view>
</view>
<view class="user-bd" v-if="current == 0">
<view class="xiangce">
<view class="title">相册
<view class="more" @click="openPage(7)">10张<image src="@/static/icon-arrow.png"></image></view>
</view>
<view class="list">
<image v-for="i in 4" :key="i" src="@/static/pic.jpg"></image>
</view>
</view>
<view class="xiangce">
<view class="title">认证状态
</view>
<view class="list">
<view class="tag">手机号认证</view>
<view class="tag">实名认证</view>
<view class="tag">真人认证</view>
</view>
</view>
<view class="xiangce">
<view class="title">情感喜好
</view>
<view class="qinggan">
<view class="dd">情感状态<text>单身</text></view>
<view class="dd">喜欢什么样的异性
<view class="b">
<view class="tag">颜值高</view>
<view class="tag">腿长</view>
<view class="tag">社牛</view>
<view class="tag">单纯</view>
<view class="tag">热情</view>
</view>
</view>
</view>
</view>
<view class="xiangce">
<view class="title">个人信息
</view>
<view class="qinggan">
<view class="li">年收入<text>6-8w</text></view>
<view class="li">家乡<text>江苏·南京</text></view>
<view class="li">学历<text>本科</text></view>
<view class="li">星座<text>处女座</text></view>
</view>
</view>
</view>
<view class="user-bd" v-if="current==1">
<view class="yuewan">
<view class="title">约玩项目
<view class="location">
<image src="@/static/dingwei.png"></image>距离1000.00km
</view>
</view>
<view class="list">
<view class="item" :class="clickIndex == idx?'item-active':(idx <= 3?'item-on':'')" v-for="idx in 9" :key="idx">
<view class="name">K歌</view>
<view class="price">158.00</view>
</view>
</view>
</view>
</view>
<view class="user-bd" v-if="current==2">
<view class="dongtai">
<view class="item" v-for="i in 10" :key="i" @click="openPage(5,1)">
<view class="a">
<view class="fl">
<image src="@/static/nv.png"></image>
<view class="info">
<view class="name">幽默的先生</view>
<view class="desc">2024-06-06 11:23</view>
</view>
</view>
<view class="fr">
<image src="@/static/shenglue.png"></image>
</view>
</view>
<view class="b">今天天气真好啊碧蓝的天空绿油油的油菜花空中飘香远远的山脉看着忽远忽近</view>
<view class="c">
<image mode="aspectFill" src="@/static/1.png"></image>
<image mode="aspectFill" src="@/static/2.png"></image>
<image mode="aspectFill" src="@/static/3.png"></image>
</view>
<view class="d">
<view class="fl">
<view class="li">
<image src="@/static/xiaoxi.png"></image>69
</view>
<view class="li">
<image src="@/static/dianzan.png"></image>896
</view>
<view class="li" @click.stop="openPage(2)">
<image src="@/static/fenxiang.png"></image>分享
</view>
</view>
<view class="fr" @click.stop="openPage(3)">搭讪</view>
</view>
</view>
</view>
</view>
<view class="user-fd">
<view class="item" @click="openPage(1)">编辑资料</view>
</view>
<dashan :isDashan="isDashan" />
<share :isShare="isShare" />
</view>
</template>
<script>
const systemInfoSync=uni.getSystemInfoSync();
export default {
data() {
return {
userInfo: {},
clickIndex: 1,
isShare: false,
isCollect: false,
isDashan: false,
isPlay: false,
title: "",
isScroll: false,
background: {
//
background: 'transparent',
},
current: 0,
statusBarHeight: 0,
list:[{'name': '资料'},{'name': '陪玩'},{'name': '动态'}],
activeStyle: {'fontSize': '35rpx'}
};
},
onPageScroll(e) {
if(e.scrollTop<=10){
this.background = {
//
background: 'transparent',
}
this.title =""
}else{
const t = e.scrollTop>=44?1:(e.scrollTop/44).toFixed(2)
this.title="李大花个人资料"
this.background = {
//
background: 'rgba(255,255,255,'+t+')',
}
}
},
onLoad() {
this.statusBarHeight = systemInfoSync.statusBarHeight;
this.getUserInfo();
},
methods: {
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
}else{
uni.showToast({
title: mgs,
position: "bottom",
icon: "none",
})
}
},
openPage(index,id){
if(index == 1){
this.isCollect = !this.isCollect
}else if(index == 2){
this.isShare = !this.isShare
}else if(index == 3){
this.isDashan = !this.isDashan
}else if(index == 4){
uni.navigateTo({
url: "/pages/peiwan/confirm?id="+id
})
}else if(index == 5){
uni.navigateTo({
url: "/pages/dongtai/detail?id="+id
})
}else if(index == 7){
uni.navigateTo({
url: "/pages/peiwan/xiangce?id="+id
})
}
},
changeTabs(index){
this.current = index
},
toToggle () {
this.isPlay = !this.isPlay
},
}
}
</script>
<style scoped lang="scss">
.user{
overflow: hidden;
&-pic{
width: 100%;
image{
width: 100%;
}
}
&-fd{
width: 100%;
height: 110rpx;
background: #FFFFFF;
position: fixed;
left: 0;
bottom: 0;
z-index: 21;
padding: 20rpx 25rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
.item{
flex: 1;
display: flex;
line-height: 70rpx;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 28rpx;
background: #FCFCFC;
border-radius: 70rpx;
border: 1px solid #000000;
color: #000000;
image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
&-on{
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
color: #FFFFFF;
}
}
.items{
width: 462rpx;
display: flex;
line-height: 70rpx;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 28rpx;
border-radius: 70rpx;
border: 1px solid #000000;
background: linear-gradient(0deg, #000000, #3D3B38);
box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
color: #FFFFFF;
image{
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
}
}
&-bd{
padding: 0 25rpx;
overflow: hidden;
.xiangce{
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-top: 20rpx;
.title{
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 30rpx;
color: #222222;
.more{
font-size: 24rpx;
display: flex;
align-items: center;
image{
width: 30rpx;
height: 30rpx;
}
}
}
.list{
width: 100%;
display: flex;
align-items: center;
image{
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
margin-left: 20rpx;
margin-top: 20rpx;
&:first-child{
margin-left: 0;
}
}
.tag{
padding: 0 30rpx;
line-height: 50rpx;
height: 50rpx;
background: #000000;
border-radius: 50rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
margin-left: 20rpx;
margin-top: 20rpx;
&:first-child{
margin-left: 0;
}
}
}
.qinggan{
background: #F7F7F7;
border-radius: 20rpx;
padding: 0 30rpx 30rpx;
font-weight: 500;
font-size: 28rpx;
color: #999999;
margin-top: 20rpx;
overflow: hidden;
text{
color: #222222;
}
.dd{
margin-top: 30rpx;
}
.li{
width: 50%;
float: left;
margin-top: 30rpx;
}
.b{
display: flex;
align-items: center;
.tag{
padding: 0 20rpx;
height: 50rpx;
font-weight: 500;
border-radius: 50rpx;
font-size: 24rpx;
line-height: 50rpx;
color: #FFFFFF;
margin-top: 20rpx;
margin-left: 20rpx;
&:first-child{
margin-left: 0;
}
&:nth-child(1){
background: linear-gradient(0deg, #A348DA, #F090F2);
}
&:nth-child(2){
background: linear-gradient(0deg, #017CF9, #10D9F2);
}
&:nth-child(3){
background: linear-gradient(0deg, #7C58DB, #9AA4FF);
}
&:nth-child(4){
background: linear-gradient(0deg, #EC1C71, #FF8CAC);
}
&:nth-child(5){
background: linear-gradient(0deg, #FA7B0B, #F7D345);
}
}
}
}
}
.yuewan{
overflow: hidden;
margin-top: 20rpx;
.list{
width: 110%;
overflow: hidden;
margin-top: 20rpx;
.item{
width: 240rpx;
height: 140rpx;
background: url(@/static/icon-xianxia.png) center top no-repeat;
background-size: contain;
float: left;
text-align: left;
padding: 30rpx;
box-sizing: border-box;
border: 1px solid #F3F4F5;
&-on{
background: url(@/static/icon-xianshang.png) center top no-repeat;
background-size: contain;
}
&-active{
border: 1px solid #000;
}
.name{
font-weight: 500;
font-size: 30rpx;
color: #222222;
white-space: nowrap;
overflow: hidden;
}
.price{
font-weight: 500;
font-size: 24rpx;
color: #E70C0C;
margin-top: 10rpx;
}
}
}
.title{
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 30rpx;
color: #222222;
.location{
display: flex;
align-items: center;
font-size: 24rpx;
color: #666666;
image{
width: 22rpx;
height: 22rpx;
margin-right: 10rpx;
}
}
}
}
.dongtai{
padding-bottom: 20rpx;
overflow: hidden;
.item{
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
margin-top: 20rpx;
.d{
font-weight: 400;
font-size: 24rpx;
color: #333333;
line-height: 42rpx;
margin-top: 20rpx;
text-align: left;
display: flex;
align-items: center;
justify-content: space-between;
.fl{
flex: 1;
display: flex;
align-items: center;
.li{
display: flex;
align-items: center;
width: 120rpx;
image{
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
}
}
.fr{
width: 90rpx;
line-height: 44rpx;
background: #000000;
border-radius: 44rpx;
text-align: center;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
}
.c{
width: 110%;
margin-top: 20rpx;
overflow: hidden;
image{
width: 210rpx;
height: 210rpx;
border-radius: 10rpx;
margin-right: 10rpx;
}
}
.b{
font-weight: 400;
font-size: 28rpx;
color: #222222;
line-height: 42rpx;
margin-top: 20rpx;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 定义文本的行数 */
overflow: hidden;
text-overflow: ellipsis;
}
.a{
display: flex;
align-items: center;
justify-content: space-between;
.fl{
flex: 1;
display: flex;
align-items: center;
margin-right: 20rpx;
image{
width: 80rpx;
height: 80rpx;
background: #E6E9ED;
border-radius: 50%;
margin-right: 20rpx;
}
.info{
flex: 1;
}
.name{
font-weight: 400;
font-size: 30rpx;
color: #222222;
}
.desc{
font-weight: 400;
font-size: 22rpx;
color: #B6BCC2;
margin-top: 10rpx;
}
}
.fr{
width: 32rpx;
image{
width: 32rpx;
height: 32rpx;
}
}
}
}
}
}
&-tab{
display: flex;
margin-top: 10rpx;
overflow: hidden;
.tab{
width: 400rpx;
}
}
&-hd{
width: 100%;
background: #FFFFFF;
border-radius: 0px 0px 20rpx 20rpx;
padding: 25rpx;
box-sizing: border-box;
position: relative;
.d{
width: 165rpx;
height: 95rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
background: url(@/static/icon-bofang.png) center top no-repeat;
background-size: contain;
line-height: 88rpx;
text-indent: 90rpx;
position: absolute;
right: 0;
top: 5rpx;
z-index: 2;
&-on{
background: url(@/static/icon-zanting.png) center top no-repeat;
background-size: contain;
}
}
.b{
display: flex;
align-items: center;
margin-top: 20rpx;
.tag{
padding: 0 20rpx;
font-weight: 500;
font-size: 22rpx;
color: #666666;
line-height: 40rpx;
border-radius: 40rpx;
background: #F2F2F2;
display: flex;
align-items: center;
margin-right: 20rpx;
display: flex;
align-items: center;
}
}
.c{
font-weight: 500;
font-size: 24rpx;
color: #222222;
text-align: left;
margin-top: 30rpx;
}
.a{
width: 100%;
display: flex;
align-items: center;
.name{
font-weight: 500;
font-size: 36rpx;
color: #222222;
}
.vip{
width: 60rpx;
line-height: 32rpx;
background: url(@/static/vip-bg.png) center top no-repeat;
background-size: contain;
text-align: center;
font-weight: 500;
font-size: 20rpx;
color: #FFFFFF;
overflow: hidden;
margin-left: 20rpx;
}
.sex{
margin-left: 20rpx;
width: 30rpx;
height: 30rpx;
image{
width: 30rpx;
height: 30rpx;
}
}
.city{
padding: 0 20rpx;
font-weight: 500;
font-size: 22rpx;
color: #666666;
line-height: 40rpx;
border-radius: 40rpx;
background: #F2F2F2;
display: flex;
align-items: center;
margin-left: 20rpx;
display: flex;
align-items: center;
image{
width: 22rpx;
height: 22rpx;
margin-right: 10rpx;
}
}
}
}
}
</style>

@ -2,9 +2,9 @@
<view class="renzheng">
<view class="titlle">小贴士</view>
<view class="tips">平台提倡真实交友完成认证用户才能享受到平台各项权益</view>
<view class="item" @click="openPage(1)">手机认证<view class="btn">已认证</view></view>
<view class="item" @click="openPage(2)">实名认证<view class="btn">已认证</view></view>
<view class="item" @click="openPage(3)">真人认证<view class="btn btn-on">认证失败</view></view>
<view class="item" @click="openPage(1)">手机认证<view class="btn" :class="userInfo.phoneFlag == 1?'btn-on':''">{{userInfo.phoneFlag == 1?'已认证':'未认证'}}</view></view>
<view class="item" @click="openPage(2)">实名认证<view class="btn" :class="userInfo.realnameFlag == 1?'btn-on':''">{{userInfo.realnameFlag == 1?'已认证':'未认证'}}</view></view>
<!-- <view class="item" v-if="userInfo.realnameFlag==1" @click="openPage(3)">真人认证<view class="btn" :class="userInfo.faceFlag == 1?'btn-on':''">{{userInfo.faceFlag == 1?'已认证':'未认证'}}</view></view> -->
</view>
</template>
@ -12,21 +12,48 @@
export default {
data() {
return {
userInfo: {},
};
},
onShow() {
this.baseUrl = this.$baseUrl;
this.getUserInfo();
},
methods: {
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
}else{
uni.showToast({
title: mgs,
position: "bottom",
icon: "none",
})
}
},
openPage(index){
if(index == 1){
if(this.userInfo.phoneFlag == 1){
return ;
}
uni.navigateTo({
url: "/pages/users/renzheng/phone"
})
}else if(index == 2){
if(this.userInfo.realnameFlag == 1){
return ;
}
uni.navigateTo({
url: "/pages/users/renzheng/shiming"
})
}else if(index == 3){
if(this.userInfo.faceFlag == 1){
return ;
}
uni.navigateTo({
url: "/pages/users/renzheng/zhenren"
})
}
}
}

@ -5,29 +5,126 @@
<view class="phone-bd">
<view class="item">
<view class="txt">手机号</view>
<input placeholder="请输入手机号" type="number" />
<input v-model="phone" placeholder="请输入手机号" type="number" />
</view>
<view class="item">
<view class="txt">验证码</view>
<input placeholder="请输入短信验证码" type="number" />
<view class="code">获取验证码</view>
<input v-model="code" placeholder="请输入短信验证码" type="number" />
<view class="code" @click="sendCode()">{{count == 60?'获取验证码': count+'s'}}</view>
</view>
</view>
<view class="phone-fd">
<view class="btn">确定</view>
<view class="btn" @click="toReg()">确定</view>
</view>
</view>
</template>
<script>
let timer = null;
export default {
data() {
return {
phone: "",
code: "",
count: 60,
isClikc: true
};
},
methods: {
//
async sendCode() {
const that = this;
if(!that.phone){
uni.showToast({
icon: "none",
position: "bottom",
title: "手机号不能为空!",
})
return
}
if(!/^1[3456789]\d{9}$/.test(that.phone)){
uni.showToast({
title: '手机号格式不能为空!',
position: "bottom",
icon: "none",
})
return ;
}
if(that.isClick == false){
return ;
}
const { code, data, msg } = await that.$api.sendSmsCode({
phone: that.phone
});
if(code == 200){
that.isClick = false;
timer = setInterval(()=>{
if(that.count == 0){
clearInterval(timer);
that.count = 60;
that.isClick = true;
}else{
that.count --
}
},1000)
uni.showToast({
icon: "none",
position: "bottom",
title: "发送成功"
})
}else{
that.isClick = true;
}
},
//
async toReg() {
const that = this;
if(!that.phone){
uni.showToast({
icon: "none",
position: "bottom",
title: "手机号不能为空!",
})
return
}
if(!/^1[3456789]\d{9}$/.test(that.phone)){
uni.showToast({
title: '手机号格式不能为空!',
position: "bottom",
icon: "none",
})
return ;
}
if(!that.code){
uni.showToast({
icon: "none",
position: "bottom",
title: "验证码不能为空!",
})
return
}
const {code, data, msg} = await this.$api.phoneAuth({
userId: uni.getStorageSync("userInfo").id,
code: this.code,
phone: this.phone
})
if(code == 200){
uni.showToast({
title: "提交成功"
})
setTimeout(()=>{
uni.navigateBack({
delta: 1
})
},2000)
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: msg
})
}
}
}
}
</script>
@ -86,6 +183,7 @@
font-weight: 400;
font-size: 30rpx;
color: #333;
margin-left: 30rpx;
}
.code{
width: 170rpx;

@ -4,15 +4,15 @@
<view class="phone-bd">
<view class="item">
<view class="txt">姓名</view>
<input placeholder="请输入本人姓名" type="text" />
<input v-model="realName" placeholder="请输入本人姓名" type="text" />
</view>
<view class="item">
<view class="txt">证件号</view>
<input placeholder="请输入18位居民身份证号码" type="text" />
<input v-model="idCard" maxlength="18" placeholder="请输入18位居民身份证号码" type="text" />
</view>
</view>
<view class="phone-fd">
<view class="btn">确定</view>
<view class="btn" @click="toNext">确定</view>
</view>
</view>
</template>
@ -21,11 +21,103 @@
export default {
data() {
return {
realName: "",
idCard: "",
};
},
mounted() {
//
uni.$on('uAvatarCropper', path => {
const that = this;
//
uni.uploadFile({
url: that.$baseUrl+'/prod-api/common/upload',
filePath: path,
name: 'file',
complete: (res) => {
if(res.statusCode == 200){
const {code, fileName, url, msg} = JSON.parse(res.data);
if(code == 200){
uni.showToast({
title: "上传成功"
})
that.toReg(url)
}else{
uni.showToast({
icon: "error",
title: "上传失败"
})
}
}else{
uni.showToast({
icon: "error",
title: "上传失败"
})
}
}
});
})
},
methods: {
toNext() {
const that = this;
if(!that.realName){
uni.showToast({
icon: "none",
position: "bottom",
title: "姓名不能为空!",
})
return
}
if(!that.idCard){
uni.showToast({
icon: "none",
position: "bottom",
title: "身份证号码不能为空!",
})
return
}
that.$u.route({
// ""
url: '/uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-shiming',
//
params: {
// px
destWidth: 700,
// px
rectWidth: 300,
// 'png'"jpg"
fileType: 'jpg',
}
})
},
//
async toReg(avatar) {
const {code, data, msg} = await this.$api.realNameAuth({
userId: uni.getStorageSync("userInfo").id,
realName: this.realName,
idCard: this.idCard,
avatar
})
if(code == 200){
uni.showToast({
title: "提交成功"
})
setTimeout(()=>{
uni.navigateBack({
delta: 1
})
},2000)
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: msg
})
}
}
}
}
</script>
@ -84,6 +176,7 @@
font-weight: 400;
font-size: 30rpx;
color: #333;
margin-left: 30rpx;
}
.code{
width: 170rpx;

@ -2,17 +2,17 @@
<view class="phone">
<view class="phone-bd">
<view class="item">
<!-- <image src="/static/renzheng-shibai.png"></image> -->
<image src="/static/renzheng-zhong.png"></image>
<image v-if="userInfo.faceFlag == 1" src="/static/renzheng-shibai.png"></image>
<image v-else src="/static/renzheng-zhong.png"></image>
</view>
</view>
<!-- <view class="title">真人认证失败</view> -->
<!-- <view class="title">请拍照</view> -->
<view class="title" v-if="userInfo.faceFlag == 0">请拍照</view>
<!-- <view class="title">头像认证中请稍后</view> -->
<view class="tips"><text>提示真人认证我们会比对实名认证的活体采集与头像\n信息是否匹配若匹配认证通过\n若不匹配认证失败</text></view>
<view class="phone-fd">
<view class="btn">确定</view>
<!-- <view class="btn">重新上传头像</view> -->
<view class="btn" v-if="userInfo.faceFlag == 0">重新上传头像</view>
<!-- <view class="btn" v-if="userInfo.faceFlag == 1">确定</view> -->
</view>
</view>
</template>
@ -21,11 +21,25 @@
export default {
data() {
return {
userInfo: {},
};
},
onReady() {
this.getUserInfo();
},
methods: {
async getUserInfo() {
const { code, data , msg } = await this.$api.findUserInfo({userId: uni.getStorageSync("userInfo").id});
if(code == 200){
this.userInfo = data;
}else{
uni.showToast({
title: mgs,
position: "bottom",
icon: "none",
})
}
},
}
}
</script>

@ -0,0 +1,302 @@
<template>
<view class="content">
<view class="cropper-wrapper" :style="{ height: cropperOpt.height + 'px' }">
<canvas
class="cropper"
:disable-scroll="true"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
:style="{ width: cropperOpt.width, height: cropperOpt.height, backgroundColor: 'rgba(0, 0, 0, 0.8)' }"
canvas-id="cropper"
id="cropper"
></canvas>
<canvas
class="cropper"
:disable-scroll="true"
:style="{
position: 'fixed',
top: `-${cropperOpt.width * cropperOpt.pixelRatio}px`,
left: `-${cropperOpt.height * cropperOpt.pixelRatio}px`,
width: `${cropperOpt.width * cropperOpt.pixelRatio}px`,
height: `${cropperOpt.height * cropperOpt.pixelRatio}`
}"
canvas-id="targetId"
id="targetId"
></canvas>
</view>
<view class="cropper-buttons safe-area-padding" :style="{ height: bottomNavHeight + 'px' }">
<!-- #ifdef H5 -->
<view class="upload" @tap="uploadTap">选择图片</view>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="upload" @tap="uploadTap">重新选择</view>
<!-- #endif -->
<view class="getCropperImage" @tap="getCropperImage(false)">确定</view>
</view>
</view>
</template>
<script>
import WeCropper from './weCropper.js';
export default {
props: {
// lineWidth-(rpx)color:
// mask-rgba"rgba(0, 0, 0, 0.35)"
boundStyle: {
type: Object,
default() {
return {
lineWidth: 4,
borderColor: 'rgb(245, 245, 245)',
mask: 'rgba(0, 0, 0, 0.35)'
};
}
}
// // rpx
// rectWidth: {
// type: [String, Number],
// default: 400
// },
// // rpx
// rectHeight: {
// type: [String, Number],
// default: 400
// },
// // rpx
// destWidth: {
// type: [String, Number],
// default: 400
// },
// // rpx
// destHeight: {
// type: [String, Number],
// default: 400
// },
// // "png""jpg"
// fileType: {
// type: String,
// default: 'jpg',
// },
// //
// // H5使
// quality: {
// type: [Number, String],
// default: 1
// }
},
data() {
return {
//
bottomNavHeight: 50,
originWidth: 200,
width: 0,
height: 0,
cropperOpt: {
id: 'cropper',
targetId: 'targetCropper',
pixelRatio: 1,
width: 0,
height: 0,
scale: 2.5,
zoom: 8,
cut: {
x: (this.width - this.originWidth) / 2,
y: (this.height - this.originWidth) / 2,
width: this.originWidth,
height: this.originWidth
},
boundStyle: {
lineWidth: uni.upx2px(this.boundStyle.lineWidth),
mask: this.boundStyle.mask,
color: this.boundStyle.borderColor
}
},
//
// px
destWidth: 200,
// px
rectWidth: 200,
// 'png'"jpg"
fileType: 'jpg',
src: '', //
};
},
onLoad(option) {
let rectInfo = uni.getSystemInfoSync();
if (rectInfo.safeAreaInsets && rectInfo.safeAreaInsets.bottom) {
this.bottomNavHeight += rectInfo.safeAreaInsets.bottom;
}
this.width = rectInfo.windowWidth;
this.height = rectInfo.windowHeight - this.bottomNavHeight;
this.cropperOpt.width = this.width;
this.cropperOpt.height = this.height;
this.cropperOpt.pixelRatio = rectInfo.pixelRatio;
if (option.destWidth) this.destWidth = option.destWidth;
if (option.rectWidth) {
let rectWidth = Number(option.rectWidth);
this.cropperOpt.cut = {
x: (this.width - rectWidth) / 2,
y: (this.height - rectWidth) / 2,
width: rectWidth,
height: rectWidth
};
}
this.rectWidth = option.rectWidth;
if (option.fileType) this.fileType = option.fileType;
//
this.cropper = new WeCropper(this.cropperOpt)
.on('ready', ctx => {
// wecropper is ready for work!
})
.on('beforeImageLoad', ctx => {
// before picture loaded, i can do something
})
.on('imageLoad', ctx => {
// picture loaded
})
.on('beforeDraw', (ctx, instance) => {
// before canvas draw,i can do something
});
// page.json
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#000000'
});
uni.chooseImage({
count: 1, // 9
sizeType: ['original '], //
sourceType: ['camera'], //
success: res => {
this.src = res.tempFilePaths[0];
// datasrc
this.cropper.pushOrign(this.src);
},
fail: (err) => {
console.error('chooseImageErr: ', err);
}
});
},
methods: {
touchStart(e) {
this.cropper.touchStart(e);
},
touchMove(e) {
this.cropper.touchMove(e);
},
touchEnd(e) {
this.cropper.touchEnd(e);
},
getCropperImage(isPre = false) {
if(!this.src) return this.$u.toast('请先选择图片再裁剪');
let cropper_opt = {
destHeight: Number(this.destWidth), // uni.canvasToTempFilePath
destWidth: Number(this.destWidth),
fileType: this.fileType
};
this.cropper.getCropperImage(cropper_opt, (path, err) => {
if (err) {
uni.showModal({
title: '温馨提示',
content: err.message
});
} else {
if (isPre) {
uni.previewImage({
current: '', // http
urls: [path] // http
});
} else {
uni.$emit('uAvatarCropper', path);
this.$u.route({
type: 'back'
});
}
}
});
},
uploadTap() {
const self = this;
uni.chooseImage({
count: 1, // 9
sizeType: ['original'], //
sourceType: ['camera'], //
success: (res) => {
self.src = res.tempFilePaths[0];
// datasrc
self.cropper.pushOrign(this.src);
}
});
}
}
};
</script>
<style scoped lang="scss">
@import '../../libs/css/style.components.scss';
.content {
background: rgba(255, 255, 255, 1);
}
.cropper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 11;
}
.cropper-buttons {
background-color: #000000;
color: #eee;
}
.safe-area-padding {
padding-bottom: 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.cropper-wrapper {
position: relative;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
background-color: #000;
}
.cropper-buttons {
width: 100vw;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
font-size: 28rpx;
}
.cropper-buttons .upload,
.cropper-buttons .getCropperImage {
width: 50%;
text-align: center;
}
.cropper-buttons .upload {
text-align: left;
padding-left: 50rpx;
}
.cropper-buttons .getCropperImage {
text-align: right;
padding-right: 50rpx;
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C06BEE","name":"chunwan","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"OAuth":{},"Camera":{},"Maps":{"coordType":"gcj02"},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#FFFFFF"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"splashscreen":{"useOriginalMsgbox":true},"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"schemes":"com.chunwan","minSdkVersion":21,"targetSdkVersion":30,"abiFilters":["armeabi-v7a","arm64-v8a","x86"]},"apple":{"idfa":false,"dSYMs":false},"plugins":{"geolocation":{"amap":{"name":"amap_17321661234Ay6qpQnkC","__platform__":["ios","android"],"appkey_ios":"49e860f8b39479b15db1110fb3e62286","appkey_android":"d2e40f882c2fde0f3724791cb82cbd9c"}},"oauth":{},"ad":{},"maps":{"amap":{"name":"amap_17321661234Ay6qpQnkC","appkey_ios":"49e860f8b39479b15db1110fb3e62286","appkey_android":"d2e40f882c2fde0f3724791cb82cbd9c"}},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#ffffff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.28","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#999999","selectedColor":"#000000","borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#ffffff","list":[{"pagePath":"pages/index/index","iconPath":"static/sy2.png","selectedIconPath":"static/sy1.png","text":"首页"},{"pagePath":"pages/peiwan/index","iconPath":"static/peiwan2.png","selectedIconPath":"static/peiwan1.png","text":"陪玩"},{"pagePath":"pages/dongtai/index","iconPath":"static/dt2.png","selectedIconPath":"static/dt1.png","text":"动态"},{"pagePath":"pages/xiaoxi/index","iconPath":"static/xiaoxi2.png","selectedIconPath":"static/xiaoxi1.png","text":"消息"},{"pagePath":"pages/user/index","iconPath":"static/wd2.png","selectedIconPath":"static/wd1.png","text":"我的"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"},"locale":"zh-Hans"}
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__7C06BEE","name":"chunwan","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Geolocation":{},"OAuth":{},"Camera":{},"Maps":{"coordType":"gcj02"},"Payment":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#FFFFFF"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"splashscreen":{"useOriginalMsgbox":true},"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"schemes":"com.chunwan","minSdkVersion":21,"targetSdkVersion":30,"abiFilters":["armeabi-v7a","arm64-v8a","x86"]},"apple":{"idfa":false,"dSYMs":false},"plugins":{"geolocation":{"amap":{"name":"amap_17321661234Ay6qpQnkC","__platform__":["ios","android"],"appkey_ios":"49e860f8b39479b15db1110fb3e62286","appkey_android":"d2e40f882c2fde0f3724791cb82cbd9c"}},"oauth":{"weixin":{"appid":"wx3024f118e0e78f2f","UniversalLinks":""}},"ad":{},"maps":{"amap":{"name":"amap_17321661234Ay6qpQnkC","appkey_ios":"49e860f8b39479b15db1110fb3e62286","appkey_android":"d2e40f882c2fde0f3724791cb82cbd9c"}},"share":{},"payment":{"weixin":{"__platform__":["ios","android"],"appid":"wx3024f118e0e78f2f","UniversalLinks":""}},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#ffffff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.28","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#999999","selectedColor":"#000000","borderStyle":"rgba(0,0,0,0.4)","backgroundColor":"#ffffff","list":[{"pagePath":"pages/index/index","iconPath":"static/sy2.png","selectedIconPath":"static/sy1.png","text":"首页"},{"pagePath":"pages/peiwan/index","iconPath":"static/peiwan2.png","selectedIconPath":"static/peiwan1.png","text":"陪玩"},{"pagePath":"pages/dongtai/index","iconPath":"static/dt2.png","selectedIconPath":"static/dt1.png","text":"动态"},{"pagePath":"pages/xiaoxi/index","iconPath":"static/xiaoxi2.png","selectedIconPath":"static/xiaoxi1.png","text":"消息"},{"pagePath":"pages/user/index","iconPath":"static/wd2.png","selectedIconPath":"static/wd1.png","text":"我的"}],"height":"50px"},"launch_path":"__uniappview.html"},"locale":"zh-Hans"}
Loading…
Cancel
Save