From d90e244633a15f705370e09d070fc33052e47efa Mon Sep 17 00:00:00 2001 From: doudou201703 <84085676+doudou201703@users.noreply.github.com> Date: Sat, 19 Sep 2026 11:48:36 +0800 Subject: [PATCH] six_uniapp_0006 --- package.json | 40 ++-- src/App.vue | 5 - src/components/ChildComScroll.vue | 1 - src/hooks/mini用户类型.ts | 1 + src/hooks/更新小程序版本.ts | 2 +- src/hooks/用户的积分列表的类型.ts | 4 +- src/pageTabBar/Home/Home.vue | 145 +++++++++---- src/pageTabBar/Home/首页组件红包.vue | 12 +- src/pageTabBar/Home/首页组件超划算.vue | 13 +- src/pages.json | 7 - src/pages/index.vue | 183 ++++++----------- src/stores/piniaPro/miniChatStore.ts | 2 - .../demo测试页面/demo测试页面.vue | 192 ++++++------------ .../商品详情页面/goods-com-pay-card.vue | 96 ++++----- .../商品详情页面/商品详情页面.vue | 11 +- .../user-component-points-card.vue | 63 ++++-- .../用户积分页面/用户积分页面.vue | 1 + 17 files changed, 361 insertions(+), 417 deletions(-) diff --git a/package.json b/package.json index ce6b48e..69d96b3 100644 --- a/package.json +++ b/package.json @@ -10,22 +10,22 @@ "type-check": "vue-tsc --noEmit" }, "dependencies": { - "@dcloudio/uni-app": "3.0.0-5020420260813003", - "@dcloudio/uni-app-harmony": "3.0.0-5020420260813003", - "@dcloudio/uni-app-plus": "3.0.0-5020420260813003", - "@dcloudio/uni-components": "3.0.0-5020420260813003", - "@dcloudio/uni-h5": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-alipay": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-baidu": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-harmony": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-jd": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-kuaishou": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-lark": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-qq": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-toutiao": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-weixin": "3.0.0-5020420260813003", - "@dcloudio/uni-mp-xhs": "3.0.0-5020420260813003", - "@dcloudio/uni-quickapp-webview": "3.0.0-5020420260813003", + "@dcloudio/uni-app": "3.0.0-5020620260917001", + "@dcloudio/uni-app-harmony": "3.0.0-5020620260917001", + "@dcloudio/uni-app-plus": "3.0.0-5020620260917001", + "@dcloudio/uni-components": "3.0.0-5020620260917001", + "@dcloudio/uni-h5": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-alipay": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-baidu": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-harmony": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-jd": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-kuaishou": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-lark": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-qq": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-toutiao": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-weixin": "3.0.0-5020620260917001", + "@dcloudio/uni-mp-xhs": "3.0.0-5020620260917001", + "@dcloudio/uni-quickapp-webview": "3.0.0-5020620260917001", "@dcloudio/uni-ui": "^1.5.12", "@uni-helper/axios-adapter": "^1.18.1", "@uni-helper/uni-network": "^0.24.2", @@ -49,10 +49,10 @@ }, "devDependencies": { "@dcloudio/types": "^3.4.8", - "@dcloudio/uni-automator": "3.0.0-5020420260813003", - "@dcloudio/uni-cli-shared": "3.0.0-5020420260813003", - "@dcloudio/uni-stacktracey": "3.0.0-5020420260813003", - "@dcloudio/vite-plugin-uni": "3.0.0-5020420260813003", + "@dcloudio/uni-automator": "3.0.0-5020620260917001", + "@dcloudio/uni-cli-shared": "3.0.0-5020620260917001", + "@dcloudio/uni-stacktracey": "3.0.0-5020620260917001", + "@dcloudio/vite-plugin-uni": "3.0.0-5020620260917001", "@mini-types/alipay": "^3.0.14", "@types/node": "^25.6.0", "@uni-helper/plugin-uni": "0.1.0", diff --git a/src/App.vue b/src/App.vue index cbcb94d..982dd30 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,6 @@ console.log("扫描小程序码", options); xiaoMain.superior_unionid = options.query.scene ?? 上级分享者的默认值; } - console.log("=======================", options, xiaoMain.superior_unionid); // 如果值为null了 就需要 调用了 xiaoMain.wechatLogin(options?.scene, xiaoMain.superior_unionid, options?.shareTicket, getDeviceInfo).then((data) => { @@ -64,12 +63,10 @@ xiaoMain.用户_IP地址转信息(地址_IP转地址, xiaoMain.mini_openid, xiaoMain.mini_unionid); xiaoMain.query_积分统计查询(积分_统计查询, xiaoMain.mini_openid, xiaoMain.mini_unionid); xiaoMain.代金券默认领券事件(卡券_领券, xiaoMain.mini_openid, xiaoMain.mini_unionid); - }); }); wx.checkIsAddedToMyMiniProgram({ success: (res) => { - console.log(res, "添加到我的小程序了吗"); } }); wx.showShareMenu({ @@ -82,7 +79,6 @@ }, }); wx.onUserCaptureScreen(() => { - console.log("=======================监听调用了吗", xiaoMain.mini_unionid); return { query: `superior_unionid=${xiaoMain.mini_unionid}`, // 通过截屏图片打开小程序的query参数 promise: new Promise((resolve) => { // 通过promise延时传递小程序的query参数 @@ -120,6 +116,5 @@ @import "@/assets/font.css"; diff --git a/src/components/ChildComScroll.vue b/src/components/ChildComScroll.vue index aa284a0..531207b 100644 --- a/src/components/ChildComScroll.vue +++ b/src/components/ChildComScroll.vue @@ -183,7 +183,6 @@ } }); - console.log("99999999999", info_window.screenHeight, info_window.safeArea.bottom); const 整个高度_rpx = 整个高度.value + "rpx"; statusHeight.value = 整个高度_rpx; diff --git a/src/hooks/mini用户类型.ts b/src/hooks/mini用户类型.ts index dec041c..fb218d4 100644 --- a/src/hooks/mini用户类型.ts +++ b/src/hooks/mini用户类型.ts @@ -42,6 +42,7 @@ export type ShareData类型 = { share分享者unionid: string; share总积分: number; share可提现积分: number; + share提现中积分: number; share不可提现积分: number; share已提现积分: number; share点击次数: number diff --git a/src/hooks/更新小程序版本.ts b/src/hooks/更新小程序版本.ts index 5cb5047..408a189 100644 --- a/src/hooks/更新小程序版本.ts +++ b/src/hooks/更新小程序版本.ts @@ -3,7 +3,7 @@ export const checkUpdate更新小程序版本 = async (): Promise => { updateManager.onCheckForUpdate(function (res) { // 请求完新版本信息的回调 - console.log(res.hasUpdate); + console.log("是否有版本更新没有为false,有则为true", res.hasUpdate); }); updateManager.onUpdateReady(function () { diff --git a/src/hooks/用户的积分列表的类型.ts b/src/hooks/用户的积分列表的类型.ts index fe526a6..23f21df 100644 --- a/src/hooks/用户的积分列表的类型.ts +++ b/src/hooks/用户的积分列表的类型.ts @@ -19,7 +19,9 @@ export interface ShareRecord子元素类型 { share点击者openid: string; share点击者昵称: string; share日期: DateTime | null; - share积分是否可以提现的状态: "可提现" | "不可提现" | "已提现"; + share积分是否可以提现的状态: "可提现" | "不可提现" | "已提现" | "WAIT_USER_CONFIRM" | null | "SUCCESS" | "FAIL" | "CANCELLED"; + share提现微信侧返回的提现状态: "可提现" | "不可提现" | "已提现" | "WAIT_USER_CONFIRM" | null | "SUCCESS" | "FAIL" | "CANCELLED"; + share提现用户提现状态: "可提现" | "不可提现" | "已提现" | "WAIT_USER_CONFIRM" | null | "SUCCESS" | "FAIL" | "CANCELLED"; share日期时间: DateTime | null; dateAndTime: DateTime; updateTime: DateTime; diff --git a/src/pageTabBar/Home/Home.vue b/src/pageTabBar/Home/Home.vue index dcd455f..350753b 100644 --- a/src/pageTabBar/Home/Home.vue +++ b/src/pageTabBar/Home/Home.vue @@ -2,7 +2,6 @@ //@import "@/assets/demo.scss"; .phone-screen { box-sizing: border-box; - font-size: 28rpx; font-family: "xiaoFont", sans-serif; height: v-bind(pxScreenHeight); //background-image: url("https://hudie.xiao.band/wechatbackimg.png"); @@ -84,57 +83,61 @@ } diff --git a/src/pageTabBar/Home/首页组件红包.vue b/src/pageTabBar/Home/首页组件红包.vue index b19c746..2e5ce28 100644 --- a/src/pageTabBar/Home/首页组件红包.vue +++ b/src/pageTabBar/Home/首页组件红包.vue @@ -323,14 +323,13 @@ } } } - } } } @@ -528,7 +528,7 @@ defineOptions({options: {styleIsolation: "shared"}, name: "home-com-hong-meng"}); // 组件使用 const sendcoupon = async (e: Send发放优惠类回调类型): Promise => { await wx.vibrateShort({type: xiaoMain.vibrateShort震动效果.heavy}); - console.log("这里是事件点击领券时触发", e); + console.log("是怎么触发了呀", e); if (e.target.send_coupon_result.at(0)?.code === "SUCCESS") { console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 onSendonSendonSendonSendonSendonSendonSend ",); let data = await useRequest(卡券_领券后更新当前券的状态, { @@ -545,7 +545,7 @@ await wx.vibrateShort({type: "heavy"});//medium heavy light console.log("放到卡包后触发", params); if (params.target.send_coupon_result.at(0)?.code === "SUCCESS") { - console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 onConfirmonConfirmonConfirmonConfirmonConfirmonConfirmonConfirm ",); + console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 放到卡包后触发放到卡包后触发放到卡包后触发放到卡包后触发放到卡包后触发 ",); } }; const 震动效果 = async (): Promise => { @@ -554,7 +554,6 @@ const info = wx.getDeviceInfo(); wx.onWindowResize(res => { const w = res.size.windowWidth; - console.log("-----------", w); // 按窗口宽度切布局,而不是按 model }); const 进入积分页面展示即时结算的功能 = async (): Promise => { @@ -635,7 +634,6 @@ console.log(xiaoMain.six_good); uni.navigateTo({url: "/subPackages/homeSubPages/商品详情页面/商品详情页面"}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"})); } - } catch (e) { console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e); } diff --git a/src/pageTabBar/Home/首页组件超划算.vue b/src/pageTabBar/Home/首页组件超划算.vue index 5b83327..730f73f 100644 --- a/src/pageTabBar/Home/首页组件超划算.vue +++ b/src/pageTabBar/Home/首页组件超划算.vue @@ -192,7 +192,7 @@ - 六果泡泡 + {{ value.title }} ¥ @@ -254,9 +254,12 @@ import {ref} from "vue"; const goods_list = ref([ - {img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp.png"}, - {img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp2.png"}, - {img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/139bd00dec9c4e39d6c3cb17fc9a098a.jpg"}, + {img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp.png", title: "通用装"}, + {img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp2.png", title: "母婴装"}, + { + img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/139bd00dec9c4e39d6c3cb17fc9a098a.jpg", + title: "强力去污" + }, ]); let theme = ref(uni.getAppBaseInfo().theme); // 返回值为 dark or linght defineOptions({options: {styleIsolation: "shared"}, name: "home-com-chao-hua-shuai"}); // 组件使用 diff --git a/src/pages.json b/src/pages.json index 8ec8399..f5a9007 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,11 +1,4 @@ { - "easycom": { - "autoscan": true, - "custom": { - "^nut-(.*)?-(.*)": "nutui-uniapp/components/$1$2/$1$2.vue", - "^nut-(.*)": "nutui-uniapp/components/$1/$1.vue" - } - }, "pages": [ { "path": "pageTabBar/Home/Home", diff --git a/src/pages/index.vue b/src/pages/index.vue index 849ffde..cf2ad83 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -1,20 +1,5 @@ diff --git a/src/stores/piniaPro/miniChatStore.ts b/src/stores/piniaPro/miniChatStore.ts index 521921c..0ce8709 100644 --- a/src/stores/piniaPro/miniChatStore.ts +++ b/src/stores/piniaPro/miniChatStore.ts @@ -136,7 +136,6 @@ export const useMainXiaoStore = defineStore("MainXiaoStore", () => { method: "POST", data: {self_mini_openid: self_mini_openid, self_mini_unionid: self_mini_unionid,} }); mini_user_积分数据.value = data.data.value; - console.log(data.data.value); } catch (e) { console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e); } @@ -177,7 +176,6 @@ export const useMainXiaoStore = defineStore("MainXiaoStore", () => { } }); mini_代金券数据.value = data.data.value; - console.log(mini_代金券数据.value); }; return { zizi, diff --git a/src/subPackages/homeSubPages/demo测试页面/demo测试页面.vue b/src/subPackages/homeSubPages/demo测试页面/demo测试页面.vue index 763775d..ab14f5f 100644 --- a/src/subPackages/homeSubPages/demo测试页面/demo测试页面.vue +++ b/src/subPackages/homeSubPages/demo测试页面/demo测试页面.vue @@ -1,20 +1,5 @@ diff --git a/src/subPackages/homeSubPages/商品详情页面/goods-com-pay-card.vue b/src/subPackages/homeSubPages/商品详情页面/goods-com-pay-card.vue index 0e5e7a2..65f93a6 100644 --- a/src/subPackages/homeSubPages/商品详情页面/goods-com-pay-card.vue +++ b/src/subPackages/homeSubPages/商品详情页面/goods-com-pay-card.vue @@ -589,54 +589,54 @@ - - - 选择规格 - * - - - - {{ xiaoMain.six_good?.goods_商品销售规格?.销售规格 }} - - - ¥ - {{ - (xiaoMain.six_good?.goods_商品销售规格?.会员价 ?? 0) / 100 - }} - - - - - 零售价 ¥{{ - (xiaoMain.six_good?.goods_商品销售规格?.零售价格 ?? 0) / 100 - }} - - - - - - - - - {{ goods_sku_list_item?.goods_select_title }} - * - - - - - - {{ spec.goods_sku_name }} - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/subPackages/homeSubPages/商品详情页面/商品详情页面.vue b/src/subPackages/homeSubPages/商品详情页面/商品详情页面.vue index 216b04d..d2df8dc 100644 --- a/src/subPackages/homeSubPages/商品详情页面/商品详情页面.vue +++ b/src/subPackages/homeSubPages/商品详情页面/商品详情页面.vue @@ -233,7 +233,6 @@ const homeLeft = () => { wx.vibrateShort({type: "heavy"}); uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"})); - }; const homeRight = () => { @@ -305,17 +304,9 @@ console.log("superior_unionid=" + xiaoMain.superior_unionid, "---------------"); return {query: "superior_unionid=" + xiaoMain.mini_unionid}; }); - // 用户点击了收藏按钮 - // onAddToFavorites((options: Page.AddToFavoritesOption) => { - // console.log("webViewUrl: ", options.webviewUrl); - // return { - // title: "收藏", - // imageUrl: "https://oss.xiao.band/backhome.png", - // query: "name=xxx&age=xxx", - // }; - // }); }); whenever(() => xiaoMain.mini_unionid, () => { + // 首次进入页面, 监听一下当前用户的openid, 当值发生变化的时候,就需要去请求后端数据接口,同时拿到 当前用户的积分统计的数据 console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 demo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_value ",); xiaoMain.query_积分统计查询(积分_统计查询, xiaoMain.mini_openid, xiaoMain.mini_unionid); }, {immediate: true}); diff --git a/src/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue b/src/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue index 99479f0..ca16f50 100644 --- a/src/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue +++ b/src/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue @@ -19,7 +19,7 @@ - @@ -27,21 +27,28 @@ - 可兑换 + + + + 兑换中 + - 已兑换 - @@ -78,6 +85,9 @@ import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types"; import {useThrottleFn} from "@vueuse/shared"; import {get获取用户当前位置信息} from "@/hooks/获取用户定位信息"; + import {useRequest} from "@uni-helper/uni-use"; + import {积分_发起提现} from "@/hooks/接口API"; + import type {ApiAxiosResponse} from "@/types/通用类型"; let xiaoMain = useMainXiaoStore(); @@ -112,6 +122,10 @@ const 已提现值 = computed(() => { return (xiaoMain.mini_user_积分数据?.share已提现积分 ?? 0) / (xiaoMain.mini_user_积分数据?.share总积分 ?? 0) * 100; }); + const 兑换中的值 = computed(() => { + return (xiaoMain.mini_user_积分数据?.share提现中积分 ?? 0) / (xiaoMain.mini_user_积分数据?.share总积分 ?? 0) * 100; + + }); const 待解锁的值 = computed(() => { return (xiaoMain.mini_user_积分数据?.share不可提现积分 ?? 0) / (xiaoMain.mini_user_积分数据?.share总积分 ?? 0) * 100; }); @@ -139,25 +153,40 @@ await wx.vibrateShort({type: "medium"});//medium heavy light await getUser位置实例对象.getUserLocation(); }; - + const 兑换中事件 = async (): Promise => { + await wx.vibrateShort({type: "medium"}); + xiaoMain.积分展示数据的列表 = xiaoMain.mini_积分列表数据.filter((item) => { + return item.share提现微信侧返回的提现状态 === "WAIT_USER_CONFIRM"; + }); + console.log("打印一下有没有数据了哟"); + }; const 发起提现事件 = useThrottleFn(async () => { //执行时机: 点击后直接执行,但是在设置的时间范围内,不会再次执行 await wx.vibrateShort({type: "heavy"});//medium heavy light - // let data = await useRequest, UniNamespace.RequestMerchantTransferOption>>(积分_发起提现, { + // let data = await useRequest(积分_发起提现, { // method: "POST", data: { // self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid, // } // }); - // uni.requestMerchantTransfer({ - // ...data.data.value!.resData.dictData, - // success: (res) => { - // console.log("✅✅✅✅✅✅✅✅✅✅✅", res); - // }, - // fail: () => { - // console.log("❌❌❌❌❌❌报错了"); - // }, - // }); - // console.log(data.data.value); + let data = await useRequest, UniNamespace.RequestMerchantTransferOption>>(积分_发起提现, { + method: "POST", data: { + self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid, + } + }); + if (data.data.value?.code === 500) { + console.log("提现出错了"); + return; + } + uni.requestMerchantTransfer({ + ...data.data.value!.resData.dictData, + success: (res) => { + console.log("✅✅✅✅✅✅✅✅✅✅✅", res); + }, + fail: () => { + console.log("❌❌❌❌❌❌报错了"); + }, + }); + console.log(data.data.value); }, 3000); @@ -348,7 +377,7 @@ // .xiaozizi-gird { display: grid; - grid-template-columns: repeat(4, auto); + grid-template-columns: repeat(5, auto); grid-auto-rows: 74px; justify-content: space-evenly; justify-items: center; diff --git a/src/subPackages/homeSubPages/用户积分页面/用户积分页面.vue b/src/subPackages/homeSubPages/用户积分页面/用户积分页面.vue index d42a030..27bad6b 100644 --- a/src/subPackages/homeSubPages/用户积分页面/用户积分页面.vue +++ b/src/subPackages/homeSubPages/用户积分页面/用户积分页面.vue @@ -228,6 +228,7 @@ }); xiaoMain.mini_积分列表数据 = data.data.value; xiaoMain.积分展示数据的列表 = data.data.value; + console.log("这里的请求调用了吗?????", xiaoMain.mini_积分列表数据); }); whenever(() => xiaoMain.mini_unionid, () => { console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 demo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_valuedemo_value ",);