mould.js
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
Page({
data:{
},
onLoad:function () {
this.gettoken();
wx.showShareMenu({
withShareTicket: true
})
},
onShow:function () {
},
gettoken:function () {
var that=this;
wx.request({
url: "https://dcapi.colorcun.com/?service=App.Wechat.CreateActivityid",
header: {
'content-type': 'application/json'
},
success: function(res) {
console.log(JSON.parse(res.data.data[0]))
var activity_id=JSON.parse(res.data.data[0]).activity_id;
that.setData({
activity_id:activity_id
})
},
complete:function (res) {
}
})
},
onShareAppMessage:function () {
wx.updateShareMenu({
withShareTicket: true,
isUpdatableMessage: true,
activityId:this.data.activity_id, // 活动 ID
templateInfo:{
parameterList: [{
name: 'member_count',
value: '1'
}, {
name: 'room_limit',
value: '5'
}]
},
success:function (res) {
console.log(res)
},
fail:function (res) {
},
complete:function (res) {
console.log(res)
}
})
},
})