1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const $ = global;
- const WxParse = require('../../wxParse/wxParse.js');
- new $.Page({
- data: {
- imgUrls: [
- '/img/demo/banner.jpg',
- '/img/demo/banner.jpg',
- '/img/demo/banner.jpg'
- ]
- },
- onLoad() {
- $.request('server_infos', 'GET', {}).then((res) => {
- const {
- bottom,
- top,
- introduce
- } = res;
- WxParse.wxParse('article', 'html', introduce, this);
- this.setData({
- bottom,
- top,
- introduce
- });
- });
-
- },
- handleJump(e) {
- const {
- route,
- type,
- target
- } = e.currentTarget.dataset;
- if (route) {
- $.router.goto({
- path: `/pages/${route}/index`,
- type: type && parseInt(type)
- });
- }
- },
- toDetail(e) {
- const {
- id
- } = e.target.dataset;
- if (id) {
- $.router.goto({
- path: `/pages/detail/index`,
- query: {
- id
- }
- });
- }
- }
- });
|