15 Commits

Author SHA1 Message Date
6e2161fc5e 修复分销回显问题,修复部分问题 2026-02-02 09:16:42 +08:00
a95d7ebf01 取消分销绑定上级的扫码功能 2026-01-31 10:28:18 +08:00
0f640bdf9e 修复分销没有显示查看更多店铺功能,修复分销绑定问题 2026-01-31 09:56:32 +08:00
ea3fb0fe0f 修复分享部分显示问题 2026-01-31 09:27:01 +08:00
8b5d81c6c8 Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into prod 2026-01-30 16:02:45 +08:00
189459845c 分享问题修复 2026-01-30 10:11:18 +08:00
c0e277fd8f 分享问题修复 2026-01-29 14:36:32 +08:00
37fe706d6a 点餐页增加轮播图点击图片进入具体页面,点击分享正常分享,在对应的页面增加分享弹窗组件 2026-01-28 18:09:47 +08:00
4b1be95bc0 Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into prod 2026-01-26 18:00:47 +08:00
13ae818fd4 工具库更新 2026-01-26 16:02:43 +08:00
gyq
93d3f9196c 去除清除绑定分销关系的方法 2026-01-23 10:52:15 +08:00
gyq
ee34d94ca0 修复分销中心绑定成功后不刷新的问题 2026-01-22 18:24:08 +08:00
gyq
cb139acf13 优化分销中心分享进来后的返回 2026-01-22 15:32:30 +08:00
4eb9eb27e3 Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into test 2026-01-22 15:02:09 +08:00
8810c218b3 点餐页问题修复 2026-01-22 15:02:06 +08:00
28 changed files with 2254 additions and 1387 deletions

View File

@@ -1,3 +1,4 @@
<script setup>
import {
useCartsStore

View File

@@ -164,3 +164,12 @@ export const autoBindInviteUser = (data) => {
data: data,
});
};
// 全民股东界面-进入过标识
export const distributionEditIn = (data) => {
return request({
url: prveUrl + "/user/distribution/editIn",
method: "get",
data: data,
});
};

View File

@@ -1,6 +1,8 @@
// 引入 request 文件
import request from '@/common/api/request.js'
import {prveUrl} from './config.js'
import {
prveUrl
} from './config.js'
export const consumeDiscount = (data) => {
return request({
@@ -16,3 +18,11 @@ export const homeData = (data) => {
data: data
})
}
// 清除所有分销绑定关系
export const distributionClear = (data) => {
return request({
url: prveUrl + '/user/distribution/clean',
method: 'get'
})
}

View File

@@ -0,0 +1,26 @@
// 引入 request 文件
import request from "@/common/api/request.js";
import { prveUrl } from "./config.js";
export const carousel = (data) => {
return request({
url: prveUrl + "/user/carousel",
method: "get",
data: data,
});
};
export const shareClaim = (data) => {
return request({
url: prveUrl + "/user/shareClaim",
method: "POST",
data: data,
});
};
export const shareConfig = (data) => {
return request({
url: prveUrl + "/user/share",
method: "get",
data: data,
});
};

View File

@@ -52,7 +52,7 @@ export default async (params) => {
//获取成功
if (res.code == 200) {
uni.hideLoading();
uni.hideToast();
// uni.hideToast();
resolve(res.data ? res.data : true);
} else {
switch (res.code) {
@@ -135,7 +135,7 @@ export default async (params) => {
// 不管成功还是失败都会执行
setTimeout((res) => {
uni.hideLoading();
uni.hideToast();
// uni.hideToast();
}, 10000);
},
});

View File

@@ -0,0 +1,141 @@
<!-- 私域引流 -->
<template>
<u-popup :show="show" mode="center" :safeAreaInsetBottom="false">
<view class="new_preview">
<view class="header">{{ shopInfo.shopName }}</view>
<view class="content">
<view class="title">{{ group.title }}</view>
<view class="img_wrap">
<image class="img" :show-menu-by-longpress="true" :src="group.groupUrl" @click=""></image>
</view>
<view class="intro">
{{ group.content }}
</view>
<view class="foot">
如果长按不能识别可截图或保存二维码图片至相册通过微信扫码入群
</view>
</view>
<view class="close" @click="closeHandle">
<u-icon name="close" color="#fff" size="14"></u-icon>
</view>
</view>
</u-popup>
</template>
<script setup>
import dayjs from 'dayjs';
import { ref, onMounted } from 'vue';
import { centerConfig,distributionEditIn } from '@/common/api/market/distribution.js';
import { checkArrayElementsExist } from '@/utils/util.js';
const shopInfo = defineModel('shopInfo');
const props = defineProps({
type: {
type: String,
default: 'home' // 调用的位置 home首页 order支付成功后
},
group:{
type:Object,
default:()=>{}
}
});
const show = defineModel(false) ;
function closeHandle() {
const shopUserInfo=uni.cache.get('shopUserInfo')
distributionEditIn({
shopUserId:shopUserInfo.id
})
show.value = false;
}
onMounted(() => {
shopInfo.value = uni.cache.get('shopInfo');
});
</script>
<style scoped lang="scss">
.new_preview {
--bg: #3f3b37;
--color: #f6dfc4;
--borderColor: #f6dfc45b;
width: 90vw;
background-color: var(--bg);
border-radius: 4px;
position: relative;
.close {
--size: 70upx;
width: var(--size);
height: var(--size);
border-radius: 50%;
background-color: var(--bg);
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: calc(var(--size) * -1 - 20upx);
left: 50%;
margin-left: calc(var(--size) / 2 * -1);
}
.header {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: var(--color);
height: 50px;
border-bottom: 1px dashed var(--borderColor);
}
.content {
padding-bottom: 14px;
.title {
font-size: 14px;
color: var(--color);
height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.img_wrap {
display: flex;
justify-content: center;
.img {
--size: 220px;
width: var(--size);
height: var(--size);
border-radius: 4px;
}
}
.intro {
height: 40px;
font-size: 14px;
color: var(--color);
display: flex;
align-items: center;
justify-content: center;
padding: 0 14px;
}
.foot {
height: 40px;
color: var(--borderColor);
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 14px;
text-align: center;
}
}
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<view class="ynf-share">
<up-popup :show="show" mode="center" bg-color="transparent">
<view >
<view class="bg" v-if="config.sharerCoupon" :style="returnBg('bg')">
<view class="title">邀请奖励</view>
<view class="desc">邀请1人即可得超值优惠券{{config.sharerCouponNum}}</view>
<view class="u-flex u-row-center">
<view class="coupon" :style="returnBg('coupon')">
<template v-if="config.sharerCoupon.couponType==1">
<view class="font-bold text-center color">
<text class="fuhao">¥</text>
<text>{{config.sharerCoupon.fullAmount}}-{{config.sharerCoupon.discountAmount}}</text>
</view>
</template>
<template v-if="config.sharerCoupon.couponType==2">
<view class="font-bold text-center color">
<text>{{config.sharerCoupon.discountNum}}</text>
</view>
</template>
<template v-if="config.sharerCoupon.couponType==3">
<view class="font-bold text-center color">
<text>{{config.sharerCoupon.discountRate/10}}</text>
</view>
</template>
<template v-if="config.sharerCoupon.couponType==3">
<view class="font-bold text-center color">
<text>{{config.sharerCoupon.discountRate/10}}</text>
</view>
</template>
<template v-if="config.sharerCoupon.couponType==4">
<view class="font-bold text-center color">
<text>第二件半价</text>
</view>
</template>
<template v-if="config.sharerCoupon.couponType==6">
<view class="font-bold text-center color">
<text>买一送一</text>
</view>
</template>
<view class="font-bold name">{{config.sharerCoupon.title}}</view>
</view>
</view>
<view class="u-flex u-row-center u-m-t-44">
<ymf-share>
<view class="share-btn" :style="returnBg('btn')"></view>
</ymf-share>
</view>
</view>
<view class="u-flex u-row-center u-m-t-30">
<view class="close-box u-flex u-col-center u-row-center" @click="close">
<up-icon name="close" size="36rpx" color="#000" :bold="true"></up-icon>
</view>
</view>
</view>
</up-popup>
</view>
</template>
<script setup>
import {
shareConfig,
} from '@/common/api/market/share.js'
import {returnPageTags} from '@/utils/share.js'
import {
productStore
} from '@/stores/user.js';
const userStore = productStore();
const show = defineModel(false)
const imgs = {
btn: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/14ca8d88516b4739b4020b10d95a33c2.png',
coupon: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/4ccffb7cf8414cd19f0a10c6cf45b45b.png',
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/1ac6490c4efd4290abe7ca7f6d8e6eb2.png'
}
function returnBg(key) {
return {
backgroundImage: 'url(' + imgs[key] + ')'
}
}
// watch(() => show.value, (newval)=>{
// if(newval){
// getData()
// }
// })
function close() {
show.value = false
}
const config = reactive({})
async function getData(id) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const currentPath = currentPage.route;
const currentOptions = currentPage.options;
const path = `/${currentPath}`;
const shopId = id||currentOptions.shopId||uni.cache.get('shopId')
// console.log('分享组件挂载完毕:shopId',shopId);
if (!shopId) {
return
}
shareConfig({
shopId
}).then(res => {
// console.log('分享组件挂载完毕:shareConfig',res);
// console.log('分享组件挂载完毕:currentOptions',currentOptions);
if(res&& typeof res==='object'){
Object.assign(config,res)
const rewardSharePages=res.rewardSharePages.split(',')
const pTag = returnPageTags(path)
if( pTag&&rewardSharePages.includes(pTag)&&currentOptions.fromUserId&&res.isSharedUserPopup&&res.isEnabled){
show.value=true
}
// if(res.sharedUserCouponId&&res.sharedUserCouponNum){
// }
}
})
}
watch(()=>userStore.shopInfo.id,(newval)=>{
if(newval){
// getData()
shareConfig({
shopId:newval
}).then(res => {
if(res){
Object.assign(config,res)
}
})
}
})
onMounted(() => {
console.log('分享组件挂载完毕!');
getData()
})
</script>
<style lang="scss">
.bg {
width: 710rpx;
background-size: cover;
min-height: 820rpx;
padding-top: 260rpx;
background-color: transparent;
padding-left: 26rpx;
.title {
font-weight: 700;
font-size: 74rpx;
text-align: center;
background-image: linear-gradient(to bottom, #FF7E2D, #FF270E);
/* 定义渐变色 */
-webkit-background-clip: text;
/* Webkit 浏览器前缀 */
background-clip: text;
/* 标准属性 */
color: transparent;
/* 使文本透明,显示背景渐变 */
}
.desc {
margin-top: 20rpx;
font-size: 28rpx;
font-weight: 700;
text-align: center;
color: #FF280F;
}
}
.coupon {
margin-top: 30rpx;
width: 436rpx;
height: 182rpx;
background-size: cover;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 54rpx;
text-align: center;
.color {
background-image: linear-gradient(to bottom, #FFFFFB, #FFEBB0);
/* 定义渐变色 */
-webkit-background-clip: text;
/* Webkit 浏览器前缀 */
background-clip: text;
/* 标准属性 */
color: transparent;
/* 使文本透明,显示背景渐变 */
}
.fuhao {
font-size: 32rpx;
}
.name {
font-size: 36rpx;
color: #FFFFFB;
}
}
.close-box {
width: 74rpx;
height: 74rpx;
opacity: 0.82;
border-radius: 50%;
background: #fff;
}
.share-btn {
width: 262rpx;
height: 72rpx;
background-size: cover;
}
</style>

View File

@@ -3,7 +3,7 @@
<slot v-if="$slots.default" name="default"></slot>
<up-icon v-else name="share-square" bold :color="color" :size="size"></up-icon>
<view class="absolute share-box">
<button open-type="share" @click="shareClick">分享</button>
<button open-type="share" @click.stop="shareClick">分享</button>
</view>
</view>
</template>

View File

@@ -2,7 +2,7 @@
<view>
<up-navbar
bg-color="transparent"
title="分销中心"
title="全民股东"
@leftClick="back"
:fixed="true"
></up-navbar>
@@ -102,7 +102,7 @@
</view>
</view>
<view
v-if="state.activates.totalRow > 0"
v-if="state.activates.totalRow*1 > 0"
class="u-flex justify-center font-12 color-666"
style="align-items: baseline"
@click="toShopList('activates')"
@@ -159,7 +159,7 @@
</view>
</view>
<view
v-if="state.activates.totalRow > 0"
v-if="state.unActivates.totalRow*1 > 0"
class="u-flex justify-center font-12 color-666"
style="align-items: baseline"
@click="toShopList('unActivates')"

View File

@@ -19,7 +19,7 @@
<view class="u-m-l-32 u-flex-1 border">
<input placeholder="请输入上级邀请码" v-model="code" />
</view>
<image src="/distribution/static/scan.svg" class="u-m-l-10" style="width: 60rpx; height: 60rpx;" @click="saoma"></image>
<!-- <image src="/distribution/static/scan.svg" class="u-m-l-10" style="width: 60rpx; height: 60rpx;" @click="saoma"></image> -->
</view>
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">

View File

@@ -3,7 +3,8 @@
<view class="w-qrcode">
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
</view>
<up-popup :show="show" bgColor="transparent" :safeAreaInsetBottom="false" :closeOnClickOverlay="true" @close="close" mode="center">
<up-popup :duration="0" :show="show" bgColor="transparent" :safeAreaInsetBottom="false"
:closeOnClickOverlay="true" @close="close" mode="center">
<view class="box">
<view class="info">
<view class="u-flex justify-center">
@@ -25,12 +26,15 @@
ref="wQrcode"
@generate="(e) => qrcodeResult(e)"
></w-qrcode> -->
<up-image width="322rpx" height="322rpx" :src="code"></up-image>
<image :src="code" class="code"></image>
<!-- <up-image width="322rpx" mode="scaleToFill" height="322rpx" :src="code"></up-image> -->
</view>
</view>
<view class="footer-wrap">
<view class="confirm line" @click="save">保存图片</view>
<ymf-share><view class="confirm">微信分享</view></ymf-share>
<ymf-share>
<view class="confirm">微信分享</view>
</ymf-share>
</view>
</view>
</up-popup>
@@ -38,17 +42,28 @@
</template>
<script setup>
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
import {
shareMixin,
handleMixinOnLoad,
returnQuery
} from '@/utils/share.js';
import ymfShare from '@/components/ymf-components/ymf-share.vue';
import wQrcode from '@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue';
import { desensitizePhone } from '@/utils/util.js';
import { ref, onMounted, nextTick } from 'vue';
import {
desensitizePhone
} from '@/utils/util.js';
import {
ref,
onMounted,
nextTick
} from 'vue';
onMounted(async () => {
setTimeout(async () => {
await nextTick();
const query = await returnQuery();
codeOptions.value.code = `https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
codeOptions.value.code =
`https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
console.log('codeOptions.value', codeOptions.value);
}, 500);
});
@@ -109,10 +124,12 @@ const show = defineModel({
default: false
});
const emits = defineEmits(['cancel', 'confirm']);
function close() {
show.value = false;
emits('cancel');
}
function save() {
show.value = false;
@@ -142,7 +159,8 @@ function save() {
uni.openSetting({
success: function(settingRes) {
// 检查用户是否开启了相册授权
if (settingRes.authSetting['scope.writePhotosAlbum']) {
if (settingRes.authSetting[
'scope.writePhotosAlbum']) {
uni.showToast({
title: '授权成功,可重新保存',
icon: 'none'
@@ -182,33 +200,40 @@ function save() {
:deep(.info .canvas) {
opacity: 1;
}
.border {
border: 2rpx solid #d9d9d9;
padding: 18rpx;
border-radius: 4rpx;
}
.box {
width: 638rpx;
background-color: #fff;
border-radius: 16rpx;
// overflow: hidden;
position: relative;
.title {
color: #000000;
font-size: 32rpx;
font-weight: 700;
}
.top {
border-bottom: 2rpx solid #ededed;
}
.info {
padding: 96rpx 40rpx 96rpx 40rpx;
font-size: 28rpx;
}
.small-title {
min-width: 84rpx;
text-align: right;
}
.footer-wrap {
width: 100%;
position: absolute;
@@ -229,6 +254,7 @@ function save() {
white-space: nowrap;
line-height: 48rpx;
}
.confirm {
$color: #e8ad7b;
flex: 1;
@@ -243,18 +269,25 @@ function save() {
display: flex;
justify-content: center;
align-items: center;
&.line {
background-color: #fff;
color: $color;
}
}
.line-height-54 {
line-height: 54rpx;
}
.w-qrcode {
position: fixed;
left: -9999px;
top: -9999px;
z-index: -1;
}
.code{
width: 322rpx;
height: 322rpx;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="min-h-100vh bg-gray">
<up-navbar bg-color="transparent" title="分销中心" @leftClick="back" :fixed="true"></up-navbar>
<up-navbar bg-color="transparent" title="全民股东" @leftClick="back" :fixed="true"></up-navbar>
<view class="top">
<image class="top_bg" src="/distribution/static/top_bg.png" :style="imageStyle"></image>
<view class="box" :class="{ type1: isActivated }">
@@ -10,10 +10,10 @@
<text class="u-m-l-14 font-14 color-333 font-700">{{ state.shopName }}</text>
</view>
<view>
<template v-if="state.parentPhone">
<template v-if="state.parentPhone||state.parentName ">
<view class="font-12 color-666">上级{{ state.parentName }}{{ state.parentPhone }}</view>
</template>
<template v-if="!state.parentPhone">
<template v-else>
<view class="bind" @click="showBindShangji = true">绑定上级</view>
</template>
</view>
@@ -26,12 +26,15 @@
<text class="color-333 font-700 u-m-r-6" v-if="state.distributionUser">
{{ state.distributionUser.level }} {{ state.distributionUser.levelName }}
</text>
<up-icon name="question-circle" size="24rpx" color="#666" @click="questionClick('等级升级条件')" />
<up-icon name="question-circle" size="24rpx" color="#666"
@click="questionClick('等级升级条件')" />
</view>
<view class="u-m-t-28 u-flex align-center" v-if="juNextLvMoney && state.distributionUser && state.distributionUser.isAssignLevel == 0">
<view class="u-m-t-28 u-flex align-center"
v-if="juNextLvMoney && state.distributionUser && state.distributionUser.isAssignLevel == 0">
<text class="color-666">距离下一级还差</text>
<text class="color-333 font-700 u-m-r-18">{{ juNextLvMoney }}</text>
<text class="color-333 font-700 u-m-r-18">{{ config.upgradeType == 'cost' ? '元' : '人' }}</text>
<text
class="color-333 font-700 u-m-r-18">{{ config.upgradeType == 'cost' ? '元' : '人' }}</text>
<!-- <up-icon
name="question-circle"
size="24rpx"
@@ -43,16 +46,21 @@
<view class="u-flex-1">
<view class="u-flex align-center">
<text class="u-m-r-10 font-12 color-666" @click="toShouyiDetail('')">总收益</text>
<up-icon name="question-circle" size="24rpx" color="#666" @click="questionClick('总收益')" />
<up-icon name="question-circle" size="24rpx" color="#666"
@click="questionClick('总收益')" />
</view>
<view class="u-m-t-16 price" @click="toShouyiDetail('')" v-if="state.distributionUser">
{{ state.distributionUser.totalIncome }}
</view>
<view class="u-m-t-16 price" @click="toShouyiDetail('')" v-if="state.distributionUser">{{ state.distributionUser.totalIncome }}</view>
</view>
<view class="u-flex-1">
<view class="u-flex align-center">
<text class="u-m-r-10 font-12 color-666" @click="toShouyiDetail('待入账')">待入账</text>
<up-icon name="question-circle" size="24rpx" color="#666" @click="questionClick('待入账')" />
<up-icon name="question-circle" size="24rpx" color="#666"
@click="questionClick('待入账')" />
</view>
<view class="u-m-t-16 price" @click="toShouyiDetail('待入账')" v-if="state.distributionUser">{{ state.distributionUser.pendingIncome }}</view>
<view class="u-m-t-16 price" @click="toShouyiDetail('待入账')"
v-if="state.distributionUser">{{ state.distributionUser.pendingIncome }}</view>
</view>
</view>
</view>
@@ -64,7 +72,8 @@
<view class="u-m-t-16 color-666 font-14">
<view>需要邀请人数{{ config.inviteCount }}</view>
<view>是否需要邀请人数下单{{ config.inviteConsume ? '是' : '否' }}</view>
<view>每人可获得的分销奖励次数{{ config.rewardCount == -1 ? '永久' : config.rewardCount + '次' }}</view>
<view>每人可获得的分销奖励次数{{ config.rewardCount == -1 ? '永久' : config.rewardCount + '次' }}
</view>
</view>
</template>
<template v-if="config.openType == 'pay'">
@@ -97,8 +106,10 @@
</view>
<view class="tabs" v-if="false">
<view class="tabs-item" :class="{ active: activeTab == 'distributor' }" @click="activeTab = 'distributor'">分销员</view>
<view class="tabs-item" :class="{ active: activeTab == 'inviter' }" @click="activeTab = 'inviter'">邀请人</view>
<view class="tabs-item" :class="{ active: activeTab == 'distributor' }"
@click="activeTab = 'distributor'">分销员</view>
<view class="tabs-item" :class="{ active: activeTab == 'inviter' }" @click="activeTab = 'inviter'">邀请人
</view>
</view>
<view class="u-m-t-48 font-14">
@@ -108,7 +119,8 @@
<view>邀请时间</view>
</view>
<view class="u-m-t-16">
<view v-for="(item, index) in userList" :key="index" class="u-flex justify-between align-center recoder-item color-666 font-12">
<view v-for="(item, index) in userList" :key="index"
class="u-flex justify-between align-center recoder-item color-666 font-12">
<view class="">
<view class="u-line-1" style="max-width: 160rpx">
<text>
@@ -144,7 +156,8 @@
<view>我的收益什么时候可以到账</view>
<view>分销的结算时长为{{ config.settlementDay || 0 }}</view>
</view>
<template v-if="config.upgradeType != 'not_upgrade' && config.levelConfigList && config.levelConfigList.length >= 2">
<template
v-if="config.upgradeType != 'not_upgrade' && config.levelConfigList && config.levelConfigList.length >= 2">
<view class="u-m-t-40">
<view>怎么样才能升级分销员等级</view>
@@ -176,9 +189,11 @@
<view style="height: 240rpx"></view>
</template>
<view class="tips u-m-t-32" v-if="state.distributionUser && state.distributionUser.status">您的分销员身份已取消不再获得分成有疑问可联系商家</view>
<view class="tips u-m-t-32" v-if="state.distributionUser && state.distributionUser.status">
您的分销员身份已取消不再获得分成有疑问可联系商家</view>
<view class="u-flex justify-center bottom-btn" v-if="showInviteCode">
<view class="bottom-btn" v-if="showInviteCode">
<view class="u-flex justify-center " style="gap: 54rpx;">
<view class="copy" @click="copyCode">
<view>复制邀请码</view>
<view v-if="inviteCode">{{ inviteCode }}</view>
@@ -188,39 +203,74 @@
</view>
</view>
<view class="buy" v-if="config.openType == 'pay' && config.payAmount && !isActivated" @click="buy">付费{{ config.payAmount }}元开通</view>
<view class="u-m-t-32 join-text u-font-28" v-if="state.group&&state.group.isEnable" @click="showGroup=true" >
加入股东群优惠活动多多{{'>>'}}
</view>
</view>
<view class="buy" v-if="config.openType == 'pay' && config.payAmount && !isActivated" @click="buy">
付费{{ config.payAmount }}元开通</view>
<bindShangji v-model="showBindShangji" @confirm="confirmBindShangji"></bindShangji>
<sharePopup
v-model="showSharePopup"
<sharePopup v-model="showSharePopup"
v-if="(state.distributionUser && state.distributionUser.inviteCode) || inviteCode"
:inviteCode="state.distributionUser ? state.distributionUser.inviteCode : inviteCode"
:shopUserInfo="shopUserInfo"
></sharePopup>
:shopUserInfo="shopUserInfo"></sharePopup>
<TipsPopup v-model="showPopup" :tips-type="tipsType"></TipsPopup>
<commissionPopup :tipsType="commissionTipsType" v-model="showCommission" :config="config" :levelConfigList="config.levelConfigList || []"></commissionPopup>
<commissionPopup :tipsType="commissionTipsType" v-model="showCommission" :config="config"
:levelConfigList="config.levelConfigList || []"></commissionPopup>
<rulePopup v-model="showRule" :config="config" :distributionUser="state.distributionUser"></rulePopup>
<popupDistributionGroupCode :group="state.group" v-model="showGroup" v-model:shopInfo="shopUserInfo.shopInfo"></popupDistributionGroupCode>
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
<script setup>
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
import popupDistributionGroupCode from '@/components/popup-distribution-group-code.vue';
const showGroup=ref(false)
import {
distributionClear
} from '@/common/api/market';
import {
shareMixin,
handleMixinOnLoad,wxShare,
returnQuery
} from '@/utils/share.js';
import bindShangji from './components/bind-shangji.vue';
import sharePopup from './components/share-popup.vue';
import TipsPopup from '../components/tips-popup.vue';
import commissionPopup from '../components/commission.vue';
import rulePopup from '../components/rule.vue';
import { desensitizePhone } from '@/utils/util.js';
import {
desensitizePhone
} from '@/utils/util.js';
import BigNumber from 'bignumber.js';
import * as distributionApi from '@/common/api/market/distribution.js';
import { distributionLtPayOrder } from '@/common/api/order/index.js';
import { APIshopUserInfo } from '@/common/api/member.js';
import { pay } from '@/utils/pay.js';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import {
distributionLtPayOrder
} from '@/common/api/order/index.js';
import {
APIshopUserInfo
} from '@/common/api/member.js';
import {
pay
} from '@/utils/pay.js';
import {
onLoad,
onReachBottom
} from '@dcloudio/uni-app';
const showBindShangji = ref(false);
const showSharePopup = ref(false);
import { ref, reactive, computed, watch } from 'vue';
import {
ref,
reactive,
computed,
watch
} from 'vue';
const content = ref('');
const showPopup = ref(false);
const showRule = ref(false);
@@ -233,6 +283,7 @@ function toShouyiDetail(name) {
url: '/distribution/income-details/index?name=' + name + '&shopId=' + options.shopId
});
}
function questionClick(title) {
if (title == '总收益') {
tipsType.value = '总收益';
@@ -251,9 +302,69 @@ function questionClick(title) {
showCommission.value = true;
}
}
function back() {
// uni.navigateBack({
// delta: 1
// });
safeNavigateBack();
}
/**
* 修复版:安全的页面返回方法
* 彻底避免 "cannot navigate back at first page" 报错
* @param {Number} delta 返回的页面数默认1
* @param {Function} fallback 失败时的降级处理函数
*/
function safeNavigateBack(delta = 1) {
// 1. 立即获取页面栈,确保拿到最新状态(关键修复点)
const pages = getCurrentPages();
// 2. 严谨判断:页面栈长度必须大于 delta 才能返回
const canNavigateBack = pages.length > delta;
console.log('页面栈信息:', {
pagesLength: pages.length,
delta: delta,
canNavigateBack: canNavigateBack
});
// 3. 如果不能返回,直接执行降级逻辑
if (!canNavigateBack) {
console.warn('当前是首页/页面栈不足,无法返回');
handleFallback();
return; // 终止后续执行,彻底避免调用 navigateBack
}
// 4. 能返回时才执行 navigateBack
try {
uni.navigateBack({
delta: 1
delta: delta,
success: () => {
console.log('页面返回成功');
},
fail: (err) => {
console.error('navigateBack 执行失败:', err);
handleFallback();
}
});
} catch (error) {
console.error('页面返回异常:', error);
handleFallback();
}
}
/**
* 统一处理降级逻辑
* @param {Function} fallback 自定义降级函数
*/
function handleFallback() {
uni.switchTab({
url: '/pages/index/index',
fail: () => {
uni.redirectTo({
url: '/pages/index/index'
});
}
});
}
@@ -279,6 +390,7 @@ async function confirmBindShangji(code) {
// });
// }
}
function copyCode() {
uni.setClipboardData({
data: inviteCode.value,
@@ -288,7 +400,7 @@ function copyCode() {
});
}
const shopUserInfo = ref();
const shopUserInfo = ref({shopInfo:{}});
const config = reactive({});
//邀请码
const inviteCode = ref('');
@@ -322,14 +434,21 @@ async function init() {
if (res.distributionId) {
options.type = 'activates';
}
if(res.distributionUser&&!res.distributionUser.firstIn&&res.group&&res.group.isEnable){
showGroup.value=true
}
Object.assign(state, res);
if (res.distributionUser) {
inviteCode.value = res.distributionUser.inviteCode;
}
content.value = res.config ? res.config.notActivatedPage : '';
}
return res;
}
const options = reactive({ type: '' });
const options = reactive({
type: ''
});
const imageStyle = computed(() => {
return {
height: isActivated.value ? '580rpx' : '580rpx'
@@ -362,7 +481,8 @@ async function buy() {
const state = reactive({
parentPhone: '',
parentName: '',
shopName: ''
shopName: '',
group:{}
});
const query = reactive({
@@ -379,7 +499,7 @@ const inviteUserRes = reactive({
totalPage: 0
});
async function getRecoders() {
if (state.config) return;
// if (state.config) return;
const ajaxQuery = {
...query,
shopId: options.shopId
@@ -389,7 +509,8 @@ async function getRecoders() {
} else {
ajaxQuery.id = state.distributionUser.distributionId;
}
const res = activeTab.value == 'distributor' ? await distributionApi.childUser(ajaxQuery) : await distributionApi.inviteUser(ajaxQuery);
const res = activeTab.value == 'distributor' ? await distributionApi.childUser(ajaxQuery) :
await distributionApi.inviteUser(ajaxQuery);
if (res) {
Object.assign(inviteUserRes, res);
if (query.page == 1) {
@@ -441,6 +562,9 @@ const juNextLvMoney = computed(() => {
const showInviteCode = computed(() => {
if (config.upgradeType == 'invite') {
if(config.openType=='pay'&&!isActivated.value){
return false
}
return true;
}
if (config.openType == 'manual' && (!state.distributionUser || !state.distributionUser.level)) {
@@ -455,12 +579,13 @@ const showInviteCode = computed(() => {
if (!state.distributionUser && config.openType == 'manual') {
return true;
}
return false;
});
//是否已成为分销员
const isActivated = computed(() => {
return state.distributionUser && state.distributionUser.level;
return (state.distributionUser && state.distributionUser.level)?true:false;
});
watch(
() => activeTab.value,
@@ -488,27 +613,30 @@ function parseQueryString(queryString) {
onShareAppMessage(async (res) => {
let query = await returnQuery();
return {
title: `股东共享-${state.shopName}`,
return wxShare({
title: `全民股东-${state.shopName}`,
path: `/distribution/shop-detail/index?${query}`,
imageUrl: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/3/ec402c96a183489788f9e43430962d04.png',
query
};
});
});
onLoad(async (opt) => {
try {
await handleMixinOnLoad(opt);
if (opt.q) {
const q = decodeURIComponent(opt.q);
const params = parseQueryString(q.split('?')[1]);
await handleMixinOnLoad(params);
Object.assign(options, params);
} else {
await handleMixinOnLoad(opt);
Object.assign(options, opt);
}
console.log(options);
await init();
getRecoders();
} catch (error) {
console.log(error);
}
});
onReachBottom(async () => {
@@ -526,10 +654,12 @@ onReachBottom(async () => {
border-bottom: 1px solid #999;
font-size: 28rpx;
align-items: baseline;
.fuhao {
font-size: 64rpx;
color: #333;
}
.input-number {
flex: 1;
height: 100%;
@@ -538,11 +668,13 @@ onReachBottom(async () => {
padding-left: 24rpx;
padding-right: 10rpx;
}
.all-in {
font-size: 28rpx;
color: #fe7e00;
}
}
.list {
.shop-item {
padding: 32rpx 28rpx;
@@ -551,12 +683,15 @@ onReachBottom(async () => {
color: #666;
display: flex;
align-items: center;
&:last-child {
border-bottom: none;
}
.fufei {
color: #e8ad7b;
}
.tag {
font-size: 24rpx;
color: #ff1c1c;
@@ -564,12 +699,14 @@ onReachBottom(async () => {
padding: 8rpx 20rpx;
border-radius: 8rpx;
}
.name {
color: #333;
font-weight: 700;
}
.shouxufei {
}
.shouxufei {}
.shouyi {
font-size: 24rpx;
color: #666;
@@ -577,15 +714,18 @@ onReachBottom(async () => {
}
}
}
.status {
font-size: 28rpx;
font-weight: 700;
text-align: right;
color: #333333;
&.fail {
color: #ff1c1c;
}
}
.lingqu {
font-size: 28rpx;
border-radius: 8rpx;
@@ -593,23 +733,28 @@ onReachBottom(async () => {
padding: 8rpx 16rpx;
color: #ffffff;
}
.price {
font-weight: 700;
font-size: 40rpx;
color: #333;
}
.top {
position: relative;
.box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 28rpx 28rpx 52rpx 28rpx;
&.type1 {
padding-bottom: 0;
}
}
.top_content {
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 16rpx;
@@ -620,6 +765,7 @@ onReachBottom(async () => {
stroke: #fff;
filter: drop-shadow(2rpx -4rpx 13.4rpx #ff6f0124);
backdrop-filter: blur(5.1rpx);
&.type1 {
filter: none;
border: none;
@@ -629,25 +775,30 @@ onReachBottom(async () => {
}
}
}
.btn-group {
position: absolute;
right: 28rpx;
top: 50%;
transform: translateY(-50%);
.btn {
padding: 8rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
border: 2rpx solid #fe6d11;
&.shiming {
color: #fe6d11;
}
&.tixian {
color: #fff;
background-color: #fe6d11;
}
}
}
.tips {
padding: 16rpx 18rpx;
background: #ffe2e2;
@@ -656,6 +807,7 @@ onReachBottom(async () => {
line-height: 48rpx;
color: #ff1c1c;
}
.bind {
padding: 8rpx 32rpx;
border-radius: 8rpx;
@@ -664,39 +816,47 @@ onReachBottom(async () => {
color: #fff;
background-color: #fe6d11;
}
.top_bg {
width: 100%;
}
.bottom {
margin: 0 28rpx;
border-radius: 36rpx;
background-color: #fff;
transform: translateY(-20rpx);
padding: 32rpx 28rpx;
&.type1 {
transform: translateY(0);
margin: 0;
padding-bottom: 42rpx;
}
}
.title {
font-size: 32rpx;
font-weight: 700;
color: #333;
}
.small-title {
font-size: 28rpx;
font-weight: 700;
color: #333;
}
.parse-html {
margin: 32rpx 28rpx;
font-size: 28rpx;
}
.recoder-item {
padding: 16rpx 0;
border-bottom: 2rpx solid #ededed;
}
.share {
border-radius: 16rpx;
background: #e8ad7b;
@@ -705,6 +865,7 @@ onReachBottom(async () => {
line-height: 48rpx;
color: #fff;
}
.copy {
padding: 4rpx 30rpx;
border-radius: 18rpx;
@@ -714,15 +875,20 @@ onReachBottom(async () => {
color: #e8ad7b;
line-height: 48rpx;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.bottom-btn {
position: fixed;
left: 84rpx;
right: 84rpx;
bottom: 100rpx;
white-space: nowrap;
gap: 54rpx;
}
.buy {
padding: 32rpx 224rpx;
border-radius: 40rpx;
@@ -737,10 +903,12 @@ onReachBottom(async () => {
bottom: 62rpx;
white-space: nowrap;
}
.tabs {
display: flex;
margin: 20rpx 0;
gap: 30rpx;
.tabs-item {
flex: 1;
padding: 4rpx 30rpx;
@@ -752,10 +920,15 @@ onReachBottom(async () => {
line-height: 48rpx;
text-align: center;
transition: all 0.3s ease-in-out;
&.active {
background-color: #e8ad7b;
color: #fff;
}
}
}
.join-text{
color: #02bbf3;
text-align: center;
}
</style>

View File

@@ -123,6 +123,9 @@
</view>
</up-popup>
<!-- 兑换确认弹窗end -->
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
<script setup>
@@ -408,7 +411,7 @@ onShareAppMessage(async () => {
query
};
console.log('onShareAppMessage===', options);
return options;
return wxShare(options);
});
onLoad(async (opt) => {

View File

@@ -121,6 +121,7 @@
</view>
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
<ymf-share-popup ></ymf-share-popup>
</view>
</template>

View File

@@ -7,7 +7,7 @@
"lodash": "^4.17.21",
"pinia": "^2.3.1",
"pinia-plugin-unistorage": "^0.1.2",
"ysk-utils": "^1.0.83"
"ysk-utils": "^1.0.85"
},
"devDependencies": {
"unplugin-auto-import": "^0.16.7"

View File

@@ -2,7 +2,7 @@
"easycom": {
"autoscan": true,
"custom": {
"^my-(.*)": "@/components/ymf-components/ymf-$1.vue",
"^ymf-(.*)": "@/components/ymf-components/ymf-$1.vue",
"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
@@ -258,7 +258,7 @@
"pages": [{
"path": "index",
"style": {
"navigationBarTitleText": "分销中心",
"navigationBarTitleText": "全民股东",
"navigationStyle": "custom"
}
},
@@ -278,7 +278,7 @@
{
"path": "shop-detail/index",
"style": {
"navigationBarTitleText": "分销中心",
"navigationBarTitleText": "全民股东",
"navigationStyle": "custom"
}
},

View File

@@ -130,6 +130,7 @@
<!-- <CouponModal></CouponModal> -->
<!-- 页面加载动画 -->
<pageLoading v-if="showPageLoading" />
</view>
</template>

View File

@@ -90,7 +90,7 @@
</view>
<view class="item" @click="toFenxiao">
<image :src="imgs.share" class="img"></image>
<view class="title">股东共享</view>
<view class="title">全民股东</view>
<view class="desc">邀请好友获得佣金</view>
</view>
</view>
@@ -116,6 +116,8 @@
</u-popup>
<!-- 私域引流弹窗 -->
<attractPopup type="home" ref="attractPopupRef" />
<ymf-share-popup ></ymf-share-popup>
</view>
</template>

View File

@@ -192,6 +192,29 @@
</scroll-view>
</view>
<view class="main">
<view class="u-p-r-32" v-if="carouselList.length">
<up-swiper indicator indicatorMode="line" height="188rpx" :list="carouselList"
keyName="imageUrl">
<template #default="scope">
<view class="relative">
<image :src="scope.item.imageUrl" mode="aspectFill"
style="width:600rpx;height: 188rpx;"></image>
<view class="absolute swiper-mask" @click.stop="swiperClick(scope.item)">
<view class="share-btn-box" v-if="showShare(scope.item)">
<ymf-share
@shareClick="shareBtnClick(scope.item)"
>
<view class="share-btn">分享</view>
</ymf-share>
</view>
</view>
</view>
</template>
</up-swiper>
</view>
<view>
<view class="item main-item" v-for="(item, index) in shopProductList.productInfo" :key="index"
:id="'item-' + index">
@@ -616,6 +639,8 @@
</view>
</view>
</u-popup>
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
@@ -649,6 +674,11 @@
import {
APIproductqueryShop
} from '@/common/api/member.js';
import {
carousel
} from '@/common/api/market/share.js'
/**
* api合集 end
*/
@@ -817,11 +847,7 @@
// 分步取值 + 每层兜底,避免某一环不存在导致 undefined
const shopExtendShopTable = uni.cache.get('shopTable') || {}; // 兜底空对象
const shopExtendMap = shopExtendShopTable.shopExtendMap || {}; // 兜底空对象
// 最终声明:即使 shopinfo_bg 不存在,也兜底为空字符串/默认值
const shopExtend = ref(shopExtendMap.shopinfo_bg || '');
const shopExtend = ref('');
/**
* 通用数据合集 end
@@ -994,6 +1020,79 @@
uni.$u.debounce(mainScroll(res), 500);
});
/*商品区域轮播图 start*/
const shareSwiperItem=ref(null)
function swiperClick(item) {
console.log('swiperClick',item);
shareSwiperItem.value=item
const pTag=returnPageTags(item.jumpPagePath)
if(pTag==='pp-list'){
return uni.navigateTo({
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
})
}
if(pTag==='pp-detail'){
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
return uni.navigateTo({
url:url.replace('goodsId','id')
})
}
if(pTag==='gb-list'){
return uni.navigateTo({
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
})
}
if(pTag==='gb-detail'){
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
return uni.navigateTo({
url:url.replace('goodsId','wareId')
})
}
if(pTag==='dis'){
return uni.navigateTo({
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
})
}
if(pTag==='index'){
return uni.switchTab({
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
})
}
if(pTag==='eat'){
if (item.extendParam) {
const id=item.extendParam.split('=')[1]
const item = allGoodsArr.value.find(v => v.id == id)
if (item) {
clickspecifications(item)
}
}
}
if(pTag==='point'){
return uni.navigateTo({
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
})
}
if(pTag==='point-detail'){
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
return uni.navigateTo({
url:url.replace('goodsId','id')
})
}
}
function showShare(item){
if(item.isShareable&&item.isEnabled){
return true
}
return false
}
/*商品区域轮播图 end*/
// 点击详情
const showShopsku = ref(false);
@@ -1454,6 +1553,9 @@
};
// 判断商品是否在可售时间内
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
if(!sellDaysStr){
return false
}
// 将后端返回的字符串转换为数组
const sellDays = sellDaysStr.split(',');
const now = dayjs();
@@ -1765,8 +1867,11 @@
if (Message.operate_type == 'init') {
// cartStore.limitTimeDiscount = Message.time_dis_info;
cartInit(Message.data)
try {
uni.hideLoading();
} catch (error) {
//TODO handle the exception
}
isLoading.value = false;
if (!socketInitFinished) {
@@ -2399,7 +2504,7 @@
console.log('options.initMessage', options.initMessage)
const newTableCode = userStore.getQueryString(res.result, 'code');
console.log('newTableCode',newTableCode);
const shopInfoRes = await APIproductqueryShop({
tableCode: newTableCode
});
@@ -2457,7 +2562,7 @@
handleMixinOnLoad,
returnQuery,
jsonToUrl,
wxShare,
wxShare,returnPageTags,
returnCommonQuery
} from '@/utils/share.js'
// defineOptions({
@@ -2471,8 +2576,49 @@
isGoodsShare.value = true
}
function getPage(pageStr){
}
function shareBtnClick(item){
console.log('shareBtnClick',item);
shareSwiperItem.value=item
}
function swiperShare(queryJson){
console.log('shareSwiperItem',shareSwiperItem.value);
const pTag=returnPageTags(shareSwiperItem.value.jumpPagePath)
let query = jsonToUrl(queryJson)
query +=('&'+shareSwiperItem.value.extendParam)
const shopName = uni.cache.get('shopInfo').shopName || ''
const path=shareSwiperItem.value.jumpPagePath?shareSwiperItem.value.jumpPagePath:'/pages/product/index?type=beforehand'
console.log('path',path);
const json={
imageUrl:shareSwiperItem.value.imageUrl,
path: path+'&'+query,
title:shareSwiperItem.value.name+ (shopName ? `-${shopName}` : ''),
}
if(pTag==='pp-detail'){
json.path=json.path.replace('goodsId','id')
}
if(pTag==='gb-detail'){
json.path=json.path.replace('goodsId','wareId')
}
if(pTag==='point-detail'){
json.path=json.path.replace('goodsId','id')
}
if(pTag.includes('eat')){
if(shareSwiperItem.value.extendParam){
json.path=json.path.replace('goodsId','showGoodsId')
}
}
return wxShare(json)
}
async function onShare() {
const queryJson = await returnCommonQuery()
if(shareSwiperItem.value){
return swiperShare(queryJson)
}
let query = jsonToUrl(queryJson)
query += '&type=beforehand'
let json = {}
@@ -2487,11 +2633,7 @@
json.title = shopName
json.imageUrl = uni.cache.get('shopInfo').logo || ''
}
console.log('onShareAppMessage', {
query,
...json,
path: '/pages/product/index' + '?' + query
});
return wxShare({
query,
...json,
@@ -2504,16 +2646,24 @@
onShareTimeline(onShare)
const pageOptions = reactive({})
const carouselList = ref([])
onLoad(async (e) => {
Object.assign(pageOptions, e)
if (e.type) {
orderType.value = e.type;
}
await handleMixinOnLoad({
...e,
shopId: e.shopId || uni.cache.get('shopId')
})
const userInfo = userStore.userInfo
if (userStore.shopUserInfo.shopExtendList) {
shopExtend.value = userStore.shopUserInfo.shopExtendList.find(v => v.autoKey == 'shopinfo_bg') ||
''
}
// //获取用户信息
// const userInfo = await APIshopUserInfo({
// shopId: uni.cache.get('shopId')
@@ -2523,11 +2673,13 @@
// shopId: uni.cache.get('shopId')
// });
Object.assign(shopInfo, userStore.shopInfo);
if (userInfo && typeof userInfo === 'object') {
shopUserInfo.value = userInfo
if (e.type == 'beforehand') {
uni.cache.set("tableCode", userStore.shopUserInfo.id);
options.initMessage.table_code = userStore.shopUserInfo.id
}
options.initMessage.shop_id = userStore.shopInfo.id
shopUserInfo.value = userStore.shopUserInfo
await productqueryProduct();
const extraInitPar = {}
@@ -2539,6 +2691,11 @@
const time_dis_info = await getLimitDiscount()
options.initMessage.time_dis_info = time_dis_info
console.log('options.initMessage', {
...options.initMessage,
...extraInitPar,
})
useSocket.connect({
...options.initMessage,
...extraInitPar,
@@ -2555,6 +2712,13 @@
// 满减活动
getDiscountActivity();
//分享轮播
carousel({
shopId: uni.cache.get('shopId')
}).then(res => {
carouselList.value = res
})
let res = await APIhistoryOrder({
tableCode: uni.cache.get('tableCode')
});
@@ -2660,6 +2824,7 @@
}
onHide(() => {
isGoodsShare.value = false
shareSwiperItem.value=null
closeSocket();
});
onUnload(() => {
@@ -3900,4 +4065,26 @@
}
}
}
.swiper-mask {
left: 0;
right: 0;
top: 0;
bottom: 0;
padding: 32rpx 28rpx;
}
.share-btn-box{
position: absolute;
right: 8rpx;
bottom: 14rpx;
}
.share-btn {
padding: 10rpx 32rpx;
border-radius: 50rpx;
background: #E3AD7F;
font-size: 24rpx;
color: #ffffff;
}
</style>

View File

@@ -232,7 +232,7 @@ const myFunList = ref([
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
},
{
name: '分销',
name: '全民股东',
type: 'fenxiao',
icon: '/static/icon/fenxiao.svg'
},

28
pnpm-lock.yaml generated
View File

@@ -30,8 +30,8 @@ importers:
specifier: ^0.1.2
version: 0.1.2
ysk-utils:
specifier: ^1.0.83
version: 1.0.83
specifier: ^1.0.85
version: 1.0.85
devDependencies:
unplugin-auto-import:
specifier: ^0.16.7
@@ -50,13 +50,13 @@ packages:
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
engines: {node: '>=6.9.0'}
'@babel/parser@7.28.5':
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
'@babel/parser@7.28.6':
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/types@7.28.5':
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
'@babel/types@7.28.6':
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
engines: {node: '>=6.9.0'}
'@dcloudio/types@3.4.21':
@@ -357,8 +357,8 @@ packages:
webpack-virtual-modules@0.6.2:
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
ysk-utils@1.0.83:
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
ysk-utils@1.0.85:
resolution: {integrity: sha512-HkbV4Jidi3G6DAuGAN972tClUYtC2zVoxo4crrxexfn0rZa8HjXatUfEbawHOeEzyl6G1CdC+160I2bKfxEBlA==}
snapshots:
@@ -368,11 +368,11 @@ snapshots:
'@babel/helper-validator-identifier@7.28.5': {}
'@babel/parser@7.28.5':
'@babel/parser@7.28.6':
dependencies:
'@babel/types': 7.28.5
'@babel/types': 7.28.6
'@babel/types@7.28.5':
'@babel/types@7.28.6':
dependencies:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
@@ -408,7 +408,7 @@ snapshots:
'@vue/compiler-core@3.5.22':
dependencies:
'@babel/parser': 7.28.5
'@babel/parser': 7.28.6
'@vue/shared': 3.5.22
entities: 4.5.0
estree-walker: 2.0.2
@@ -421,7 +421,7 @@ snapshots:
'@vue/compiler-sfc@3.5.22':
dependencies:
'@babel/parser': 7.28.5
'@babel/parser': 7.28.6
'@vue/compiler-core': 3.5.22
'@vue/compiler-dom': 3.5.22
'@vue/compiler-ssr': 3.5.22
@@ -684,7 +684,7 @@ snapshots:
webpack-virtual-modules@0.6.2: {}
ysk-utils@1.0.83:
ysk-utils@1.0.85:
dependencies:
bignumber.js: 9.3.1
loadsh: 0.0.4

View File

@@ -116,6 +116,8 @@
</view>
</up-popup>
<!-- 兑换确认弹窗end -->
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
<script setup>

View File

@@ -45,6 +45,8 @@
<up-loadmore :status="isEnd?'nomore':'loadmore'"></up-loadmore>
</view>
</view>
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
<script setup>

View File

@@ -90,9 +90,11 @@ export const useWebSocket = defineStore('socketTask', () => {
let onMessage = () => {
}
function setOnMessage(onMessageBallBack) {
onMessage = onMessageBallBack
}
function chnageInitMessage(data) {
initMessage = data
}
@@ -127,6 +129,8 @@ export const useWebSocket = defineStore('socketTask', () => {
url: uni.conf.baseUrlwws + '?' + Date.now(),
success: (res) => {
console.log('连接成功');
console.log('connectMsg', connectMsg);
console.log('initMessage', initMessage);
isConnected.value = true;
// 监听初始化成功在开启心跳
startHeartbeat();
@@ -369,6 +373,8 @@ export const useWebSocket = defineStore('socketTask', () => {
initNetworkListener,
connect,
allowReconnect,
socketTask,setOnMessage,chnageInitMessage
socketTask,
setOnMessage,
chnageInitMessage
};
})

View File

@@ -77,7 +77,8 @@
<text class="u-m-l-30">{{ item.packageProducts.length }}{{ item.num }}</text>
</view>
<view class="">
<view class="u-flex u-m-t-24 u-row-between" v-for="(goods, goodsIndex) in item.packageProducts" :key="goodsIndex">
<view class="u-flex u-m-t-24 u-row-between" v-for="(goods, goodsIndex) in item.packageProducts"
:key="goodsIndex">
<text>{{ goods.name }}</text>
<view class="u-flex text-right">
<text class="color-666 u-m-r-42">x{{ goods.num }}</text>
@@ -142,7 +143,8 @@
<view class="title">商品详情</view>
</view>
<view class="u-m-t-32">
<image class="w-full" v-for="(item, index) in item.detailImages" :key="index" mode="widthFix" :src="item"></image>
<image class="w-full" v-for="(item, index) in item.detailImages" :key="index" mode="widthFix"
:src="item"></image>
</view>
</view>
@@ -154,7 +156,8 @@
<view v-if="isCanExchange" class="btn" @click="payExchange">
{{ returnBtmText }}
</view>
<view class="btn gray u-m-t-32" @click="createOrder" v-if="item.tieredDiscount && item.tieredDiscount.length > 0">发起助力</view>
<view class="btn gray u-m-t-32" @click="createOrder"
v-if="item.tieredDiscount && item.tieredDiscount.length > 0">发起助力</view>
</view>
<!-- 需要支付的弹窗 -->
@@ -198,20 +201,38 @@
</view>
</view>
</up-popup>
<ymf-share-popup ></ymf-share-popup>
<!-- 兑换确认弹窗end -->
</view>
</template>
<script setup>
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
import { Storelogin } from '@/stores/user.js';
import {
shareMixin,
handleMixinOnLoad,
returnQuery
} from '@/utils/share.js';
import {
Storelogin
} from '@/stores/user.js';
const storelogin = Storelogin();
import { computed, reactive, watch } from 'vue';
import {
computed,
reactive,
watch
} from 'vue';
import dayjs from 'dayjs';
import { wxShare } from '@/utils/share.js';
import { getOpenId } from '@/utils/uniapp.js';
import {
wxShare
} from '@/utils/share.js';
import {
getOpenId
} from '@/utils/uniapp.js';
import modal from '@/groupBuying/components/modal.vue';
import * as Api from '@/common/api/market/package.js';
import { pay } from '@/utils/pay.js';
import {
pay
} from '@/utils/pay.js';
const imgs = {
bg: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/9fd6a3ad2b384f6cb4e88ed6b77bd334.png'
};
@@ -221,7 +242,9 @@ const showGroup = ref(true);
const showDesc = ref(true);
const useDescShow = ref(true);
import { BigNumber } from 'bignumber.js';
import {
BigNumber
} from 'bignumber.js';
const totalPrice = computed(() => {
if (!item.price) {
return 0;
@@ -289,7 +312,9 @@ watch(
function dingyue() {
return new Promise((revlove, reject) => {
uni.requestSubscribeMessage({
tmplIds: ['JGPAGmqcPEgWB6mvAl0SC5cMqr5H5Qjcim8JCpHAZd0', 'F4OyUhe_ZQ9BR731jlkaN2QXAUaA3HBZuUeVPfraSz0'],
tmplIds: ['JGPAGmqcPEgWB6mvAl0SC5cMqr5H5Qjcim8JCpHAZd0',
'F4OyUhe_ZQ9BR731jlkaN2QXAUaA3HBZuUeVPfraSz0'
],
success(res) {},
complete() {
revlove();
@@ -496,7 +521,7 @@ onShareAppMessage(async () => {
query
};
console.log('onShareAppMessage===', options);
return options;
return wxShare(options);
});
const canuseTime = computed(() => {

View File

@@ -167,6 +167,7 @@
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
<ymf-share-popup ></ymf-share-popup>
</view>
</template>
@@ -513,9 +514,9 @@
})
})
onLoad(() => {
onLoad((opt) => {
APIusershopInfodetail({
shopId: uni.cache.get('shopId')
shopId: uni.cache.get('shopId')||opt.shopId
}).then(res => {
console.log(res);
shopInfo.value = res.shopInfo

View File

@@ -538,7 +538,7 @@ onShareAppMessage(async () => {
query
};
console.log('onShareAppMessage===', options);
return options;
return wxShare(options);
});
onLoad(async (opt) => {

View File

@@ -2,6 +2,10 @@ import {
autoBindInviteUser,
autoGetInviteCode
} from '@/common/api/market/distribution.js'
import {
shareClaim
} from '@/common/api/market/share.js'
import {
APIshopUserInfo,
APIusershopInfodetail
@@ -10,8 +14,17 @@ import {
productStore
} from '@/stores/user.js';
const accountStore = productStore();
// #ifdef MP-WEIXIN
const accountInfo = wx.getAccountInfoSync();
export const envVersion = accountInfo.miniProgram.envVersion;
// #endif
// #ifdef H5
const accountInfo = {};
export const envVersion = 'release'
// #endif
let type = 3;
if (envVersion === 'trial') {
console.log('当前环境是体验版');
@@ -24,38 +37,78 @@ if (envVersion === 'trial') {
console.log('当前环境是开发版或其他');
}
export const pageTags = {
'/userPackage/index/index': 'pp-list', //套餐推广列表页
'/userPackage/goodsDetail/goodsDetail': 'pp-detail', //套餐推广商品详情页
'/groupBuying/index/index': 'gb-list', //商品拼团列表页
'/groupBuying/goodsDetail/goodsDetail': 'gb-detail', //商品拼团详情页
'/distribution/shop-detail/index': 'dis', //全民股东页面
'/pages/index/index': 'index', //店铺首页
'/pages/product/index': 'eat', //点餐页
'/pages/product/index?pTag=eat-detail': 'eat-detail', //点餐商品详情弹窗页
'/scoreShop/index/index':'point' ,//积分商品
'/scoreShop/detail/index':'point-detail' ,//积分商品详情
}
export function returnPageTags(page) {
for (let key in pageTags) {
if (page.includes(key)) {
if (page.includes('/pages/product/index')) {
if (page.includes('showGoodsId=')||page.includes('goodsId=')) {
return 'eat-detail'
} else {
return 'eat'
}
} else {
return pageTags[key]
}
}
}
return ''
}
/**
* 绑定用户邀请关系(核心函数)
* 功能说明:校验邀请码有效性,有效则调用自动绑定接口完成邀请关系绑定
* @param {Object} args - 绑定邀请关系的入参对象
* @param {number} [args.shopUserId] - 需要绑定邀请人的用户IDinteger <int64>可选
* @param {number} [args.shopId] - 店铺IDinteger <int64>可选
* @param {string} args.inviteCode - 邀请人的邀请码(必填,非空校验通过后才会执行绑定逻辑)
* @param {number} args.fromUserId - 需要绑定邀请人的用户IDinteger <int64>必填
* @param {number} args.shopId - 店铺IDinteger <int64>必填
* @param {string} args.pTag - 来源页面类型
* @returns {void} 无返回值
*/
export function bindInvite(args) {
export async function bindInvite(args) {
// 解构入参对象,获取需要的核心参数
const {
shopUserId,
fromUserId,
shopId,
inviteCode
pTag,
} = args;
// 校验邀请码有效性若邀请码为空、null、undefined则直接返回不执行后续绑定逻辑
if (!inviteCode || inviteCode === null || inviteCode === undefined) {
console.log('bindInvite',args);
if (!fromUserId || !shopId) {
return;
}
const shopUserInfo = uni.cache.get('shopUserInfo')
// 邀请码有效,调用自动绑定邀请人接口,传递绑定所需参数
autoBindInviteUser({
id: shopUserId,
return await shareClaim({
tagType: pTag || '',
shopId,
inviteCode
fromUserId: fromUserId,
toUserId: shopUserInfo.id
});
}
export function wxShare(par) {
const path = par.path
const pTag = returnPageTags(path)
if (pTag) {
par.path += '&pTag=' + pTag
par.query += '&pTag=' + pTag
}
console.log('pTag', pTag);
console.log('wxShare', {
...par,
type
});
return {
...par,
type
@@ -66,15 +119,15 @@ export async function returnCommonQuery() {
const shopId = uni.cache.get('shopId')
const shopUserInfo = uni.cache.get('shopUserInfo')
const shopInfo = uni.cache.get('shopInfo')
const inviteCode = await autoGetInviteCode({
shopId: shopId,
shopUserId: shopUserInfo.id
})
// const inviteCode = await autoGetInviteCode({
// shopId: shopId,
// fromUserId: shopUserInfo.id
// })
const queryJson = {
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
shopId,
shopUserId: shopUserInfo.id,
fromUserId: shopUserInfo.id,
}
return Promise.resolve(queryJson)
}
@@ -103,10 +156,10 @@ export async function returnQuery(query, showkeys) {
const shopId = uni.cache.get('shopId')
const shopUserInfo = uni.cache.get('shopUserInfo')
const shopInfo = uni.cache.get('shopInfo')
const inviteCode = await autoGetInviteCode({
shopId: shopId,
shopUserId: shopUserInfo.id
})
// const inviteCode = await autoGetInviteCode({
// shopId: shopId,
// fromUserId: shopUserInfo.id
// })
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
@@ -116,9 +169,9 @@ export async function returnQuery(query, showkeys) {
let sharePath = `/${currentPath}`;
const queryJson = {
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
shopId,
shopUserId: shopUserInfo.id,
fromUserId: shopUserInfo.id,
...query
}
for (const key in currentOptions) {
@@ -131,8 +184,8 @@ export async function returnQuery(query, showkeys) {
}
}
queryJson.shopId = shopId
queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
queryJson.shopUserId = shopUserInfo.id
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
queryJson.fromUserId = shopUserInfo.id
let result = ''
for (let key in queryJson) {
@@ -177,16 +230,9 @@ export async function handleMixinOnLoad(opt, vm) {
await accountStore.pageOnload()
}
uni.setStorageSync('loadFinsh', true)
// const shopId = uni.cache.get('shopId')
// const shopUserInfo = uni.cache.get('shopUserInfo')
// const shopInfo = uni.cache.get('shopInfo')
// const inviteCode = await autoGetInviteCode({
// shopId: shopId,
// shopUserId: shopUserInfo.id
// })
if (options.inviteCode) {
bindInvite(options)
if (options.shopId) {
return await bindInvite(options)
}
}
@@ -220,36 +266,7 @@ export function returnIndexBg() {
// utils/share.js
export const shareMixin = {
// async onLoad(opt) {
// console.log('onLoad');
// const options = {}
// if (opt.q) {
// const q = decodeURIComponent(opt.q);
// const params = parseQueryString(q.split("?")[1]);
// Object.assign(options, params);
// } else {
// Object.assign(options, opt);
// }
// console.log('options', options);
// if (options.shopId) {
// uni.cache.set('shopId', options.shopId)
// }
// const shopId = uni.cache.get('shopId')
// const shopUserInfo = uni.cache.get('shopUserInfo')
// const shopInfo = uni.cache.get('shopInfo')
// const inviteCode = await autoGetInviteCode({
// shopId: shopId,
// shopUserId: shopUserInfo.id
// })
// uni.setStorageSync('loadFinsh',true)
// if (options.inviteCode) {
// bindInvite(options)
// }
// },
async onShareAppMessage(res) {
const shopInfo = uni.cache.get('shopInfo')
@@ -261,10 +278,11 @@ export const shareMixin = {
let sharePath = `/${currentPath}`;
const query = await returnQuery()
let query = await returnQuery()
const indexBg = returnIndexBg()
console.log('indexBg', indexBg);
const imageUrl = indexBg || shopInfo.logo
// 全局默认配置(可被页面覆盖)
const defaultShareConfig = {
title: shopInfo.shopName,
@@ -311,9 +329,11 @@ export const shareMixin = {
let sharePath = `/${currentPath}`;
const query = await returnQuery()
let query = await returnQuery()
const indexBg = returnIndexBg()
const imageUrl = indexBg || shopInfo.logo
const defaultTimelineConfig = {
title: shopInfo.shopName,
path: sharePath + '?' + query,