|
@@ -3,7 +3,7 @@
|
|
|
<view class="phone-navBar-box">
|
|
<view class="phone-navBar-box">
|
|
|
<view @click="goUpPage" class="nav-bar-icon"></view>
|
|
<view @click="goUpPage" class="nav-bar-icon"></view>
|
|
|
<text class="nav-bar-title">职业海报</text>
|
|
<text class="nav-bar-title">职业海报</text>
|
|
|
- <view @click="getUUid" class="text-btn">分享</view>
|
|
|
|
|
|
|
+ <view @click="getHaibaoImg" class="text-btn">分享</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="haibao-info-body-box">
|
|
<view class="haibao-info-body-box">
|
|
|
<view v-if="data.img" class="img-box">
|
|
<view v-if="data.img" class="img-box">
|
|
@@ -47,9 +47,10 @@
|
|
|
const haibaoUrl = ref('')
|
|
const haibaoUrl = ref('')
|
|
|
const sharePopupRef = ref(null)
|
|
const sharePopupRef = ref(null)
|
|
|
|
|
|
|
|
- function onShareSuccess(e){
|
|
|
|
|
- console.log('分享成功', e.scene)
|
|
|
|
|
|
|
+ function onShareSuccess(e) {
|
|
|
|
|
+ console.log('分享成功', e.scene)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function goUpPage() {
|
|
function goUpPage() {
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
url: `/pages/admin/haibao/index?menuId=${data.menuId}`
|
|
url: `/pages/admin/haibao/index?menuId=${data.menuId}`
|
|
@@ -73,24 +74,34 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function getUUid() {
|
|
|
|
|
|
|
+ function getHaibaoImg() {
|
|
|
httpApi.haibaoShare({
|
|
httpApi.haibaoShare({
|
|
|
id: data.id
|
|
id: data.id
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
|
- data.uuid = res.data.uuid
|
|
|
|
|
- haibaoUrl.value = `${config.haibaoUrl}?uuid=${data.uuid}`
|
|
|
|
|
- sharePopupRef.value.open()
|
|
|
|
|
|
|
+ uni.share({
|
|
|
|
|
+ provider: "weixin",
|
|
|
|
|
+ scene: "WXSceneTimeline",
|
|
|
|
|
+ type: 2,
|
|
|
|
|
+ imageUrl: "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png",
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ console.log("success:" + JSON.stringify(res));
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function(err) {
|
|
|
|
|
+ console.log("fail:" + JSON.stringify(err));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '获得uuid失败',
|
|
|
|
|
|
|
+ title: '获得海报图片失败',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
|
data.id = options.cardId || ''
|
|
data.id = options.cardId || ''
|
|
|
data.menuId = options.menuId || ''
|
|
data.menuId = options.menuId || ''
|