Browse Source

1. 首页留言 2.图片替换为线上地址 3. 登录权限

master
kola-web 3 months ago
parent
commit
d1d8071ff4
  1. 2
      README.md
  2. 22
      project.config.json
  3. 2
      src/pages/article/index.ts
  4. 12
      src/pages/article/index.wxml
  5. 6
      src/pages/classify/index.ts
  6. 12
      src/pages/classify/index.wxml
  7. 2
      src/pages/collection/index.ts
  8. 8
      src/pages/collection/index.wxml
  9. 25
      src/pages/home/index.ts
  10. 33
      src/pages/home/index.wxml
  11. 10
      src/pages/login/index.wxml
  12. 2
      src/pages/my/index.ts
  13. 12
      src/pages/my/index.wxml
  14. 2
      src/pages/search/index.ts
  15. 6
      src/pages/search/index.wxml
  16. 2
      src/pages/switchLogin/index.wxml
  17. 6
      src/pages/topic/index.wxml
  18. 4
      src/pages/userInfo/index.wxml
  19. 2
      typings/index.d.ts

2
README.md

@ -9,7 +9,7 @@ https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c @@ -9,7 +9,7 @@ https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c
images svn 地址
svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt
(/images/)(\S\*(?=["|']))
(/images/)(\S*(?=["|']))
{{imageUrl}}$2?t={{Timestamp}}
ui问题

22
project.config.json

@ -40,8 +40,26 @@ @@ -40,8 +40,26 @@
"libVersion": "2.32.3",
"ignore": [],
"packOptions": {
"include": [],
"ignore": []
"ignore": [
{
"value": "src/images/*.*",
"type": "glob"
},
{
"value": "src/images/**/*.*",
"type": "glob"
},
{
"value": "src/images/**/**/*.*",
"type": "glob"
}
],
"include": [
{
"value": "src/images/tabbar/*.*",
"type": "glob"
}
]
},
"appid": "wx2b0bb13edf717c1d"
}

2
src/pages/article/index.ts

@ -22,7 +22,7 @@ Page({ @@ -22,7 +22,7 @@ Page({
this.setData({
BookId: options.id,
});
app.waitLogin().then(() => {
app.waitLogin(false, true).then(() => {
this.getChapterList();
this.getDetail();
});

12
src/pages/article/index.wxml

@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
<view class="name">概要解读</view>
<view class="date">{{time}}</view>
</view>
<image bind:tap="handlePause" wx:if="{{play}}" class="icon" src="/images/icon-stop.png"></image>
<image bind:tap="handlePlay" wx:else class="icon" src="/images/icon-play.png"></image>
<image bind:tap="handlePause" wx:if="{{play}}" class="icon" src="{{imageUrl}}icon-stop.png?t={{Timestamp}}"></image>
<image bind:tap="handlePlay" wx:else class="icon" src="{{imageUrl}}icon-play.png?t={{Timestamp}}"></image>
</view>
<van-slider
class="progress"
@ -50,15 +50,15 @@ @@ -50,15 +50,15 @@
<view class="footer">
<view class="item" bind:tap="handleDirectory">
<image class="icon" src="/images/icon-directory.png"></image>
<image class="icon" src="{{imageUrl}}icon-directory.png?t={{Timestamp}}"></image>
目录
</view>
<view class="item" wx:if="{{book.IsCollect===1}}" bind:tap="handleUnCollect">
<image class="icon" src="/images/icon-collection-active.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
取消收藏
</view>
<view class="item" wx:else bind:tap="handleCollect">
<image class="icon" src="/images/icon-collection.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection.png?t={{Timestamp}}"></image>
收藏
</view>
</view>
@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
<view class="p-close-line" bind:tap="onClose">
<view class="option">
收起
<image class="icon" src="/images/fold-up.png"></image>
<image class="icon" src="{{imageUrl}}fold-up.png?t={{Timestamp}}"></image>
</view>
</view>
<view class="p-title">{{book.BookName}}</view>

6
src/pages/classify/index.ts

@ -137,6 +137,7 @@ Page({ @@ -137,6 +137,7 @@ Page({
handleCollect(e) {
const { index, list } = e.currentTarget.dataset;
const { Id } = this.data[list][index];
app.waitLogin(false, true).then(() => {
wx.ajax({
method: 'POST',
url: '?r=shizhong/book/collect',
@ -150,10 +151,12 @@ Page({ @@ -150,10 +151,12 @@ Page({
[`${list}[${index}].IsCollect`]: '1',
});
});
});
},
handleUnCollect(e) {
const { index, list } = e.currentTarget.dataset;
const { Id } = this.data[list][index];
app.waitLogin(false, true).then(() => {
wx.ajax({
method: 'POST',
url: '?r=shizhong/book/cancel-collect',
@ -167,12 +170,15 @@ Page({ @@ -167,12 +170,15 @@ Page({
[`${list}[${index}].IsCollect`]: '0',
});
});
});
},
handleDetail(e) {
const { id } = e.currentTarget.dataset;
app.waitLogin(false, true).then(() => {
wx.navigateTo({
url: `/pages/article/index?id=${id}`,
});
});
},
handleBack() {
wx.navigateBack();

12
src/pages/classify/index.wxml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<view class="type">{{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}}</view>
<view class="stat">
<view class="s-item">
<image class="icon" src="/images/icon-eye.png"></image>
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
</view>
<view
@ -40,11 +40,11 @@ @@ -40,11 +40,11 @@
data-index="{{index}}"
data-list="list"
>
<image class="icon" src="/images/icon-collection-active.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
已收藏
</view>
<view class="s-item" wx:else catch:tap="handleCollect" data-index="{{index}}" data-list="list">
<image class="icon" src="/images/icon-collection.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection.png?t={{Timestamp}}"></image>
收藏
</view>
</view>
@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
<view class="type">{{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}}</view>
<view class="stat">
<view class="s-item">
<image class="icon" src="/images/icon-eye.png"></image>
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
</view>
<view
@ -69,11 +69,11 @@ @@ -69,11 +69,11 @@
data-index="{{index}}"
data-list="recommendList"
>
<image class="icon" src="/images/icon-collection-active.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
已收藏
</view>
<view class="s-item" wx:else catch:tap="handleCollect" data-index="{{index}}" data-list="recommendList">
<image class="icon" src="/images/icon-collection.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection.png?t={{Timestamp}}"></image>
收藏
</view>
</view>

2
src/pages/collection/index.ts

@ -12,7 +12,7 @@ Page({ @@ -12,7 +12,7 @@ Page({
list: [],
},
onLoad() {
app.waitLogin().then(() => {
app.waitLogin(false, true).then(() => {
this.getList();
});
},

8
src/pages/collection/index.wxml

@ -10,13 +10,13 @@ @@ -10,13 +10,13 @@
<view class="page" style="padding-top:{{menuButtonInfo.bottom}}px;">
<view class="card" wx:for="{{list}}" wx:key="Id">
<image class="photo" mode="aspectFill" src="/images/place.png"></image>
<image class="photo" mode="aspectFill" src="{{imageUrl}}place.png?t={{Timestamp}}"></image>
<view class="c-container">
<view class="title">{{item.BookName}}</view>
<view class="type">{{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}}</view>
<view class="stat">
<view class="s-item">
<image class="icon" src="/images/icon-eye.png"></image>
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
</view>
<view
@ -26,11 +26,11 @@ @@ -26,11 +26,11 @@
data-index="{{index}}"
data-list="list"
>
<image class="icon" src="/images/icon-collection-active.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
已收藏
</view>
<view class="s-item" wx:else catch:tap="handleCollect" data-index="{{index}}" data-list="list">
<image class="icon" src="/images/icon-collection.png"></image>
<image class="icon" src="{{imageUrl}}icon-collection.png?t={{Timestamp}}"></image>
收藏
</view>
</view>

25
src/pages/home/index.ts

@ -3,10 +3,16 @@ const app = getApp<IAppOption>(); @@ -3,10 +3,16 @@ const app = getApp<IAppOption>();
Page({
data: {
cateList: [] as any,
remark: '',
isLogin: 0,
},
onLoad() {
app.waitLogin().then(() => {
this.getCateList();
this.setData({
isLogin: app.globalData.isLogin,
});
});
},
getCateList() {
@ -32,6 +38,25 @@ Page({ @@ -32,6 +38,25 @@ Page({
url: '/pages/search/index',
});
},
handleRemark() {
const { remark } = this.data;
wx.ajax({
method: 'POST',
url: '?r=shizhong/account/send-feedback',
data: {
content: remark,
},
loading: true,
}).then(() => {
wx.showToast({
title: '提交成功',
icon: 'success',
});
this.setData({
remark: '',
});
});
},
});
export {};

33
src/pages/home/index.wxml

@ -1,9 +1,12 @@ @@ -1,9 +1,12 @@
<view class="page" style="background: url('/images/home-bg.png') no-repeat top center/100% 580rpx;padding-top:{{menuButtonInfo.top}}px;">
<image class="logo" src="/images/home-logo.png"></image>
<image class="page-title" src="/images/home-title.png"></image>
<view
class="page"
style="background: url('{{imageUrl}}home-bg.png?t={{Timestamp}}') no-repeat top center/100% 580rpx;padding-top:{{menuButtonInfo.top}}px;"
>
<image class="logo" src="{{imageUrl}}home-logo.png?t={{Timestamp}}"></image>
<image class="page-title" src="{{imageUrl}}home-title.png?t={{Timestamp}}"></image>
<view class="page-slogan">人人都是家庭健康师,让生活更有质量</view>
<view class="search" bind:tap="handleSearch">
<image class="icon" src="/images/icon-search.png"></image>
<image class="icon" src="{{imageUrl}}icon-search.png?t={{Timestamp}}"></image>
<input
type="text"
disabled="{{true}}"
@ -14,14 +17,9 @@ @@ -14,14 +17,9 @@
placeholder="请输入要搜索的内容"
/>
</view>
<swiper
class="swiper"
indicator-dots
indicator-color="rgba(255,255,255,0.62)"
indicator-active-color="#FFFFFF"
>
<swiper class="swiper" indicator-dots indicator-color="rgba(255,255,255,0.62)" indicator-active-color="#FFFFFF">
<swiper-item class="swiper-item">
<image class="banner" src="/images/place.png"></image>
<image class="banner" src="{{imageUrl}}place.png?t={{Timestamp}}"></image>
</swiper-item>
</swiper>
<view class="cards">
@ -29,23 +27,24 @@ @@ -29,23 +27,24 @@
class="card"
wx:for="{{cateList}}"
wx:key="index"
style="background: url('/images/home-card-bg.png') no-repeat center/100%"
style="background: url('{{imageUrl}}home-card-bg.png?t={{Timestamp}}') no-repeat center/100%"
bind:tap="handleDetail"
data-index="{{index}}"
>
<view class="title">{{item.CateName}}</view>
<view class="content">
{{item.Intro}}
</view>
<view class="content">{{item.Intro}}</view>
</view>
</view>
<view class="remark">
<view class="remark" wx:if="{{isLogin===1}}">
<view class="r-header">留言板</view>
<textarea
class="r-content"
model:value="{{remark}}"
placeholder-class="textarea-placeholder"
placeholder="欢迎反馈您的问题"
confirm-type="send"
bindconfirm="handleRemark"
></textarea>
<view class="submit">提交</view>
<view class="submit" bindconfirm="handleRemark">提交</view>
</view>
</view>

10
src/pages/login/index.wxml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<view
class="page"
style="background: url('/images/login-bg.png') no-repeat top center/100% 624rpx;padding-top:{{menuButtonInfo.bottom}}px;"
style="background: url('{{imageUrl}}login-bg.png?t={{Timestamp}}') no-repeat top center/100% 624rpx;padding-top:{{menuButtonInfo.bottom}}px;"
>
<view class="container">
<view class="tel">
@ -30,11 +30,11 @@ @@ -30,11 +30,11 @@
</view>
<view class="submit" bind:tap="handleSubmit">登录</view>
<button wx:if="{{protool}}" class="tel-btn" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit">
<image class="icon" src="/images/icon-phone.png"></image>
<image class="icon" src="{{imageUrl}}icon-phone.png?t={{Timestamp}}"></image>
手机号快捷登录
</button>
<button wx:else class="tel-btn" bind:tap="handleWxSubmit">
<image class="icon" src="/images/icon-phone.png"></image>
<image class="icon" src="{{imageUrl}}icon-phone.png?t={{Timestamp}}"></image>
手机号快捷登录
</button>
<view class="visitor" bind:tap="handleVisitor">
@ -47,8 +47,8 @@ @@ -47,8 +47,8 @@
<van-popup show="{{ show }}" bind:close="onClose" round style="--popup-background-color: transparent">
<view class="popup">
<view class="popup-container">
<image class="badge" src="/images/login-popup-badge.png"></image>
<image class="title" src="/images/login-popup-title.png"></image>
<image class="badge" src="{{imageUrl}}login-popup-badge.png?t={{Timestamp}}"></image>
<image class="title" src="{{imageUrl}}login-popup-title.png?t={{Timestamp}}"></image>
<view class="conform" bind:tap="handleTopic">开始</view>
<view class="cancel" bind:tap="handleCancelTopic">跳过</view>
</view>

2
src/pages/my/index.ts

@ -8,7 +8,7 @@ Page({ @@ -8,7 +8,7 @@ Page({
userInfo: {} as any,
},
onLoad() {
app.waitLogin(true).then(() => {
app.waitLogin(false, true).then(() => {
app.getUserInfo(this);
});
},

12
src/pages/my/index.wxml

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
wx:else
class="avatar"
mode="aspectFill"
src="/images/user.png"
src="{{imageUrl}}user.png?t={{Timestamp}}"
></image>
</uploadFile>
@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
<view class="name">{{userInfo.username || '---'}}
<image
class="icon"
src="/images/icon-edit.png"
src="{{imageUrl}}icon-edit.png?t={{Timestamp}}"
bind:tap="handleEditUser"
></image>
</view>
@ -38,20 +38,20 @@ @@ -38,20 +38,20 @@
</view>
</view>
<view class="no-login" wx:else>
<image class="avatar" src="/images/user.png"></image>
<image class="avatar" src="{{imageUrl}}user.png?t={{Timestamp}}"></image>
<view class="name" bind:tap="handleLogin">登录</view>
</view>
<view class="nav-list">
<view class="nav-item" bind:tap="handleCollection">
<image class="icon" src="/images/my-list-icon1.png"></image>
<image class="icon" src="{{imageUrl}}my-list-icon1.png?t={{Timestamp}}"></image>
我的收藏
</view>
<view class="nav-item" bind:tap="handleOffice">
<image class="icon" src="/images/my-list-icon2.png"></image>
<image class="icon" src="{{imageUrl}}my-list-icon2.png?t={{Timestamp}}"></image>
关注公众号
</view>
<view class="nav-item" bind:tap="handleCompanyOffice">
<image class="icon" src="/images/my-list-icon3.png"></image>
<image class="icon" src="{{imageUrl}}my-list-icon3.png?t={{Timestamp}}"></image>
联系我们
</view>
</view>

2
src/pages/search/index.ts

@ -14,7 +14,7 @@ Page({ @@ -14,7 +14,7 @@ Page({
list: [],
},
onLoad() {
app.waitLogin().then(() => {
app.waitLogin(false, true).then(() => {
this.setData({
focus: true,
});

6
src/pages/search/index.wxml

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<view class="page" style="padding-top:{{menuButtonInfo.bottom}}px;">
<view class="search">
<image class="icon" src="/images/icon-search.png"></image>
<image class="icon" src="{{imageUrl}}icon-search.png?t={{Timestamp}}"></image>
<input
type="text"
class="input"
@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
<view class="type">{{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}}</view>
<view class="stat">
<view class="s-item">
<image class="icon" src="/images/icon-eye.png"></image>
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
???
</view>
</view>
@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
</view>
</view>
<view class="empty-search" wx:if="{{search && pagination.count===0}}">
<image class="e-icon" src="/images/empty-1.png"></image>
<image class="e-icon" src="{{imageUrl}}empty-1.png?t={{Timestamp}}"></image>
<view class="content">
抱歉,未搜到相关内容
<view></view>

2
src/pages/switchLogin/index.wxml

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
/>
<view
class="page"
style="background: url('/images/login-bg.png') no-repeat top center/100% 624rpx;padding-top:{{menuButtonInfo.bottom}}px;"
style="background: url('{{imageUrl}}login-bg.png?t={{Timestamp}}') no-repeat top center/100% 624rpx;padding-top:{{menuButtonInfo.bottom}}px;"
>
<view class="container">
<view class="tel">

6
src/pages/topic/index.wxml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<view
class="page"
style="background: url('/images/topic-bg.png') no-repeat {{menuButtonInfo.bottom+62}}rpx center/100% 1284rpx;"
style="background: url('{{imageUrl}}topic-bg.png?t={{Timestamp}}') no-repeat {{menuButtonInfo.bottom+62}}rpx center/100% 1284rpx;"
>
<swiper
class="swiper"
@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
style="margin-top:{{menuButtonInfo.bottom+73}}px;"
>
<swiper-item wx:for="{{question}}" wx:key="index" wx:for-item="questionItem">
<view class="topic" style="background: url('/images/topic-card-bg.png') no-repeat top center/100% 1232rpx">
<view class="topic" style="background: url('{{imageUrl}}topic-card-bg.png?t={{Timestamp}}') no-repeat top center/100% 1232rpx">
<view class="order">
{{index + 1}}/
<text class="all">{{question.length}}</text>
@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
</view>
<view class="footer">
<view class="prev" bind:tap="handlePrev" wx:if="{{index>0}}">
<image class="icon" src="/images/icon-prev.png"></image>
<image class="icon" src="{{imageUrl}}icon-prev.png?t={{Timestamp}}"></image>
上一题
</view>
<view

4
src/pages/userInfo/index.wxml

@ -19,9 +19,9 @@ @@ -19,9 +19,9 @@
<image
wx:else
class="a-img"
src="/images/user.png"
src="{{imageUrl}}user.png?t={{Timestamp}}"
></image>
<image class="icon" src="/images/icon-pic.png"></image>
<image class="icon" src="{{imageUrl}}icon-pic.png?t={{Timestamp}}"></image>
</uploadFile>
</view>
</view>

2
typings/index.d.ts vendored

@ -10,7 +10,7 @@ interface IAppOption { @@ -10,7 +10,7 @@ interface IAppOption {
scene: null | { [key: string]: any };
};
userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback;
waitLogin: (waitLoginState?: boolean) => Promise<any>;
waitLogin: (waitLoginState?: boolean, requireLogin?: boolean) => Promise<any>;
getMenuInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>) => void;
getUserInfo: (arg0: WechatMiniprogram.Page.Instance<any, any>, arg1?: (arg0: any) => void) => void;
}

Loading…
Cancel
Save