Commit 78e0aa1c authored by 秦威威's avatar 秦威威

水印拍照

parent a456838b
<script> <script>
// https://ext.dcloud.net.cn/plugin?id=1287 绘制二维码插件地址 // https://ext.dcloud.net.cn/plugin?id=1287 绘制二维码插件地址
// https://ext.dcloud.net.cn/plugin?id=10446 地址三级联动插件地址 // https://ext.dcloud.net.cn/plugin?id=10446 地址三级联动插件地址
export default { export default {
onLaunch: async function() { onLaunch: async function() {
// // #ifdef MP-WEIXIN // // #ifdef MP-WEIXIN
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
// console.log(token) // console.log(token)
// 有token先获取用户信息 // 有token先获取用户信息
if (token) { // if (token) {
this.$store.dispatch('user/getUserInfo'); // this.$store.dispatch('user/getUserInfo');
} // }
}, },
onShow: function() { onShow: function() {
}, },
onHide: function() { onHide: function() {
}, },
methods: { methods: {
// 小程序检测更新 // 小程序检测更新
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
content: '新版本已经上线,请您删除当前小程序,重新搜索打开', content: '新版本已经上线,请您删除当前小程序,重新搜索打开',
}) })
}) })
} else { // 没有新版本 } else { // 没有新版本
} }
}) })
} else { } else {
...@@ -87,5 +87,4 @@ ...@@ -87,5 +87,4 @@
/*每个页面公共css */ /*每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss"; @import "@/uni_modules/uview-ui/index.scss";
@import "@/common/css/public.scss"; @import "@/common/css/public.scss";
</style>
</style> \ No newline at end of file
...@@ -2,13 +2,12 @@ import config from "config" ...@@ -2,13 +2,12 @@ import config from "config"
/** /**
* http请求 * http请求
* @author 万世科技 * @author
* @param {Object} params * @param {Object} params
*/ */
function request(params) { function request(params) {
// console.log(params) //console.log(params)
// const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
const token = '237c5a89-2627-48a7-b0b7-49b68af09d3d'
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
params.url = config.domain + params.url params.url = config.domain + params.url
...@@ -22,30 +21,28 @@ function request(params) { ...@@ -22,30 +21,28 @@ function request(params) {
uni.request({ uni.request({
...params, ...params,
header: { header: {
"token": token || '' "Authorization": token || '',
}, },
success: (res) => { success: (res) => {
// console.log(res)
// 防止组件那边使用showLoading这里提前关闭 // 防止组件那边使用showLoading这里提前关闭
if(params.loadingTip === '' || params.loadingTip){ if (params.loadingTip === '' || params.loadingTip) {
uni.hideLoading() uni.hideLoading()
} }
// 这里判断code为1,组件那边不需要再判断then回调就是成功 // 这里判断code为1,组件那边不需要再判断then回调就是成功
if (res.statusCode === 200 && res.data.code === 1) { if (res.statusCode === 200 && res.data.code === 200) {
resolve(res.data) resolve(res.data)
} else if (res.statusCode === 401 || res.data.code === 401) { // 未登录,或登录过期 } else if (res.statusCode === 401 || res.data.code === 401) { // 未登录,或登录过期
// toLogin() toLogin()
} else if (res.statusCode === 200 || res.data.code === 500) {
this.$wskj.toast('接口异常')
} else { } else {
reject(res.data || {}) reject(res.data || {})
} }
logApiRequest(params, res.data)
}, },
fail: (err) => { fail: (err) => {
// console.log('失败') console.log(err);
// console.log(err)
uni.hideLoading() uni.hideLoading()
if(err.data.code === 401) {
// toLogin()
}
reject(err || {}) reject(err || {})
} }
}) })
...@@ -54,15 +51,34 @@ function request(params) { ...@@ -54,15 +51,34 @@ function request(params) {
} }
}) })
} }
//封装日志打印函数
function logApiRequest(data, response) {
console.log(`========== 接口请求start日志 ==========`);
console.log(data);
console.log(response);
if (response.code == 500) {
uni.showToast({
title: response.msg,
icon: 'none',
duration: 2000 // 持续时间,单位ms
});
}
console.log(`========== 接口请求end日志 ==========`);
}
function toLogin(){ function toLogin() {
uni.$u.toast('登录过期')
uni.clearStorageSync(); uni.clearStorageSync();
setTimeout(()=> { uni.showModal({
uni.reLaunch({ title: '提示',
url: '/pages/login/wechatlogin' content: '您的登录失效,是否重新登录?',
}) success(res) {
}, 600) console.log(res)
if (res.confirm) {
uni.redirectTo({
url: '/pages/login/wechatlogin'
})
}
}
})
} }
export default request export default request
\ No newline at end of file
export default { export default {
domain: 'https://smxy0327.idiaoyuyi.com', // 项目域名 domain: 'http://192.168.0.160:8086', // 项目域名
cdnUrl: '', // 云储蓄静态资源图片域名 cdnUrl: '', // 云储蓄静态资源图片域名
amapKey: '' , // 高德web服务key amapKey: '', // 高德web服务key
socketUrl: ''// websocket地址 socketUrl: '' // websocket地址
} }
\ No newline at end of file
{ {
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/wy-home", "path": "pages/login/wechatlogin",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/wy-bmfw", "path": "pages/xieyi",
"style": {
"navigationBarTitleText": "协议"
}
},
{
"path": "pages/wy-home",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/wy-mine", "path": "pages/wy-bmfw",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/login/wechatlogin", "path": "pages/wy-mine",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }
], ],
"subPackages": [{ "subPackages": [{
"root": "pagesMain", "root": "pagesMain",
...@@ -187,6 +194,12 @@ ...@@ -187,6 +194,12 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/dkpz",
"style": {
"navigationStyle": "custom"
}
} }
] ]
} }
......
<template> <template>
<view class='container'> <view class='container'>
<view class="center"> <view class="center">
<image class="w-240 h-240" src="@/static/logo.png"></image> <image class="w-240 h-240" src="@/static/icon_logo.png"></image>
</view> </view>
<view class="login-btn"> <view class="login-btn">
<button v-if="agreement" class="lh-90 br-8" style="height: 100%;background-color: #31AD6F;color: #FFF;" <button v-if="agreement" class="lh-90 br-8" style="height: 100%;background-color: #1FCA7C;color: #FFF;"
open-type="getPhoneNumber" @getphonenumber="onGetphonenumber"> open-type="getPhoneNumber" @getphonenumber="onGetphonenumber">
<text>立即登录</text> <text>立即登录</text>
</button> </button>
...@@ -13,16 +13,16 @@ ...@@ -13,16 +13,16 @@
style="height: 100%;background-color: #ccc;border-radius: 8rpx;"> style="height: 100%;background-color: #ccc;border-radius: 8rpx;">
<text class="fs-30">立即登录</text> <text class="fs-30">立即登录</text>
</view> </view>
<view @click="youkeLogin" class="lh-90 br-8 mt-30" style="height: 100%;background-color: #31AD6F;"> <!-- <view @click="youkeLogin" class="lh-90 br-8 mt-30" style="height: 100%;background-color: #31AD6F;">
<text>游客登录</text> <text>游客登录</text>
</view> </view> -->
</view> </view>
<view class="agreement"> <view class="agreement">
<image v-if="!agreement" @click="agreement = !agreement" src="@/static/select.png"></image> <image v-if="!agreement" @click="agreement = !agreement" src="@/static/select.png"></image>
<image v-else @click="agreement = !agreement" src="@/static/is-select.png"></image> <image v-else @click="agreement = !agreement" src="@/static/is-select.png"></image>
<text>阅读并同意<text @click="onGetXieyi('yhxy')" style="color: #4083F0;">《用户协议》</text><text <text>阅读并同意<text @click="onGetXieyi(1)" style="color: #4083F0;">《用户协议》</text><text @click="onGetXieyi(2)"
@click="onGetXieyi('yszc')" style="color: #4083F0;">《隐私政策》</text></text> style="color: #4083F0;">《隐私政策》</text></text>
</view> </view>
</view> </view>
</template> </template>
...@@ -38,12 +38,10 @@ ...@@ -38,12 +38,10 @@
}, },
onLoad(options) { onLoad(options) {
this.userId = options.userId || '' this.userId = options.userId || ''
// uni.login({ const token = uni.getStorageSync('token')
// provider: 'weixin', if (!token) {
// success: (loginRes) => { this.$wskj.switchTab('/pages/wy-home');
// this.code = loginRes.code }
// }
// });
}, },
methods: { methods: {
onGetphonenumber(e) { onGetphonenumber(e) {
...@@ -53,39 +51,30 @@ ...@@ -53,39 +51,30 @@
this.code = loginRes.code this.code = loginRes.code
console.log("微信授权信息", loginRes) console.log("微信授权信息", loginRes)
console.log("手机号授权信息", e) console.log("手机号授权信息", e)
if (e.detail.iv && e.detail.encryptedData) {
const params = {
url: '/api/login/mobile',
loadingTip: '登录中...',
data: {
payCode: this.code,
loginCode: e.detail.code,
}
}
this.$request(params).then(res => {
console.log(res)
if (res.code === 200) {
uni.setStorageSync('token', res.data.token)
this.$wskj.switchTab('/pages/wy-home');
} else {
this.$u.toast(res.msg || '登录失败')
}
})
} else {
this.$u.toast('手机号授权失败')
}
} }
}); });
if (e.detail.iv && e.detail.encryptedData) {
// const params = {
// url: '/api/user/getnewuserinfo',
// loadingTip: '登录中...',
// data: {
// code: this.code,
// iv: e.detail.iv,
// encryptedData: e.detail.encryptedData,
// fid: this.userId // 推荐绑定上下级
// }
// }
// this.$request(params).then(async (res) => {
// // console.log(res)
// if (res.code === 1) {
// uni.setStorageSync('token', res.data.userinfo.token)
// this.$store.dispatch('user/getUserInfo');
// uni.redirectTo({
// url: '/pages/index'
// })
// } else {
// this.$u.toast(res.msg || '登录失败')
// }
// }).catch(err => {
// this.$u.toast(err.msg || '登录失败')
// })
} else {
this.$u.toast('手机号授权失败')
}
}, },
youkeLogin() { youkeLogin() {
if (!this.agreement) { if (!this.agreement) {
...@@ -97,25 +86,14 @@ ...@@ -97,25 +86,14 @@
}, },
onGetXieyi(type) { onGetXieyi(type) {
const params = { const params = {
url: '/api/index/xieyi', url: '/api/protocol/' + type,
loadingTip: '', loadingTip: '',
data: { method: 'GET',
type data: {}
}
} }
this.$request(params).then(res => { this.$request(params).then(res => {
// console.log(res) let title = type == 1 ? '用户协议' : '隐私政策'
let title = type === 'yhxy' ? '用户协议' : '隐私政策' this.$wskj.to('/pages/xieyi?title=' + title + '&content=' + res.data.content)
// #ifdef APP-PLUS
this.$wskj.to('/pages/xieyi?title=' + title + '&content=' + res.data)
// #endif
// #ifdef MP-WEIXIN || MP-ALIPAY
this.$wskj.to('/pages/xieyi?title=' + title + '&content=' + encodeURIComponent(res.data))
// #endif
}).catch(err => {
// console.log(err)
this.$u.toast('发生错误')
}) })
} }
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);"> <view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);">
<u-navbar bgColor="transparent" placeholder="true"> <u-navbar bgColor="transparent" placeholder="true">
<view style="display: flex;align-items: center;font-size: 32rpx;color: #fff;" slot="left"> <view style="display: flex;align-items: center;font-size: 32rpx;color: #fff;" slot="left">
<image src="https://zhongqian.xnszz.com/1-images/home/20250213002.png" <image src="/static/icon_home_dw.png" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"
style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" mode=""></image> mode=""></image>
<text>利达物业中心</text> <text>利达物业中心</text>
<image src="https://zhongqian.xnszz.com/1-images/home/20250213003.png" <image src="https://zhongqian.xnszz.com/1-images/home/20250213003.png"
style="width: 30rpx;height: 8.5rpx;margin-left: 8rpx;" mode="widthFix"></image> style="width: 30rpx;height: 8.5rpx;margin-left: 8rpx;" mode="widthFix"></image>
......
<template> <template>
<view class="center"> <view class="center">
<view> <view>
<u-navbar bgColor="#1FCA7C" placeholder="true"> <u-navbar bgColor="#1FCA7C" placeholder="true" @leftClick="open">
<view style="display: flex;align-items: center;font-size: 32rpx;color: #fff;" slot="left"> <view style="display: flex;align-items: center;font-size: 32rpx;color: #fff;" slot="left">
<image src="https://zhongqian.xnszz.com/1-images/home/20250213002.png" <image src="/static/icon_home_dw.png" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"
style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" mode=""></image> mode=""></image>
<text>利达物业中心</text> <text>{{address}}</text>
<image src="https://zhongqian.xnszz.com/1-images/home/20250213003.png" <image src="https://zhongqian.xnszz.com/1-images/home/20250213003.png"
style="width: 30rpx;height: 8.5rpx;margin-left: 8rpx;" mode="widthFix"></image> style="width: 30rpx;height: 8.5rpx;margin-left: 8rpx;" mode="widthFix"></image>
</view> </view>
...@@ -32,13 +32,14 @@ ...@@ -32,13 +32,14 @@
<view class="flex-column mlr-50" style="width:600rpx;"> <view class="flex-column mlr-50" style="width:600rpx;">
<text class="fs-32 fw-600 mtb-20">选择小区</text> <text class="fs-32 fw-600 mtb-20">选择小区</text>
<scroll-view scroll-y class="h-400"> <scroll-view scroll-y class="h-400">
<view v-for="(item, index) in 8" :key="index"> <view v-for="(item, index) in listXq" :key="index" @click="onSelect(index)">
<view class="fs-24 pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="fs-24 pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text>西城小区</text> <text
:style="selectIndex==index?'color: #1FCA7C;':'color: #000000;'">{{item.communityName}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="mt-40"> <view class="mt-40" @click="onSubmit()">
<text class="plr-80 ptb-12 br-12" style="background:#1FCA7C;color: #fff;">下一步</text> <text class="plr-80 ptb-12 br-12" style="background:#1FCA7C;color: #fff;">下一步</text>
</view> </view>
</view> </view>
...@@ -50,7 +51,10 @@ ...@@ -50,7 +51,10 @@
export default { export default {
data() { data() {
return { return {
address: '请选择',
show: false, show: false,
selectIndex: 0,
listXq: [],
list1: [ list1: [
"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
...@@ -90,21 +94,39 @@ ...@@ -90,21 +94,39 @@
], ],
}; };
}, },
onLoad(options) { onShow() {
this.listAll()
}, },
methods: { methods: {
open() { open() {
// console.log('open'); this.show = true
}, },
close() { close() {
this.show = false this.show = false
// console.log('close'); // console.log('close');
}, },
onSelect(index) {
this.selectIndex = index
},
onSubmit() {
this.show = false
this.address = this.listXq[this.selectIndex].communityName
},
listAll() {
const params = {
url: '/api/community/listAll',
loadingTip: '',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
console.log(res.data)
this.listXq = res.data
})
},
onClick(index) { onClick(index) {
if (index == 0) { if (index == 0) {
this.$wskj.to("/pages/login/wechatlogin") this.$wskj.to("/pagesMain/pages/fkdj")
//this.$wskj.to("/pagesMain/pages/fkdj")
return return
} }
if (index == 1) { if (index == 1) {
...@@ -127,7 +149,6 @@ ...@@ -127,7 +149,6 @@
this.$wskj.to("/pagesMain/pages/tsby") this.$wskj.to("/pagesMain/pages/tsby")
return return
} }
} }
} }
}; };
......
<template> <template>
<view class='container'> <view class='container'>
<u-parse v-if="content" :content="content"></u-parse> <u-parse v-if="content" :content="content"></u-parse>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
content: '' content: ''
}; };
}, },
onLoad(options) { onLoad(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: options.title title: options.title
}) })
this.content = decodeURIComponent(options.content) this.content = options.content
} }
}; };
</script> </script>
<style scoped> <style scoped>
.container { .container {
padding: 20rpx; padding: 20rpx;
} }
</style> </style>
\ No newline at end of file
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
<attend-calendar :lateddates="[`2025-5-26`,`2025-5-27`,`2025-6-27`]" <attend-calendar :lateddates="[`2025-5-26`,`2025-5-27`,`2025-6-27`]"
:truancyeddates="[`2025-5-23`]"></attend-calendar> :truancyeddates="[`2025-5-23`]"></attend-calendar>
</view> </view>
<view class="flex v-center pad-30 mlr-25 mt-30" style="background: #EBF5F0;">
<text class="fs-28 fw-700">打卡时间:</text>
<text class="fs-24">2025-04-03 10:32:31</text>
</view>
<view class="flex-column mlr-25 mt-30" style="background: #EBF5F0;"> <view class="flex-column mlr-25 mt-30" style="background: #EBF5F0;">
<view class="flex v-center pad-30"> <view class="flex v-center pad-30">
<text class="fs-28 fw-700">打卡天数:</text> <text class="fs-28 fw-700">打卡天数:</text>
...@@ -25,6 +20,16 @@ ...@@ -25,6 +20,16 @@
<text class="fs-24">1天</text> <text class="fs-24">1天</text>
</view> </view>
</view> </view>
<view class="overflow-y">
<scroll-view scroll-y style="height: 100%;">
<view @click="onClickSelecte(index)" v-for="(item, index) in 10" :key="index">
<view class="flex v-center pad-30 mlr-25 mt-30" style="background: #EBF5F0;">
<text class="fs-28 fw-700">打卡时间:</text>
<text class="fs-24">2025-04-03 10:32:31</text>
</view>
</view>
</scroll-view>
</view>
</view> </view>
</template> </template>
......
<template>
<view class="content">
<div></div>
<view class="takepicture" :style="{ 'height': allhight + 'px'}" v-show="isshow==true">
<!-- 头部 -->
<!-- <view class="mode">
<image :src="imginfo" mode=""></image>
<view class="one" @click="takeFlash">
<image v-show="num==0" src="/pagesMine/static/flash.png" mode=""></image>
<image v-show="num==1" src="/pagesMine/static/flashon.png" mode=""></image>
<text>闪光灯</text>
</view>
<view class="one" @click="countDown">
<image src="/pagesMine/static/count.png" mode=""></image>
<text>倒计时</text>
</view>
<view class="one" @click="devicePosition">
<image src="/pagesMine/static/turn.png" mode=""></image>
<text>翻转</text>
</view>
<view class="one">
<image src="/pagesMine/static/set.png" mode=""></image>
<text>设置</text>
</view>
</view> -->
<!-- 相机 -->
<view class="photo" :style="{ 'height': Height + 'px'}">
<camera :device-position="position" :flash="flash" mode="mode" :style="{ 'height': Height + 'px'}">
</camera>
</view>
<!-- 底部 -->
<view class="bot" v-show="watermode">
<view class="left" @click="takeAlbum">
<image src="/pagesMine/static/photo.png" mode=""></image>
</view>
<view class="center" @click="takePhotoAction">
<image src="/pagesMine/static/camera.png" mode=""></image>
</view>
<view class="right" @click="devicePosition">
<image src="/pagesMine/static/turn.png" mode=""></image>
</view>
</view>
<view class="bota" v-show="!watermode">
<view class="back" @click="watermode=!watermode">返回</view>
<view class="watera" @click="draw(1)">
<view class="ti">
19:23:45
</view>
<view class="ad">
2023-10-21 星期六 选择地点
</view>
</view>
</view>
<!-- 水印1 -->
<cover-view class="cameraa">
<cover-view class="hour">{{nowTimes}}</cover-view>
<cover-view @click="getLocation" class="time">{{nowTime}} {{addRess?addRess:'选择地点'}}</cover-view>
</cover-view>
<!-- 画水印 -->
<!-- canvas元素,利用它的功能,实现添加水印style="position: absolute;top: -999999px;" -->
<view style="position: absolute;top: -999999px;">
<view>
<canvas :style="{ width: w, height: h }" canvas-id="firstCanvas"></canvas>
</view>
</view>
</view>
<view class="photograph" v-show="isshow==false">
<!-- 图片预览 :style="{ 'height': imgheight + 'px'}" :style="{ 'height': h + 'px','width': w +'px'}"-->
<view class="look">
<view class="one" :style="{ 'height': Height + 'px'}">
<image style="height: 100%; width: 100%;" :src="imageSrc? imageSrc:''" mode=""></image>
</view>
<!-- <view class="two">
<view class="btn" @click="showPic">
<image src="/pagesMine/static/camera.png" mode=""></image>
</view>
<view class="down" @click="downImg">
<image src="/pagesMine/static/down.png" mode=""></image>
</view>
<view class="btn" @click="upload">
<image src="/pagesMine/static/waterup.png" mode=""></image>
</view>
</view> -->
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isshow: true,
allhight: 0,
Height: 0, //页面高度
imgheight: 0,
flash: 'off', //闪光 默认off 打开on 自动auto
num: 0, //闪光灯
position: 'back', //前置后置 默认后置false 前置true
pos: false, //前置后置
imageSrc: '', //图片路径
qualityChange: 'hight', //图像质量 high 高质量成像、 normal 普通质量、row 低质量
time: false, //倒计时
w: '', // canvas 元素宽度
h: '', // canvas 元素高度
watermode: true, //拍照按钮模块显示
nowTime: '', //时间
nowTimes: '',
addRess: '', //地址
txtName: '', //名字
txtMain: '', //备注内容
waterdraw: 1,
}
},
mounted() {
// 注意,这里要用个变量存this,不然进到getSystemInfo后this指向会变化,找不到data变量
var _this = this
uni.getSystemInfo({
success: function(res) {
//console.log(res.screenHeight); // 屏幕高度,包含导航栏
//console.log(res.windowHeight); // 能够使用的窗口高度,不包含导航栏
//console.log(res.screenWidth); // 屏幕宽度
//console.log(res.windowWidth); // 能够使用31口宽度
_this.Height = res.windowHeight;
_this.allhight = res.windowHeight
_this.imgheight = res.windowHeight - 220;
_this.imgWidth = res.windowWidth
}
});
// 获取当前日期时间
this.getTime();
},
methods: {
takePhotoAction() {
var that = this
if (that.time == false) {
that.takePhoto()
} else if (that.time == true) {
setTimeout(() => {
that.takePhoto()
}, 5000);
}
},
takePhoto: function() { //拍照
var that = this;
const camera = uni.createCameraContext() //创建照相机对象
camera.takePhoto({ //实现拍照功能
quality: 'high', //high 高质量成像、 normal 普通质量、row 低质量
zoom: [1, 1], //缩放
success: (res) => {
console.log('拍照成功', res.tempImagePath)
that.imageSrc = res.tempImagePath //原图
that.takeCanvas(res.tempImagePath) //画图
}
})
},
takeAlbum() {
var that = this
uni.chooseImage({
count: 1,
success: (res) => {
var file = res.tempFilePaths[0];
const tempFiles = res.tempFiles[0];
setTimeout(() => { //必须加个延迟
that.takeCanvas(file)
}, 1000);
}
})
},
takeCanvas(imginfo) {
console.log(imginfo)
var that = this
// 获取图片信息
uni.getImageInfo({
src: imginfo,
success: ress => {
that.w = ress.width + 'px'; // 设置 canvas 元素宽度
that.h = ress.height + 'px'; // 设置 canvas 元素高度
console.log(that.w, that.h)
let ctx = uni.createCanvasContext('firstCanvas'); /** 创建画布 */
//将图片绘制到cancas内
ctx.drawImage(imginfo, 0, 0, ress.width, ress.height);
ctx.setFontSize(14); // 设置字体大小为 10px
ctx.setFillStyle('#FFFFFF'); // 设置颜色为白色#FFFFFF
// ctx.setTextAlign("center")
let textToWidth = 25; // 绘制文本的左上角x坐标位置
let textToWidth1 = 100; // 绘制文本的左上角x坐标位置
let textToHeight1 = 150; // 绘制文本的左上角y坐标位置
let textToHeight2 = 170; // 绘制文本的左上角y坐标位置
let textToHeight3 = 190; // 绘制文本的左上角y坐标位置
//绘制的模板1
if (that.waterdraw == 1) {
// 绘制时间
ctx.setFontSize(25);
ctx.fillText(that.nowTimes, textToWidth, textToHeight1);
// 绘制日期
ctx.setFontSize(16);
ctx.fillText(that.nowTime, textToWidth1, textToHeight1);
// 绘制地点
ctx.setFontSize(14);
ctx.fillText(that.addRess + "郑州市", textToWidth, textToHeight2);
// 绘制名称
ctx.setFontSize(14);
ctx.fillText("小木(安保)", textToWidth, textToHeight3);
}
// 绘制完成后,在下一个事件循环将 canvas 内容导出为临时图片地址
ctx.draw(false, () => {
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'firstCanvas',
success: res1 => {
that.imageSrc = res1.tempFilePath
that.isshow = false
},
fail: (err) => {
console.log('导出图片失败', err)
}
});
}, 1000);
});
}
});
},
takeFlash() { //闪光灯
this.num++
if (this.num == 0) {
this.flash = "off"
} else if (this.num == 1) {
this.flash = "on"
} else if (this.num == 2) {
this.flash = "auto"
this.num = 0
}
},
devicePosition() { //前置后置
if (this.pos == false) {
this.position = "front"
this.pos = true
} else if (this.pos == true) {
this.position = "back"
this.pos = false
}
},
countDown() { //倒计时
this.time = !this.time
},
showPic() { //预览图片
this.isshow = !this.isshow
},
// 获取当天是周几
getWeekday() {
const weekdays = ['', '', '', '', '', '', ''];
const d = new Date();
const weekday = weekdays[d.getDay()];
return weekday;
},
getTime: function() { //获取当前时间
var date = new Date(),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
month >= 1 && month <= 9 ? (month = "0" + month) : "";
day >= 0 && day <= 9 ? (day = "0" + day) : "";
var timer = year + '-' + month + '-' + day;
var timers = hour + ':' + minute;
// 调用方法获取当天是周几
const todayWeekday = this.getWeekday();
//console.log('今天是周' + todayWeekday);
this.nowTimes = timers
this.nowTime = timer + ' ' + '星期' + todayWeekday;
},
getLocation() { //获取位置
var that = this
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
// that.addRess = res.address + ' ' + res.name //详细地址
that.addRess = res.name
}
});
},
downImg() { //保存到相册
var that = this
uni.saveImageToPhotosAlbum({
filePath: that.imageSrc,
success: function() {
uni.showToast({
title: "保存成功",
icon: "none"
});
},
fail: function(err) {
uni.showToast({
title: "保存失败,请稍后重试",
icon: "none"
});
console.log(err)
},
})
},
draw(wa) { //选择的水印模板
// this.waterdraw = wa
// this.watermode = !this.watermode
},
}
}
</script>
<style>
.content {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
/* 头部 */
.mode {
width: 750upx;
height: 140upx;
display: flex;
background-color: #161616;
}
.mode>.one {
width: 120upx;
height: 140upx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.mode>.one>image {
width: 70upx;
height: 70upx;
}
.mode>.one>text {
width: 120upx;
height: 30upx;
line-height: 30upx;
text-align: center;
font-size: 22upx;
color: #ffffff;
}
/* 相机 */
.photo {
width: 750upx;
}
.photo>camera {
width: 750upx;
height: 700upx;
position: relative;
}
/* 拍照按钮模块区1 */
.bot {
width: 750upx;
height: 200upx;
background-color: #161616;
position: absolute;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
}
.bot>.left {
width: 90upx;
height: 90upx;
border-radius: 50%;
border: 3upx solid #ffffff;
}
.bot>.left>image {
width: 90upx;
height: 90upx;
border-radius: 50%;
}
.bot>.center {
width: 130upx;
height: 130upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.bot>.center>image {
width: 80upx;
height: 80upx;
}
.bot>.center:active {
transform: scale(1.2);
}
.bot>.right {
width: 90upx;
height: 90upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.bot>.right>image {
width: 50upx;
height: 50upx;
}
/* 拍照按钮模块区2 水印 */
.bota {
position: absolute;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
background-color: #161616;
}
.bota>.back {
width: 750upx;
height: 60upx;
line-height: 60upx;
color: #ffffff;
}
.bota>.watera {
width: 300upx;
height: 350upx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10upx;
background-color: #d9cdf3;
color: #ffffff;
}
.bota>.watera>.ti {
width: 300upx;
height: 60upx;
line-height: 60upx;
font-size: 38upx;
text-align: center;
}
.bota>.watera>.ad {
width: 300upx;
height: 60upx;
line-height: 60upx;
font-size: 28upx;
text-align: center;
overflow-x: hidden;
}
/* 水印1显示 */
.cameraa {
width: 690upx;
height: 120upx;
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
color: #ffffff;
z-index: 200;
position: absolute;
left: 30upx;
bottom: 560upx;
font-size: 28upx;
}
.hour {
width: 690upx;
height: 60upx;
line-height: 60upx;
font-size: 38upx;
}
/* 图片预览/下载 */
.look {
width: 750upx;
height: 1000upx;
}
.look>.one {
width: 750upx;
height: 800upx;
display: flex;
justify-content: center;
align-items: center;
}
.look>.one>image {
width: 750upx;
height: 800upx;
}
.look>.two {
width: 750upx;
height: 200upx;
display: flex;
justify-content: space-around;
align-items: center;
background-color: #161616;
}
.look>.two>.btn {
width: 100upx;
height: 100upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.look>.two>.btn>image {
width: 60upx;
height: 60upx;
}
.look>.two>.down {
width: 120upx;
height: 120upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.look>.two>.down>image {
width: 60upx;
height: 60upx;
}
</style>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
return return
} }
if (index == 2) { if (index == 2) {
this.$wskj.to("/pagesMain/pages/bxbs_lsgd") this.$wskj.to("/pagesMine/pages/dkpz")
return return
} }
if (index == 3) { if (index == 3) {
......
...@@ -2,9 +2,9 @@ import request from "@/common/request.js" ...@@ -2,9 +2,9 @@ import request from "@/common/request.js"
// 获取用户信息 // 获取用户信息
export function getUserInfo(body) { export function getUserInfo(body) {
return request({ return request({
method: "post", method: "post",
url: '/api/user/index', url: '',
data: body || {}, data: body || {},
}) })
} }
\ No newline at end of file
static/icon_logo.png

27.9 KB | W: | H:

static/icon_logo.png

7.55 KB | W: | H:

static/icon_logo.png
static/icon_logo.png
static/icon_logo.png
static/icon_logo.png
  • 2-up
  • Swipe
  • Onion skin
static/is-select.png

711 Bytes | W: | H:

static/is-select.png

778 Bytes | W: | H:

static/is-select.png
static/is-select.png
static/is-select.png
static/is-select.png
  • 2-up
  • Swipe
  • Onion skin
## 1.0.2(2023-10-24)
新增从相册选择图片添加水印
## 1.0.1(2023-10-21)
修改水印样式
## 1.0.0(2023-09-29)
上传
{
"id": "watermark-camera",
"displayName": "watermark-camera 水印相机",
"version": "1.0.2",
"description": "watermark-camera",
"keywords": [
"watermark-camera"
],
"repository": "",
"engines": {
"HBuilderX": "^3.5.3"
},
"dcloudext": {
"type": "unicloud-template-page",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
<template>
<view class="content">
<view class="takepicture" :style="{ 'height': allhight + 'px'}" v-show="isshow==true">
<!-- 头部 -->
<view class="mode">
<image :src="imginfo" mode=""></image>
<view class="one" @click="takeFlash">
<image v-show="num==0" src="../../static/flash.png" mode=""></image>
<image v-show="num==1" src="../../static/flashon.png" mode=""></image>
<text>闪光灯</text>
</view>
<view class="one" @click="countDown">
<image src="../../static/count.png" mode=""></image>
<text>倒计时</text>
</view>
<view class="one" @click="devicePosition">
<image src="../../static/turn.png" mode=""></image>
<text>翻转</text>
</view>
<view class="one">
<image src="../../static/set.png" mode=""></image>
<text>设置</text>
</view>
</view>
<!-- 相机 -->
<view class="photo" :style="{ 'height': Height + 'px'}">
<camera :device-position="position" :flash="flash" mode="mode" :style="{ 'height': Height + 'px'}">
</camera>
</view>
<!-- 底部 -->
<view class="bot" v-show="watermode">
<view class="left" @click="takeAlbum">
<image src="../../static/photo.png" mode=""></image>
</view>
<view class="center" @click="takePhotoAction">
<image src="../../static/camera.png" mode=""></image>
</view>
<view class="right" @click="watermode=!watermode">
<image src="../../static/water.png" mode=""></image>
</view>
</view>
<view class="bota" v-show="!watermode">
<view class="back" @click="watermode=!watermode">返回</view>
<view class="watera" @click="draw(1)">
<view class="ti">
19:23:45
</view>
<view class="ad">
2023-10-21 星期六 选择地点
</view>
</view>
</view>
<!-- 水印1 -->
<cover-view class="cameraa">
<cover-view class="hour">{{nowTimes}}</cover-view>
<cover-view @click="getLocation" class="time">{{nowTime}} {{addRess?addRess:'选择地点'}}</cover-view>
</cover-view>
<!-- 画水印 -->
<!-- canvas元素,利用它的功能,实现添加水印style="position: absolute;top: -999999px;" -->
<view style="position: absolute;top: -999999px;">
<view>
<canvas :style="{ width: w, height: h }" canvas-id="firstCanvas"></canvas>
</view>
</view>
</view>
<view class="photograph" v-show="isshow==false">
<!-- 图片预览 :style="{ 'height': imgheight + 'px'}" :style="{ 'height': h + 'px','width': w +'px'}"-->
<view class="look">
<view class="one" :style="{ 'height': imgheight + 'px'}">
<image style="height: 100%; width: 100%;" :src="imageSrc? imageSrc:''" mode=""></image>
</view>
<view class="two">
<view class="btn" @click="showPic">
<image src="../../static/camera.png" mode=""></image>
</view>
<view class="down" @click="downImg">
<image src="../../static/down.png" mode=""></image>
</view>
<view class="btn" @click="upload">
<image src="../../static/waterup.png" mode=""></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isshow: true,
allhight: 0,
Height: 0, //页面高度
imgheight: 0,
flash: 'off', //闪光 默认off 打开on 自动auto
num: 0, //闪光灯
position: 'back', //前置后置 默认后置false 前置true
pos: false, //前置后置
imageSrc: '', //图片路径
qualityChange: 'hight', //图像质量 high 高质量成像、 normal 普通质量、row 低质量
time: false, //倒计时
w: '', // canvas 元素宽度
h: '', // canvas 元素高度
watermode: true, //拍照按钮模块显示
nowTime: '', //时间
nowTimes: '',
addRess: '', //地址
txtName: '', //名字
txtMain: '', //备注内容
waterdraw: 1,
}
},
mounted() {
// 注意,这里要用个变量存this,不然进到getSystemInfo后this指向会变化,找不到data变量
var _this = this
uni.getSystemInfo({
success: function(res) {
//console.log(res.screenHeight); // 屏幕高度,包含导航栏
//console.log(res.windowHeight); // 能够使用的窗口高度,不包含导航栏
//console.log(res.screenWidth); // 屏幕宽度
//console.log(res.windowWidth); // 能够使用31口宽度
_this.Height = res.windowHeight - 280;
_this.allhight = res.windowHeight
_this.imgheight = res.windowHeight - 220;
_this.imgWidth =res.windowWidth
}
});
// 获取当前日期时间
this.getTime();
},
methods: {
takePhotoAction() {
var that = this
if (that.time == false) {
that.takePhoto()
} else if (that.time == true) {
setTimeout(() => {
that.takePhoto()
}, 5000);
}
},
takePhoto: function() { //拍照
var that = this;
const camera = uni.createCameraContext() //创建照相机对象
camera.takePhoto({ //实现拍照功能
quality: 'high', //high 高质量成像、 normal 普通质量、row 低质量
zoom: [1, 5], //缩放
success: (res) => {
console.log('拍照成功', res.tempImagePath)
that.imageSrc = res.tempImagePath //原图
that.takeCanvas(res.tempImagePath) //画图
}
})
},
takeAlbum() {
var that = this
uni.chooseImage({
count: 1,
success: (res) => {
var file = res.tempFilePaths[0];
const tempFiles = res.tempFiles[0];
setTimeout(() => { //必须加个延迟
that.takeCanvas(file)
}, 1000);
}
})
},
takeCanvas(imginfo) {
console.log(imginfo)
var that = this
// 获取图片信息
uni.getImageInfo({
src: imginfo,
success: ress => {
that.w = ress.width / 3 + 'px'; // 设置 canvas 元素宽度
that.h = ress.height / 3.01 + 'px'; // 设置 canvas 元素高度
console.log(that.w, that.h)
let ctx = uni.createCanvasContext('firstCanvas'); /** 创建画布 */
//将图片绘制到cancas内
ctx.drawImage(imginfo, 0, 0, ress.width/3, ress
.height/3);
ctx.setFontSize(14); // 设置字体大小为 10px
ctx.setFillStyle('#FFFFFF'); // 设置颜色为白色#FFFFFF
ctx.setTextAlign("center")
let textToWidth = (ress.width / 3) * 0.5; // 绘制文本的左上角x坐标位置
let textToWidth2 = (ress.width / 3) * 0.3; // 绘制文本的左上角x坐标位置
let textToHeight1 = (ress.height / 3) * 0.82; // 绘制文本的左上角y坐标位置
let textToHeight2 = (ress.height / 3) * 0.90;
let textToHeight3 = (ress.height / 3) * 0.94;
let textToHeight4 = (ress.height / 3) * 0.98;
//绘制的模板1
if (that.waterdraw == 1) {
// 绘制日期和时间
ctx.setFontSize(20); // 设置字体大小为 10px
ctx.fillText(that.nowTimes,textToWidth, textToHeight1);
ctx.setFontSize(14);
ctx.fillText(that.nowTime + ' ' + that.addRess,
textToWidth, textToHeight2);
}
// 绘制完成后,在下一个事件循环将 canvas 内容导出为临时图片地址
ctx.draw(false, () => {
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'firstCanvas',
success: res1 => {
that.imageSrc = res1.tempFilePath
that.isshow = false
},
fail: (err) => {
console.log('导出图片失败', err)
}
});
}, 1000);
});
}
});
},
takeFlash() { //闪光灯
this.num++
if (this.num == 0) {
this.flash = "off"
} else if (this.num == 1) {
this.flash = "on"
} else if (this.num == 2) {
this.flash = "auto"
this.num = 0
}
},
devicePosition() { //前置后置
if (this.pos == false) {
this.position = "front"
this.pos = true
} else if (this.pos == true) {
this.position = "back"
this.pos = false
}
},
countDown() { //倒计时
this.time = !this.time
},
showPic() { //预览图片
this.isshow = !this.isshow
},
// 获取当天是周几
getWeekday() {
const weekdays = ['', '', '', '', '', '', ''];
const d = new Date();
const weekday = weekdays[d.getDay()];
return weekday;
},
getTime: function() { //获取当前时间
var date = new Date(),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
month >= 1 && month <= 9 ? (month = "0" + month) : "";
day >= 0 && day <= 9 ? (day = "0" + day) : "";
var timer = year + '-' + month + '-' + day;
var timers = hour + ':' + minute + ':' + second;
// 调用方法获取当天是周几
const todayWeekday = this.getWeekday();
//console.log('今天是周' + todayWeekday);
this.nowTimes = timers
this.nowTime = timer + ' ' + '星期' + todayWeekday;
},
getLocation() { //获取位置
var that = this
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
// that.addRess = res.address + ' ' + res.name //详细地址
that.addRess = res.name
}
});
},
downImg() { //保存到相册
var that = this
uni.saveImageToPhotosAlbum({
filePath: that.imageSrc,
success: function() {
uni.showToast({
title: "保存成功",
icon: "none"
});
},
fail: function(err) {
uni.showToast({
title: "保存失败,请稍后重试",
icon: "none"
});
console.log(err)
},
})
},
draw(wa) { //选择的水印模板
this.waterdraw = wa
this.watermode = !this.watermode
},
}
}
</script>
<style>
.content {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
/* 头部 */
.mode {
width: 750upx;
height: 140upx;
display: flex;
background-color: #161616;
}
.mode>.one {
width: 120upx;
height: 140upx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.mode>.one>image {
width: 70upx;
height: 70upx;
}
.mode>.one>text {
width: 120upx;
height: 30upx;
line-height: 30upx;
text-align: center;
font-size: 22upx;
color: #ffffff;
}
/* 相机 */
.photo {
width: 750upx;
}
.photo>camera {
width: 750upx;
height: 700upx;
position: relative;
}
/* 拍照按钮模块区1 */
.bot {
width: 750upx;
height: 460upx;
background-color: #161616;
position: absolute;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
}
.bot>.left {
width: 90upx;
height: 90upx;
border-radius: 50%;
border: 3upx solid #ffffff;
}
.bot>.left>image {
width: 90upx;
height: 90upx;
border-radius: 50%;
}
.bot>.center {
width: 130upx;
height: 130upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.bot>.center>image {
width: 80upx;
height: 80upx;
}
.bot>.center:active {
transform: scale(1.2);
}
.bot>.right {
width: 90upx;
height: 90upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.bot>.right>image {
width: 50upx;
height: 50upx;
}
/* 拍照按钮模块区2 水印 */
.bota {
width: 750upx;
height: 460upx;
position: absolute;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
background-color: #161616;
}
.bota>.back {
width: 750upx;
height: 60upx;
line-height: 60upx;
color: #ffffff;
}
.bota>.watera {
width: 300upx;
height: 350upx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 10upx;
background-color: #d9cdf3;
color: #ffffff;
}
.bota>.watera>.ti {
width: 300upx;
height: 60upx;
line-height: 60upx;
font-size: 38upx;
text-align: center;
}
.bota>.watera>.ad {
width: 300upx;
height: 60upx;
line-height: 60upx;
font-size: 28upx;
text-align: center;
overflow-x: hidden;
}
/* 水印1显示 */
.cameraa {
width: 690upx;
height: 120upx;
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
color: #ffffff;
z-index: 200;
position: absolute;
left: 30upx;
bottom: 560upx;
font-size: 28upx;
}
.hour {
width: 690upx;
height: 60upx;
line-height: 60upx;
font-size: 38upx;
}
/* 图片预览/下载 */
.look {
width: 750upx;
height: 1000upx;
}
.look>.one {
width: 750upx;
height: 800upx;
display: flex;
justify-content: center;
align-items: center;
}
.look>.one>image {
width: 750upx;
height: 800upx;
}
.look>.two {
width: 750upx;
height: 460upx;
display: flex;
justify-content: space-around;
align-items: center;
background-color: #161616;
}
.look>.two>.btn {
width: 100upx;
height: 100upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.look>.two>.btn>image {
width: 60upx;
height: 60upx;
}
.look>.two>.down {
width: 120upx;
height: 120upx;
border-radius: 50%;
border: 3upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.look>.two>.down>image {
width: 60upx;
height: 60upx;
}
</style>
\ No newline at end of file
# watermark-camera
# 在使用 getLocation 方法前需要先在 manifest.json 中配置相应的权限,以授权应用程序获取用户位置信息。
\ No newline at end of file
'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
const collection = db.collection('tableImages') // 云数据库里的表名 ,记录上传图片到云存储后返回的fileID
const res = await collection.add(event) // event为客户端上传的参数
return res
};
{
"name": "up-images",
"dependencies": {},
"extensions": {
"uni-cloud-jql": {}
}
}
\ No newline at end of file
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