six_uniapp_0006

This commit is contained in:
doudou201703
2026-09-19 11:48:36 +08:00
parent 830f6ca2a2
commit d90e244633
17 changed files with 361 additions and 417 deletions
+20 -20
View File
@@ -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",
-5
View File
@@ -40,7 +40,6 @@
console.log("扫描小程序码", options);
xiaoMain.superior_unionid = options.query.scene ?? 上级分享者的默认值;
}
console.log("=======================", options, xiaoMain.superior_unionid);
// 如果值为null了 就需要 调用了
xiaoMain.wechatLogin(options?.scene, <string>xiaoMain.superior_unionid, options?.shareTicket, getDeviceInfo).then((data) => {
@@ -64,12 +63,10 @@
xiaoMain.用户_IP地址转信息(地址_IP转地址, <string>xiaoMain.mini_openid, <string>xiaoMain.mini_unionid);
xiaoMain.query_积分统计查询(积分_统计查询, <string>xiaoMain.mini_openid, <string>xiaoMain.mini_unionid);
xiaoMain.代金券默认领券事件(卡券_领券, <string>xiaoMain.mini_openid, <string>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";
</style>
<style lang="scss">
// 1️⃣ 先引入 nutui 的变量和 mixins(必须在 nutui 样式之前)
@import "nutui-uniapp/styles/index.scss";
</style>
-1
View File
@@ -183,7 +183,6 @@
}
});
console.log("99999999999", info_window.screenHeight, info_window.safeArea.bottom);
const 整个高度_rpx = 整个高度.value + "rpx";
statusHeight.value = 整个高度_rpx;
+1
View File
@@ -42,6 +42,7 @@ export type ShareData类型 = {
share分享者unionid: string;
share总积分: number;
share可提现积分: number;
share提现中积分: number;
share不可提现积分: number;
share已提现积分: number;
share点击次数: number
+1 -1
View File
@@ -3,7 +3,7 @@ export const checkUpdate更新小程序版本 = async (): Promise<void> => {
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate);
console.log("是否有版本更新没有为false,有则为true", res.hasUpdate);
});
updateManager.onUpdateReady(function () {
+3 -1
View File
@@ -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;
+69 -8
View File
@@ -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,6 +83,7 @@
}
</style>
<template>
<page-meta class="page-meta" rootFontSize="32rpx" :pageStyle="`height: ${pxScreenHeight};`">
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
@@ -94,7 +94,6 @@
v-model:statusHeight="statusHeight"
:modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
</ChildComScroll>
</view>
<view class="scrollTopHeigh"><!--预留的空间高度--></view>
@@ -109,9 +108,9 @@
</view>
<view class="line-widht-number" style="height: 10rpx"></view>
<view class="page_1_chao_hong">
<home-com-hong-meng :hong-height="info_scroll_height"
:css_com_height="css_com_height"></home-com-hong-meng>
:css_com_height="css_com_height">
</home-com-hong-meng>
</view>
</scroll-view>
<view class="scrollBottomHeigh">
@@ -123,18 +122,22 @@
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
</page-meta>
</template>
<script lang="ts" setup>
import ChildComScroll from "@/components/ChildComScroll.vue";
import {ref} from "vue";
import type {GlobelsChildPropsType} from "@/types/通用类型";
import {onTabItemTap} from "@dcloudio/uni-app";
import type {ApiAxiosResponse, GlobelsChildPropsType} from "@/types/通用类型";
import {onLoad, onShareAppMessage, onShareTimeline, onTabItemTap} from "@dcloudio/uni-app";
import {useMessage, useToast} from "wot-design-uni";
import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import HomeComImage from "@/pageTabBar/Home/首页组件图片.vue";
import HomeComChaoHuaShuai from "@/pageTabBar/Home/首页组件超划算.vue";
import HomeComHongMeng from "@/pageTabBar/Home/首页组件红包.vue";
import {usePage, useRequest} from "@uni-helper/uni-use";
import {分享_HOME页面分享到朋友圈, 分享_HOME页面分享到群或者好友} from "@/hooks/接口API";
let xiaoMain = useMainXiaoStore();
defineOptions({options: {styleIsolation: "shared"}}); // 组件使用
@@ -166,13 +169,12 @@
isShowRight: {
showCom: "icon",
img: {imgRight: xiao_six_img},
iconTextRight: {classPrefix: "wd-icon", name: "app", size: 20},
iconTextRight: {classPrefix: "wd-icon", name: "app1", size: 20},
},
title_text: "六果泡泡", navIsShow: "default",
};
const homeLeft = () => {
wx.vibrateShort({type: "heavy"});//medium heavy light
uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
};
const homeRight = () => {
@@ -187,4 +189,63 @@
console.log("🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 ");
wx.vibrateShort({type: "heavy"});//medium heavy light
});
onLoad((query) => {
let page_path = usePage().value.route;
const instance = getCurrentInstance();
uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"], // 关键!明确启用哪些功能 "shareTimeline"
});
onShareAppMessage((options: Page.ShareAppMessageOption) => {
return {
title: "",
path: page_path,
desc: "",
imageUrl: "",
promise: new Promise<Page.CustomShareContent>(async (resolve) => {
try {
let dataPostData = await useRequest<ApiAxiosResponse<Array<string>, Page.CustomShareContent>>(分享_HOME页面分享到群或者好友, {
method: "POST", data: {
self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid,
page_path: page_path,
}
});
resolve(dataPostData.data.value?.resData.dictData ?? {});
} catch (e) {
console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e);
}
}),
};
});
onShareTimeline(() => {
return {
title: "", //自定义标题,即朋友圈列表页上显示的标题默认值为小程序的名称
imageUrl: "",//imageUrl:自定义图片路径,可以是本地文件或者网络图片
query: "",
path: page_path,
promise: new Promise<Page.ShareTimelineContent>(async (resolve, reject) => {
try {
let dataPostData = await useRequest<ApiAxiosResponse<Array<string>, Page.CustomShareContent>>(分享_HOME页面分享到朋友圈, {
method: "POST", data: {
self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid,
page_path: page_path,
}
});
resolve(dataPostData.data.value?.resData.dictData ?? {});
} catch (e) {
console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e);
}
}),
};
});
wx.onCopyUrl(() => {
// return {query: `superior_unionid=${xiao_main.self_user_unionid}`};
return {query: "superior_unionid=" + xiaoMain.mini_unionid};
});
});
</script>
+5 -7
View File
@@ -323,14 +323,13 @@
}
}
}
}
}
}
</style>
<template>
<view class=root-demo>
<view class="root-demo">
<view class="xiaozizi">
<view class="div-left">
<view class="div-left-items div-left-items-1" :class="{'shake-element':shakeBoole}">
@@ -476,7 +475,8 @@
:closeOnClick="true" @clickModal="点击幕帘事件" @close="点击幕帘关闭按钮"
@error="幕帘图片加载报错事件" :showMenuByLongpress="true"
to="/subPackages/homeSubPages/用户积分页面/用户积分页面"
:closeOnClickModal="true"></wd-curtain>
:closeOnClickModal="true">
</wd-curtain>
</view>
</template>
@@ -528,7 +528,7 @@
defineOptions({options: {styleIsolation: "shared"}, name: "home-com-hong-meng"}); // 组件使用
const sendcoupon = async (e: Send发放优惠类回调类型): Promise<void> => {
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<void> => {
@@ -554,7 +554,6 @@
const info = wx.getDeviceInfo();
wx.onWindowResize(res => {
const w = res.size.windowWidth;
console.log("-----------", w);
// 按窗口宽度切布局,而不是按 model
});
const 进入积分页面展示即时结算的功能 = async (): Promise<void> => {
@@ -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);
}
@@ -192,7 +192,7 @@
</style>
<template>
<view class=home-com-chao-hua-shuai @click="进入商城页面">
<view class="home-com-chao-hua-shuai" @click="进入商城页面">
<view class="hua-shuai-title">
<view class="flex-container">
<view class="flex-container-item">
@@ -224,7 +224,7 @@
</template>
</wd-img>
</view>
<view class="goods-items-name">六果泡泡</view>
<view class="goods-items-name">{{ value.title }}</view>
<view class="goods-items-price">
<view class="name-text-1">
<text class="text-1">¥</text>
@@ -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"}); // 组件使用
-7
View File
@@ -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",
+41 -94
View File
@@ -1,20 +1,5 @@
<style lang="scss" scoped>
//@import "@/assets/demo.scss";
@mixin line-color {
@keyframes gradientFlow {
0%, 100% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
}
background: linear-gradient(to right, #FF6B6B 0%, #4ECDC4 20%, #FFD166 40%, #06D6A0 60%, #118AB2 80%, #EF476F 100%);
background-size: 400% 100%;
animation: gradientFlow 5s ease infinite;
}
.phone-screen {
box-sizing: border-box;
font-family: "xiaoFont", sans-serif;
@@ -56,46 +41,9 @@
/*状态栏的高度 这里的值不能动*/
box-sizing: border-box;
height: v-bind(statusHeight);
:deep(.default-view-slot) {
line-height: v-bind(meunHeight);
display: flex;
align-items: center;
height: v-bind(meunHeight);
text-align: center;
.default-view-slot-left {
flex: 1;
}
.default-view-slot-right {
display: flex;
align-items: center;
padding: 0 20rpx;
border: solid rgba(255, 255, 255, 0.03) 1px;
border-radius: calc(v-bind(meunHeight) / 2);
.title-imgimage_item {
width: calc(v-bind(meunHeight) * 0.7);
height: calc(v-bind(meunHeight) * 0.7);
}
}
.default-view-slot-right-text {
font-weight: 800;
}
}
}
}
.grit-content {
height: calc(v-bind(pxScrollHeight) - v-bind(statusHeight));
display: grid;
grid-template-columns: 1fr;
grid-auto-rows: auto 1fr auto;
box-sizing: border-box;
.scrollTopHeigh {
/*在滚动区域内的, 可以自定义的高度*/
@@ -108,6 +56,9 @@
box-sizing: border-box;
font-size: 1rem;
overflow: hidden;
height: v-bind(defaule滚动区域的高度);
//background-color: #007aff;
box-shadow: inset 0 -1px 3px rgba(200, 200, 205, 0.15);
:deep() {
/*button按钮的 阴影样式可以直接使用*/
@@ -115,85 +66,80 @@
box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
}
}
}
.scrollBottomHeigh {
box-sizing: border-box;
height: 1px;
@include line-color();
}
}
}
}
</style>
<template>
<page-meta class="page-meta" rootFontSize="32rpx" :pageStyle="`height: ${pxScreenHeight};`">
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
<view class="status-wifi-nav">
<ChildComScroll v-model:meunHeight="meunHeight" v-model:pxScreenHeight="pxScreenHeight"
v-model:pxScrollHeight="pxScrollHeight" v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight" :modelValue="modelValue" @homeLeft="homeLeft"
<ChildComScroll v-model:pxScreenHeight="pxScreenHeight"
v-model:info_scroll_height="info_scroll_height"
v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight"
:modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
<template v-slot:default>
<view class="default-view-slot" @click="defaultSearchChange">
<view class="default-view-slot-left"></view>
<view class="default-view-slot-right">
<image :lazy-load="true" class="title-imgimage_item" mode="scaleToFill"
src="https://hudie.xiao.band/search.png" webp/>
<view class="default-view-slot-right-text">搜索</view>
</view>
<view class="line-widht-number" style="width: 30rpx"></view>
</view>
</template>
</ChildComScroll>
</view>
<!--分隔线,上面的是子组件-->
<!-- 滚动区域开始-->
<view class="grit-content">
<view class="scrollTopHeigh"><!--预留的空间高度--></view>
<scroll-view :enableBackToTop="true" :enhanced="true" :scroll-y="true" :showScrollbar="false"
class="scrollViewHeigh">
内容
<view class="">
<wd-button type="primary" icon="phone" :block="true"
@click="小程序发起支付" custom-class="custom-shadow">
小程序发起支付
</wd-button>
</view>
<view class="">
<wd-button type="primary" icon="phone" :block="true"
@click="发起提现" custom-class="custom-shadow">
发起提现
</wd-button>
</view>
</scroll-view>
<view class="scrollBottomHeigh">
<!--底部预留区域-->
</view>
</view>
<!--滚动区域结束-->
</view>
</wd-config-provider>
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
</page-meta>
</template>
<script lang="ts" setup>
import ChildComScroll from "@/components/ChildComScroll.vue";
import {ref} from "vue";
import type {ApiAxiosResponse, GlobelsChildPropsType} from "@/types/通用类型";
import {onTabItemTap} from "@dcloudio/uni-app";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import {useMessage, useToast} from "wot-design-uni";
import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types";
import {ref} from "vue";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import {useRequest} from "@uni-helper/uni-use";
import {积分_发起提现} from "@/hooks/接口API";
let xiaoMain = useMainXiaoStore();
defineOptions({options: {styleIsolation: "shared"}}); // 组件使用
let toast = useToast("default-toast");
let message = useMessage("default-message-box");
let theme = ref(<ConfigProviderTheme>uni.getAppBaseInfo().theme); // 返回值为 dark or linght
let pxScreenHeight = ref(); // 手机高度
let pxWindowHeight = ref(); // 屏幕可视区高度
let pxScrollHeight = ref(); // 滚动区域高度
let pxScreenHeight = ref("0rpx"); // 手机高度
let pxWindowHeight = ref("0rpx"); // 屏幕可视区高度
let statusHeight = ref(); // 固定的顶部
let meunHeight = ref();//插槽时要用的 高度
let info_scroll_height = ref(0);
const defaule滚动区域的高度 = computed(() => {
return info_scroll_height.value + "rpx";
});
const xiao_six_img = "https://hudie.xiao.band/icon/six.png";
const modelValue: GlobelsChildPropsType = {
@@ -209,7 +155,6 @@
},
title_text: "六果泡泡", navIsShow: "default",
};
let xiaoMain = useMainXiaoStore();
const homeLeft = () => {
wx.vibrateShort({type: "heavy"});//medium heavy light
uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
@@ -227,12 +172,6 @@
console.log("🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 ");
wx.vibrateShort({type: "heavy"});//medium heavy light
});
const buttonClick = dash.throttle({interval: 330,}, async () => {
await wx.vibrateShort({type: "heavy"});//medium heavy light
console.log("=============");
});
const 小程序发起支付 = async (): Promise<void> => {
try {
let data = await useRequest<ApiAxiosResponse<Array<string>, WechatMiniprogram.RequestPaymentOption>>(
@@ -246,6 +185,14 @@
toast.error({msg: "支付取消", position: "middle"});
}
};
const 发起提现 = async (): Promise<void> => {
let data = await useRequest<ApiAxiosResponse<Array<string>, 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("提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了提现出错了");
}
};
</script>
-2
View File
@@ -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,
@@ -1,20 +1,5 @@
<style lang="scss" scoped>
//@import "@/assets/demo.scss";
@mixin line-color {
@keyframes gradientFlow {
0%, 100% {
background-position: 0 50%;
}
50% {
background-position: 100% 50%;
}
}
background: linear-gradient(to right, #FF6B6B 0%, #4ECDC4 20%, #FFD166 40%, #06D6A0 60%, #118AB2 80%, #EF476F 100%);
background-size: 400% 100%;
animation: gradientFlow 5s ease infinite;
}
.phone-screen {
box-sizing: border-box;
font-family: "xiaoFont", sans-serif;
@@ -56,46 +41,9 @@
/*状态栏的高度 这里的值不能动*/
box-sizing: border-box;
height: v-bind(statusHeight);
:deep(.default-view-slot) {
line-height: v-bind(meunHeight);
display: flex;
align-items: center;
height: v-bind(meunHeight);
text-align: center;
.default-view-slot-left {
flex: 1;
}
.default-view-slot-right {
display: flex;
align-items: center;
padding: 0 20rpx;
border: solid rgba(255, 255, 255, 0.03) 1px;
border-radius: calc(v-bind(meunHeight) / 2);
.title-imgimage_item {
width: calc(v-bind(meunHeight) * 0.7);
height: calc(v-bind(meunHeight) * 0.7);
}
}
.default-view-slot-right-text {
font-weight: 800;
}
}
}
}
.grit-content {
height: calc(v-bind(pxScrollHeight) - v-bind(statusHeight));
display: grid;
grid-template-columns: 1fr;
grid-auto-rows: auto 1fr auto;
box-sizing: border-box;
.scrollTopHeigh {
/*在滚动区域内的, 可以自定义的高度*/
@@ -108,6 +56,9 @@
box-sizing: border-box;
font-size: 1rem;
overflow: hidden;
height: v-bind(defaule滚动区域的高度);
//background-color: #007aff;
box-shadow: inset 0 -1px 3px rgba(200, 200, 205, 0.15);
:deep() {
/*button按钮的 阴影样式可以直接使用*/
@@ -115,60 +66,34 @@
box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
}
}
}
.scrollBottomHeigh {
box-sizing: border-box;
height: 1px;
@include line-color();
}
}
}
}
</style>
<template>
<page-meta class="page-meta" rootFontSize="32rpx" :pageStyle="`height: ${pxScreenHeight};`">
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
<view class="status-wifi-nav">
<ChildComScroll v-model:meunHeight="meunHeight" v-model:pxScreenHeight="pxScreenHeight"
v-model:pxScrollHeight="pxScrollHeight" v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight" :modelValue="modelValue" @homeLeft="homeLeft"
<ChildComScroll v-model:pxScreenHeight="pxScreenHeight"
v-model:info_scroll_height="info_scroll_height"
v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight"
:modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
<template v-slot:default>
<view class="default-view-slot" @click="defaultSearchChange">
<view class="default-view-slot-left"></view>
<view class="default-view-slot-right">
<image :lazy-load="true" class="title-imgimage_item" mode="scaleToFill"
src="https://hudie.xiao.band/search.png" webp/>
<view class="default-view-slot-right-text">搜索</view>
</view>
<view class="line-widht-number" style="width: 30rpx"></view>
</view>
</template>
</ChildComScroll>
</view>
<!--分隔线,上面的是子组件-->
<!-- 滚动区域开始-->
<view class="grit-content">
<view class="scrollTopHeigh"><!--预留的空间高度-->
<user-component-points-card></user-component-points-card>
</view>
<view class="scrollTopHeigh"><!--预留的空间高度--></view>
<scroll-view :enableBackToTop="true" :enhanced="true" :scroll-y="true" :showScrollbar="false"
class="scrollViewHeigh">
<view class="line-widht-number" style="height: 10rpx"></view>
<view class="line-widht-number" style="height: 10rpx"></view>
<user-com-servise></user-com-servise>
<user-com-points-list-data></user-com-points-list-data>
2
</scroll-view>
<view class="scrollBottomHeigh">
<!--底部预留区域-->
</view>
</view>
<!--滚动区域结束-->
</view>
@@ -176,61 +101,62 @@
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
</page-meta>
</template>
<script lang="ts" setup>
import ChildComScroll from "@/components/ChildComScroll.vue";
import {ref} from "vue";
import type {GlobelsChildPropsType} from "@/types/通用类型";
import {onTabItemTap} from "@dcloudio/uni-app";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import {useMessage, useToast} from "wot-design-uni";
import UserComServise from "@/subPackages/homeSubPages/用户积分页面/user-com-servise.vue";
import UserComPointsListData from "@/subPackages/homeSubPages/用户积分页面/user-com-points-list-data.vue";
import UserComponentPointsCard from "@/subPackages/homeSubPages/用户积分页面/user-component-points-card.vue";
import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
let xiaoMain = useMainXiaoStore();
defineOptions({options: {styleIsolation: "shared"}}); // 组件使用
let toast = useToast("default-toast");
let message = useMessage("default-message-box");
let show = ref<boolean>(false);
let theme = ref(<ConfigProviderTheme>uni.getAppBaseInfo().theme); // 返回值为 dark or linght
let pxScreenHeight = ref(); // 手机高度
let pxWindowHeight = ref(); // 屏幕可视区高度
let pxScrollHeight = ref(); // 滚动区域高度
let pxScreenHeight = ref("0rpx"); // 手机高度
let pxWindowHeight = ref("0rpx"); // 屏幕可视区高度
let statusHeight = ref(); // 固定的顶部
let meunHeight = ref();//插槽时要用的 高度
let info_scroll_height = ref(0);
const defaule滚动区域的高度 = computed(() => {
return info_scroll_height.value + "rpx";
});
const xiao_six_img = "https://hudie.xiao.band/icon/six.png";
const modelValue: GlobelsChildPropsType = {
isShowLeft: {
showCom: "icon",
img: {imgLeft: "https://oss.xiao.band/icon/left.png"},
iconTextLeft: {classPrefix: "xiaozizi", name: "arrow-left-circle-line", size: 23},
img: {imgLeft: xiao_six_img},
iconTextLeft: {classPrefix: "wd-icon", name: "app", size: 20},
},
isShowRight: {
showCom: "icon",
img: {imgRight: "https://oss.xiao.band/icon/%E9%99%8D%E8%90%BD%E4%BC%9E_parachute.png"},
iconTextRight: {classPrefix: "xiaozizi", name: "jifen3", size: 23},
img: {imgRight: xiao_six_img},
iconTextRight: {classPrefix: "wd-icon", name: "app", size: 20},
},
title_text: "积分管理", navIsShow: "default",
title_text: "六果泡泡", navIsShow: "default",
};
let xiaoMain = useMainXiaoStore();
const homeLeft = () => {
wx.vibrateShort({type: "light"});
wx.vibrateShort({type: "heavy"});//medium heavy light
uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
};
const homeRight = () => {
wx.vibrateShort({type: "light"});
wx.vibrateShort({type: "heavy"});//medium heavy light
console.log("右键按键");
};
let defaultSearchChange = async () => {
wx.vibrateShort({type: "light"});
await wx.vibrateShort({type: "heavy"});//medium heavy light
console.log("搜索发起");
};
onTabItemTap(() => {
console.log("🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 ");
wx.vibrateShort({type: "light"});
wx.vibrateShort({type: "heavy"});//medium heavy light
});
</script>
@@ -589,54 +589,54 @@
</view>
</view>
<!-- 选取规格-->
<view class="spec-section">
<view class="section-title">
<text class="title-text">选择规格</text>
<text class="required">*</text>
</view>
<view class="spec-options">
<view
:class="{ 'spec-selected': true}" class="spec-option">
<view class="spec-name">{{ xiaoMain.six_good?.goods_商品销售规格?.销售规格 }}</view>
<view class="spec-price-info">
<view class="spec-price">
<text class="currency">¥</text>
<text class="price-number">{{
(xiaoMain.six_good?.goods_商品销售规格?.会员价 ?? 0) / 100
}}
</text>
<!-- <text class="price-number">2222</text>-->
</view>
<view class="member-price-tag">
零售价 ¥{{
(xiaoMain.six_good?.goods_商品销售规格?.零售价格 ?? 0) / 100
}}
<!-- 零售价 ¥3333-->
</view>
</view>
</view>
</view>
</view>
<view class="spec-section-sku">
<view class="section-title">
<text class="title-text">{{ goods_sku_list_item?.goods_select_title }}</text>
<text class="required">*</text>
</view>
<view class="spec-options-sku">
<!-- sku的选项,比如可以选择香型,-->
<view v-for="(spec, goods_sku_index) in goods_sku_list_item?.goods_sku_list"
:key="goods_sku_index"
:class="{ 'spec-selected': selectedSpecIndex === goods_sku_index }"
class="spec-options-sku-items"
@click="选取规则事件(goods_sku_index)">
<wd-button :plain="index_goods_sku_子元素!==goods_sku_index"
:type="index_goods_sku_子元素===goods_sku_index?'warning':'primary'"
custom-class="custom-shadow">
{{ spec.goods_sku_name }}
</wd-button>
</view>
</view>
</view>
<!-- <view class="spec-section">-->
<!-- <view class="section-title">-->
<!-- <text class="title-text">选择规格</text>-->
<!-- <text class="required">*</text>-->
<!-- </view>-->
<!-- <view class="spec-options">-->
<!-- <view-->
<!-- :class="{ 'spec-selected': true}" class="spec-option">-->
<!-- <view class="spec-name">{{ xiaoMain.six_good?.goods_商品销售规格?.销售规格 }}</view>-->
<!-- <view class="spec-price-info">-->
<!-- <view class="spec-price">-->
<!-- <text class="currency">¥</text>-->
<!-- <text class="price-number">{{-->
<!-- (xiaoMain.six_good?.goods_商品销售规格?.会员价 ?? 0) / 100-->
<!-- }}-->
<!-- </text>-->
<!-- &lt;!&ndash; <text class="price-number">2222</text>&ndash;&gt;-->
<!-- </view>-->
<!-- <view class="member-price-tag">-->
<!-- 零售价 ¥{{-->
<!-- (xiaoMain.six_good?.goods_商品销售规格?.零售价格 ?? 0) / 100-->
<!-- }}-->
<!-- &lt;!&ndash; 零售价 ¥3333&ndash;&gt;-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="spec-section-sku">-->
<!-- <view class="section-title">-->
<!-- <text class="title-text">{{ goods_sku_list_item?.goods_select_title }}</text>-->
<!-- <text class="required">*</text>-->
<!-- </view>-->
<!-- <view class="spec-options-sku">-->
<!-- &lt;!&ndash; sku的选项,比如可以选择香型,&ndash;&gt;-->
<!-- <view v-for="(spec, goods_sku_index) in goods_sku_list_item?.goods_sku_list"-->
<!-- :key="goods_sku_index"-->
<!-- :class="{ 'spec-selected': selectedSpecIndex === goods_sku_index }"-->
<!-- class="spec-options-sku-items"-->
<!-- @click="选取规则事件(goods_sku_index)">-->
<!-- <wd-button :plain="index_goods_sku_子元素!==goods_sku_index"-->
<!-- :type="index_goods_sku_子元素===goods_sku_index?'warning':'primary'"-->
<!-- custom-class="custom-shadow">-->
<!-- {{ spec.goods_sku_name }}-->
<!-- </wd-button>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- 购买数量 -->
<view class="quantity-section">
<!-- 对购买的商品数量进行 加 和 减-->
@@ -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_积分统计查询(积分_统计查询, <string>xiaoMain.mini_openid, <string>xiaoMain.mini_unionid);
}, {immediate: true});
@@ -19,7 +19,7 @@
<view class="xiaozizi-gird">
<view class="xiaozizi-gird-item" @click="点击总积分事件">
<wd-circle v-model="全部值" :size="50" :color="gradientColor"
<wd-circle v-model="全部值" :size="40" :color="gradientColor"
:text="`${xiaoMain.mini_user_积分数据?.share总积分?? 0}`" :strokeWidth="15"
custom-class="circle-xiaozizi-gird">
</wd-circle>
@@ -27,21 +27,28 @@
</view>
<view class="xiaozizi-gird-item" @click="可提现事件">
<wd-circle v-model="可提现值" :size="50" color="#05ce66"
<wd-circle v-model="可提现值" :size="40" color="#05ce66"
:text="`${xiaoMain.mini_user_积分数据?.share可提现积分?? 0}`" :strokeWidth="15"
custom-class="circle-xiaozizi-gird">
</wd-circle>
<view class="xiaozizi-gird-items-text">可兑换</view>
</view>
<view class="xiaozizi-gird-item" @click="兑换中事件">
<wd-circle v-model="兑换中的值" :size="40" color="#007799"
:text="`${xiaoMain.mini_user_积分数据?.share已提现积分?? 0}`" :strokeWidth="15"
custom-class="circle-xiaozizi-gird">
</wd-circle>
<view class="xiaozizi-gird-items-text">兑换中</view>
</view>
<view class="xiaozizi-gird-item" @click="已兑换事件">
<wd-circle v-model="已提现值" :size="50" color="#007799"
<wd-circle v-model="已提现值" :size="40" color="#007799"
:text="`${xiaoMain.mini_user_积分数据?.share已提现积分?? 0}`" :strokeWidth="15"
custom-class="circle-xiaozizi-gird">
</wd-circle>
<view class="xiaozizi-gird-items-text">已兑换</view>
</view>
<view class="xiaozizi-gird-item" @click="待解锁事件">
<wd-circle v-model="待解锁的值" :size="50" color="#A0AEC0"
<wd-circle v-model="待解锁的值" :size="40" color="#A0AEC0"
:text="`${xiaoMain.mini_user_积分数据?.share不可提现积分?? 0}`"
:strokeWidth="15"
custom-class="circle-xiaozizi-gird">
@@ -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<void> => {
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<ApiAxiosResponse<Array<string>, 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<ApiAxiosResponse<Array<string>, 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);
</script>
@@ -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;
@@ -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 ",);