123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <view class="page">
- <view class="topBody">
- <view class="header">
- </view>
- <view class="myinfo">
- <image class="img" :src="myinfo.share_img0" mode="widthFix"></image>
- <view style="margin-top: 24rpx;" class="numlist">
- <view class="num" @click="shareImg">
- <view class="img2">
- <image src="../../static/icon/share_wx.png" mode="widthFix"></image>
- </view>
- <view class="name">分享</view>
- </view>
- <view class="num" @click="saveImg">
- <view class="img2">
- <image src="../../static/icon/share_down.png" mode="widthFix"></image>
- </view>
- <view class="name">保存</view>
- </view>
- </view>
- </view>
- <view class="blankHeight"></view>
- </view>
- <DialogBox ref="DialogBox"></DialogBox>
- </view>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- title: '',
- sel: 1,
- nodata: true,
- myinfo: {},
- list: [],
- }
- },
- onLoad() {
- // setTimeout(function() {
- // uni.setNavigationBarColor({
- // frontColor: '#ffffff',
- // backgroundColor: '#00000000',
- // animation: {
- // duration: 400,
- // timingFunc: 'easeIn'
- // }
- // })
- // }, 200);
- this.loadInfo();
- },
- onShow() {},
- methods: {
- onBack() {},
- chkSel() {
- if (this.sel == 1) {
- this.sel = 0;
- } else {
- this.sel = 1;
- }
- },
- loadInfo() {
- console.log({
- uuid: getApp().globalData.uuid,
- skey: getApp().globalData.skey
- });
- uni.request({
- url: this.$apiHost + '/Web/getinfo',
- data: {
- uuid: getApp().globalData.uuid,
- type: 'tuan'
- },
- header: {
- "content-type": "application/json",
- 'sign': getApp().globalData.headerSign
- },
- success: (res) => {
- console.log("----:", res.data);
- this.myinfo = res.data;
- },
- complete: (com) => {
- // uni.hideLoading();
- },
- fail: (e) => {
- console.log("----e:", e);
- }
- });
- },
- shareImg() {
- let that = this;
- uni.share({
- provider: "weixin",
- scene: "WXSceneSession",
- type: 2,
- imageUrl: that.myinfo.share_img0,
- success: function(res) {
- console.log("success:" + JSON.stringify(res));
- },
- fail: function(err) {
- console.log("fail:" + JSON.stringify(err));
- }
- });
- },
- saveImg() {
- // #ifdef APP-PLUS
- let that = this;
- uni.showLoading({
- title: '正在保存...',
- })
- uni.downloadFile({
- url: that.myinfo.share_img0,
- success: (res) => {
- if (res.statusCode === 200) {
- uni.saveImageToPhotosAlbum({
- filePath: res.tempFilePath,
- success: function() {
- uni.showToast({
- title: '已保存到相册'
- });
- },
- fail: function(e) {
- uni.showToast({
- icon: 'none',
- title: '保存到相册失败'
- });
- },
- complete: function() {
- uni.hideLoading()
- }
- });
- } else {
- uni.showToast({
- icon: 'none',
- title: '邀请码下载失败'
- })
- uni.hideLoading()
- }
- },
- fail: function() {
- uni.showToast({
- icon: 'none',
- title: '邀请码下载错误'
- })
- },
- complete() {
- uni.hideLoading()
- }
- })
- // #endif
- }
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'share_img.scss';
- </style>
|