邀请码页面绘制
This commit is contained in:
@@ -9,11 +9,11 @@ import store from '@/store'
|
|||||||
|
|
||||||
// 基础配置
|
// 基础配置
|
||||||
const config = {
|
const config = {
|
||||||
apiUrl : 'https://oapi.lianshang.vip/api/',
|
// apiUrl : 'https://oapi.lianshang.vip/api/',
|
||||||
apiUrls : 'https://oapi.lianshang.vip/',
|
// apiUrls : 'https://oapi.lianshang.vip/',
|
||||||
|
|
||||||
// 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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 { 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() {
|
||||||
@@ -96,7 +97,7 @@
|
|||||||
async coverCode(){
|
async coverCode(){
|
||||||
// let { img, title, price, head, tips } = this
|
// let { img, title, price, head, tips } = this
|
||||||
let img = this.inviteData[this.codeIndex].code
|
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 name = this.inviteData[this.codeIndex].user_info.nickname
|
||||||
let invite = this.inviteData[this.codeIndex].invite
|
let invite = this.inviteData[this.codeIndex].invite
|
||||||
let avatar = this.inviteData[this.codeIndex].user_info.avatar || '/static/user/user-portrait.png'
|
let avatar = this.inviteData[this.codeIndex].user_info.avatar || '/static/user/user-portrait.png'
|
||||||
@@ -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({
|
uni.showToast({
|
||||||
data : copyNo,
|
title:'不支持',
|
||||||
success : res=> {
|
})
|
||||||
uni.showToast({
|
} else {
|
||||||
title : '复制成功',
|
uni.showToast({
|
||||||
icon :'none',
|
title:'复制成功',
|
||||||
duration: 3000
|
icon:'none'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换海报背景index
|
// 切换海报背景index
|
||||||
|
|||||||
@@ -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({
|
uni.showToast({
|
||||||
data : copyNo,
|
title:'不支持',
|
||||||
success : res=> {
|
})
|
||||||
uni.showToast({
|
} else {
|
||||||
title : '复制成功',
|
uni.showToast({
|
||||||
icon :'none',
|
title:'复制成功',
|
||||||
duration: 3000
|
icon:'none'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 友情提示信息
|
// 友情提示信息
|
||||||
|
|||||||
Reference in New Issue
Block a user