123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- // pages/art/art.js
- <<<<<<< HEAD
- 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: {},
- },
- =======
- const APIClient = require('../../utils/APIClient.js');
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
-
- },
- /**
- * 组件的初始数据
- */
- data: {
- flag: false,
- productionData: {},
- questionsData: {}
- },
- /**
- * 组件的方法列表
- */
- >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
- methods: {
- shareImage: function(e) {
- console.log(e.target.dataset.flag)
- }
- },
- <<<<<<< HEAD
- 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));
- }
- }
- =======
- ready () {
- /* 区分答疑和分享 */
- let distinction = (type, success) => {
- APIClient.getProductionSchedule({
- uid: 'e7e0d43a-36b1-4e71-a3a3-61469c90d0a2'
- }, {
- "userId": "e7e0d43a-36b1-4e71-a3a3-61469c90d0a2",
- "type": type,
- "columnId": "41209f14-05ba-11e8-9771-080027fcfc4b",
- "pageNo": 1,
- "pageSize": 2
- }).success(success)
- };
- /* 分享 */
- distinction(2, res => {
- console.log(res.data.data)
- this.setData({
- productionData: res.data.data,
- })
- });
- /* 答疑 */
- distinction(1, res => {
- console.log(res.data)
- this.setData({
- questionsData: res.data.data,
- })
- })
- >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
- },
- })
|