| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <view class="flex-common-css iPhone-bottom box-border-box">
- <Nav title="实习岗位" leftColor="#fff" bgckgroundBox='transparent' titleColor="#fff"></Nav>
- <image class="bg" src="@/static/img/index/sxgw.png" mode=""></image>
- <image class="code-img" :src="codeImg" mode="aspectFit"></image>
- <image @click="saveImg" class="but-img" src="@/static/img/index/bcdxc.png" mode=""></image>
- </view>
- </template>
- <script>
- import {
- commonPracticeCode
- } from "@/api/common.js"
- export default {
- components: {},
- data() {
- return {
- codeImg: ''
- };
- },
- onLoad(data) {},
- mounted() {
- this.commonPracticeCode()
- },
- methods: {
- commonPracticeCode() {
- commonPracticeCode().then((res) => {
- if (res.code == 1) {
- this.codeImg = res.data.url
- }
- })
- },
- scrolltolower() {
- console.log('触底');
- },
- saveImg() {
- uni.downloadFile({
- url: this.codeImg,
- success: downloadResult => {
- if (downloadResult.statusCode === 200) {
- // 下载成功,保存图片到系统相册
- uni.saveImageToPhotosAlbum({
- filePath: downloadResult.tempFilePath,
- success: () => {
- uni.showToast({
- title: '图片保存成功'
- });
- },
- fail: () => {
- uni.showToast({
- title: '图片保存失败',
- icon: 'none'
- });
- }
- });
- } else {
- uni.showToast({
- title: '图片下载失败',
- icon: 'none'
- });
- }
- },
- fail: () => {
- uni.showToast({
- title: '图片下载失败',
- icon: 'none'
- });
- }
- });
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .bg {
- width: 100%;
- height: 100vh;
- position: fixed;
- left: 0;
- top: 0;
- }
- .but-img {
- width: 670rpx;
- height: 88rpx;
- position: absolute;
- bottom: 56rpx;
- left: 40rpx;
- }
- .code-img {
- width: 340rpx;
- height: 340rpx;
- position: absolute;
- top: calc(50vh - (340rpx / 2));
- left: 204rpx;
- border-radius: 20rpx;
- }
- </style>
|