| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- // components/fulltime/fulltime.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- // 渲染列表
- list: {
- type: Array,
- value: []
- },
- // 是否可以滚动
- isScroll: {
- type: Boolean,
- value: true
- },
- // 更多消息
- showNoMore: {
- type: String,
- value: "没有更多信息..."
- },
- // 控制高薪拼工图片显示
- show_img: {
- type: Boolean,
- value: true
- },
- margin: {
- type: Number,
- value: 10
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- myFormat: ['天', '时', '分', '秒'],
- },
- /**
- * 组件的方法列表
- */
- methods: {
- doArrow(e) {
- const index = e.currentTarget.dataset.index;
- const list = this.data.list;
- this.setData({
- [`list[${index}].up`]: !list[index].up
- })
- },
- action(e) {
- const date = wx.getStorageSync('detail_time');
- let times = wx.getStorageSync('detail_times') || 0;
- const _date = new Date().getTime();
- if (!date || _date - date > 86400000) {
- if (times < 2) {
- // 上报详情订阅信息
- wx.aldPushSubscribeMessage({
- eventId: '5ea139ed6df4251c4a09a4bf',
- success: () => {
- wx.setStorageSync('detail_times', 2);
- wx.setStorageSync('detail_time', new Date().getTime())
- },
- fail: () => {
- times++;
- wx.setStorageSync('detail_times', times);
- if (times === 2) {
- wx.setStorageSync('detail_time', new Date().getTime())
- }
- }
- });
- }
- }
- this.triggerEvent('action', e.currentTarget.dataset)
- }
- }
- })
|