Commit 8fa5c924 authored by Damon's avatar Damon

style: merge

parents 75582a53 b83a619b
const UNI_APP = { const UNI_APP = {
apiUrl: 'http://192.168.0.208:8760', apiUrl: 'http://192.168.0.208:8760',
qn_base_url: 'https://qn-static.banshouhui.com/study/', qn_base_url: 'https://qn-static.banshouhui.com/study/',
qn_asset_url: 'http://deudn.c.pp.cc/',
uUrl: 'http://rest-u.yunya.com/',
argoDebugMode: 1, argoDebugMode: 1,
version: 'v1.0.0' version: 'v1.0.0',
} }
module.exports = UNI_APP module.exports = UNI_APP
const UNI_APP = { const UNI_APP = {
apiUrl: 'https://system.banshouhui.com', apiUrl: 'https://system.banshouhui.com',
qn_base_url: 'https://qn-static.banshouhui.com/study/', qn_base_url: 'https://qn-static.banshouhui.com/study/',
qn_asset_url: 'https://img2.banshouhui.com/',
uUrl: 'http://rest-u.banshouhui.com/',
argoDebugMode: 1, argoDebugMode: 1,
version: 'v1.0.0' version: 'v1.0.0',
} }
module.exports = UNI_APP module.exports = UNI_APP
const UNI_APP = { const UNI_APP = {
apiUrl: 'https://system.dev.banshouhui.com', apiUrl: 'https://system.dev.banshouhui.com',
qn_base_url: 'https://qn-static.banshouhui.com/study/', qn_base_url: 'https://qn-static.banshouhui.com/study/',
qn_asset_url: 'https://img2.banshouhui.com/',
uUrl: 'http://rest-u.test.ibanshou.cn/',
argoDebugMode: 1, argoDebugMode: 1,
version: 'v1.0.0' version: 'v1.0.0',
} }
module.exports = UNI_APP module.exports = UNI_APP
...@@ -2,13 +2,15 @@ let commonApiFun = function(vm) { ...@@ -2,13 +2,15 @@ let commonApiFun = function(vm) {
let loginWechatAuth = async (params = {}) => await vm.$u.post('/wxapp/unify/authorization', params) let loginWechatAuth = async (params = {}) => await vm.$u.post('/wxapp/unify/authorization', params)
let payOrder = async (params = {}) => await vm.$u.post('/pay/order', params) let payOrder = async (params = {}) => await vm.$u.post('/pay/order', params)
let payQuery = async (params = {}) => await vm.$u.get('/pay/query', params) let payQuery = async (params = {}) => await vm.$u.get('/pay/query', params)
let getQiNiuToken = async (params = {}) => await vm.$u.post(ucenterApiUrl + 'v1/tokens', params)
const commonApi = { const commonApi = {
loginWechatAuth, loginWechatAuth,
payOrder, payOrder,
payQuery payQuery,
getQiNiuToken,
} }
return commonApi return commonApi
} }
module.exports = { module.exports = {
commonApiFun commonApiFun,
} }
function hasPermissionOfCamera() {
//如果没权限提示文字,还没取得权限会自动吊起询问权限,已经有权限自动返回true
return new Promise((r, j) => {
uni.authorize({
scope: 'scope.camera',
success: function() {
r(true)
},
fail: function() {
j(false)
},
complete: function() {
console.log('done!')
},
})
})
}
//吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息
function getPhoto(type, token) {
return new Promise((resolve, reject) => {
hasPermissionOfCamera().then((r) => {
if (!r) {
console.warn('调用相机失败')
}
})
let sourceType = type == 1 ? ['album'] : ['album', 'camera']
uni.chooseImage({
count: 6, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, //从相册选择
success: function(res) {
//上传七牛
let filePath = res.tempFiles[0].path //为需要上传的文件
upload(filePath, token)
.then((msg) => {
//最后七牛返回的key
resolve({
key: msg,
files: res.tempFiles,
})
})
.catch((msg) => {
console.error(msg)
reject(msg)
})
},
})
})
}
//上传七牛
function upload(filePath, token) {
return new Promise((resolve, reject) => {
let key =
new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名
uni.uploadFile({
url: 'https://up.qiniup.com', // default ecn华北的地址,在七牛云中选择对应位置的网址
filePath: filePath,
name: 'file',
formData: {
token: token,
key: key,
},
complete: (res) => {
if (res.statusCode === 200) {
resolve(JSON.parse(res.data).key)
} else {
reject(res.errMsg)
}
},
})
})
}
export default {
upload,
getPhoto,
}
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<u-avatar :src="avatar"></u-avatar> <u-avatar :src="avatar"></u-avatar>
</view> </view>
<view> <view>
<view class="nick"><text>aaa</text><u-icon name="server-man"></u-icon></view> <view class="nick"
><text>aaa</text><u-icon name="server-man"></u-icon
></view>
<view class="city"><text>安徽</text><text>合肥</text></view> <view class="city"><text>安徽</text><text>合肥</text></view>
</view> </view>
</view> </view>
...@@ -19,66 +21,61 @@ ...@@ -19,66 +21,61 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
title: '我的客服', title: '我的客服',
avatar:'https://qn-static.banshouhui.com/self-support/avatar.gif', avatar: 'https://qn-static.banshouhui.com/self-support/avatar.gif',
erweima:"https://qn-static.banshouhui.com/self-support/erweima-bg.png" erweima: 'https://qn-static.banshouhui.com/self-support/erweima-bg.png',
} }
}, },
onLoad() { onLoad() {},
methods: {},
}, }
methods: {
}
}
</script> </script>
<style> <style>
page{ page {
background-color: rgb(229, 229, 236); background-color: rgb(229, 229, 236);
} }
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 130rpx 30rpx 0rpx 30rpx; padding: 130rpx 30rpx 0rpx 30rpx;
} }
.logo { .logo {
height: 200rpx; height: 200rpx;
width: 200rpx; width: 200rpx;
margin: 200rpx auto 50rpx auto; margin: 200rpx auto 50rpx auto;
} }
.text-area { .text-area {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.title { .title {
font-size: 36rpx; font-size: 36rpx;
color: #8f8f94; color: #8f8f94;
} }
.kf-body{ .kf-body {
width: 100%; width: 100%;
height: 700rpx; height: 700rpx;
background-color: aliceblue; background-color: aliceblue;
padding: 50rpx; padding: 50rpx;
} }
.name-space{ .name-space {
display: flex; display: flex;
} }
.erweima{ .erweima {
text-align: center; text-align: center;
margin-top: 30rpx; margin-top: 30rpx;
padding-left: 10%; padding-left: 10%;
} }
</style> </style>
<template>
<view class="content">
<u-cell-group>
<u-cell-item title="头像" @click="changeHead">
<view slot="right-icon">
<u-image width="50rpx" height="50rpx" :src="headPhoto"></u-image>
</view>
</u-cell-item>
<u-cell-item title="证件照" @click="changeCertPhoto">
<view slot="right-icon">
<u-image
v-if="isupLoadCertPhoto"
width="50rpx"
height="50rpx"
:src="headCertPhoto"
></u-image>
<text v-else style="color:blue;">未上传</text>
</view>
</u-cell-item>
<u-cell-item
title="手机号"
:arrow="false"
:hover-class="none"
:value="getMobile"
></u-cell-item>
<u-cell-item
title="实名认证"
:arrow="false"
:hover-class="none"
title-style="{'font':'bold','font-size':'40rpx'}"
>
<view slot="label" style="display:flex;flex-direction: column;">
<text>上传二代身份证照片,图片大小不大于2M</text>
<view class="upload-image">
<image
class="cert-image"
:src="certFront"
mode="widthFix"
lazy-load="false"
binderror=""
bindload=""
@click="getFront"
/>
<image
class="cert-image"
style="margin-left: 30rpx;"
:src="certBack"
mode="widthFix"
lazy-load="false"
binderror=""
bindload=""
@click="getBack"
/>
</view>
</view>
</u-cell-item>
<u-cell-item
:arrow="false"
:hover-class="none"
title="姓名"
value="阿斯达"
></u-cell-item>
<u-cell-item
:arrow="false"
:hover-class="none"
title="身份证号"
:value="idCardNum"
></u-cell-item>
<u-cell-item
:arrow="false"
:hover-class="none"
title="有效期"
:value="expire"
></u-cell-item>
<u-cell-item title="工作单位" :value="company"></u-cell-item>
</u-cell-group>
</view>
</template>
<script>
import upload from '@/common/upload'
export default {
data() {
return {
title: '个人信息',
headPhoto: 'https://qn-static.banshouhui.com/self-support/avatar.gif',
headCertPhoto: 'https://qn-static.banshouhui.com/self-support/avatar.gif',
certFront: 'https://qn-static.banshouhui.com/self-support/renxiang.png',
certBack: 'https://qn-static.banshouhui.com/self-support/guohui.png',
idCardNum: '1312315661651',
expire: '2020-12-01~2090-09-01',
mobile: '1773322111',
company: '深圳维修会科技有限公司',
token: null,
host: process.uniEnv.qn_asset_url,
}
},
computed: {
isupLoadCertPhoto() {
return true //this.member && this.member.certPhoto || false
},
getMobile() {
return this.mobile
},
},
onLoad() {
this.$u.api.getQiNiuToken({ type: 'image' }).catch((data) => {
if (data.errMsg == 'request:ok') {
this.token = data.data.token //token为七牛云的token一般由后台接口提供
} else {
console.log('get token error')
}
})
},
methods: {
changeHead() {
//获取图片
upload.getPhoto(1, this.token).then((res) => {
this.headPhoto = this.host + res.key
})
},
changeCertPhoto() {
//获取图片
upload.getPhoto(2, this.token).then((res) => {
//显示
this.headCertPhoto = this.host + res.key
})
},
getFront() {
//获取图片
upload.getPhoto(1, this.token).then((res) => {
this.certFront = this.host + res.key
})
},
getBack() {
//获取图片
upload.getPhoto(1, this.token).then((res) => {
this.certBack = this.host + res.key
})
},
toUrl(url) {
this.$u.route({
url: url,
})
},
},
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
}
.logo {
height: 200rpx;
width: 200rpx;
margin: 200rpx auto 50rpx auto;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
.cell-item {
display: flex;
}
.cert-image {
width: 300rpx;
height: 300rpx;
}
.upload-image {
margin-top: 30rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment