1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- // pages/art/art.js
- const app = getApp()
- const util = require('../../utils/util.js');
- const APIClient = require('../../utils/APIClient.js');
- const login = require('../../utils/loginSchedule.js');
- Page({
- data: {
- flag: false,
- productionData: {},
- questionsData: {},
- },
- methods: {
- shareImage: function(e) {
- console.log(e.target.dataset.flag)
- }
- },
- onLoad: function (options) {
- //分享按钮
- wx.showShareMenu({
- withShareTicket: true
- })
- },
- onShow: function () {
- /* 区分答疑和分享 */
- let distinction = (type, success) => {
- login.getOpenidSessionKey(function(res) {
- //console.log(res.data.data.uid);
- APIClient.getProductionSchedule({
- uid: res.data.data.uid
- }, {
- "type": type,
- "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
- "pageNo": 1,
- "pageSize": 6
- }).success(success)
- }, function() {
- wx.showModal({
- title: '提示',
- content: '需要获取您的公开信息(昵称、头像等),请从小程序列表删除小学王者班后再次扫码进入,允许授权后可正常使用',
- showCancel: false,
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- });
- };
- /* 分享 */
- distinction(2, res => {
- if(res.data.success) {
- console.log(res.data.data)
- this.setData({
- productionData: res.data.data,
- })
- }
-
- });
- /* 答疑 */
- distinction(1, res => {
- if(res.data.success) {
- console.log(res.data.data)
- this.setData({
- questionsData: res.data.data,
- })
- }
- });
- },
- /* 转发*/
- onShareAppMessage: function (ops) {
- if (ops.from === 'button') {
- // 来自页面内转发按钮
- console.log(ops.target)
- }
- const postId = ops.target.dataset.postid;
- return {
- title: '小学王者班',
- path: `pages/transmit/transmit?ind=7&postId=${postId}`,
- success: function (res) {
- // 转发成功
- console.log("转发成功:" + JSON.stringify(res));
- },
- fail: function (res) {
- // 转发失败
- console.log("转发失败:" + JSON.stringify(res));
- }
- }
- },
- })
|