21 changed files with 733 additions and 514 deletions
@ -1,85 +1,120 @@ |
|||
<script> |
|||
import api from '@/utils/api' |
|||
export default { |
|||
// computed: { |
|||
// i18n() { |
|||
// return this.$t('index') |
|||
// }, |
|||
// }, |
|||
onLaunch: function () { |
|||
console.log('App Launch') |
|||
api.indexInfo().then(res => { |
|||
uni.setStorageSync('coinTypeInfo',res) |
|||
}) |
|||
}, |
|||
onShow: function () { |
|||
export default { |
|||
// computed: { |
|||
// i18n() { |
|||
// return this.$t('index') |
|||
// }, |
|||
// }, |
|||
onLaunch: function() { |
|||
console.log('App Launch') |
|||
this.appVersion() |
|||
api.indexInfo().then(res => { |
|||
uni.setStorageSync('coinTypeInfo', res) |
|||
}) |
|||
}, |
|||
onShow: function() { |
|||
|
|||
console.log('App Show') |
|||
}, |
|||
onHide: function() { |
|||
console.log('App Hide') |
|||
}, |
|||
methods: { |
|||
// 校验APP应用版本 |
|||
async appVersion() { |
|||
let param = { |
|||
'appId': uni.getSystemInfoSync().platform |
|||
} |
|||
console.log('ss' + JSON.stringify(uni.getSystemInfoSync())) |
|||
const response = await this.$api.appVersion(param) |
|||
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { |
|||
console.log('当前版本号' + wgtinfo.versionCode) |
|||
console.log((wgtinfo.versionCode < response.versionCode)) |
|||
console.log(wgtinfo.versionCode, response.versionCode) |
|||
if (wgtinfo.versionCode < response.versionCode) { |
|||
console.log('更新了吗') |
|||
let that = this; |
|||
uni.showModal({ |
|||
title: this.$t("login").Versionupdate, |
|||
content: response.info, |
|||
showCancel: false, |
|||
success: function(res) { |
|||
if (res.confirm) { |
|||
plus.runtime.openURL(response.appUrl); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
console.log('App Show') |
|||
}, |
|||
onHide: function () { |
|||
console.log('App Hide') |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
/*每个页面公共css */ |
|||
@import "uview-ui/index.scss"; |
|||
/*每个页面公共css */ |
|||
@import "uview-ui/index.scss"; |
|||
.main .body{ |
|||
margin-top: 100rpx !important; |
|||
} |
|||
/deep/ .u-loadmore__content__text { |
|||
line-height: 50rpx !important; |
|||
} |
|||
/deep/body { |
|||
// max-width: 828rpx; //最大宽度自己可以调整 |
|||
// margin: auto !important; |
|||
|
|||
background-color: #15141F; |
|||
height: auto; |
|||
margin: 0; |
|||
} |
|||
/deep/body { |
|||
// max-width: 828rpx; //最大宽度自己可以调整 |
|||
// margin: auto !important; |
|||
|
|||
/deep/ .u-empty{ |
|||
position: absolute; |
|||
top: 150%; |
|||
left: 50%; |
|||
transform: translateX(-50%); |
|||
} |
|||
background-color: #15141F; |
|||
height: auto; |
|||
margin: 0; |
|||
} |
|||
|
|||
/deep/ .u-empty { |
|||
position: absolute; |
|||
top: 50%; |
|||
left: 50%; |
|||
transform: translate(-50%, -50%); |
|||
} |
|||
|
|||
page { |
|||
color: #fff; |
|||
} |
|||
page { |
|||
color: #fff; |
|||
min-height: 100vh; |
|||
} |
|||
|
|||
button::after { |
|||
border: none; |
|||
} |
|||
button::after { |
|||
border: none; |
|||
} |
|||
|
|||
uni-tabbar { |
|||
.uni-tabbar { |
|||
// tab背景 |
|||
padding-top: 28rpx; |
|||
padding-bottom: 30rpx !important; |
|||
background-image: linear-gradient(to top, #FAF8F8, #FFFFFF) !important; // tab背景图片或者渐变色,背景色和背景图片最多选择一个进行设置 |
|||
uni-tabbar { |
|||
.uni-tabbar { |
|||
// tab背景 |
|||
padding-top: 28rpx; |
|||
padding-bottom: 30rpx !important; |
|||
background-image: linear-gradient(to top, #FAF8F8, #FFFFFF) !important; // tab背景图片或者渐变色,背景色和背景图片最多选择一个进行设置 |
|||
|
|||
.uni-tabbar-border { |
|||
// tabBar上边框 |
|||
background-color: #F7F4F4 !important; // tabBar上边框的颜色 |
|||
} |
|||
.uni-tabbar-border { |
|||
// tabBar上边框 |
|||
background-color: #F7F4F4 !important; // tabBar上边框的颜色 |
|||
} |
|||
|
|||
.uni-tabbar__bd { |
|||
.uni-tabbar__bd { |
|||
|
|||
// tabBar单项 |
|||
.uni-tabbar__icon { |
|||
// 图标 |
|||
width: 48rpx !important; |
|||
height: 48rpx !important; |
|||
} |
|||
// tabBar单项 |
|||
.uni-tabbar__icon { |
|||
// 图标 |
|||
width: 48rpx !important; |
|||
height: 48rpx !important; |
|||
} |
|||
|
|||
.uni-tabbar__label { |
|||
// 文字 |
|||
font-size: 20rpx !important; |
|||
.uni-tabbar__label { |
|||
// 文字 |
|||
font-size: 20rpx !important; |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
|
@ -1,121 +1,196 @@ |
|||
<template> |
|||
<view class="main"> |
|||
<!-- nav --> |
|||
<navigation>{{ i18n.InviteFriends }}</navigation> |
|||
<view class="body"> |
|||
<view class="shareText">{{ i18n.ShareWithFriends }}</view> |
|||
<view class="scanText">{{ i18n.ScanTheCode }}</view> |
|||
<!-- 二维码 --> |
|||
<view class="QRCode"> |
|||
<u-image class="QRCodeImg" src="../../static/me/QR-code.png" width="400rpx" height="400rpx"></u-image> |
|||
</view> |
|||
<view class="myIdText">{{ i18n.MyReferralID }}{{referralID}}</view> |
|||
<!-- 按钮 --> |
|||
<u-button class="button" color="#00E8A2" throttleTime="500" @click="copyId(referralID)">{{ |
|||
<view class="main"> |
|||
<!-- nav --> |
|||
<navigation>{{ i18n.InviteFriends }}</navigation> |
|||
<view class="body"> |
|||
<view class="shareText">{{ i18n.ShareWithFriends }}</view> |
|||
<!-- <view class="scanText">{{ i18n.ScanTheCode }}</view> --> |
|||
|
|||
<!-- 二维码 --> |
|||
<view class="QRCode"> |
|||
<u-image class="QRCodeImg" :src="qr" width="400rpx" height="400rpx"> |
|||
</u-image> |
|||
</view> |
|||
<!-- <view class="myIdText">{{ i18n.MyReferralID }}{{inviteRules.invitationCode}}</view> --> |
|||
<!-- 按钮 --> |
|||
<!-- <u-button class="button" color="#00E8A2" throttleTime="500" @click="copyId(referralID)">{{ |
|||
i18n.CopyID |
|||
}} |
|||
</u-button> |
|||
</u-button> --> |
|||
<view class="copy"> |
|||
<view class="item"> |
|||
{{link}} |
|||
</view> |
|||
<view class="btn" @click="copyId(link)"> |
|||
{{ i18n.CopyLink}} |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="copy"> |
|||
<view class="item2"> |
|||
{{ i18n.MyReferralID }}{{this.inviteRules.invitationCode}} |
|||
</view> |
|||
<view class="btn" @click="copyId(inviteRules.invitationCode)"> |
|||
{{ i18n.CopyID}} |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
<view class="title" style="color: #94939B;"> |
|||
{{ i18n.TIPS}} |
|||
</view> |
|||
<view class="scanText" v-html="inviteRules.invitationRules"></view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import uniCopy from '@/utils/uni-copy' |
|||
export default { |
|||
name: "inviteFriends", |
|||
data() { |
|||
return { |
|||
referralID: 857222, |
|||
}; |
|||
}, |
|||
computed: { |
|||
i18n() { |
|||
return this.$t("me"); |
|||
}, |
|||
}, |
|||
onLoad() { |
|||
}, |
|||
onShow() { }, |
|||
methods: { |
|||
copyId(value = "") { |
|||
// console.log(value) |
|||
uniCopy({ |
|||
content: value, |
|||
success: (res) => { |
|||
uni.showToast({ |
|||
title: "复制成功", |
|||
duration: 3000, |
|||
}) |
|||
}, |
|||
error: (e) => { |
|||
uni.showToast({ |
|||
title: e, |
|||
icon: 'none', |
|||
duration: 2000, |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
} |
|||
import uniCopy from '@/utils/uni-copy' |
|||
import api from '@/utils/api' |
|||
import constant from '@/utils/constant.js'; |
|||
import QR from '@/utils/qrCode/wxqrcode.js' |
|||
export default { |
|||
name: "inviteFriends", |
|||
data() { |
|||
return { |
|||
// 邀请链接 |
|||
link:'', |
|||
qr: null, |
|||
referralID: 857222, |
|||
inviteRules: {}, |
|||
}; |
|||
}, |
|||
computed: { |
|||
i18n() { |
|||
return this.$t("me"); |
|||
}, |
|||
}, |
|||
onLoad() { |
|||
this.invitation() |
|||
}, |
|||
onShow() {}, |
|||
methods: { |
|||
//获取邀请规则文案 |
|||
invitation() { |
|||
api.invitation().then(res => { |
|||
this.inviteRules = res |
|||
this.link = this.inviteRules.generateQRCodeUrl + this.inviteRules.invitLink |
|||
// let baseURL = constant.BASE_URL |
|||
// e=e.replace('h5Path',baseURL) |
|||
this.qr = QR.createQrCodeImg(this.link) |
|||
}) |
|||
}, |
|||
copyId(e) { |
|||
// console.log(value) |
|||
uniCopy({ |
|||
content: e, |
|||
success: (res) => { |
|||
uni.showToast({ |
|||
title: this.$t("login").copySuccess, |
|||
duration: 3000, |
|||
}) |
|||
}, |
|||
error: (e) => { |
|||
uni.showToast({ |
|||
title: e, |
|||
icon: 'none', |
|||
duration: 2000, |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.main { |
|||
|
|||
.body { |
|||
overflow: hidden; |
|||
margin-top: 200rpx; |
|||
padding: 0 48rpx; |
|||
|
|||
.shareText { |
|||
margin-top: 104rpx; |
|||
font-size: 60rpx; |
|||
font-weight: 800; |
|||
text-align: center; |
|||
} |
|||
|
|||
.scanText { |
|||
font-size: 32rpx; |
|||
text-align: center; |
|||
color: #A2A0A8; |
|||
} |
|||
|
|||
.QRCode { |
|||
box-sizing: border-box; |
|||
margin: 66rpx auto; |
|||
width: 520rpx; |
|||
height: 520rpx; |
|||
background-image: url(../../static/me/bg_QR_code.png); |
|||
background-repeat: no-repeat; |
|||
background-size: 520rpx; |
|||
padding: 52rpx; |
|||
|
|||
.QRCodeImg { |
|||
margin-left: 8rpx; |
|||
} |
|||
} |
|||
|
|||
.myIdText { |
|||
font-size: 48rpx; |
|||
font-weight: 800; |
|||
text-align: center; |
|||
} |
|||
|
|||
.button { |
|||
height: 112rpx; |
|||
margin: 72rpx 0; |
|||
border-radius: 32rpx; |
|||
color: #15141F !important; |
|||
font-weight: 700; |
|||
font-size: 32rpx; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
.copy { |
|||
margin-bottom: 60rpx; |
|||
background: #323045; |
|||
border-radius: 32rpx; |
|||
line-height: 60rpx; |
|||
padding: 32rpx; |
|||
position: relative; |
|||
|
|||
.item { |
|||
overflow: hidden; |
|||
white-space: nowrap; |
|||
text-overflow: ellipsis; |
|||
width: 450rpx; |
|||
} |
|||
|
|||
.btn { |
|||
position: absolute; |
|||
right: 0; |
|||
top: 0; |
|||
line-height: 60rpx; |
|||
height: 100%; |
|||
background: #00E8A2; |
|||
border-radius: 0px 32rpx 32rpx 0px; |
|||
width: 162rpx; |
|||
font-weight: 600; |
|||
font-size: 28rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
color: #15141F; |
|||
justify-content: center; |
|||
} |
|||
} |
|||
|
|||
.main { |
|||
|
|||
.body { |
|||
overflow: hidden; |
|||
margin-top: 200rpx; |
|||
padding: 0 48rpx; |
|||
padding-bottom: 45rpx; |
|||
|
|||
.shareText { |
|||
margin-top: 104rpx; |
|||
font-size: 60rpx; |
|||
font-weight: 800; |
|||
text-align: center; |
|||
} |
|||
|
|||
.scanText { |
|||
font-size: 32rpx; |
|||
text-align: center; |
|||
color: #A2A0A8; |
|||
word-break: break-all; |
|||
} |
|||
|
|||
.QRCode { |
|||
box-sizing: border-box; |
|||
margin: 66rpx auto; |
|||
width: 520rpx; |
|||
height: 520rpx; |
|||
background-image: url(../../static/me/bg_QR_code.png); |
|||
background-repeat: no-repeat; |
|||
background-size: 520rpx; |
|||
padding: 52rpx; |
|||
|
|||
.QRCodeImg { |
|||
margin-left: 8rpx; |
|||
} |
|||
} |
|||
|
|||
.myIdText { |
|||
font-size: 48rpx; |
|||
font-weight: 800; |
|||
text-align: center; |
|||
} |
|||
|
|||
.button { |
|||
height: 112rpx; |
|||
margin: 72rpx 0; |
|||
border-radius: 32rpx; |
|||
color: #15141F !important; |
|||
font-weight: 700; |
|||
font-size: 32rpx; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue