123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- // index.js
- //专题
- var contentList = [
- ];
- //商品
- var goodsList = [
-
- ];
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- contentList: contentList,
- goodsList: goodsList,
- currentItem : 1,
- showcont : 1
- },
- onLoad: function (options) {
- var classid = options.com_id;
- var name = options.name
- wx.setNavigationBarTitle({
- title: name
- })
- that = this;
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- if (un_id != undefined && un_id != '' && un_id != null){
- wx.request({
- url: host + "findapi/findMyforxcx",
- data: {
- user_id: un_id
- },
- method: 'GET',
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- var size = res.data.total;
- that.setData({
- contentList: res.data.rows,
- });
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- })
- wx.request({
- url: host + "collectionapi/selectcommodity",
- data: {
- user_id: un_id
- },
- method: 'GET',
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- var size = res.data.total;
- that.setData({
- goodsList: res.data.rows,
- });
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- })
- }
-
-
- },
- navChange: function (options){
- var that = this
- var id = options.currentTarget.dataset.id;
- that.setData({
- 'currentItem': id,
- 'showcont' : id
- })
- },
- onShow: function (options){
- var that = this;
- var host = getApp().globalData.servsers;
- var un_id = getApp().globalData.un_id;
- if (un_id != undefined && un_id != '' && un_id != null){
- wx.request({
- url: host + "findapi/findMyforxcx",
- data: {
- user_id: un_id
- },
- method: 'GET',
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- var size = res.data.total;
- that.setData({
- contentList: res.data.rows,
- });
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- })
-
- wx.request({
- url: host + "collectionapi/selectcommodity",
- data: {
- user_id: un_id
- },
- method: 'GET',
- header: {
- 'Accept': 'application/json'
- },
- success: function (res) {
- var size = res.data.total;
- that.setData({
- goodsList: res.data.rows,
- });
- if (res == null || res.data == null) {
- console.error('网络请求失败');
- return;
- }
- }
- })
- }
-
- }
-
- })
- var that;
- var Util = require('../../utils/util.js');
|