Browse Source

feat: 分享好友页面;

pull/1/head
Fox-33 1 month ago
parent
commit
42cad142c6
4 changed files with 102 additions and 5 deletions
  1. +3
    -0
      pages.json
  2. +3
    -5
      pages/index/center.vue
  3. +96
    -0
      pages_order/mine/sharing.vue
  4. BIN
      static/image/center/temp-share.png

+ 3
- 0
pages.json View File

@ -54,6 +54,9 @@
{ {
"path": "mine/setting" "path": "mine/setting"
}, },
{
"path": "mine/sharing"
},
{ {
"path": "mine/wallet" "path": "mine/wallet"
}, },


+ 3
- 5
pages/index/center.vue View File

@ -56,7 +56,7 @@
</template> </template>
</view> </view>
<view class="tools flex"> <view class="tools flex">
<view class="tool" @click="onShare">
<view class="tool" @click="$utils.navigateTo('/pages_order/mine/sharing')">
<view class="tool-icon"> <view class="tool-icon">
<image src="@/static/image/center/tool-share.png"></image> <image src="@/static/image/center/tool-share.png"></image>
</view> </view>
@ -127,11 +127,12 @@
</view> </view>
</view> </view>
<view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">>
<view class="service" @click="$utils.navigateTo('/pages_order/mine/service')">
<image src="@/static/image/center/service.png" mode=""></image> <image src="@/static/image/center/service.png" mode=""></image>
</view> </view>
<popupActivate ref="popupActivate"></popupActivate> <popupActivate ref="popupActivate"></popupActivate>
<popupSharing ref="popupSharing"></popupSharing>
<tabber select="center" /> <tabber select="center" />
</view> </view>
@ -233,9 +234,6 @@
goSetting() { goSetting() {
// todo // todo
}, },
onShare() {
// todo
},
onActivate() { onActivate() {
this.$refs.popupActivate.open(this.isAgent) this.$refs.popupActivate.open(this.isAgent)
}, },


+ 96
- 0
pages_order/mine/sharing.vue View File

@ -0,0 +1,96 @@
<template>
<view class="page">
<navbar title="分享好友" leftClick @leftClick="$utils.navigateBack" />
<view class="flex content">
<image class="bg" :src="imgurl"></image>
<view class="flex btns">
<button class="btn btn-back" @click="$utils.navigateBack">返回</button>
<button plain class="btn btn-save" @click="saveImg" >保存到相册</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgurl: null,
}
},
onLoad() {
// todo: fetch imgurl
this.imgurl = '../../static/image/center/temp-share.png'
},
methods: {
saveImg(){
this.$authorize('scope.writePhotosAlbum').then((res) => {
this.imgApi(this.imgurl)
})
},
imgApi(image) {
/* 获取图片的信息 */
uni.getImageInfo({
src: image,
success: function(image) {
/* 保存图片到手机相册 */
uni.saveImageToPhotosAlbum({
filePath: image.path,
success: function() {
uni.showModal({
title: '保存成功',
content: '图片已成功保存到相册',
showCancel: false
});
},
complete(res) {
console.log(res);
}
});
}
});
},
},
}
</script>
<style scoped lang="scss">
.page {
background-color: #111317;
height: 100vh;
}
.content {
margin-top: 79rpx;
flex-direction: column;
}
.bg {
width: 598rpx;
height: 1063rpx;
}
.btns {
justify-content: space-between;
margin-top: 53rpx;
width: 598rpx;
}
.btn {
width: 280rpx;
height: 90rpx;
font-size: 36rpx;
color: #FFFFFF;
border-radius: 45rpx;
margin: 0;
&-back {
background-color: #4E5053;
}
&-save {
background-image: linear-gradient(to right, #02DED6, #05D9A2);
}
}
</style>

BIN
static/image/center/temp-share.png View File

Before After
Width: 598  |  Height: 1063  |  Size: 436 KiB

Loading…
Cancel
Save