12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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),
- params: {
- type: target || ''
- }
- });
- }
- },
- toDetail(e) {
- console.warn(e);
- const {
- id,
- name,
- type
- } = e.currentTarget.dataset;
- if (type && type == 'bottom') {
- return $.router.goto({
- path: `/pages/detail/index`,
- params: {
- content: this.data.bottom.content || ''
- }
- });
- }
- if (id) {
- $.router.goto({
- path: `/pages/introduce/index`,
- query: {
- id,
- name
- }
- });
- }
- },
- toConsult() {
- // $.wx.showToast({
- // title: '持续开发中'
- // });
- }
- });
|