From 53429bb4cfd5304d74f26a04f6cee45acc6201f0 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Fri, 12 Sep 2025 18:39:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- api/api.js | 5 +- api/model/activity.js | 5 + api/model/bind.js | 34 ++++++ api/model/coupon.js | 29 +++++ api/model/experience.js | 8 ++ api/model/login.js | 4 +- api/model/partner.js | 2 +- components/home/pictureLiveView.vue | 61 +++------- components/home/productView.vue | 2 +- components/partner/posterPopup.vue | 13 ++- components/product/productCard.vue | 3 + pages.json | 80 ++++++++++--- pages/index/category.vue | 74 ++---------- pages/index/center.vue | 21 ++-- pages/index/growing.vue | 70 ++++++----- pages/index/index.vue | 5 +- pages/index/partner.vue | 5 + pages_order/auth/wxLogin.vue | 6 +- pages_order/auth/wxUserInfo.vue | 40 +++---- pages_order/comment/commentCard.vue | 6 +- pages_order/comment/commentPopup.vue | 48 +++++--- pages_order/comment/commentRecords.vue | 22 ++-- pages_order/comment/recordFormPopup.vue | 87 +++++++++----- pages_order/coupon/couponList/couponCard.vue | 1 + pages_order/coupon/couponList/index.vue | 40 +------ pages_order/coupon/couponSelect/couponCard.vue | 6 +- pages_order/coupon/couponSelect/index.vue | 40 +------ pages_order/growing/activity/index.vue | 16 +++ pages_order/live/formPopup.vue | 38 +++--- pages_order/live/index.vue | 107 +++++------------ pages_order/live/list.vue | 83 ++++--------- pages_order/member/memberApplyCard.vue | 22 ++-- pages_order/member/memberBind.vue | 20 ++-- pages_order/member/memberCard.vue | 2 +- pages_order/member/memberList.vue | 63 ++-------- pages_order/member/switch.vue | 46 +------- pages_order/order/orderConfirm/infoPopup.vue | 50 ++++---- .../order/orderConfirm/peopleNumberInput.vue | 130 ++++++--------------- .../order/orderConfirm/timeOptionsSelect.vue | 5 +- pages_order/order/orderDetail/index.vue | 4 +- pages_order/order/orderList/index.vue | 9 +- pages_order/partner/apply.vue | 6 +- pages_order/partner/team.vue | 102 +--------------- pages_order/partner/withdraw.vue | 23 ++-- pages_order/product/productDetail.vue | 3 +- pages_order/traveler/travelerList.vue | 2 +- store/store.js | 26 ++++- 48 files changed, 615 insertions(+), 861 deletions(-) create mode 100644 api/model/bind.js create mode 100644 api/model/coupon.js diff --git a/App.vue b/App.vue index cc1058b..651fe9f 100644 --- a/App.vue +++ b/App.vue @@ -3,7 +3,7 @@ onLaunch: function() { }, onShow: function() { - // this.$store.commit('initConfig') + this.$store.commit('initConfig') }, onHide: function() { } diff --git a/api/api.js b/api/api.js index d38f8c5..ad64fc6 100644 --- a/api/api.js +++ b/api/api.js @@ -5,7 +5,7 @@ import utils from '../utils/utils.js' let limit = {} let debounce = {} -const models = ['login', 'index', 'image', 'activity', 'order', 'comment', 'experience', 'partner', 'info'] +const models = ['login', 'index', 'image', 'activity', 'coupon', 'order', 'comment', 'bind', 'experience', 'partner', 'info'] const config = { // 示例 @@ -14,7 +14,8 @@ const config = { // limit : 1000 // }, - getConfig : {url : '/config_common/getConfig', method : 'GET', limit : 500}, + getConfig : {url : '/config/queryConfigList', method : 'GET', limit : 500}, + queryConfigByParamCode : {url : '/config/queryConfigByParamCode', method : 'GET'}, } diff --git a/api/model/activity.js b/api/model/activity.js index a524a73..a8a2bd6 100644 --- a/api/model/activity.js +++ b/api/model/activity.js @@ -1,6 +1,11 @@ // 研学活动相关接口 const api = { + // 系统配置-查询研学活动分类列表 + queryCategoryList: { + url: '/config/queryCategoryList', + method: 'GET', + }, // 首页&分类-查询研学活动列表 queryActivityList: { url: '/activity/queryActivityList', diff --git a/api/model/bind.js b/api/model/bind.js new file mode 100644 index 0000000..51ef0a0 --- /dev/null +++ b/api/model/bind.js @@ -0,0 +1,34 @@ +// 成员管理相关接口 + +const api = { + // 成员管理-查询绑定成员列表 + queryBindList: { + url: '/bind/queryBindList', + method: 'GET', + auth: true, + }, + // 成员管理-查询绑定人信息 + queryBindUser: { + url: '/bind/queryBindUser', + method: 'GET', + auth: true, + }, + // 成员管理-绑定申请 + addBind: { + url: '/bind/addBind', + method: 'POST', + auth: true, + limit : 500, + showLoading : true, + }, + // 成员管理-审批绑定申请 + updateBind: { + url: '/bind/updateBind', + method: 'POST', + auth: true, + limit : 500, + showLoading : true, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/coupon.js b/api/model/coupon.js new file mode 100644 index 0000000..29232eb --- /dev/null +++ b/api/model/coupon.js @@ -0,0 +1,29 @@ +// 优惠券相关接口 + +const api = { + // 优惠券-我的优惠券列表 + queryCouponList: { + url: '/coupon/queryCouponList', + method: 'GET', + auth: true, + }, + // 优惠券-根据id查看优惠券详情 + queryCouponById: { + url: '/coupon/queryCouponById', + method: 'GET', + }, + // 优惠券-查看可领取的优惠券 + queryFetchCouponList: { // todo: check use in where? + url: '/coupon/queryFetchCouponList', + method: 'GET', + auth: true, + }, + // 优惠券-领取优惠券 + fetchCoupon: { // todo: check use in where? + url: '/coupon/fetchCoupon', + method: 'POST', + auth: true, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/experience.js b/api/model/experience.js index 9b8e126..ba8b88a 100644 --- a/api/model/experience.js +++ b/api/model/experience.js @@ -11,6 +11,14 @@ const api = { url: '/experience/queryExperienceById', method: 'GET', }, + // 成长档案-新增成长档案 + addExperience: { + url: '/experience/addExperience', + method: 'POST', + auth: true, + limit : 500, + showLoading : true, + }, } export default api \ No newline at end of file diff --git a/api/model/login.js b/api/model/login.js index ffaa447..a08f43f 100644 --- a/api/model/login.js +++ b/api/model/login.js @@ -18,7 +18,7 @@ const api = { }, // 修改个人信息接口 updateInfo: { - url: '/info_common/updateInfo', + url: '/userInfo/updateUser', method: 'POST', auth: true, limit : 500, @@ -26,7 +26,7 @@ const api = { }, // 获取个人信息 getInfo: { - url: '/info_common/getInfo', + url: '/userInfo/queryUser', method: 'GET', auth: true, }, diff --git a/api/model/partner.js b/api/model/partner.js index 8d8dedd..97e5bf3 100644 --- a/api/model/partner.js +++ b/api/model/partner.js @@ -31,7 +31,7 @@ const api = { method: 'GET', }, // 我的团队-获取间推用户列表 - queryDirectList: { + queryIndirectList: { url: '/partner/queryIndirectList', method: 'GET', }, diff --git a/components/home/pictureLiveView.vue b/components/home/pictureLiveView.vue index 0acb3b5..b9288f7 100644 --- a/components/home/pictureLiveView.vue +++ b/components/home/pictureLiveView.vue @@ -27,7 +27,7 @@ - + {{ item.title }} {{ item.createTime }} @@ -52,57 +52,26 @@ }, methods: { async getData() { - - this.list = [ - { - id: '001', - image: '/static/image/temp-15.png', - title: '苕溪露营漂流', - createTime: '2025-04-18', - }, - { - id: '002', - image: '/static/image/temp-15.png', - title: '科技奇遇记', - createTime: '2025-04-18', - }, - { - id: '003', - image: '/static/image/temp-15.png', - title: '满陇桂雨', - createTime: '2025-04-18', - }, - { - id: '004', - image: '/static/image/temp-15.png', - title: '跟着皇帝游江南', - createTime: '2025-04-18', - }, - { - id: '005', - image: '/static/image/temp-15.png', - title: '苕溪露营漂流', - createTime: '2025-04-18', - }, - { - id: '006', - image: '/static/image/temp-15.png', - title: '科技奇遇记', - createTime: '2025-04-18', - }, - ] - - return - - // todo: check try { - this.list = await this.$fetch('queryImageList', { pageNo: 1, pageSize: 8 }) + this.list = (await this.$fetch('queryImageList', { pageNo: 1, pageSize: 8 }))?.records?.map(item => { + const { id, image, activityId_dictText, createTime } = item + + const images = image?.split?.(',') || [] + + return { + id, + url: images?.[0], + images, + title: activityId_dictText, + createTime: this.$dayjs(createTime).format('YYYY-MM-DD'), + } + }) } catch (err) { } - }, jumpToLive(id) { + this.$store.commit('setLiveInfo', this.list.find(item => item.id === id)) this.$utils.navigateTo(`/pages_order/live/index?id=${id}`) }, showAll() { diff --git a/components/home/productView.vue b/components/home/productView.vue index 6b92b2e..f5eb9a8 100644 --- a/components/home/productView.vue +++ b/components/home/productView.vue @@ -73,7 +73,7 @@ // todo: fetch this.tabs = [ { name: '全部' }, - { id: '1962342791093227522', name: '研学活动一', disabled: true, }, + // { id: '1962342791093227522', name: '研学活动一', disabled: true, }, ] }, onClickTab(e) { diff --git a/components/partner/posterPopup.vue b/components/partner/posterPopup.vue index dba142f..bba815b 100644 --- a/components/partner/posterPopup.vue +++ b/components/partner/posterPopup.vue @@ -21,6 +21,8 @@ diff --git a/pages_order/comment/recordFormPopup.vue b/pages_order/comment/recordFormPopup.vue index d8bf00d..1263e7c 100644 --- a/pages_order/comment/recordFormPopup.vue +++ b/pages_order/comment/recordFormPopup.vue @@ -10,18 +10,17 @@ - + 关联项目 - {{ projectDesc }} + {{ projectDesc }} 请选择关联项目 @@ -30,31 +29,31 @@ - + 行程 - + - + 景点 - + - + 导师 - + @@ -89,6 +88,8 @@ diff --git a/pages_order/growing/activity/index.vue b/pages_order/growing/activity/index.vue index 0651385..48dd517 100644 --- a/pages_order/growing/activity/index.vue +++ b/pages_order/growing/activity/index.vue @@ -112,6 +112,22 @@ }, methods: { async getData() { + + try { + const result = await this.$fetch('queryExperienceById', { recordId: this.id }) + const { image, thoughts } = result + + this.detail = { + highlights: image?.split?.(',') || [], + // todo: check key + thoughts, + // todo: check key about "行后报告" + } + } catch (err) { + + } + + return // todo this.detail = { diff --git a/pages_order/live/formPopup.vue b/pages_order/live/formPopup.vue index 9439990..2d6c493 100644 --- a/pages_order/live/formPopup.vue +++ b/pages_order/live/formPopup.vue @@ -14,14 +14,14 @@ errorType="toast" > - + 关联项目 - {{ projectDesc }} + {{ projectDesc }} 请选择关联项目 @@ -75,14 +75,14 @@ data() { return { form: { - project: null, + activityId: null, area: null, latitude: null, longitude: null, images: [], }, rules: { - 'project': { + 'activityId': { type: 'string', required: true, message: '请选择关联项目', @@ -104,8 +104,8 @@ }, computed: { projectDesc() { - const { project } = this.form - const target = this.projects?.find?.(item => item.id === project) + const { activityId } = this.form + const target = this.projects?.find?.(item => item.id === activityId) return target?.name || '' }, @@ -160,18 +160,15 @@ ] }, async open(id) { - // todo: auto bind project by id? + // todo: auto bind activityId by id? await this.getData() - const texts = this.questions.map(() => '') - this.form = { - project: null, - tripNum: null, - spotNum: null, - mentorNum: null, + activityId: null, + area: null, + latitude: null, + longitude: null, images: [], - texts, } this.$refs.popup.open() @@ -180,10 +177,10 @@ this.$refs.popup.close() }, openRelatePojectPicker() { - this.$refs.reloateProjectPopup.open(this.form.project?.id || null) + this.$refs.reloateProjectPopup.open(this.form.activityId?.id || null) }, onRelateProjectChange(id) { - this.form.project = id + this.form.activityId = id }, //地图上选择地址 selectAddr() { @@ -212,13 +209,18 @@ await this.$refs.form.validate() const { + activityId, + area, + images, } = this.form const params = { + activityId, + address: area, + image: images.join(',') } - // todo: fetch - // await this.$fetch('updateAddress', params) + await this.$fetch('addImage', params) uni.showToast({ icon: 'success', diff --git a/pages_order/live/index.vue b/pages_order/live/index.vue index 02dbd7a..d58abdc 100644 --- a/pages_order/live/index.vue +++ b/pages_order/live/index.vue @@ -1,14 +1,14 @@ diff --git a/pages_order/order/orderConfirm/infoPopup.vue b/pages_order/order/orderConfirm/infoPopup.vue index 1613afe..89341bc 100644 --- a/pages_order/order/orderConfirm/infoPopup.vue +++ b/pages_order/order/orderConfirm/infoPopup.vue @@ -19,28 +19,24 @@ - + - + 选择人数 @@ -77,6 +73,12 @@ import timeCalendarSelect from '@/pages_order/order/orderConfirm/timeCalendarSelect.vue' import peopleNumberInput from '@/pages_order/order/orderConfirm/peopleNumberInput.vue' + const TYPE_INDEX_MAPPING = { + '成人': 0, + '青少年': 1, + '儿童': 2, + } + export default { components: { timeOptionsSelect, @@ -96,25 +98,29 @@ options: [], form: { time: null, - adults: 0, - teenager: 0, - child: 0, + prices: [], members: [], }, formItemStyle: { padding: 0 }, } }, computed : { - ...mapState(['configList', 'travelerList']), - selectTimeObj() { + ...mapState(['configList', 'userInfo', 'travelerList']), + priceList() { const { time: id } = this.form - const { timeOptions } = this.data + const { dateList } = this.data + + let priceList = dateList?.[0]?.priceList || [] if (id) { - return timeOptions?.find?.(option => option.id === id) || {} + priceList = dateList?.find?.(option => option.id === id)?.priceList || [] } - return timeOptions?.[0] || {} + priceList.sort((a, b) => { + return TYPE_INDEX_MAPPING[a.period_dictText] - TYPE_INDEX_MAPPING[b.period_dictText] + }) + + return priceList }, }, watch: { @@ -144,13 +150,12 @@ required: true, message: '请选择团期', }, - 'adults': { - type: 'number', - required: true, + 'prices': { + type: 'array', message: '请选择人数', validator: (rule, value, callback) => { - if (adults || teenager || child) { + if (value.some(num => num > 0)) { return true } @@ -169,7 +174,8 @@ }, async getDefaultMembers() { try { - return (await this.$fetch('queryTouristList', { isDefault: '1' })).records + // todo: check params + return (await this.$fetch('queryTouristList', { pageNo: 1, pageSize: 1000, userId: this.userInfo.id, isDefault: '1' })).records } catch (err) { return [] } diff --git a/pages_order/order/orderConfirm/peopleNumberInput.vue b/pages_order/order/orderConfirm/peopleNumberInput.vue index 5f5291d..b384121 100644 --- a/pages_order/order/orderConfirm/peopleNumberInput.vue +++ b/pages_order/order/orderConfirm/peopleNumberInput.vue @@ -1,69 +1,19 @@