|
|
@@ -0,0 +1,119 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="img_box">
|
|
|
+ <image :src="imgUrl" class="img_url"></image>
|
|
|
+ </view>
|
|
|
+ <!-- 确认 -->
|
|
|
+ <div class="confirm-btn">
|
|
|
+ <button class="admin-button-com big blue" @click="downloadImg">保存图片邀请</button>
|
|
|
+ </div>
|
|
|
+ <div class="confirm-btn1">
|
|
|
+ <button class="admin-button-com big blue" @click="goToMallPt()">直接打开分享</button>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { applyInviteHdPoster } from '@/api/apply/index'
|
|
|
+import { getWeixinId } from "@/api/invite/index";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ imgUrl: '',
|
|
|
+ getappIdList: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({ loginInfo: "getLoginInfo" })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.getImg()
|
|
|
+ getWeixinId().then(res => {
|
|
|
+ this.getappIdList = res.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ downloadImg() {
|
|
|
+ uni.downloadFile({
|
|
|
+ url: this.imgUrl,
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res)
|
|
|
+ uni.saveImageToPhotosAlbum({
|
|
|
+ filePath: res.tempFilePath,
|
|
|
+ success: function() {
|
|
|
+ uni.showToast({
|
|
|
+ title: '保存成功',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ // this.$msg('保存失败')
|
|
|
+ uni.showToast({
|
|
|
+ title: '保存失败',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getImg() {
|
|
|
+ applyInviteHdPoster().then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.imgUrl = res.data.imgUrl
|
|
|
+ }).catch(err => {})
|
|
|
+ },
|
|
|
+ goToMallPt () {
|
|
|
+ //查看分享的路径,不要删除 shish 20210517
|
|
|
+ console.log('pagesClient/official/index','ghsShopAdminId='+ this.loginInfo.shopAdminId)
|
|
|
+
|
|
|
+ getWeixinId().then(res => {
|
|
|
+ uni.navigateToMiniProgram({
|
|
|
+ appId: res.data.hd.miniAppId,
|
|
|
+ path: 'pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId,
|
|
|
+ //develop 开发板 trial 体验版 release 正式版
|
|
|
+ envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
|
|
|
+ extraData: {
|
|
|
+ //'ghsShopAdminId': this.loginInfo.shopAdminId
|
|
|
+ },
|
|
|
+ success(res) {
|
|
|
+ // 打开成功
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-content{
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.img_box{
|
|
|
+ height: 450upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &>.img_url{
|
|
|
+ height: 450upx;
|
|
|
+ width: 450upx;
|
|
|
+ margin: 100upx auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 按钮
|
|
|
+.confirm-btn {
|
|
|
+ width: calc(100% - 60px);
|
|
|
+ margin: 100px 30px 20px;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 按钮
|
|
|
+.confirm-btn1 {
|
|
|
+ width: calc(100% - 60px);
|
|
|
+ margin: 50px 30px 20px;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|