|
@@ -34,9 +34,13 @@ |
|
|
<text>邀请好友可获得2枚金币</text>
|
|
|
<text>邀请好友可获得2枚金币</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<button open-type="share" class="shareBtn">分享</button>
|
|
|
<button open-type="share" class="shareBtn">分享</button>
|
|
|
<view class="shareBtn" @click="inviteFriend">邀请好友</view>
|
|
|
|
|
|
|
|
|
<view class="shareBtn" @click="getUserQrcode">邀请好友</view>
|
|
|
<view class="shareBtn" @click="buyCoin">金币充值</view>
|
|
|
<view class="shareBtn" @click="buyCoin">金币充值</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 画报 -->
|
|
|
|
|
|
<view v-if="showPictorial" class="pictorialBox">
|
|
|
|
|
|
<image :src="pictorialUrl" mode="scaleToFill" />
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
</template>
|
|
|
|
|
|
|
|
@@ -50,6 +54,7 @@ import { |
|
|
getPhotoListApi,
|
|
|
getPhotoListApi,
|
|
|
photoSupperApi,
|
|
|
photoSupperApi,
|
|
|
getSupperPhotoStateApi,
|
|
|
getSupperPhotoStateApi,
|
|
|
|
|
|
getUserQrcodeApi,
|
|
|
} from "../../api/lookPhoto.js";
|
|
|
} from "../../api/lookPhoto.js";
|
|
|
//#endregion
|
|
|
//#endregion
|
|
|
const userInfoModulesPinia = userInfoModules();
|
|
|
const userInfoModulesPinia = userInfoModules();
|
|
@@ -159,34 +164,34 @@ function previewImage(index) { |
|
|
//#endregion ---------------------
|
|
|
//#endregion ---------------------
|
|
|
|
|
|
|
|
|
//#region 分享
|
|
|
//#region 分享
|
|
|
onShareAppMessage((res) => {
|
|
|
|
|
|
// 分享事件来源:button(页面内分享按钮)、menu(右上角分享按钮)
|
|
|
|
|
|
if (res.from === "button") {
|
|
|
|
|
|
// 来自页面内分享按钮
|
|
|
|
|
|
return {
|
|
|
|
|
|
//分享标题
|
|
|
|
|
|
title: "智像",
|
|
|
|
|
|
//页面 path
|
|
|
|
|
|
path: `/pages/login/index`,
|
|
|
|
|
|
// 分享图标
|
|
|
|
|
|
// imageUr: shopDetailsData.value?.GoodsCoverImg,
|
|
|
|
|
|
success: function () {
|
|
|
|
|
|
// 转发成功
|
|
|
|
|
|
console.log("res", res);
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function () {
|
|
|
|
|
|
// 转发失败
|
|
|
|
|
|
console.log("res", res);
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return {
|
|
|
|
|
|
title: "智像",
|
|
|
|
|
|
path: "/pages/login/index",
|
|
|
|
|
|
// imageUr: shopDetailsData.value?.GoodsCoverImg,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
// onShareAppMessage((res) => {
|
|
|
|
|
|
// // 分享事件来源:button(页面内分享按钮)、menu(右上角分享按钮)
|
|
|
|
|
|
// if (res.from === "button") {
|
|
|
|
|
|
// // 来自页面内分享按钮
|
|
|
|
|
|
// return {
|
|
|
|
|
|
// //分享标题
|
|
|
|
|
|
// title: "智像",
|
|
|
|
|
|
// //页面 path
|
|
|
|
|
|
// path: `/pages/login/index`,
|
|
|
|
|
|
// // 分享图标
|
|
|
|
|
|
// // imageUr: shopDetailsData.value?.GoodsCoverImg,
|
|
|
|
|
|
// success: function () {
|
|
|
|
|
|
// // 转发成功
|
|
|
|
|
|
// console.log("res", res);
|
|
|
|
|
|
// },
|
|
|
|
|
|
// fail: function () {
|
|
|
|
|
|
// // 转发失败
|
|
|
|
|
|
// console.log("res", res);
|
|
|
|
|
|
// },
|
|
|
|
|
|
// };
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// return {
|
|
|
|
|
|
// title: "智像",
|
|
|
|
|
|
// path: "/pages/login/index",
|
|
|
|
|
|
// // imageUr: shopDetailsData.value?.GoodsCoverImg,
|
|
|
|
|
|
// };
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
// onShareAppMessage((res) => {
|
|
|
// onShareAppMessage((res) => {
|
|
|
// return {
|
|
|
// return {
|
|
|
// title: "页面分享的标题",
|
|
|
// title: "页面分享的标题",
|
|
@@ -222,34 +227,7 @@ function share() { |
|
|
// },
|
|
|
// },
|
|
|
// });
|
|
|
// });
|
|
|
}
|
|
|
}
|
|
|
function inviteFriend() {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: "敬请期待!",
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
});
|
|
|
|
|
|
return;
|
|
|
|
|
|
uni.share({
|
|
|
|
|
|
provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
|
|
|
|
|
|
scene: "WXSceneSession", //WXSceneSession(分享到聊天界面)、WXSenceTimeline(分享到朋友圈)、WXSceneFavorite(分享到微信收藏)
|
|
|
|
|
|
type: 5,
|
|
|
|
|
|
title: "分享给好友",
|
|
|
|
|
|
summary: "分享描述",
|
|
|
|
|
|
href: "www.baidu.com", //分享跳转地址
|
|
|
|
|
|
imageUrl: "../static/lovehot.png", //分享图片路径(必须是线上可访问图片)
|
|
|
|
|
|
miniProgram: {
|
|
|
|
|
|
id: "gwx75cf14e3a0d45821",
|
|
|
|
|
|
path: "pages/index/index",
|
|
|
|
|
|
type: 0,
|
|
|
|
|
|
webUrl: "",
|
|
|
|
|
|
},
|
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
// console.log("success:" + JSON.stringify(res));
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function (err) {
|
|
|
|
|
|
// console.log("fail:" + JSON.stringify(err));
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion ---------------------
|
|
|
//#endregion ---------------------
|
|
|
|
|
|
|
|
|
//#region 页面跳转
|
|
|
//#region 页面跳转
|
|
@@ -342,6 +320,48 @@ watch( |
|
|
);
|
|
|
);
|
|
|
//#endregion ---------------------
|
|
|
//#endregion ---------------------
|
|
|
|
|
|
|
|
|
|
|
|
//#region 生成画报
|
|
|
|
|
|
const pictorialUrl = ref("");
|
|
|
|
|
|
const showPictorial = ref(false);
|
|
|
|
|
|
async function getUserQrcode() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
title: "加载中...",
|
|
|
|
|
|
mask: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
appId: userInfoModulesPinia.getAppId(),
|
|
|
|
|
|
img: swiperList.value[swiperIndex.value].imageSuper
|
|
|
|
|
|
? swiperList.value[swiperIndex.value].imageSuper
|
|
|
|
|
|
: swiperList.value[swiperIndex.value].image,
|
|
|
|
|
|
};
|
|
|
|
|
|
const res = await getUserQrcodeApi(data);
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
uni.arrayBufferToBase64(res.data, (base64) => {
|
|
|
|
|
|
pictorialUrl.value = "data:image/jpeg;base64," + base64; // 在前面加上正确的图片格式
|
|
|
|
|
|
});
|
|
|
|
|
|
showPictorial.value = true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: "画报生成失败",
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
mask: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: "画报生成失败",
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
mask: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion ---------------------
|
|
|
|
|
|
|
|
|
//#region
|
|
|
//#region
|
|
|
|
|
|
|
|
|
//#endregion ---------------------
|
|
|
//#endregion ---------------------
|
|
@@ -467,12 +487,28 @@ watch( |
|
|
text-align: center;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
.shareBtn {
|
|
|
.shareBtn {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
color: #fff;
|
|
|
width: 200rpx;
|
|
|
width: 200rpx;
|
|
|
height: 70rpx;
|
|
|
height: 70rpx;
|
|
|
line-height: 70rpx;
|
|
|
line-height: 70rpx;
|
|
|
text-align: center;
|
|
|
text-align: center;
|
|
|
border-radius: 70rpx;
|
|
|
border-radius: 70rpx;
|
|
|
|
|
|
font-size: 26rpx;
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pictorialBox {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100vh;
|
|
|
|
|
|
image {
|
|
|
|
|
|
margin-top: 80rpx;
|
|
|
|
|
|
width: 630rpx;
|
|
|
|
|
|
height: 940rpx;
|
|
|
|
|
|
border-radius: 24rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
z-index: 9;
|
|
|
|
|
|
}
|
|
|
</style>
|
|
|
</style>
|