diff --git a/app.json b/app.json index d718c34..50f3120 100644 --- a/app.json +++ b/app.json @@ -27,7 +27,11 @@ "pages/aid/finance/index", "pages/aid/law/index", "pages/aid/detail/index", - "pages/aid/consult/index" + "pages/aid/consult/index", + "pages/ticket/index", + "pages/integral/index", + "pages/discountCoupon/index", + "pages/integralRecord/index" ], "subPackages": [ { diff --git a/assets/images/baike.png b/assets/images/baike.png new file mode 100644 index 0000000..62ac6d6 Binary files /dev/null and b/assets/images/baike.png differ diff --git a/assets/images/finance.png b/assets/images/finance.png new file mode 100644 index 0000000..c6d5b0f Binary files /dev/null and b/assets/images/finance.png differ diff --git a/assets/images/law.png b/assets/images/law.png new file mode 100644 index 0000000..62ee7f9 Binary files /dev/null and b/assets/images/law.png differ diff --git a/components/aid/index.wxss b/components/aid/index.wxss index 0a0f96d..8163535 100644 --- a/components/aid/index.wxss +++ b/components/aid/index.wxss @@ -28,7 +28,7 @@ } .synopsis { - height: 80rpx; + height: 75rpx; overflow: hidden; margin-top: 20rpx; margin-bottom: 10rpx; diff --git a/components/discountCoupon/index.js b/components/discountCoupon/index.js index dfbe50d..1100b62 100644 --- a/components/discountCoupon/index.js +++ b/components/discountCoupon/index.js @@ -19,6 +19,8 @@ Component({ * 组件的方法列表 */ methods: { - + handleUse() { + + } } }) \ No newline at end of file diff --git a/components/discountCoupon/index.json b/components/discountCoupon/index.json index e8cfaaf..3b51cdc 100644 --- a/components/discountCoupon/index.json +++ b/components/discountCoupon/index.json @@ -1,4 +1,6 @@ { "component": true, - "usingComponents": {} + "usingComponents": { + "van-button": "@vant/weapp/button/index" + } } \ No newline at end of file diff --git a/components/discountCoupon/index.wxml b/components/discountCoupon/index.wxml index f7a650d..bbee968 100644 --- a/components/discountCoupon/index.wxml +++ b/components/discountCoupon/index.wxml @@ -1,2 +1,32 @@ -components/discountCoupon/index.wxml \ No newline at end of file + + + + + + + 通用优惠券 + + + 有效期至2024.12.01 + + + + + + 30 + + + 满30可用 + + + + + + 仅限商城使用 + + + 去使用 + + + \ No newline at end of file diff --git a/components/discountCoupon/index.wxss b/components/discountCoupon/index.wxss index 96d216b..4dac214 100644 --- a/components/discountCoupon/index.wxss +++ b/components/discountCoupon/index.wxss @@ -1 +1,55 @@ -/* components/discountCoupon/index.wxss */ \ No newline at end of file +/* components/discountCoupon/index.wxss */ + +.wrapper { + padding: 24rpx; + border-radius: 16rpx; + background-color: #fff; +} + +.top { + display: flex; + justify-content: space-between; + border-bottom: 1rpx dashed #ccc; + padding-bottom: 20rpx; +} + +.top .right { + color: #fa541c; +} + +.price { + display: flex; + align-items: flex-end; + margin-bottom: 14rpx; +} + +.typeText { + font-weight: 700; + font-size: 42rpx; + margin-bottom: 20rpx; +} + +.time { + font-size: 30rpx; +} + +.price { + font-size: 44rpx; + line-height: 44rpx; +} + +.limit { + font-size: 30rpx; +} + +.bottom { + margin-top: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.bottom .left { + flex: 1; + font-size: 32rpx; +} \ No newline at end of file diff --git a/pages/discountCoupon/index.js b/pages/discountCoupon/index.js new file mode 100644 index 0000000..d474e1a --- /dev/null +++ b/pages/discountCoupon/index.js @@ -0,0 +1,66 @@ +// pages/discountCoupon/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/discountCoupon/index.json b/pages/discountCoupon/index.json new file mode 100644 index 0000000..a6d770b --- /dev/null +++ b/pages/discountCoupon/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "navigator": "/components/navigator/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/discountCoupon/index.wxml b/pages/discountCoupon/index.wxml new file mode 100644 index 0000000..3d23205 --- /dev/null +++ b/pages/discountCoupon/index.wxml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/pages/discountCoupon/index.wxss b/pages/discountCoupon/index.wxss new file mode 100644 index 0000000..5f4d834 --- /dev/null +++ b/pages/discountCoupon/index.wxss @@ -0,0 +1 @@ +/* pages/discountCoupon/index.wxss */ \ No newline at end of file diff --git a/pages/integral/index.js b/pages/integral/index.js new file mode 100644 index 0000000..cd63725 --- /dev/null +++ b/pages/integral/index.js @@ -0,0 +1,84 @@ +// pages/integral/index.js +import request from "../../utils/request" +import { getCurrentIntegral } from "../../service/system"; +const { OK } = request; + +Page({ + + /** + * 页面的初始数据 + */ + data: { + integral: 0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.getIntegral(); + }, + jumpToRecord() { + wx.navigateTo({ + url: '/pages/integralRecord/index', + }) + }, + async getIntegral() { + const { code, message, data } = await getCurrentIntegral(); + if (code !== OK) { + alertInfo(message) + return; + } + this.setData({ + integral: data?.balance || 0 + }) + }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/integral/index.json b/pages/integral/index.json new file mode 100644 index 0000000..9e5a1a4 --- /dev/null +++ b/pages/integral/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "navigator": "/components/navigator/index", + "discount-coupon": "/components/discountCoupon/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/integral/index.wxml b/pages/integral/index.wxml new file mode 100644 index 0000000..3fa518b --- /dev/null +++ b/pages/integral/index.wxml @@ -0,0 +1,11 @@ + + + + + 当前积分: {{ integral }} + 查看积分明细 + + + + + \ No newline at end of file diff --git a/pages/integral/index.wxss b/pages/integral/index.wxss new file mode 100644 index 0000000..6228fc8 --- /dev/null +++ b/pages/integral/index.wxss @@ -0,0 +1,19 @@ +/* pages/integral/index.wxss */ + +page { + background-color: rgb(242,243,245); +} + +.integralWrapper { + padding: 20rpx; +} + +.currentIntegral { + font-size: 34rpx; + display: flex; + justify-content: space-between; +} + +.ticketList { + margin-top: 20rpx; +} diff --git a/pages/integralRecord/index.js b/pages/integralRecord/index.js new file mode 100644 index 0000000..33703ae --- /dev/null +++ b/pages/integralRecord/index.js @@ -0,0 +1,89 @@ +// pages/integralRecord/index.js +import request from "../../utils/request" +import { getIntegralRecord } from "../../service/system"; +import { alertInfo, loadingFunc } from "../../utils"; +const { OK } = request; +Page({ + + /** + * 页面的初始数据 + */ + data: { + page: 1, + size: 20, + list: [], + total: 0, + totalPage: 0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + async init() { + const { page, size } = this.data; + const { code, message, data, total } = await getIntegralRecord({ page, size }) + if (code !== OK) { + alertInfo(message) + return; + } + this.setData({ + list: data || [], + total, + totalPage: Math.ceil(total / size), + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + const that = this; + loadingFunc(async () => { + await that.init(); + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/integralRecord/index.json b/pages/integralRecord/index.json new file mode 100644 index 0000000..a6d770b --- /dev/null +++ b/pages/integralRecord/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "navigator": "/components/navigator/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/integralRecord/index.wxml b/pages/integralRecord/index.wxml new file mode 100644 index 0000000..5b0a52c --- /dev/null +++ b/pages/integralRecord/index.wxml @@ -0,0 +1,2 @@ + + diff --git a/pages/integralRecord/index.wxss b/pages/integralRecord/index.wxss new file mode 100644 index 0000000..78be163 --- /dev/null +++ b/pages/integralRecord/index.wxss @@ -0,0 +1 @@ +/* pages/integralRecord/index.wxss */ \ No newline at end of file diff --git a/pages/my/index.js b/pages/my/index.js index b6acdd6..6a28faa 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -4,8 +4,10 @@ import Dialog from '@vant/weapp/dialog/dialog'; import { getUserInfo, logout } from "../../service/user"; import { getDot } from "../../utils/system"; import request from "../../utils/request" +import { getCurrentIntegral } from "../../service/system"; const { OK } = request; + Page({ /** @@ -15,6 +17,7 @@ Page({ user: {}, tenement: {}, visible: false, + integral: 0, }, /** @@ -63,9 +66,20 @@ Page({ } this.init() this.getUnReadNumber() + // this.getIntegral() const tenement = wx.getStorageSync('tenement') this.setData({ tenement }) }, + async getIntegral() { + const { code, message, data } = await getCurrentIntegral(); + if (code !== OK) { + alertInfo(message) + return; + } + this.setData({ + integral: data?.balance || 0 + }) + }, async init() { const tenement = wx.getStorageSync('tenement') const result = await getUserInfo(tenement?.id); @@ -86,6 +100,16 @@ Page({ url: '/pages/workBench/index', }) }, + jumpToIntegral() { + wx.navigateTo({ + url: '/pages/integral/index', + }) + }, + jumpToDiscountCoupon() { + wx.navigateTo({ + url: '/pages/discountCoupon/index', + }) + }, async getUnReadNumber() { const dot = await getDot(); this.setData({ diff --git a/pages/my/index.json b/pages/my/index.json index e3a3189..ac9188c 100644 --- a/pages/my/index.json +++ b/pages/my/index.json @@ -8,7 +8,8 @@ "navigator": "/components/navigator/index", "van-grid": "@vant/weapp/grid/index", "avatar": "/components/avatar/index", - "van-grid-item": "@vant/weapp/grid-item/index" + "van-grid-item": "@vant/weapp/grid-item/index", + "van-image": "@vant/weapp/image/index" }, "navigationBarTitleText": "我的", "navigationStyle": "custom" diff --git a/pages/my/index.wxml b/pages/my/index.wxml index 489f166..29fc796 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -12,12 +12,61 @@ - - - - + + + + 财税援助 + + + + 法律援助 + + + + 电力百科 + + @@ -29,7 +78,7 @@ - + diff --git a/pages/ticket/index.js b/pages/ticket/index.js new file mode 100644 index 0000000..4775f6c --- /dev/null +++ b/pages/ticket/index.js @@ -0,0 +1,66 @@ +// pages/ticket/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/ticket/index.json b/pages/ticket/index.json new file mode 100644 index 0000000..9e5a1a4 --- /dev/null +++ b/pages/ticket/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "navigator": "/components/navigator/index", + "discount-coupon": "/components/discountCoupon/index" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/ticket/index.wxml b/pages/ticket/index.wxml new file mode 100644 index 0000000..ef43b1f --- /dev/null +++ b/pages/ticket/index.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/pages/ticket/index.wxss b/pages/ticket/index.wxss new file mode 100644 index 0000000..2d42574 --- /dev/null +++ b/pages/ticket/index.wxss @@ -0,0 +1 @@ +/* pages/ticket/index.wxss */ \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index ee87624..fadfe0b 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -10,6 +10,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "pages/ticket/index", + "pathName": "pages/ticket/index", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "pages/aid/consult/index", "pathName": "pages/aid/consult/index", diff --git a/service/system.js b/service/system.js index 0e81520..6206f57 100644 --- a/service/system.js +++ b/service/system.js @@ -69,4 +69,14 @@ export const getAidDetail = async function(id) { // 提交财务/律师援助 export const askAid = async function(data) { return await POST(`/wx/aid/approve`, data); +} + +// 获取当前积分 +export const getCurrentIntegral = async function() { + return await GET(`/integral/getWxIntegralList`); +} + +// 获取积分明细 +export const getIntegralRecord = async function({ page, size }) { + return await GET(`/integral/getWxIntegralList/detail?page=${page}&size=${size}`); } \ No newline at end of file