diff --git a/miniprogram/app.js b/miniprogram/app.js
index 122a849..6a254a6 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -3,6 +3,13 @@ import { timestampToTime } from './utils/util'
App({
globalData: {
+ sessionKey: "",
+ openId: "",
+ token: "",
+ userInfo: null,
+ promotContentCount: "",
+ completionContentCount: "",
+ noticeText: ""
},
onLaunch() {
const that = this
@@ -38,9 +45,8 @@ App({
that.globalData.openId = res.data.openId
wx.setStorageSync('token', res.data.token)
that.globalData.token = res.data.token
-
- // 检查用户信息
- checkUserInfo()
+ // 获取通知栏信息文本
+ getNoticeText()
}).catch(err => {
console.log(err);
wx.showToast({
@@ -80,5 +86,27 @@ App({
console.log(err, 'err');
})
}
+
+ /**
+ * @description 获取通知栏信息文本
+ * @returns list
+ */
+ const getNoticeText = () => {
+ const that = this
+ request.get({
+ url: '/api/notice/list'
+ }).then(res => {
+ console.log(res, 'getNoticeText');
+ let noticeText = ''
+ res.data.forEach((item, index) => {
+ noticeText += index + 1 + '、' + item.content + ' '
+ })
+ that.globalData.noticeText = noticeText
+ // 检查用户信息
+ checkUserInfo()
+ }).catch(err => {
+ console.log(err, 'err');
+ })
+ }
},
})
\ No newline at end of file
diff --git a/miniprogram/app.json b/miniprogram/app.json
index 1665b15..cec93e6 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -7,7 +7,8 @@
"pages/chat/chat",
"pages/orderDetail/orderDetail",
"pages/userProtocol/userProtocol",
- "pages/mine/mine"
+ "pages/mine/mine",
+ "pages/productDetail/productDetail"
],
"window": {
"backgroundTextStyle": "light",
@@ -18,6 +19,7 @@
"style": "v2",
"sitemapLocation": "sitemap.json",
"usingComponents": {
+ "van-notice-bar": "@vant/weapp/notice-bar/index",
"van-toast": "@vant/weapp/toast/index"
}
}
\ No newline at end of file
diff --git a/miniprogram/pages/chat/chat.js b/miniprogram/pages/chat/chat.js
index a5b46e8..3ec3fd0 100644
--- a/miniprogram/pages/chat/chat.js
+++ b/miniprogram/pages/chat/chat.js
@@ -21,7 +21,8 @@ Page({
clearTimer: null,
interval: null,
promotContentCount: 0,
- completionContentCount: 0
+ completionContentCount: 0,
+ noticeText: ''
},
/**
@@ -32,7 +33,8 @@ Page({
this.chatLimit()
this.setData({
promotContentCount: wx.getStorageSync('promotContentCount'),
- completionContentCount: wx.getStorageSync('completionContentCount')
+ completionContentCount: wx.getStorageSync('completionContentCount'),
+ noticeText: app.globalData.noticeText ? app.globalData.noticeText : ''
})
},
@@ -67,6 +69,12 @@ Page({
})
},
+ // 跳转至产品详情页面
+ goToProductDetail() {
+ wx.navigateTo({
+ url: '/pages/productDetail/productDetail',
+ })
+ },
chatLimit() {
request.get({
diff --git a/miniprogram/pages/chat/chat.wxml b/miniprogram/pages/chat/chat.wxml
index bf2f992..87e34c2 100644
--- a/miniprogram/pages/chat/chat.wxml
+++ b/miniprogram/pages/chat/chat.wxml
@@ -1,4 +1,7 @@
+
+
+
diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js
index 0d6eca5..eae847a 100644
--- a/miniprogram/pages/index/index.js
+++ b/miniprogram/pages/index/index.js
@@ -15,7 +15,8 @@ Page({
logoActive: false,
timer: null,
touchFlag: "",
- isNotRead: true
+ isNotRead: true,
+ noticeText: ''
},
// 事件处理函数
bindViewTap() {
@@ -34,7 +35,11 @@ Page({
userInfo: res.data,
isPhone: that.data.userInfo.phone ? true : false
})
- this.getNoticeText()
+ if (app.globalData.noticeText) {
+ that.setData({
+ noticeText: app.globalData.noticeText
+ })
+ }
}
},
getUserProfile() {
@@ -60,6 +65,13 @@ Page({
})
},
+ // 跳转至产品详情页面
+ goToProductDetail() {
+ wx.navigateTo({
+ url: '/pages/productDetail/productDetail',
+ })
+ },
+
// 跳转至购买历史页面
checkPayHistory() {
wx.navigateTo({
@@ -67,13 +79,11 @@ Page({
})
},
-
getUserPhone(e) {
const sessionKey = wx.getStorageSync('sessionKey')
this.doGetUserPhone(e.detail.encryptedData, e.detail.iv, sessionKey, request.appId)
},
-
/** 获取手机号授权 */
doGetUserPhone(encryptedData, iv, sessionKey, appId) {
request.post({
@@ -172,7 +182,8 @@ Page({
checkCheatCodeStatus() {
if (this.data.logoActive) {
this.setData({
- isDevMode: true
+ isDevMode: true,
+ noticeText: '𝙒𝙚𝙡𝙘𝙤𝙢𝙚 𝘿𝙚𝙫𝙚𝙡𝙤𝙥𝙚𝙧 𝙔𝙒𝙌 !'
})
}
},
@@ -215,24 +226,6 @@ Page({
})
},
- /**
- * @description 获取通知栏信息文本
- * @returns list
- */
- getNoticeText() {
- const that = this
- request.get({
- url: '/api/notice/list'
- }).then(res => {
- console.log(res, 'getNoticeText');
- that.setData({
- noticeText: '"小闲聊"是一款基于人工智能技术开发的智能聊天机器人应用'
- })
- }).catch(err => {
- console.log(err, 'err');
- })
- },
-
onShareAppMessage() {
const promise = new Promise(resolve => {
setTimeout(() => {
diff --git a/miniprogram/pages/index/index.json b/miniprogram/pages/index/index.json
index 8c57617..a860429 100644
--- a/miniprogram/pages/index/index.json
+++ b/miniprogram/pages/index/index.json
@@ -1,6 +1,4 @@
{
"navigationBarTitleText": "首页",
- "usingComponents": {
- "van-notice-bar": "@vant/weapp/notice-bar/index"
- }
+ "usingComponents": {}
}
\ No newline at end of file
diff --git a/miniprogram/pages/index/index.less b/miniprogram/pages/index/index.less
index 82cc8a0..e286794 100644
--- a/miniprogram/pages/index/index.less
+++ b/miniprogram/pages/index/index.less
@@ -2,6 +2,7 @@
padding: 0 0 25rpx 0;
.logo {
+ position: relative;
width: 500rpx;
height: 120rpx;
line-height: 120rpx;
@@ -16,12 +17,28 @@
&.active {
color: aqua;
}
+
+ .tinyChatICon {
+ position: absolute;
+ top: 15rpx;
+ left: 20rpx;
+ width: 60rpx;
+ text-align: center;
+ transition: all 0.3s;
+
+ &.active {
+ transform: scale(1.05);
+ }
+
+ image {
+ width: 100%;
+ }
+ }
}
.introduction {
position: relative;
width: 600rpx;
- height: 850rpx;
margin: 50rpx auto;
padding: 0 20rpx;
border: 1px dashed #747474;
@@ -37,7 +54,6 @@
.contain {
width: 500rpx;
- height: 520rpx;
font-size: 30rpx;
color: #585858;
text-indent: 1cm;
@@ -88,27 +104,8 @@
}
- .tinyChatICon {
- position: relative;
- top: -85rpx;
- text-align: center;
- transition: all 0.3s;
-
- &.active {
- transform: scale(1.05);
- }
-
- image {
- position: absolute;
- left: 50%;
- transform: translate(-50%, 50%);
- width: 100rpx;
- }
- }
-
.buttons {
font-size: 25rpx;
- margin-top: 150rpx;
.userProtocolModel {
text-align: center;
diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml
index 4e0089d..c4a424a 100644
--- a/miniprogram/pages/index/index.wxml
+++ b/miniprogram/pages/index/index.wxml
@@ -1,11 +1,14 @@
-
-
+
+
-
- 𝑺𝒎𝒂𝒓𝒕-𝑪𝒉𝒂𝒕
+
+
+
+
+ 𝑺𝒎𝒂𝒓𝒕-𝑪𝒉𝒂𝒕
欢迎使用小闲聊
@@ -21,10 +24,6 @@
-
-
-
-
@@ -52,7 +51,7 @@
当前用户:{{userInfo.coverPhone}}
到期时间:{{userInfo.validEndTime}}
- 用户协议
+ 用户协议
延续历史
diff --git a/miniprogram/pages/productDetail/productDetail.js b/miniprogram/pages/productDetail/productDetail.js
new file mode 100644
index 0000000..62c501f
--- /dev/null
+++ b/miniprogram/pages/productDetail/productDetail.js
@@ -0,0 +1,66 @@
+// pages/productDetail/productDetail.ts
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pages/productDetail/productDetail.json b/miniprogram/pages/productDetail/productDetail.json
new file mode 100644
index 0000000..d0f2e87
--- /dev/null
+++ b/miniprogram/pages/productDetail/productDetail.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "关于我们",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/pages/productDetail/productDetail.less b/miniprogram/pages/productDetail/productDetail.less
new file mode 100644
index 0000000..2c16655
--- /dev/null
+++ b/miniprogram/pages/productDetail/productDetail.less
@@ -0,0 +1 @@
+/* pages/productDetail/productDetail.wxss */
\ No newline at end of file
diff --git a/miniprogram/pages/productDetail/productDetail.wxml b/miniprogram/pages/productDetail/productDetail.wxml
new file mode 100644
index 0000000..b800df5
--- /dev/null
+++ b/miniprogram/pages/productDetail/productDetail.wxml
@@ -0,0 +1,2 @@
+
+关于我们
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 61c1e54..9f3a2f1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -36,7 +36,7 @@
"miniprogram/pages/orderDetail/orderDetail.js",
"miniprogram/pages/userProtocol/userProtocol.js",
"miniprogram/pages/mine/mine.js",
- "miniprogram/components/userNumberChkeck/userNumberChkeck.js",
+ "miniprogram/components/userNumberChkeck/userNumberChkeck.js", "miniprogram/pages/productDetail/productDetail.js",
],
"exclude": [
"node_modules"