main
xy 3 years ago
parent 2405cebfe5
commit 0a27a5733d

@ -1,4 +1,5 @@
<script>
const jwx = require('jweixin-module')
export default {
onLaunch: function() {
console.log('App Launch')
@ -17,6 +18,45 @@
})
this.$u.vuex('vuex_token', res.token)
this.$u.vuex('vuex_userId', res.user_id)
let url = location.href.split('#')[0]
this.$u.api.share({
url
}).then(res => {
jwx.config({
debug: true, // , api alert pc log pc
appId: res.appId,
jsApiList: res.jsApiList,
nonceStr: res.nonceStr,
signature: res.signature,
timestamp: res.timestamp,
})
jwx.ready(() => {
jwx.updateAppMessageShareData({
title: '疯狂赏金-192用户现金红包大派送', //
desc: '疯狂赏金-192用户现金红包大派',
link: url, // ,JS
imgUrl: '/static/share-img.jpeg', //
});
jwx.onMenuShareAppMessage({
title: '疯狂赏金-192用户现金红包大派', //
desc: '疯狂赏金-192用户现金红包大派',
link: url, // ,JS
imgUrl: '/static/share-img.jpeg', //
});
jwx.updateTimelineShareData({
title: '疯狂赏金-192用户现金红包大派', //
desc: '疯狂赏金-192用户现金红包大派',
link: url, // ,JS
imgUrl: '/static/share-img.jpeg', //
});
jwx.onMenuShareTimeline({
title: '疯狂赏金-192用户现金红包大派', //
desc: '疯狂赏金-192用户现金红包大派',
link: url, // ,JS
imgUrl: '/static/share-img.jpeg', //
});
})
})
})
}
} else {

@ -7,7 +7,8 @@ let apiApp = {
draw: '/api/mobile/draw/draw',
endTask: '/api/mobile/draw/end-task',
mobileCheck: '/api/mobile/draw/mobile-check',
bindMobile: '/api/mobile/user/bind-mobile'
bindMobile: '/api/mobile/user/bind-mobile',
share: '/api/mobile/user/wechat-share'
}
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
@ -22,8 +23,9 @@ const install = (Vue, vm) => {
let mobileCheck = (params = {}) => vm.$u.get(apiApp.mobileCheck, params);
let sendSms = (params = {}) => vm.$u.get(apiApp.sendSms, params);
let bindMobile = (params = {}) => vm.$u.get(apiApp.bindMobile, params);
let share = (params = {}) => vm.$u.get(apiApp.share, params);
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = { login, getPrize, draw, endTask, mobileCheck, getAppId, sendSms, bindMobile };
vm.$u.api = { login, getPrize, draw, endTask, mobileCheck, getAppId, sendSms, bindMobile, share };
}
export default {

@ -0,0 +1,5 @@
{
"dependencies": {
"jweixin-module": "^1.6.0"
}
}

@ -122,7 +122,7 @@ import popover from "@/component/popover/index.vue";
async getNotices() {
const res = await this.$u.api.getPrize()
this.notices = res.draw_log_day?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
this.notices = res.draw_log_day?.filter(i => i.draw_prize?.name !== '谢谢参与')?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
},
sendCode() {

@ -14,7 +14,7 @@
</view>
<view class="notice">
恭喜192****1774获得1.99元红包
<u-notice-bar :speed="80" color="#fff" bg-color="transparent" :volume-icon="false" :more-icon="false" :list="notices"></u-notice-bar>
</view>
<view class="present">
@ -42,14 +42,28 @@
export default {
data() {
return {
notices: []
}
},
onLoad() {
},
methods: {
async getNotices() {
const res = await this.$u.api.getPrize()
this.notices = res.draw_log_day?.filter(i => i.draw_prize?.name !== '谢谢参与')?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
},
},
computed: {
},
watch: {
vuex_token: {
handler(newVal){
if(newVal) {
this.getNotices()
}
},
immediate: true
}
}
}
</script>

@ -202,7 +202,7 @@ export default {
}
this.prizeList = arr
this.usrInfo = res.user
this.notices = res.draw_log_day?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
this.notices = res.draw_log_day?.filter(i => i.draw_prize?.name !== '谢谢参与')?.map(i => `恭喜${i.mobile.slice(0,3)}****${i.mobile.slice(-4)}获得${i.draw_prize ? i.draw_prize.name : ''}`)
},
async draw() {
try{

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Loading…
Cancel
Save