已添加1个文件
已修改11个文件
已重命名1个文件
| | |
| | | import { |
| | | wxLoginCustomer |
| | | } from './api/index' |
| | | import CustomHook from 'spa-custom-hooks'; |
| | | let globalData = { |
| | | token: '', |
| | | primary: '#B08771', |
| | | bottomLift: '' |
| | | } |
| | | App({ |
| | | globalData: { |
| | | primary: '#B08771', |
| | | bottomLift: '' |
| | | }, |
| | | globalData, |
| | | onLaunch: function (op) { |
| | | console.log('options', op.query.scene) |
| | | let pathMap = [ |
| | |
| | | // ææç»å½ |
| | | wx.login({ |
| | | timeout: 5000, |
| | | success(res) { |
| | | success: (res) => { |
| | | if (res.code) { |
| | | //åèµ·ç½ç»è¯·æ± |
| | | wxLoginCustomer({ |
| | | code: res.code |
| | | }).then(res => { |
| | | console.log(res) |
| | | wx.setStorageSync('token', res.data.token) |
| | | this.globalData.token = res.data.token |
| | | if (op.query.scene) { |
| | | let temp = op.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | console.log('æ¿å°tokenäº', res.data.token); |
| | | if (res && res.data.member) { |
| | | wx.setStorageSync('member', res.data.member) |
| | | wx.setStorageSync('openid', res.data.member.openid) |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | if (op.query.scene) { |
| | | let temp = op.query.scene.split('_') |
| | | wx.navigateTo({ |
| | | url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`, |
| | | }) |
| | | } |
| | | } else { |
| | | console.log('ç»å½å¤±è´¥ï¼') |
| | | } |
| | |
| | | |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | CustomHook.install({ |
| | | 'Login':{ |
| | | name:'Login', |
| | | watchKey: 'token', |
| | | onUpdate(val){ |
| | | //ætokenåè§¦åæ¤é©å |
| | | return !!val; |
| | | } |
| | | } |
| | | }, globalData || 'globalData') |
| | |
| | | "@vant/weapp": "^1.11.6", |
| | | "hy-event-store": "^1.3.1", |
| | | "mp-html": "^2.5.0", |
| | | "spa-custom-hooks": "^1.2.2", |
| | | "vant-weapp": "^0.5.28" |
| | | }, |
| | | "scripts": { |
| | |
| | | origin: '', |
| | | showShare: false |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoadLogin(options){ |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | |
| | | if(options.origin && options.origin == 'b'){ |
| | | this.setData({ origin: 'b' }) |
| | | } |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({id: options.id, member}) |
| | | }, |
| | |
| | | import { |
| | | shareContent, |
| | | getProductInfo, |
| | | actionDo |
| | | } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | |
| | | member: {}, |
| | | showShare: false |
| | | }, |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoadLogin(options){ |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | |
| | | if(options.origin && options.origin == 'b'){ |
| | | this.setData({ origin: 'b' }) |
| | | } |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({ |
| | | id: options.id, |
| | |
| | | }) |
| | | }, |
| | | bindchange(e) { |
| | | console.log('e', e.detail ); |
| | | this.setData({ current: e.detail.current }) |
| | | }, |
| | | priviewBanner(e) { |
| | |
| | | import { getRealcaseInfo, actionDo } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | bottomLift: 0, |
| | | id: '', |
| | |
| | | showShare: false |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoadLogin(options){ |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | |
| | | if(options.origin && options.origin == 'b'){ |
| | | this.setData({ origin: 'b' }) |
| | | } |
| | | this.getDetail(options.id, options.userId || '') |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') |
| | | this.setData({id: options.id, member}) |
| | | }, |
| | |
| | | HYEventBus |
| | | } = require('hy-event-store') |
| | | const eventBus = new HYEventBus() |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | HOME_CLASS_B2: '', |
| | | HOME_CLASS_C: '', |
| | | }, |
| | | onLoadLogin(options){ |
| | | // å·²ç»ç»å½ï¼å¯ä»¥èµ°ä¾èµtokençé»è¾äº |
| | | console.log('é¦é¡µçonLoadLogin',options,`{"token":"${app.globalData.token}"}`); |
| | | this.initData() |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | const member = wx.getStorageSync('member') |
| | |
| | | onLoad(options) { |
| | | const member = wx.getStorageSync('member') |
| | | this.initDictData() |
| | | setTimeout(() => { |
| | | this.initData() |
| | | }, 1200) |
| | | }, |
| | | changePath(e) { |
| | | let index = e.currentTarget.dataset.type |
¶Ô±ÈÐÂÎļþ |
| | |
| | | let isLogin = false;
|
| | |
|
| | | // åå¸è®¢é
模å¼
|
| | | class Publisher {
|
| | | constructor() {
|
| | | this.map = new Map();
|
| | | }
|
| | | on(key, callback) {
|
| | | let arr = this.map.get(key) || [];
|
| | | arr.push(callback);
|
| | | this.map.set(key, arr);
|
| | | }
|
| | | emit(key, data = {}) {
|
| | | if (this.map.has(key)) {
|
| | | this.map.get(key).forEach((item) => {
|
| | | item.call(this, data);
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | let publisher = new Publisher();
|
| | |
|
| | | // 页颿©å±
|
| | | const oldPage = Page;
|
| | | Page = function (pageParams) {
|
| | | const { onLoad, onShow, onReady } = pageParams;
|
| | |
|
| | | pageParams.onLoad = function (params) {
|
| | | // 夿æ¯å¦ç»é
|
| | | if (isLogin) {
|
| | | onLoad && onLoad.call(this, params);
|
| | | } else {
|
| | | publisher.on("login", () => {
|
| | | isLogin = true;
|
| | | onLoad && onLoad.call(this, params);
|
| | | });
|
| | | }
|
| | | };
|
| | |
|
| | | pageParams.onShow = function () {
|
| | | // 夿æ¯å¦ç»é
|
| | | if (isLogin) {
|
| | | onShow && onShow.call(this);
|
| | | } else {
|
| | | publisher.on("login", () => {
|
| | | onShow && onShow.call(this);
|
| | | });
|
| | | }
|
| | | };
|
| | |
|
| | | pageParams.onReady = function () {
|
| | | // 夿æ¯å¦ç»é
|
| | | if (isLogin) {
|
| | | onReady && onReady.call(this);
|
| | | } else {
|
| | | publisher.on("login", () => {
|
| | | onReady && onReady.call(this);
|
| | | });
|
| | | }
|
| | | };
|
| | | return oldPage(pageParams);
|
| | | };
|
| | |
|
| | | module.exports = {
|
| | | publisher,
|
| | | };
|
| | |
| | | height: 264rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 40rpx; |
| | | padding: 0 60rpx; |
| | | .item{ |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border: 1rpx solid #e5e5e5; |
| | | border-top: 1rpx solid #e5e5e5; |
| | | } |
| | | } |
| | | .shade{ |
| | |
| | | height: 264rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 40rpx; |
| | | padding: 0 60rpx; |
| | | } |
| | | .shade_modal .btns .item { |
| | | display: flex; |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border: 1rpx solid #e5e5e5; |
| | | border-top: 1rpx solid #e5e5e5; |
| | | } |
| | | .shade { |
| | | position: fixed; |
| | |
| | | <view class="container"> |
| | | <buoyClient showPurpose="1" class="buoyClient"/> |
| | | <view> |
| | | <buoyClient showPurpose="1" class="buoyClient" /> |
| | | <detailFooter bindenjoy="handleEnjoy" path="1" info="{{info}}" /> |
| | | <view class="main_title">{{ info.title }}</view> |
| | | <view class="time">å叿¶é´ï¼{{ info.publishDt }}</view> |
| | | <view class="fullview_wrap"> |
| | | <view bindtap="priviewFull" wx:if="{{ info.panorama }}" class="full"> |
| | | <image class="icon" src="../../static/icon/ic_720.png" mode="widthFix"></image> |
| | | <text>å
¨æ¯</text> |
| | | <view class="container"> |
| | | <view class="main_title">{{ info.title }}</view> |
| | | <view class="time">å叿¶é´ï¼{{ info.publishDt }}</view> |
| | | <view class="fullview_wrap"> |
| | | <view bindtap="priviewFull" wx:if="{{ info.panorama }}" class="full"> |
| | | <image class="icon" src="../../static/icon/ic_720.png" mode="widthFix"></image> |
| | | <text>å
¨æ¯</text> |
| | | </view> |
| | | <image class="banner" src="{{ info.coverImage }}" mode="widthFix"></image> |
| | | </view> |
| | | <image class="banner" src="{{ info.coverImage }}" mode="widthFix"></image> |
| | | </view> |
| | | <view class="h1">å¸ç½®å¾</view> |
| | | <image bindtap="priviewLayout" class="img" src="{{ info.layoutUlr }}" mode="widthFix"></image> |
| | | <view class="analysis"> |
| | | <view class="h2">æ¡ä¾è§£æ</view> |
| | | <view class="text">{{ info.caseInfo }}</view> |
| | | </view> |
| | | <view class="list"> |
| | | <view wx:for="{{ info.apiSpaceCaseVos }}" class="item"> |
| | | <view class="h1">{{ item.spaceName }}</view> |
| | | <image data-url="{{ img }}" bindtap="priviewSpace" class="img" wx:for="{{ item.imgList }}" wx:for-item="img" src="{{ img }}" mode="widthFix" /> |
| | | <view class="content">{{ item.spaceDesc }}</view> |
| | | <view class="h1">å¸ç½®å¾</view> |
| | | <image bindtap="priviewLayout" class="img" src="{{ info.layoutUlr }}" mode="widthFix"></image> |
| | | <view class="analysis"> |
| | | <view class="h2">æ¡ä¾è§£æ</view> |
| | | <view class="text">{{ info.caseInfo }}</view> |
| | | </view> |
| | | <view class="list"> |
| | | <view wx:for="{{ info.apiSpaceCaseVos }}" class="item"> |
| | | <view class="h1">{{ item.spaceName }}</view> |
| | | <image data-url="{{ img }}" bindtap="priviewSpace" class="img" wx:for="{{ item.imgList }}" wx:for-item="img" src="{{ img }}" mode="widthFix" /> |
| | | <view class="content">{{ item.spaceDesc }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- footer --> |
| | |
| | | }) |
| | | }, |
| | | bindchange(e) { |
| | | console.log('e', e.detail ); |
| | | this.setData({ current: e.detail.current }) |
| | | }, |
| | | priviewSpace(e) { |
| | |
| | | <view class="container"> |
| | | <buoyClient showPurpose="1" class="buoyClient"/> |
| | | <view> |
| | | <buoyClient showPurpose="1" class="buoyClient" /> |
| | | <detailFooter bindenjoy="handleEnjoy" path="2" info="{{info}}" /> |
| | | <!-- --> |
| | | <view class="main_title">{{ info.title }}</view> |
| | | <view class="time">å叿¶é´ï¼{{ info.publishDt }}</view> |
| | | <image data-url="{{ item }}" bindtap="priviewSpace" class="info_item" wx:for="{{ info.contentImgList }}" src="{{ item }}" mode="widthFix"></image> |
| | | <view class="desc">{{ info.contentText || '' }}</view> |
| | | <view class="container"> |
| | | <view class="main_title">{{ info.title }}</view> |
| | | <view class="time">å叿¶é´ï¼{{ info.publishDt }}</view> |
| | | <image data-url="{{ item }}" bindtap="priviewSpace" class="info_item" wx:for="{{ info.contentImgList }}" src="{{ item }}" mode="widthFix"></image> |
| | | <view class="desc">{{ info.contentText || '' }}</view> |
| | | </view> |
| | | |
| | | <!-- <view class="list"> |
| | | <view class="item"> |
| | | <image src="" mode="widthFix" /> |