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