调整绘制背景图

This commit is contained in:
唐明明
2021-09-29 16:56:29 +08:00
4 changed files with 46 additions and 32 deletions

View File

@@ -9,8 +9,8 @@ import store from '@/store'
// 基础配置 // 基础配置
const config = { const config = {
apiUrl : 'https://oapi.lianshang.vip/api/', apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
apiUrls : 'https://oapi.lianshang.vip/', apiUrls : 'http://api.ahxh.shangkelian.cn/',
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
// apiUrls : 'http://api.ahxh.shangkelian.cn/', // apiUrls : 'http://api.ahxh.shangkelian.cn/',
timeout : 60000 timeout : 60000

View File

@@ -0,0 +1,18 @@
export default function h5Copy(content) {
if (!document.queryCommandSupported('copy')) {
// 不支持
return false
}
let textarea = document.createElement("textarea")
textarea.value = content
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select() // 选择对象
textarea.setSelectionRange(0, content.length) //核心
let result = document.execCommand("copy") // 执行浏览器复制命令
textarea.remove()
return result
}

View File

@@ -60,6 +60,7 @@
import { userInvite } from '@/apis/interfaces/user' import { userInvite } from '@/apis/interfaces/user'
import { saveImageToPhotosAlbum, showToast, downloadFile } from '@/uni_modules/sakura-canvas/js_sdk/util' import { saveImageToPhotosAlbum, showToast, downloadFile } from '@/uni_modules/sakura-canvas/js_sdk/util'
import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw' import Draw from '@/uni_modules/sakura-canvas/js_sdk/draw'
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
let draw = null let draw = null
export default { export default {
data() { data() {
@@ -270,20 +271,17 @@
// 复制邀请码 // 复制邀请码
copyCenter(e) { copyCenter(e) {
let copyNo = e let copyNo = e
uni.vibrateShort({ const result = h5Copy(copyNo)
success: () => { if (result === false) {
uni.setClipboardData({
data : copyNo,
success : res=> {
uni.showToast({ uni.showToast({
title : '复制成功', title:'不支持',
icon :'none', })
duration: 3000 } else {
}); uni.showToast({
} title:'复制成功',
icon:'none'
}) })
} }
})
}, },
// 切换海报背景index // 切换海报背景index

View File

@@ -28,7 +28,7 @@
<!-- 消息列表弹出 end --> <!-- 消息列表弹出 end -->
<!-- 用户信息 start --> <!-- 用户信息 start -->
<view class="fileTool" :class="{ bigTool: scroll > 200 }"> <!-- <view class="fileTool" :class="{ bigTool: scroll > 200 }">
<view class="user-portrait"> <view class="user-portrait">
<image class="user-portrait-head" :src="userData.avatar ? userData.avatar : '/static/user/user-portrait.png'" mode="aspectFill"></image> <image class="user-portrait-head" :src="userData.avatar ? userData.avatar : '/static/user/user-portrait.png'" mode="aspectFill"></image>
</view> </view>
@@ -39,7 +39,7 @@
<image class="user-tool-icon" src="/static/user/user-top-00.png" mode="aspectFill" @click="$Router.push({name: 'setting'})"></image> <image class="user-tool-icon" src="/static/user/user-top-00.png" mode="aspectFill" @click="$Router.push({name: 'setting'})"></image>
<image class="user-tool-icon" src="/static/user/user-top-01.png" mode="aspectFill" @click="$Router.push({name: 'news'})"></image> <image class="user-tool-icon" src="/static/user/user-top-01.png" mode="aspectFill" @click="$Router.push({name: 'news'})"></image>
</view> </view>
</view> </view> -->
<view class="user-top" :class="[scroll > 0 ? 'bigTop' : 'refurnTop']"> <view class="user-top" :class="[scroll > 0 ? 'bigTop' : 'refurnTop']">
<!-- <image class="user-back" :class="[scroll > 0 ? 'bigSize' : 'refurnSize']" src="../../static/img/user-back.png" mode="aspectFill"></image> --> <!-- <image class="user-back" :class="[scroll > 0 ? 'bigSize' : 'refurnSize']" src="../../static/img/user-back.png" mode="aspectFill"></image> -->
<view class="user-tool"> <view class="user-tool">
@@ -252,6 +252,7 @@
<script> <script>
import { userIndex, userNotice, userCustomer } from '@/apis/interfaces/user' import { userIndex, userNotice, userCustomer } from '@/apis/interfaces/user'
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
export default { export default {
data() { data() {
return { return {
@@ -355,20 +356,17 @@
// 复制邀请码 // 复制邀请码
copyCenter(e) { copyCenter(e) {
let copyNo = e let copyNo = e
uni.vibrateShort({ const result = h5Copy(copyNo)
success: () => { if (result === false) {
uni.setClipboardData({
data : copyNo,
success : res=> {
uni.showToast({ uni.showToast({
title : '复制成功', title:'不支持',
icon :'none', })
duration: 3000 } else {
}); uni.showToast({
} title:'复制成功',
icon:'none'
}) })
} }
})
}, },
// 友情提示信息 // 友情提示信息