|
|
@ -14,8 +14,6 @@ |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
<loginPopup ref="loginPopup" @login="fetchDetails"/> |
|
|
|
|
|
|
|
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-user.png"></popupUnlock> |
|
|
|
|
|
|
|
</view> |
|
|
@ -23,12 +21,10 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex' |
|
|
|
import loginPopup from '@/components/config/loginPopup.vue' |
|
|
|
import popupUnlock from '../components/popupUnlock.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
loginPopup, |
|
|
|
popupUnlock, |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -40,7 +36,7 @@ |
|
|
|
headImage: null, |
|
|
|
headTitle: null, |
|
|
|
indexImage: null, |
|
|
|
num: 10, |
|
|
|
num: 0, |
|
|
|
wxCodeImage: null, |
|
|
|
textDetails: null, |
|
|
|
}, |
|
|
@ -50,6 +46,11 @@ |
|
|
|
computed: { |
|
|
|
...mapState(['userInfo']), |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.id && uni.getStorageSync('token')) { |
|
|
|
this.fetchDetails() |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
const { id, state, shareId } = option |
|
|
|
|
|
|
@ -67,12 +68,13 @@ |
|
|
|
|
|
|
|
this.id = id |
|
|
|
|
|
|
|
if(uni.getStorageSync('token')){ |
|
|
|
if (uni.getStorageSync('token')) { |
|
|
|
this.fetchDetails() |
|
|
|
}else{ |
|
|
|
this.$refs.loginPopup.open() |
|
|
|
} else { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages_order/auth/wxLogin' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onShareAppMessage(res) { |
|
|
|
const { |
|
|
@ -98,9 +100,9 @@ |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
async fetchCheckShare(id) { |
|
|
|
async fetchCheckShare() { |
|
|
|
try { |
|
|
|
return await this.$fetch('checkShare', { id }) |
|
|
|
return await this.$fetch('checkShare', { id: this.id }) |
|
|
|
} catch (err) { |
|
|
|
return {} |
|
|
|
} |
|
|
@ -126,14 +128,18 @@ |
|
|
|
}, |
|
|
|
async onAdd() { |
|
|
|
const result = await this.fetchCheckShare() |
|
|
|
const { open } = result |
|
|
|
const { open, need_num, num } = result |
|
|
|
|
|
|
|
// todo: check |
|
|
|
if (open) { // 转发已达标 |
|
|
|
this.isLocked = false |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
title: `还需转发${need_num - num}次`, |
|
|
|
icon: 'none', |
|
|
|
}) |
|
|
|
|
|
|
|
this.openPopup() |
|
|
|
} |
|
|
|
}, |
|
|
|