Browse Source

1.0end

master
kola-web 3 days ago
parent
commit
9bbf119531
  1. 11
      project.private.config.json
  2. 2
      src/doc/pages/doc1/index.json
  3. 2
      src/doc/pages/doc1/index.ts
  4. BIN
      src/images/bg9.png
  5. 7
      src/pages/home/index.ts
  6. 4
      src/pages/home/index.wxml
  7. 21
      src/pages/informationDetail/index.ts
  8. 63
      src/pages/login/index.ts
  9. 2
      src/utils/page.ts

11
project.private.config.json

@ -23,13 +23,20 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "首页", "name": "隐私协议",
"pathName": "pages/home/index", "pathName": "doc/pages/doc1/index",
"query": "", "query": "",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
}, },
{ {
"name": "首页",
"pathName": "pages/home/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "资料库详情", "name": "资料库详情",
"pathName": "pages/informationDetail/index", "pathName": "pages/informationDetail/index",
"query": "", "query": "",

2
src/doc/pages/doc1/index.json

@ -1,6 +1,6 @@
{ {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarTitleText": "TED关爱中心小程序隐私政策", "navigationBarTitleText": "隐私协议",
"usingComponents": { "usingComponents": {
"mp-html": "mp-html" "mp-html": "mp-html"
} }

2
src/doc/pages/doc1/index.ts

File diff suppressed because one or more lines are too long

BIN
src/images/bg9.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 158 KiB

7
src/pages/home/index.ts

@ -113,13 +113,14 @@ Page({
}, },
handleSwiperChange(e) { handleSwiperChange(e) {
const current = e.detail.current; const current = e.detail.current;
this.setData({
current: e.detail.current,
});
const { Id } = this.data.notice[current] || {}; const { Id } = this.data.notice[current] || {};
if (Id) { if (Id) {
app.mpBehavior({ PositionId: '4', OperateType: '4', OperateId: Id }); app.mpBehavior({ PositionId: '4', OperateType: '4', OperateId: Id });
} }
this.setData({
current: e.detail.current,
});
}, },
getBanner() { getBanner() {
wx.ajax({ wx.ajax({

4
src/pages/home/index.wxml

@ -23,7 +23,7 @@
<image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image> <image class="e-img" src="{{imageUrl}}card1.png?t={{Timestamp}}"></image>
</view> </view>
<view class="notice"> <view class="notice">
<swiper class="v-swiper" current="{{current}}" autoplay bind:change="handleSwiperChange"> <swiper class="v-swiper" autoplay bind:change="handleSwiperChange">
<swiper-item <swiper-item
class="swiper-item" class="swiper-item"
wx:for="{{notice}}" wx:for="{{notice}}"
@ -136,7 +136,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="ad"> <view class="ad" wx:if="{{bannerList.length > 0}}">
<swiper <swiper
class="swiper" class="swiper"
autoplay autoplay

21
src/pages/informationDetail/index.ts

@ -10,6 +10,8 @@ Page({
position: 'bottom', position: 'bottom',
} as any, } as any,
Timestamp: '',
doc: '1', doc: '1',
id: '', id: '',
@ -115,17 +117,14 @@ Page({
}, },
}); });
}, },
onShareAppMessage(e) { onShareAppMessage() {
if (e.from === 'button') { const { Title, CoverImgUrl, Id } = this.data.detail;
const { Title, CoverImgUrl, Id } = this.data.detail; app.mpBehavior({ PositionId: '1', OperateType: '3', OperateId: Id as string });
app.mpBehavior({ PositionId: '3', OperateType: '3', OperateId: Id }); return {
return { title: Title,
title: Title, path: `/pages/informationDetail/index?id=${Id}`,
path: `/pages/informationDetail/index?id=${Id}`, imageUrl: CoverImgUrl,
imageUrl: CoverImgUrl, };
};
}
return {};
}, },
}); });

63
src/pages/login/index.ts

@ -109,14 +109,15 @@ Page({
.then((res) => { .then((res) => {
this.submitCallback(res); this.submitCallback(res);
}) })
.catch(() => { .catch((err) => {
this.setData({ if (err.data.code == 100) {
popupShow: true, this.handleShowPopup();
popupType: 'popup4', } else if (err.data.msg) {
popupParams: { wx.showToast({
close: true, title: err.data.msg,
}, icon: 'none',
}); });
}
}); });
}, },
handleWxSubmit(e: WechatMiniprogram.CustomEvent) { handleWxSubmit(e: WechatMiniprogram.CustomEvent) {
@ -134,14 +135,15 @@ Page({
.then((res) => { .then((res) => {
this.submitCallback(res); this.submitCallback(res);
}) })
.catch(() => { .catch((err) => {
this.setData({ if (err.data.code == 100) {
popupShow: true, this.handleShowPopup();
popupType: 'popup4', } else if (err.data.msg) {
popupParams: { wx.showToast({
close: true, title: err.data.msg,
}, icon: 'none',
}); });
}
}); });
} }
}, },
@ -149,20 +151,27 @@ Page({
console.log('DEBUGPRINT[79]: index.ts:112: res=', res); console.log('DEBUGPRINT[79]: index.ts:112: res=', res);
app.globalData.loginType = res.loginType; app.globalData.loginType = res.loginType;
app.globalData.isLogin = res.isLogin; app.globalData.isLogin = res.isLogin;
if (res.isLogin == 1 && res.loginType == 2) { if (res.isLogin == 1) {
wx.reLaunch({ if (res.loginType == 2) {
url: '/pages/home/index', wx.reLaunch({
}); url: '/pages/home/index',
});
} else {
this.handleShowPopup();
}
} else { } else {
this.setData({ this.handleShowPopup();
popupShow: true,
popupType: 'popup4',
popupParams: {
close: true,
},
});
} }
}, },
handleShowPopup() {
this.setData({
popupShow: true,
popupType: 'popup4',
popupParams: {
close: true,
},
});
},
handleShowTel() { handleShowTel() {
this.setData({ this.setData({
showTel: !this.data.showTel, showTel: !this.data.showTel,

2
src/utils/page.ts

@ -60,7 +60,7 @@ function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObje
url = 'pages/start/index'; url = 'pages/start/index';
} }
return { return {
title: '甲状腺眼病TED规范化诊治中心', title: 'TED规范化诊治中心',
path: url, path: url,
imageUrl: `${getApp().globalData.imageUrl}share.png?t=${Timestamp}`, imageUrl: `${getApp().globalData.imageUrl}share.png?t=${Timestamp}`,
}; };

Loading…
Cancel
Save