From 57fa7980cf25caad28486983576320f80024873d Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 24 Jun 2024 14:07:32 +0800 Subject: [PATCH 01/27] ad --- config/app.js | 4 ++-- pages/index/index.vue | 34 +++++++++++++--------------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/config/app.js b/config/app.js index 85facca..ab2ac5f 100644 --- a/config/app.js +++ b/config/app.js @@ -1,8 +1,8 @@ let BASE_URL import store from "@/store/user.js" // 环境 -// let env = "dev" -let env = "prod" +let env = "dev" +// let env = "prod" // let env = "liu"; switch (env) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 254ab6f..955ee96 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -247,8 +247,8 @@ import useUserStore from "@/store/user"; const userStore = useUserStore(); const STORE_INFO = reactive({ - id: 23, - store_name: "农(特)产品直营店" + id: '', + store_name: "" }) const getStoreInfoFn = () => { @@ -370,8 +370,7 @@ name: '', order: '', store_name: '', - // store_id: 23 - store_id: 4 + store_id: '' }) const loading = ref(true); @@ -387,8 +386,7 @@ if (class_all) class_id = ""; //只能带其中一个 if (loadmore) where.value.page_no++; else where.value.page_no = 1; - // where.value.store_id = 23 - where.value.store_id = 4 + console.log('where------------', where.value) goodListApi({ ...where.value, class_all: class_all, @@ -397,11 +395,6 @@ }).then(res => { if (loadmore) goodList.value.push(...res.data.lists); else goodList.value = res.data.lists; - // 补充店铺信息 - // if (!STORE_INFO.store_name || !STORE_INFO.detailed_address) { - // STORE_INFO.store_name = res.data.store.name; - // STORE_INFO.value.detailed_address = res.data.store.detailed_address; - // } }) } @@ -423,9 +416,7 @@ page_no: page_no, page_size: 30, level: three, - // store_id: STORE_INFO.id // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 - // store_id: 23 // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 - store_id: 4 // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 + store_id: STORE_INFO.id // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 }).then(res => { if (pid == 0) { // 加载一级分类时设置全部分类 if (!res.data?.lists?.length) return; @@ -527,10 +518,7 @@ const openGoodPopup = (item) => { // 打开数量/重量弹窗 goodData.value = item; goodRef.value.setData(item); - // goodRef.value.founcsFn(); showGoodPopup.value = true; - - //统计商品的访问记录 productLogApi({ product_id: item.product_id, @@ -609,13 +597,17 @@ getShareInfo() onLoad(async (opt) => { - where.value.store_id = opt.id || STORE_INFO.id; - // 店铺id if (opt.id) { + where.value.store_id = (opt.id == 'undefined' ? STORE_INFO.id : opt.id); + } else { + where.value.store_id = STORE_INFO.id + } + // 店铺id + if (opt.id && opt.id != 'undefined') { + console.log(opt.id, opt.id != 'undefined', "进来了这里") where.value.store_id = opt.id; const info = await shopDetailApi({ - store_id: 4 - // store_id: 23 + store_id: where.value.store_id }); // 分享参数至当前用户参数 if (opt.spread_uid) { From 9086ccd76fbc193ec027a870fe7825edf68bcdff Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 24 Jun 2024 14:20:47 +0800 Subject: [PATCH 02/27] add --- pages/index/index.vue | 1 - pages/login/test.vue | 1 - 2 files changed, 2 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 955ee96..93ae8a3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -386,7 +386,6 @@ if (class_all) class_id = ""; //只能带其中一个 if (loadmore) where.value.page_no++; else where.value.page_no = 1; - console.log('where------------', where.value) goodListApi({ ...where.value, class_all: class_all, diff --git a/pages/login/test.vue b/pages/login/test.vue index 4611f40..32c2ed4 100644 --- a/pages/login/test.vue +++ b/pages/login/test.vue @@ -94,7 +94,6 @@ }) uni.setStorageSync('token', res.data.token); userStore.setToken(res.data.token); - console.log(res.data.token) userInfoApi().then(res => { const user = res.data; userStore.setUserInfo(user); From edb5d70e9a95495dd6dea9939bfbb44284198bcc Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 24 Jun 2024 15:03:11 +0800 Subject: [PATCH 03/27] add --- api/address.js | 4 ++ pageQuota/balanceDetail/index.vue | 83 +++++++++++++++++++++++++++++++ pages.json | 9 +++- pages/index/index.vue | 7 ++- pages/login/test.vue | 6 ++- pages/my/my.vue | 8 +-- 6 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 pageQuota/balanceDetail/index.vue diff --git a/api/address.js b/api/address.js index 50022aa..7cd7b05 100644 --- a/api/address.js +++ b/api/address.js @@ -29,4 +29,8 @@ export const getMassageCode = (data) => { export const setPayPassword = (data) => { return request.post('/user/user/set_payPassword', data); +} + +export const getFundList = (data) => { + return request.get('/user/user/fundList', data); } \ No newline at end of file diff --git a/pageQuota/balanceDetail/index.vue b/pageQuota/balanceDetail/index.vue new file mode 100644 index 0000000..47c6ca0 --- /dev/null +++ b/pageQuota/balanceDetail/index.vue @@ -0,0 +1,83 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index c1ae891..2db36bc 100644 --- a/pages.json +++ b/pages.json @@ -234,9 +234,14 @@ "navigationBarTitleText": "会员报备", "enablePullDownRefresh": true } + }, + { + "path": "balanceDetail/index", + "style": { + "navigationBarTitleText": "余额明细", + "enablePullDownRefresh": true + } } - - ] } ], diff --git a/pages/index/index.vue b/pages/index/index.vue index 93ae8a3..749cef2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -232,7 +232,8 @@ import { productLogApi, userInfoApi, - getStoreInfo + getStoreInfo, + loginUpdateUserApi } from "@/api/user.js"; import viewPopup from "@/components/viewPopup.vue" import goodPopup from "@/components/goodPopup.vue" @@ -630,6 +631,10 @@ userInfoApi().then(res => { const user = res.data; userStore.setUserInfo(user); + if (!user.openid) loginUpdateUserApi({ + mobile: user.mobile + }) + if (user.is_staff == 1) { uni.reLaunch({ url: "/multipleShop/verificationOrder/index" diff --git a/pages/login/test.vue b/pages/login/test.vue index 32c2ed4..f66e9f3 100644 --- a/pages/login/test.vue +++ b/pages/login/test.vue @@ -39,7 +39,8 @@ userLoginApi, userInfoApi, getStoreInfo, - getloginSms + getloginSms, + loginUpdateUserApi } from "@/api/user.js"; import { ref, @@ -97,6 +98,9 @@ userInfoApi().then(res => { const user = res.data; userStore.setUserInfo(user); + if (!user.openid) loginUpdateUserApi({ + mobile: user.mobile + }) uni.reLaunch({ url: '/pages/index/index' }) // 存储token到本地存储中 diff --git a/pages/my/my.vue b/pages/my/my.vue index 7109249..351e715 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -43,20 +43,20 @@ - + {{userInfo.now_money||"0.00"}} 余额 - + {{userInfo.purchase_funds||'0.00'}} 采购款 - + {{userInfo.return_money||'0.00'}} 返还金 - + {{userInfo.integral ||"0.00"}} 礼品券 From 1e52c22acda00c884ec19a8d6208f2fe0006b494 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 24 Jun 2024 15:27:45 +0800 Subject: [PATCH 04/27] add --- pageQuota/balanceDetail/index.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pageQuota/balanceDetail/index.vue b/pageQuota/balanceDetail/index.vue index 47c6ca0..8a098ad 100644 --- a/pageQuota/balanceDetail/index.vue +++ b/pageQuota/balanceDetail/index.vue @@ -1,18 +1,17 @@ @@ -24,13 +56,14 @@ reactive } from "vue" import { - onLoad + onLoad, + onPullDownRefresh } from "@dcloudio/uni-app" import { getFundList } from "@/api/address.js" - + const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细'] const tabsLst = reactive([{ name: '全部' }, @@ -50,20 +83,28 @@ const lists = ref([]) - let type = '' - const getLists = async () => { + let type = ref('') + const getLists = async (isPullDown = false) => { let res = await getFundList({ - type, + type: type.value, mark: mark.value || '' }) lists.value = res.data.lists + if (isPullDown) uni.stopPullDownRefresh() + } - onLoad((opt) => { - type = opt.type + type.value = opt.type + uni.setNavigationBarTitle({ + title: navLists[type.value] + }) getLists() }) + + onPullDownRefresh(() => { + getLists(true) + })