邀请码页面绘制
This commit is contained in:
@@ -9,11 +9,11 @@ import store from '@/store'
|
||||
|
||||
// 基础配置
|
||||
const config = {
|
||||
apiUrl : 'https://oapi.lianshang.vip/api/',
|
||||
apiUrls : 'https://oapi.lianshang.vip/',
|
||||
// apiUrl : 'https://oapi.lianshang.vip/api/',
|
||||
// apiUrls : 'https://oapi.lianshang.vip/',
|
||||
|
||||
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
|
||||
// apiUrls : 'http://api.ahxh.shangkelian.cn/',
|
||||
apiUrl : 'http://api.ahxh.shangkelian.cn/api/',
|
||||
apiUrls : 'http://api.ahxh.shangkelian.cn/',
|
||||
timeout : 60000
|
||||
}
|
||||
|
||||
|
||||
18
js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js
Normal file
18
js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js
Normal 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
|
||||
|
||||
}
|
||||
@@ -60,6 +60,7 @@
|
||||
import { userInvite } from '@/apis/interfaces/user'
|
||||
import { saveImageToPhotosAlbum, showToast, downloadFile } from '@/uni_modules/sakura-canvas/js_sdk/util'
|
||||
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
|
||||
export default {
|
||||
data() {
|
||||
@@ -96,7 +97,7 @@
|
||||
async coverCode(){
|
||||
// let { img, title, price, head, tips } = this
|
||||
let img = this.inviteData[this.codeIndex].code
|
||||
let back = this.defaultImg
|
||||
let back = this.inviteData[this.codeIndex].cover
|
||||
let name = this.inviteData[this.codeIndex].user_info.nickname
|
||||
let invite = this.inviteData[this.codeIndex].invite
|
||||
let avatar = this.inviteData[this.codeIndex].user_info.avatar || '/static/user/user-portrait.png'
|
||||
@@ -270,20 +271,17 @@
|
||||
// 复制邀请码
|
||||
copyCenter(e) {
|
||||
let copyNo = e
|
||||
uni.vibrateShort({
|
||||
success: () => {
|
||||
uni.setClipboardData({
|
||||
data : copyNo,
|
||||
success : res=> {
|
||||
const result = h5Copy(copyNo)
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title:'不支持',
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:'复制成功',
|
||||
icon :'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 切换海报背景index
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<!-- 消息列表弹出 end -->
|
||||
|
||||
<!-- 用户信息 start -->
|
||||
<view class="fileTool" :class="{ bigTool: scroll > 200 }">
|
||||
<!-- <view class="fileTool" :class="{ bigTool: scroll > 200 }">
|
||||
<view class="user-portrait">
|
||||
<image class="user-portrait-head" :src="userData.avatar ? userData.avatar : '/static/user/user-portrait.png'" mode="aspectFill"></image>
|
||||
</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-01.png" mode="aspectFill" @click="$Router.push({name: 'news'})"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<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> -->
|
||||
<view class="user-tool">
|
||||
@@ -252,6 +252,7 @@
|
||||
|
||||
<script>
|
||||
import { userIndex, userNotice, userCustomer } from '@/apis/interfaces/user'
|
||||
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -355,20 +356,17 @@
|
||||
// 复制邀请码
|
||||
copyCenter(e) {
|
||||
let copyNo = e
|
||||
uni.vibrateShort({
|
||||
success: () => {
|
||||
uni.setClipboardData({
|
||||
data : copyNo,
|
||||
success : res=> {
|
||||
const result = h5Copy(copyNo)
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title:'不支持',
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:'复制成功',
|
||||
icon :'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 友情提示信息
|
||||
|
||||
Reference in New Issue
Block a user