Browse Source

Merge pull request 'fox' (#12) from fox into master

Reviewed-on: http://175.178.51.79:3000/hly/fission-star-applet-250304/pulls/12
fox
Fox 1 month ago
parent
commit
75e6869232
10 changed files with 132 additions and 47 deletions
  1. +4
    -0
      pages_order/mine/team.vue
  2. +3
    -1
      pages_order/record/articleSharing.vue
  3. +3
    -0
      pages_order/record/groupSharing.vue
  4. +3
    -0
      pages_order/record/personalSharing.vue
  5. +3
    -0
      pages_order/record/videoSharing.vue
  6. +19
    -10
      pages_order/sharing/article.vue
  7. +21
    -10
      pages_order/sharing/group.vue
  8. +19
    -10
      pages_order/sharing/personal.vue
  9. +16
    -16
      pages_order/sharing/video.vue
  10. +41
    -0
      utils/shareLog.js

+ 4
- 0
pages_order/mine/team.vue View File

@ -16,6 +16,10 @@
<view class="phone-label">手机号</view> <view class="phone-label">手机号</view>
<view>{{ userInfoVip.pidInfo.phone }}</view> <view>{{ userInfoVip.pidInfo.phone }}</view>
</view> </view>
<view v-else>
<view class="phone-label">微信号</view>
<view>{{ userInfoVip.pidInfo.wxCode }}</view>
</view>
</view> </view>
</view> </view>
<view class="summary"> <view class="summary">


+ 3
- 1
pages_order/record/articleSharing.vue View File

@ -119,6 +119,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import formInput from '../components/formInput.vue' import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue' import formNumberBox from '../components/formNumberBox.vue'
@ -189,7 +190,8 @@
state:"3", state:"3",
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
// todo: get times and check is unlocked
shareLog.insert(this.id)
this.isLocked = false this.isLocked = false


+ 3
- 0
pages_order/record/groupSharing.vue View File

@ -134,6 +134,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import formInput from '../components/formInput.vue' import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue' import formNumberBox from '../components/formNumberBox.vue'
@ -249,6 +250,8 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
shareLog.insert(this.id)
this.isLocked = false this.isLocked = false
return o return o


+ 3
- 0
pages_order/record/personalSharing.vue View File

@ -127,6 +127,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import formInput from '../components/formInput.vue' import formInput from '../components/formInput.vue'
import formNumberBox from '../components/formNumberBox.vue' import formNumberBox from '../components/formNumberBox.vue'
@ -235,6 +236,8 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
shareLog.insert(this.id)
this.isLocked = false this.isLocked = false
return o return o


+ 3
- 0
pages_order/record/videoSharing.vue View File

@ -123,6 +123,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import formUpload from '../components/formUpload.vue' import formUpload from '../components/formUpload.vue'
import formInput from '../components/formInput.vue' import formInput from '../components/formInput.vue'
@ -241,6 +242,8 @@
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
// todo: get times and check is unlocked // todo: get times and check is unlocked
shareLog.insert(this.id)
this.isLocked = false this.isLocked = false
return o return o


+ 19
- 10
pages_order/sharing/article.vue View File

@ -27,6 +27,8 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import popupUnlock from '../components/popupUnlock.vue' import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue' import popupQrCode from '../components/popupQrCode.vue'
@ -54,8 +56,12 @@
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) {
this.detail.id ? this.refreshLockStatus() : this.initData()
// if (this.id && uni.getStorageSync('token')) {
// this.detail.id ? this.refreshLockStatus() : this.initData()
// }
if (this.detail.id) { //
this.refreshLockStatus()
} }
}, },
async onLoad(option) { async onLoad(option) {
@ -75,14 +81,15 @@
this.id = id this.id = id
if (uni.getStorageSync('token')) {
this.initData()
} else {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
// if (uni.getStorageSync('token')) {
// this.initData()
// } else {
// uni.navigateTo({
// url: '/pages_order/auth/wxLogin'
// })
// }
this.initData()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
const { const {
@ -103,6 +110,8 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
shareLog.insert(this.id)
return o return o
}, },
methods: { methods: {
@ -135,7 +144,7 @@
}, },
async fetchCheckShare() { async fetchCheckShare() {
try { try {
return await this.$fetch('checkArticleShare', { id: this.id })
return shareLog.check(this.id, this.detail.num)
} catch (err) { } catch (err) {
return {} return {}
} }


+ 21
- 10
pages_order/sharing/group.vue View File

@ -22,6 +22,8 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import popupUnlock from '../components/popupUnlock.vue' import popupUnlock from '../components/popupUnlock.vue'
export default { export default {
@ -47,8 +49,12 @@
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) {
this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
// if (this.id && uni.getStorageSync('token')) {
// this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
// }
if (this.detail.id) { //
this.refreshLockStatus()
} }
}, },
onLoad(option) { onLoad(option) {
@ -68,13 +74,16 @@
this.id = id this.id = id
if (uni.getStorageSync('token')) {
this.fetchDetails()
} else {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
// if (uni.getStorageSync('token')) {
// this.fetchDetails()
// } else {
// uni.navigateTo({
// url: '/pages_order/auth/wxLogin'
// })
// }
this.fetchDetails()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
const { const {
@ -95,6 +104,8 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
shareLog.insert(this.id)
return o return o
}, },
methods: { methods: {
@ -107,7 +118,7 @@
}, },
async fetchCheckShare() { async fetchCheckShare() {
try { try {
return await this.$fetch('checkGroupShare', { id: this.id })
return await shareLog.check(this.id, this.detail.num)
} catch (err) { } catch (err) {
return {} return {}
} }


+ 19
- 10
pages_order/sharing/personal.vue View File

@ -22,6 +22,8 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import shareLog from '@/utils/shareLog'
import popupUnlock from '../components/popupUnlock.vue' import popupUnlock from '../components/popupUnlock.vue'
export default { export default {
@ -48,8 +50,12 @@
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) {
this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
// if (this.id && uni.getStorageSync('token')) {
// this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
// }
if (this.detail.id) { //
this.refreshLockStatus()
} }
}, },
onLoad(option) { onLoad(option) {
@ -69,13 +75,14 @@
this.id = id this.id = id
if (uni.getStorageSync('token')) {
this.fetchDetails()
} else {
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
// if (uni.getStorageSync('token')) {
// this.fetchDetails()
// } else {
// uni.navigateTo({
// url: '/pages_order/auth/wxLogin'
// })
// }
this.fetchDetails()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
const { const {
@ -96,6 +103,8 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
shareLog.insert(this.id)
return o return o
}, },
methods: { methods: {
@ -108,7 +117,7 @@
}, },
async fetchCheckShare() { async fetchCheckShare() {
try { try {
return await this.$fetch('checkShare', { id: this.id })
return await shareLog.check(this.id, this.detail.num)
} catch (err) { } catch (err) {
return {} return {}
} }


+ 16
- 16
pages_order/sharing/video.vue View File

@ -31,6 +31,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import popupUnlock from '../components/popupUnlock.vue' import popupUnlock from '../components/popupUnlock.vue'
import popupQrCode from '../components/popupQrCode.vue' import popupQrCode from '../components/popupQrCode.vue'
@ -61,8 +62,12 @@
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) {
this.detail.id ? this.refreshLockStatus() : this.initData()
// if (this.id && uni.getStorageSync('token')) {
// this.detail.id ? this.refreshLockStatus() : this.initData()
// }
if (this.detail.id) { //
this.refreshLockStatus()
} }
}, },
async onLoad(option) { async onLoad(option) {
@ -82,13 +87,15 @@
this.id = id this.id = id
if(uni.getStorageSync('token')){
this.initData()
}else{
uni.navigateTo({
url: '/pages_order/auth/wxLogin'
})
}
// if(uni.getStorageSync('token')){
// this.initData()
// }else{
// uni.navigateTo({
// url: '/pages_order/auth/wxLogin'
// })
// }
this.initData()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -126,13 +133,6 @@
this.videoContext = uni.createVideoContext('video'); this.videoContext = uni.createVideoContext('video');
}, },
async fetchCheckShare() {
try {
return await this.$fetch('checkVideoShare', { id: this.id })
} catch (err) {
return {}
}
},
refreshLockStatus() { refreshLockStatus() {
this.isLocked = false this.isLocked = false
this.timeIsUp = false this.timeIsUp = false


+ 41
- 0
utils/shareLog.js View File

@ -0,0 +1,41 @@
import fetch from '@/api/fetch.js'
const get = () => {
try {
return JSON.parse(uni.getStorageSync('shareLog')) || {}
} catch (err) {
return {}
}
}
const insert = (id) => {
const log = get()
let bef = log[id] || 0
log[id] = bef + 1
uni.setStorageSync('shareLog', JSON.stringify(log))
}
const check = async (id, need_num) => {
try {
const log = get()
const num = log[id] || 0
const open = num >= need_num
return { open, need_num, num, title: `已转发${num}` }
} catch (err) {
console.error('--校验达标异常', err)
return {}
}
}
export default {
get,
insert,
check,
}

Loading…
Cancel
Save