Compare commits
21 Commits
a0cc43e118
...
prod
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e2161fc5e | |||
| a95d7ebf01 | |||
| 0f640bdf9e | |||
| ea3fb0fe0f | |||
| 8b5d81c6c8 | |||
| 189459845c | |||
| c0e277fd8f | |||
| 37fe706d6a | |||
| 4b1be95bc0 | |||
| 13ae818fd4 | |||
| 93d3f9196c | |||
| ee34d94ca0 | |||
| cb139acf13 | |||
| 4eb9eb27e3 | |||
| 8810c218b3 | |||
| dc3174ef13 | |||
| 94be2739af | |||
| 9037e205a0 | |||
| 2afc2f9fab | |||
| 46105da573 | |||
| 20a54c3bd9 |
1
App.vue
1
App.vue
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
useCartsStore
|
useCartsStore
|
||||||
|
|||||||
@@ -164,3 +164,12 @@ export const autoBindInviteUser = (data) => {
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 全民股东界面-进入过标识
|
||||||
|
export const distributionEditIn = (data) => {
|
||||||
|
return request({
|
||||||
|
url: prveUrl + "/user/distribution/editIn",
|
||||||
|
method: "get",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
// 引入 request 文件
|
// 引入 request 文件
|
||||||
import request from '@/common/api/request.js'
|
import request from '@/common/api/request.js'
|
||||||
import {prveUrl} from './config.js'
|
import {
|
||||||
|
prveUrl
|
||||||
|
} from './config.js'
|
||||||
|
|
||||||
export const consumeDiscount = (data) => {
|
export const consumeDiscount = (data) => {
|
||||||
return request({
|
return request({
|
||||||
@@ -16,3 +18,11 @@ export const homeData = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清除所有分销绑定关系
|
||||||
|
export const distributionClear = (data) => {
|
||||||
|
return request({
|
||||||
|
url: prveUrl + '/user/distribution/clean',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
26
common/api/market/share.js
Normal file
26
common/api/market/share.js
Normal 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,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
@@ -20,6 +20,12 @@ export const pointGoodsPage = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const pointsGoods = (data) => {
|
||||||
|
return request({
|
||||||
|
url: url + '/user/pointGoods/'+data.id,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const exchange = (data) => {
|
export const exchange = (data) => {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default async (params) => {
|
|||||||
//获取成功
|
//获取成功
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.hideToast();
|
// uni.hideToast();
|
||||||
resolve(res.data ? res.data : true);
|
resolve(res.data ? res.data : true);
|
||||||
} else {
|
} else {
|
||||||
switch (res.code) {
|
switch (res.code) {
|
||||||
@@ -135,7 +135,7 @@ export default async (params) => {
|
|||||||
// 不管成功还是失败都会执行
|
// 不管成功还是失败都会执行
|
||||||
setTimeout((res) => {
|
setTimeout((res) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.hideToast();
|
// uni.hideToast();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
141
components/popup-distribution-group-code.vue
Normal file
141
components/popup-distribution-group-code.vue
Normal 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>
|
||||||
224
components/ymf-components/ymf-share-popup.vue
Normal file
224
components/ymf-components/ymf-share-popup.vue
Normal 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)&¤tOptions.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>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<slot v-if="$slots.default" name="default"></slot>
|
<slot v-if="$slots.default" name="default"></slot>
|
||||||
<up-icon v-else name="share-square" bold :color="color" :size="size"></up-icon>
|
<up-icon v-else name="share-square" bold :color="color" :size="size"></up-icon>
|
||||||
<view class="absolute share-box">
|
<view class="absolute share-box">
|
||||||
<button open-type="share" @click="shareClick">分享</button>
|
<button open-type="share" @click.stop="shareClick">分享</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<up-navbar
|
<up-navbar
|
||||||
bg-color="transparent"
|
bg-color="transparent"
|
||||||
title="分销中心"
|
title="全民股东"
|
||||||
@leftClick="back"
|
@leftClick="back"
|
||||||
:fixed="true"
|
:fixed="true"
|
||||||
></up-navbar>
|
></up-navbar>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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"
|
class="u-flex justify-center font-12 color-666"
|
||||||
style="align-items: baseline"
|
style="align-items: baseline"
|
||||||
@click="toShopList('activates')"
|
@click="toShopList('activates')"
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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"
|
class="u-flex justify-center font-12 color-666"
|
||||||
style="align-items: baseline"
|
style="align-items: baseline"
|
||||||
@click="toShopList('unActivates')"
|
@click="toShopList('unActivates')"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<view class="u-m-l-32 u-flex-1 border">
|
<view class="u-m-l-32 u-flex-1 border">
|
||||||
<input placeholder="请输入上级邀请码" v-model="code" />
|
<input placeholder="请输入上级邀请码" v-model="code" />
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
|
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="w-qrcode">
|
<view class="w-qrcode">
|
||||||
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
|
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
|
||||||
</view>
|
</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="box">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="u-flex justify-center">
|
<view class="u-flex justify-center">
|
||||||
@@ -25,12 +26,15 @@
|
|||||||
ref="wQrcode"
|
ref="wQrcode"
|
||||||
@generate="(e) => qrcodeResult(e)"
|
@generate="(e) => qrcodeResult(e)"
|
||||||
></w-qrcode> -->
|
></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>
|
</view>
|
||||||
<view class="footer-wrap">
|
<view class="footer-wrap">
|
||||||
<view class="confirm line" @click="save">保存图片</view>
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
@@ -38,191 +42,252 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ymfShare from '@/components/ymf-components/ymf-share.vue';
|
import {
|
||||||
import wQrcode from '@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue';
|
shareMixin,
|
||||||
import { desensitizePhone } from '@/utils/util.js';
|
handleMixinOnLoad,
|
||||||
import { ref } from 'vue';
|
returnQuery
|
||||||
const props = defineProps({
|
} from '@/utils/share.js';
|
||||||
inviteCode: {
|
import ymfShare from '@/components/ymf-components/ymf-share.vue';
|
||||||
type: String,
|
import wQrcode from '@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue';
|
||||||
default: ''
|
import {
|
||||||
},
|
desensitizePhone
|
||||||
shopUserInfo: {
|
} from '@/utils/util.js';
|
||||||
type: Object,
|
import {
|
||||||
default: () => {}
|
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)}`;
|
||||||
|
console.log('codeOptions.value', codeOptions.value);
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截取字符串,移除 &q 及后面的所有内容
|
||||||
|
* @param {string} str - 原始字符串
|
||||||
|
* @returns {string} 处理后的字符串
|
||||||
|
*/
|
||||||
|
function removeQAndAfter(str) {
|
||||||
|
// 检查是否为空字符串
|
||||||
|
if (!str || typeof str !== 'string') {
|
||||||
|
return str || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 找到 &q 的起始位置
|
||||||
|
const qIndex = str.indexOf('&q');
|
||||||
|
|
||||||
|
// 如果找到 &q,截取前面的部分;否则返回原字符串
|
||||||
|
return qIndex !== -1 ? str.slice(0, qIndex) : str;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
const codeOptions = ref({
|
const props = defineProps({
|
||||||
size: 200,
|
inviteCode: {
|
||||||
code: props.inviteCode
|
type: String,
|
||||||
});
|
default: ''
|
||||||
function copyCode() {
|
},
|
||||||
uni.setClipboardData({
|
shopUserInfo: {
|
||||||
data: props.inviteCode,
|
type: Object,
|
||||||
success: function () {
|
default: () => {}
|
||||||
console.log('success');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const code = ref('');
|
|
||||||
|
|
||||||
function qrcodeResult(e) {
|
const codeOptions = ref({
|
||||||
console.log('qrcodeResult', e);
|
padding: 10,
|
||||||
code.value = e.img.tempFilePath;
|
size: 200,
|
||||||
console.log('code', code.value);
|
code: ''
|
||||||
}
|
});
|
||||||
|
|
||||||
const show = defineModel({
|
function copyCode() {
|
||||||
type: Boolean,
|
uni.setClipboardData({
|
||||||
default: false
|
data: props.inviteCode,
|
||||||
});
|
success: function() {
|
||||||
const emits = defineEmits(['cancel', 'confirm']);
|
console.log('success');
|
||||||
function close() {
|
}
|
||||||
show.value = false;
|
});
|
||||||
emits('cancel');
|
}
|
||||||
}
|
const code = ref('');
|
||||||
function save() {
|
|
||||||
show.value = false;
|
|
||||||
|
|
||||||
// 保存图片到相册
|
function qrcodeResult(e) {
|
||||||
uni.saveImageToPhotosAlbum({
|
console.log('qrcodeResult', e);
|
||||||
filePath: code.value,
|
code.value = e.img.tempFilePath;
|
||||||
success: function () {
|
console.log('code', code.value);
|
||||||
uni.showToast({
|
}
|
||||||
title: '保存成功',
|
|
||||||
icon: 'none'
|
const show = defineModel({
|
||||||
});
|
type: Boolean,
|
||||||
},
|
default: false
|
||||||
fail: function (err) {
|
});
|
||||||
console.log('保存失败原因:', err);
|
const emits = defineEmits(['cancel', 'confirm']);
|
||||||
// 判断是否为授权拒绝(微信小程序授权拒绝的特征)
|
|
||||||
if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
|
function close() {
|
||||||
// 弹出提示引导用户去设置页开启授权
|
show.value = false;
|
||||||
uni.showModal({
|
emits('cancel');
|
||||||
title: '授权提示',
|
}
|
||||||
content: '保存图片需要授权访问相册,请前往设置开启授权',
|
|
||||||
showCancel: true,
|
function save() {
|
||||||
cancelText: '取消',
|
show.value = false;
|
||||||
confirmText: '去设置',
|
|
||||||
success: function (res) {
|
// 保存图片到相册
|
||||||
if (res.confirm) {
|
uni.saveImageToPhotosAlbum({
|
||||||
// 跳转到微信小程序的授权设置页
|
filePath: code.value,
|
||||||
uni.openSetting({
|
success: function() {
|
||||||
success: function (settingRes) {
|
uni.showToast({
|
||||||
// 检查用户是否开启了相册授权
|
title: '保存成功',
|
||||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log('保存失败原因:', err);
|
||||||
|
// 判断是否为授权拒绝(微信小程序授权拒绝的特征)
|
||||||
|
if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
|
||||||
|
// 弹出提示引导用户去设置页开启授权
|
||||||
|
uni.showModal({
|
||||||
|
title: '授权提示',
|
||||||
|
content: '保存图片需要授权访问相册,请前往设置开启授权',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '去设置',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 跳转到微信小程序的授权设置页
|
||||||
|
uni.openSetting({
|
||||||
|
success: function(settingRes) {
|
||||||
|
// 检查用户是否开启了相册授权
|
||||||
|
if (settingRes.authSetting[
|
||||||
|
'scope.writePhotosAlbum']) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '授权成功,可重新保存',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未开启授权,保存失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '授权成功,可重新保存',
|
title: '打开设置失败',
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '未开启授权,保存失败',
|
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
fail: function () {
|
}
|
||||||
uni.showToast({
|
|
||||||
title: '打开设置失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
||||||
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
uni.showToast({
|
||||||
uni.showToast({
|
title: '保存失败',
|
||||||
title: '保存失败',
|
icon: 'none'
|
||||||
icon: 'none'
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
emits('confirm', code.value);
|
emits('confirm', code.value);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.info .canvas) {
|
:deep(.info .canvas) {
|
||||||
opacity: 1;
|
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;
|
|
||||||
left: 0;
|
|
||||||
bottom: -100upx;
|
|
||||||
display: flex;
|
|
||||||
gap: 28upx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cancel {
|
.border {
|
||||||
padding: 14rpx 76rpx;
|
border: 2rpx solid #d9d9d9;
|
||||||
border-radius: 36rpx;
|
padding: 18rpx;
|
||||||
border: 2rpx solid #e8ad7b;
|
border-radius: 4rpx;
|
||||||
color: #e8ad7b;
|
}
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 400;
|
.box {
|
||||||
white-space: nowrap;
|
width: 638rpx;
|
||||||
line-height: 48rpx;
|
background-color: #fff;
|
||||||
}
|
border-radius: 16rpx;
|
||||||
.confirm {
|
// overflow: hidden;
|
||||||
$color: #e8ad7b;
|
position: relative;
|
||||||
flex: 1;
|
|
||||||
padding: 14rpx 76rpx;
|
.title {
|
||||||
border-radius: 16rpx;
|
color: #000000;
|
||||||
background-color: $color;
|
font-size: 32rpx;
|
||||||
border: 2rpx solid $color;
|
font-weight: 700;
|
||||||
color: #fff;
|
}
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 400;
|
.top {
|
||||||
white-space: nowrap;
|
border-bottom: 2rpx solid #ededed;
|
||||||
display: flex;
|
}
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
.info {
|
||||||
&.line {
|
padding: 96rpx 40rpx 96rpx 40rpx;
|
||||||
background-color: #fff;
|
font-size: 28rpx;
|
||||||
color: $color;
|
}
|
||||||
|
|
||||||
|
.small-title {
|
||||||
|
min-width: 84rpx;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-wrap {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: -100upx;
|
||||||
|
display: flex;
|
||||||
|
gap: 28upx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel {
|
||||||
|
padding: 14rpx 76rpx;
|
||||||
|
border-radius: 36rpx;
|
||||||
|
border: 2rpx solid #e8ad7b;
|
||||||
|
color: #e8ad7b;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm {
|
||||||
|
$color: #e8ad7b;
|
||||||
|
flex: 1;
|
||||||
|
padding: 14rpx 76rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background-color: $color;
|
||||||
|
border: 2rpx solid $color;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
white-space: nowrap;
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.line-height-54 {
|
|
||||||
line-height: 54rpx;
|
|
||||||
}
|
|
||||||
.w-qrcode {
|
|
||||||
position: fixed;
|
|
||||||
left: -9999px;
|
|
||||||
top: -9999px;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -123,6 +123,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
<!-- 兑换确认弹窗end -->
|
<!-- 兑换确认弹窗end -->
|
||||||
|
|
||||||
|
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -408,7 +411,7 @@ onShareAppMessage(async () => {
|
|||||||
query
|
query
|
||||||
};
|
};
|
||||||
console.log('onShareAppMessage===', options);
|
console.log('onShareAppMessage===', options);
|
||||||
return options;
|
return wxShare(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad(async (opt) => {
|
onLoad(async (opt) => {
|
||||||
|
|||||||
@@ -121,6 +121,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
|
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
"pinia-plugin-unistorage": "^0.1.2",
|
"pinia-plugin-unistorage": "^0.1.2",
|
||||||
"ysk-utils": "^1.0.83"
|
"ysk-utils": "^1.0.85"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"unplugin-auto-import": "^0.16.7"
|
"unplugin-auto-import": "^0.16.7"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"easycom": {
|
"easycom": {
|
||||||
"autoscan": true,
|
"autoscan": true,
|
||||||
"custom": {
|
"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",
|
"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
|
||||||
"^up-(.*)": "@/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"
|
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
|
||||||
@@ -258,7 +258,7 @@
|
|||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销中心",
|
"navigationBarTitleText": "全民股东",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
{
|
{
|
||||||
"path": "shop-detail/index",
|
"path": "shop-detail/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销中心",
|
"navigationBarTitleText": "全民股东",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -130,6 +130,7 @@
|
|||||||
<!-- <CouponModal></CouponModal> -->
|
<!-- <CouponModal></CouponModal> -->
|
||||||
<!-- 页面加载动画 -->
|
<!-- 页面加载动画 -->
|
||||||
<pageLoading v-if="showPageLoading" />
|
<pageLoading v-if="showPageLoading" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item" @click="toFenxiao">
|
<view class="item" @click="toFenxiao">
|
||||||
<image :src="imgs.share" class="img"></image>
|
<image :src="imgs.share" class="img"></image>
|
||||||
<view class="title">股东共享</view>
|
<view class="title">全民股东</view>
|
||||||
<view class="desc">邀请好友,获得佣金</view>
|
<view class="desc">邀请好友,获得佣金</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -116,6 +116,8 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- 私域引流弹窗 -->
|
<!-- 私域引流弹窗 -->
|
||||||
<attractPopup type="home" ref="attractPopupRef" />
|
<attractPopup type="home" ref="attractPopupRef" />
|
||||||
|
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
v-else-if="item1.isTemporary &&item1.productName=='签子'"
|
v-else-if="item1.isTemporary &&item1.productName=='签子'"
|
||||||
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
|
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
|
||||||
></u-image>
|
></u-image>
|
||||||
<u-image width="112" height="112" radius="20"
|
<u-image width="56" height="56" radius="10"
|
||||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||||
mode="heightFix" v-else></u-image>
|
mode="heightFix" v-else></u-image>
|
||||||
<text class="productName"> {{ item1.productName }} </text>
|
<text class="productName"> {{ item1.productName }} </text>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
uni.cache.set("shopId", item.shopId);
|
uni.cache.set("shopId", item.shopId);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
|
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
|
||||||
'&one_more_order=1',
|
'&one_more_order=1&shopId='+item.shopId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -192,6 +192,29 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<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>
|
||||||
<view class="item main-item" v-for="(item, index) in shopProductList.productInfo" :key="index"
|
<view class="item main-item" v-for="(item, index) in shopProductList.productInfo" :key="index"
|
||||||
:id="'item-' + index">
|
:id="'item-' + index">
|
||||||
@@ -616,6 +639,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -649,6 +674,11 @@
|
|||||||
import {
|
import {
|
||||||
APIproductqueryShop
|
APIproductqueryShop
|
||||||
} from '@/common/api/member.js';
|
} from '@/common/api/member.js';
|
||||||
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
carousel
|
||||||
|
} from '@/common/api/market/share.js'
|
||||||
/**
|
/**
|
||||||
* api合集 end
|
* api合集 end
|
||||||
*/
|
*/
|
||||||
@@ -817,11 +847,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 分步取值 + 每层兜底,避免某一环不存在导致 undefined
|
const shopExtend = ref('');
|
||||||
const shopExtendShopTable = uni.cache.get('shopTable') || {}; // 兜底空对象
|
|
||||||
const shopExtendMap = shopExtendShopTable.shopExtendMap || {}; // 兜底空对象
|
|
||||||
// 最终声明:即使 shopinfo_bg 不存在,也兜底为空字符串/默认值
|
|
||||||
const shopExtend = ref(shopExtendMap.shopinfo_bg || '');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用数据合集 end
|
* 通用数据合集 end
|
||||||
@@ -994,6 +1020,79 @@
|
|||||||
uni.$u.debounce(mainScroll(res), 500);
|
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);
|
const showShopsku = ref(false);
|
||||||
|
|
||||||
@@ -1454,6 +1553,9 @@
|
|||||||
};
|
};
|
||||||
// 判断商品是否在可售时间内
|
// 判断商品是否在可售时间内
|
||||||
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
||||||
|
if(!sellDaysStr){
|
||||||
|
return false
|
||||||
|
}
|
||||||
// 将后端返回的字符串转换为数组
|
// 将后端返回的字符串转换为数组
|
||||||
const sellDays = sellDaysStr.split(',');
|
const sellDays = sellDaysStr.split(',');
|
||||||
const now = dayjs();
|
const now = dayjs();
|
||||||
@@ -1765,8 +1867,11 @@
|
|||||||
if (Message.operate_type == 'init') {
|
if (Message.operate_type == 'init') {
|
||||||
// cartStore.limitTimeDiscount = Message.time_dis_info;
|
// cartStore.limitTimeDiscount = Message.time_dis_info;
|
||||||
cartInit(Message.data)
|
cartInit(Message.data)
|
||||||
|
try {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
} catch (error) {
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
|
|
||||||
if (!socketInitFinished) {
|
if (!socketInitFinished) {
|
||||||
@@ -2399,7 +2504,7 @@
|
|||||||
|
|
||||||
console.log('options.initMessage', options.initMessage)
|
console.log('options.initMessage', options.initMessage)
|
||||||
const newTableCode = userStore.getQueryString(res.result, 'code');
|
const newTableCode = userStore.getQueryString(res.result, 'code');
|
||||||
|
console.log('newTableCode',newTableCode);
|
||||||
const shopInfoRes = await APIproductqueryShop({
|
const shopInfoRes = await APIproductqueryShop({
|
||||||
tableCode: newTableCode
|
tableCode: newTableCode
|
||||||
});
|
});
|
||||||
@@ -2457,9 +2562,9 @@
|
|||||||
handleMixinOnLoad,
|
handleMixinOnLoad,
|
||||||
returnQuery,
|
returnQuery,
|
||||||
jsonToUrl,
|
jsonToUrl,
|
||||||
|
wxShare,returnPageTags,
|
||||||
returnCommonQuery
|
returnCommonQuery
|
||||||
} from '@/utils/share.js'
|
} from '@/utils/share.js'
|
||||||
import { onShareTimeline } from '@dcloudio/uni-app';
|
|
||||||
// defineOptions({
|
// defineOptions({
|
||||||
// mixins: [shareMixin],
|
// mixins: [shareMixin],
|
||||||
// });
|
// });
|
||||||
@@ -2471,31 +2576,69 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
isGoodsShare.value = true
|
isGoodsShare.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onShare(){
|
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()
|
const queryJson = await returnCommonQuery()
|
||||||
|
if(shareSwiperItem.value){
|
||||||
|
return swiperShare(queryJson)
|
||||||
|
}
|
||||||
let query = jsonToUrl(queryJson)
|
let query = jsonToUrl(queryJson)
|
||||||
query += '&type=beforehand'
|
query += '&type=beforehand'
|
||||||
let json={}
|
let json = {}
|
||||||
|
const shopName = uni.cache.get('shopInfo').shopName || ''
|
||||||
if (goodsModalList.value.length && isGoodsShare.value) {
|
if (goodsModalList.value.length && isGoodsShare.value) {
|
||||||
const goods = goodsModalList.value[goodsModalList.value.length - 1].goods
|
const goods = goodsModalList.value[goodsModalList.value.length - 1].goods
|
||||||
query += '&showGoodsId=' + goods.id
|
query += '&showGoodsId=' + goods.id
|
||||||
json.title = goods.name
|
json.title = goods.name + (shopName ? `-${shopName}` : '')
|
||||||
json.imageUrl = goods.coverImg
|
json.imageUrl = goods.coverImg
|
||||||
json.showGoodsId = goods.id
|
json.showGoodsId = goods.id
|
||||||
}else{
|
} else {
|
||||||
json.title=uni.cache.get('shopInfo').shopName||''
|
json.title = shopName
|
||||||
json.imageUrl=uni.cache.get('shopInfo').logo||''
|
json.imageUrl = uni.cache.get('shopInfo').logo || ''
|
||||||
}
|
}
|
||||||
console.log('onShareAppMessage', {
|
|
||||||
|
return wxShare({
|
||||||
query,
|
query,
|
||||||
...json,
|
...json,
|
||||||
path: '/pages/product/index' + '?' + query
|
path: '/pages/product/index' + '?' + query
|
||||||
});
|
})
|
||||||
return {
|
|
||||||
query,
|
|
||||||
...json,
|
|
||||||
path: '/pages/product/index' + '?' + query
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onShareAppMessage(onShare)
|
onShareAppMessage(onShare)
|
||||||
@@ -2503,17 +2646,24 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
onShareTimeline(onShare)
|
onShareTimeline(onShare)
|
||||||
|
|
||||||
const pageOptions = reactive({})
|
const pageOptions = reactive({})
|
||||||
|
|
||||||
|
const carouselList = ref([])
|
||||||
onLoad(async (e) => {
|
onLoad(async (e) => {
|
||||||
Object.assign(pageOptions, e)
|
Object.assign(pageOptions, e)
|
||||||
if (e.type) {
|
if (e.type) {
|
||||||
orderType.value = e.type;
|
orderType.value = e.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
await handleMixinOnLoad({
|
await handleMixinOnLoad({
|
||||||
...e,
|
...e,
|
||||||
shopId: e.shopId || uni.cache.get('shopId')
|
shopId: e.shopId || uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
const userInfo = userStore.userInfo
|
|
||||||
const shopInfoRes = userStore.shopInfo
|
if (userStore.shopUserInfo.shopExtendList) {
|
||||||
|
shopExtend.value = userStore.shopUserInfo.shopExtendList.find(v => v.autoKey == 'shopinfo_bg') ||
|
||||||
|
''
|
||||||
|
}
|
||||||
|
|
||||||
// //获取用户信息
|
// //获取用户信息
|
||||||
// const userInfo = await APIshopUserInfo({
|
// const userInfo = await APIshopUserInfo({
|
||||||
// shopId: uni.cache.get('shopId')
|
// shopId: uni.cache.get('shopId')
|
||||||
@@ -2522,14 +2672,14 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
// const shopInfoRes = await APIusershopInfodetail({
|
// const shopInfoRes = await APIusershopInfodetail({
|
||||||
// shopId: uni.cache.get('shopId')
|
// shopId: uni.cache.get('shopId')
|
||||||
// });
|
// });
|
||||||
if (shopInfoRes && shopInfoRes.shopInfo) {
|
Object.assign(shopInfo, userStore.shopInfo);
|
||||||
Object.assign(shopInfo, shopInfoRes.shopInfo);
|
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
|
||||||
|
|
||||||
|
|
||||||
if (userInfo && typeof userInfo === 'object') {
|
|
||||||
shopUserInfo.value = userInfo
|
|
||||||
}
|
|
||||||
await productqueryProduct();
|
await productqueryProduct();
|
||||||
|
|
||||||
const extraInitPar = {}
|
const extraInitPar = {}
|
||||||
@@ -2541,6 +2691,11 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
|
|
||||||
const time_dis_info = await getLimitDiscount()
|
const time_dis_info = await getLimitDiscount()
|
||||||
options.initMessage.time_dis_info = time_dis_info
|
options.initMessage.time_dis_info = time_dis_info
|
||||||
|
|
||||||
|
console.log('options.initMessage', {
|
||||||
|
...options.initMessage,
|
||||||
|
...extraInitPar,
|
||||||
|
})
|
||||||
useSocket.connect({
|
useSocket.connect({
|
||||||
...options.initMessage,
|
...options.initMessage,
|
||||||
...extraInitPar,
|
...extraInitPar,
|
||||||
@@ -2557,6 +2712,13 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
// 满减活动
|
// 满减活动
|
||||||
getDiscountActivity();
|
getDiscountActivity();
|
||||||
|
|
||||||
|
//分享轮播
|
||||||
|
carousel({
|
||||||
|
shopId: uni.cache.get('shopId')
|
||||||
|
}).then(res => {
|
||||||
|
carouselList.value = res
|
||||||
|
})
|
||||||
|
|
||||||
let res = await APIhistoryOrder({
|
let res = await APIhistoryOrder({
|
||||||
tableCode: uni.cache.get('tableCode')
|
tableCode: uni.cache.get('tableCode')
|
||||||
});
|
});
|
||||||
@@ -2661,7 +2823,8 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
useSocket.setOnMessage(() => {});
|
useSocket.setOnMessage(() => {});
|
||||||
}
|
}
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
isGoodsShare.value=false
|
isGoodsShare.value = false
|
||||||
|
shareSwiperItem.value=null
|
||||||
closeSocket();
|
closeSocket();
|
||||||
});
|
});
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
@@ -3902,4 +4065,26 @@ import { onShareTimeline } from '@dcloudio/uni-app';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.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>
|
</style>
|
||||||
@@ -199,8 +199,79 @@ function toPwd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function back() {
|
function back() {
|
||||||
uni.navigateBack();
|
safeNavigateBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修复版:安全的页面返回方法
|
||||||
|
* 彻底避免 "cannot navigate back at first page" 报错
|
||||||
|
* @param {Number} delta 返回的页面数,默认1
|
||||||
|
* @param {Function} fallback 失败时的降级处理函数
|
||||||
|
*/
|
||||||
|
function safeNavigateBack(delta = 1, fallback) {
|
||||||
|
// 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(fallback);
|
||||||
|
return; // 终止后续执行,彻底避免调用 navigateBack
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 能返回时才执行 navigateBack
|
||||||
|
try {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: delta,
|
||||||
|
success: () => {
|
||||||
|
console.log('页面返回成功');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('navigateBack 执行失败:', err);
|
||||||
|
handleFallback(fallback);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('页面返回异常:', error);
|
||||||
|
handleFallback(fallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一处理降级逻辑
|
||||||
|
* @param {Function} fallback 自定义降级函数
|
||||||
|
*/
|
||||||
|
function handleFallback(fallback) {
|
||||||
|
if (typeof fallback === 'function') {
|
||||||
|
fallback(); // 执行自定义降级
|
||||||
|
} else {
|
||||||
|
// 默认降级:返回首页(请替换为你的首页路径)
|
||||||
|
uni.showToast({
|
||||||
|
title: '已到首页,无法返回',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
});
|
||||||
|
|
||||||
|
// 如果需要强制跳首页,解开下面注释(根据你的业务选择)
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
fail: () => {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const list = ref([]);
|
const list = ref([]);
|
||||||
const sel = ref(0);
|
const sel = ref(0);
|
||||||
const money = ref(null);
|
const money = ref(null);
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ const myFunList = ref([
|
|||||||
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
|
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '分销',
|
name: '全民股东',
|
||||||
type: 'fenxiao',
|
type: 'fenxiao',
|
||||||
icon: '/static/icon/fenxiao.svg'
|
icon: '/static/icon/fenxiao.svg'
|
||||||
},
|
},
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -30,8 +30,8 @@ importers:
|
|||||||
specifier: ^0.1.2
|
specifier: ^0.1.2
|
||||||
version: 0.1.2
|
version: 0.1.2
|
||||||
ysk-utils:
|
ysk-utils:
|
||||||
specifier: ^1.0.83
|
specifier: ^1.0.85
|
||||||
version: 1.0.83
|
version: 1.0.85
|
||||||
devDependencies:
|
devDependencies:
|
||||||
unplugin-auto-import:
|
unplugin-auto-import:
|
||||||
specifier: ^0.16.7
|
specifier: ^0.16.7
|
||||||
@@ -50,13 +50,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
|
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/parser@7.28.5':
|
'@babel/parser@7.28.6':
|
||||||
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
|
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
|
||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
'@babel/types@7.28.5':
|
'@babel/types@7.28.6':
|
||||||
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
|
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@dcloudio/types@3.4.21':
|
'@dcloudio/types@3.4.21':
|
||||||
@@ -357,8 +357,8 @@ packages:
|
|||||||
webpack-virtual-modules@0.6.2:
|
webpack-virtual-modules@0.6.2:
|
||||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||||
|
|
||||||
ysk-utils@1.0.83:
|
ysk-utils@1.0.85:
|
||||||
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
|
resolution: {integrity: sha512-HkbV4Jidi3G6DAuGAN972tClUYtC2zVoxo4crrxexfn0rZa8HjXatUfEbawHOeEzyl6G1CdC+160I2bKfxEBlA==}
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
@@ -368,11 +368,11 @@ snapshots:
|
|||||||
|
|
||||||
'@babel/helper-validator-identifier@7.28.5': {}
|
'@babel/helper-validator-identifier@7.28.5': {}
|
||||||
|
|
||||||
'@babel/parser@7.28.5':
|
'@babel/parser@7.28.6':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/types': 7.28.5
|
'@babel/types': 7.28.6
|
||||||
|
|
||||||
'@babel/types@7.28.5':
|
'@babel/types@7.28.6':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/helper-string-parser': 7.27.1
|
'@babel/helper-string-parser': 7.27.1
|
||||||
'@babel/helper-validator-identifier': 7.28.5
|
'@babel/helper-validator-identifier': 7.28.5
|
||||||
@@ -408,7 +408,7 @@ snapshots:
|
|||||||
|
|
||||||
'@vue/compiler-core@3.5.22':
|
'@vue/compiler-core@3.5.22':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.28.5
|
'@babel/parser': 7.28.6
|
||||||
'@vue/shared': 3.5.22
|
'@vue/shared': 3.5.22
|
||||||
entities: 4.5.0
|
entities: 4.5.0
|
||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
@@ -421,7 +421,7 @@ snapshots:
|
|||||||
|
|
||||||
'@vue/compiler-sfc@3.5.22':
|
'@vue/compiler-sfc@3.5.22':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.28.5
|
'@babel/parser': 7.28.6
|
||||||
'@vue/compiler-core': 3.5.22
|
'@vue/compiler-core': 3.5.22
|
||||||
'@vue/compiler-dom': 3.5.22
|
'@vue/compiler-dom': 3.5.22
|
||||||
'@vue/compiler-ssr': 3.5.22
|
'@vue/compiler-ssr': 3.5.22
|
||||||
@@ -684,7 +684,7 @@ snapshots:
|
|||||||
|
|
||||||
webpack-virtual-modules@0.6.2: {}
|
webpack-virtual-modules@0.6.2: {}
|
||||||
|
|
||||||
ysk-utils@1.0.83:
|
ysk-utils@1.0.85:
|
||||||
dependencies:
|
dependencies:
|
||||||
bignumber.js: 9.3.1
|
bignumber.js: 9.3.1
|
||||||
loadsh: 0.0.4
|
loadsh: 0.0.4
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view @click="prveImg(item.goodsImageUrl)">
|
<view @click="prveImg(item.goodsImageUrl)">
|
||||||
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFill" ></image>
|
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view class="sku">
|
<view class="sku">
|
||||||
@@ -27,7 +27,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="text">剩余:{{item.quantity}}</text>
|
<text class="text">剩余:{{item.quantity}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-name">{{item.goodsName}}</view>
|
<view class="goods-name u-flex u-row-between">
|
||||||
|
<text class="u-m-r-30" style="word-break: break-all;">{{item.goodsName}}</text>
|
||||||
|
<ymfShare color="#333" />
|
||||||
|
</view>
|
||||||
<view class="bg-f7" style="height: 24rpx"></view>
|
<view class="bg-f7" style="height: 24rpx"></view>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
@@ -55,10 +58,10 @@
|
|||||||
|
|
||||||
<view style="height: 140px"></view>
|
<view style="height: 140px"></view>
|
||||||
<view class="fixed-bottom u-flex u-row-center">
|
<view class="fixed-bottom u-flex u-row-center">
|
||||||
<view v-if="isCanExchange" class="btn" @click="exchangeClick" >
|
<view v-if="isCanExchange" class="btn" @click="exchangeClick">
|
||||||
{{returnBtmText}}
|
{{returnBtmText}}
|
||||||
</view>
|
</view>
|
||||||
<view class="btn gray" v-else >
|
<view class="btn gray" v-else>
|
||||||
{{returnBtmText}}
|
{{returnBtmText}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -113,9 +116,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
<!-- 兑换确认弹窗end -->
|
<!-- 兑换确认弹窗end -->
|
||||||
|
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import ymfShare from '@/components/ymf-components/ymf-share.vue'
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
reactive
|
reactive
|
||||||
@@ -125,6 +131,11 @@
|
|||||||
} from '@/utils/uniapp.js'
|
} from '@/utils/uniapp.js'
|
||||||
import modal from "@/scoreShop/components/modal.vue";
|
import modal from "@/scoreShop/components/modal.vue";
|
||||||
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
||||||
|
import {
|
||||||
|
userPoints
|
||||||
|
} from "@/common/api/market/points.js";
|
||||||
|
|
||||||
|
|
||||||
import couponIcon from "@/components/coupon-icon/index";
|
import couponIcon from "@/components/coupon-icon/index";
|
||||||
import {
|
import {
|
||||||
pay
|
pay
|
||||||
@@ -136,9 +147,9 @@
|
|||||||
show: false,
|
show: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
function prveImg(url){
|
function prveImg(url) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls:[url]
|
urls: [url]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,16 +315,64 @@
|
|||||||
return `单人兑换已达上限`
|
return `单人兑换已达上限`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onLoad((opt) => {
|
async function getGoods() {
|
||||||
const exchange_goods = uni.getStorageSync('exchange_goods')
|
const res = await pointGoodsApi.pointsGoods({
|
||||||
if (exchange_goods.goodsDescription) {
|
id: options.id
|
||||||
exchange_goods.goodsDescription = JSON.parse(exchange_goods.goodsDescription)
|
})
|
||||||
|
if (res.goodsDescription) {
|
||||||
|
res.goodsDescription = JSON.parse(res.goodsDescription)
|
||||||
} else {
|
} else {
|
||||||
exchange_goods.goodsDescription = []
|
res.goodsDescription = []
|
||||||
}
|
}
|
||||||
const pointsUserData = uni.getStorageSync('pointsUser')
|
res.couponInfo=res.couponInfo||{}
|
||||||
Object.assign(item, exchange_goods)
|
|
||||||
Object.assign(pointsUser, pointsUserData)
|
Object.assign(item, res)
|
||||||
|
}
|
||||||
|
async function getPointUser() {
|
||||||
|
const res = await userPoints({
|
||||||
|
shopUserId: uni.cache.get('shopUserInfo').id || ''
|
||||||
|
})
|
||||||
|
Object.assign(pointsUser, res.pointsUser)
|
||||||
|
}
|
||||||
|
async function init() {
|
||||||
|
await getGoods()
|
||||||
|
await getPointUser()
|
||||||
|
}
|
||||||
|
|
||||||
|
import {
|
||||||
|
shareMixin,
|
||||||
|
handleMixinOnLoad,wxShare,returnQuery ,returnIndexBg,
|
||||||
|
} from '@/utils/share.js'
|
||||||
|
// defineOptions({
|
||||||
|
// mixins: [shareMixin],
|
||||||
|
// });
|
||||||
|
|
||||||
|
onShareAppMessage(async(res)=>{
|
||||||
|
const query=await returnQuery()
|
||||||
|
const shopInfo=uni.cache.get('shopInfo')
|
||||||
|
return wxShare({
|
||||||
|
...res,
|
||||||
|
title:item.goodsName +'-'+shopInfo.shopName,
|
||||||
|
path:'/scoreShop/detail/index'+'?'+query,
|
||||||
|
query,
|
||||||
|
imageUrl:item.goodsImageUrl||returnIndexBg()||''
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const options = reactive({})
|
||||||
|
onLoad(async (opt) => {
|
||||||
|
Object.assign(options, opt)
|
||||||
|
await handleMixinOnLoad(opt)
|
||||||
|
await init()
|
||||||
|
// const exchange_goods = uni.getStorageSync('exchange_goods')
|
||||||
|
// if (exchange_goods.goodsDescription) {
|
||||||
|
// exchange_goods.goodsDescription = JSON.parse(exchange_goods.goodsDescription)
|
||||||
|
// } else {
|
||||||
|
// exchange_goods.goodsDescription = []
|
||||||
|
// }
|
||||||
|
// const pointsUserData = uni.getStorageSync('pointsUser')
|
||||||
|
// Object.assign(item, exchange_goods)
|
||||||
|
// Object.assign(pointsUser, pointsUserData)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -463,7 +522,8 @@
|
|||||||
height: 184rpx;
|
height: 184rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
&.bg-fff{
|
|
||||||
|
&.bg-fff {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,7 +547,8 @@
|
|||||||
font-size: 700;
|
font-size: 700;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.w-full{
|
|
||||||
|
.w-full {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
function toDetail(item) {
|
function toDetail(item) {
|
||||||
uni.setStorageSync('exchange_goods', item)
|
uni.setStorageSync('exchange_goods', item)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/scoreShop/detail/index?id=' + item.id,
|
url: '/scoreShop/detail/index?id=' + item.id+'&shopId='+item.shopId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,13 @@
|
|||||||
<view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
|
<view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
|
||||||
<view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其它商品</view>
|
<view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其它商品</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex gap-20" @click="toggleLayout">
|
<view class="u-flex gap-20">
|
||||||
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
<view @click="toggleLayout">
|
||||||
|
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
||||||
|
</view>
|
||||||
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
|
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
||||||
|
|
||||||
@@ -42,6 +45,8 @@
|
|||||||
<up-loadmore :status="isEnd?'nomore':'loadmore'"></up-loadmore>
|
<up-loadmore :status="isEnd?'nomore':'loadmore'"></up-loadmore>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -72,9 +77,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function back() {
|
function back() {
|
||||||
uni.navigateBack({
|
const pages = getCurrentPages();
|
||||||
delta: 1,
|
if (pages.length < 2) {
|
||||||
});
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function exchange(item) {
|
// function exchange(item) {
|
||||||
@@ -139,12 +153,32 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
shareMixin,
|
shareMixin,
|
||||||
handleMixinOnLoad
|
handleMixinOnLoad,
|
||||||
|
returnQuery,
|
||||||
|
jsonToUrl,
|
||||||
|
wxShare,returnIndexBg ,
|
||||||
|
returnCommonQuery
|
||||||
} from '@/utils/share.js'
|
} from '@/utils/share.js'
|
||||||
defineOptions({
|
// defineOptions({
|
||||||
mixins: [shareMixin],
|
// mixins: [shareMixin],
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
async function onShare() {
|
||||||
|
const queryJson = await returnCommonQuery()
|
||||||
|
let query = jsonToUrl(queryJson)
|
||||||
|
let json = {}
|
||||||
|
|
||||||
|
json.title = '积分乐园,好物兑换'
|
||||||
|
json.imageUrl = returnIndexBg()||uni.cache.get('shopInfo').logo || ''
|
||||||
|
return wxShare({
|
||||||
|
query,
|
||||||
|
...json,
|
||||||
|
path: '/scoreShop/index/index' + '?' + query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onShareAppMessage(onShare)
|
||||||
|
onShareTimeline(onShare)
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -171,6 +205,10 @@
|
|||||||
import {
|
import {
|
||||||
productStore
|
productStore
|
||||||
} from '@/stores/user.js';
|
} from '@/stores/user.js';
|
||||||
|
import {
|
||||||
|
onShareAppMessage
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import { onShareTimeline } from '@dcloudio/uni-app';
|
||||||
const storeuser = productStore();
|
const storeuser = productStore();
|
||||||
|
|
||||||
|
|
||||||
@@ -191,9 +229,11 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.gap-20{
|
|
||||||
|
.gap-20 {
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
padding: 138rpx 26rpx 48rpx 42rpx;
|
padding: 138rpx 26rpx 48rpx 42rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,124 +1,130 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="min-page bg-f7 u-font-28 color-333">
|
<view class="min-page bg-f7 u-font-28 color-333">
|
||||||
<up-navbar
|
<up-navbar title="兑换成功" bgColor="transparent" leftIconColor="#333" @leftClick="back()"
|
||||||
title="兑换成功"
|
titleStyle="color:#333"></up-navbar>
|
||||||
bgColor="transparent"
|
<view class="content">
|
||||||
leftIconColor="#333"
|
<view class="bg" :style="{ backgroundImage: `url(${imgs.bg})` }">
|
||||||
@leftClick="back()"
|
<image :src="imgs.success" class="success"></image>
|
||||||
titleStyle="color:#333"
|
<view class="u-font-40 font-700">兑换成功</view>
|
||||||
></up-navbar>
|
<view class="u-font-32 font-700">{{item.pointsGoodsName}}</view>
|
||||||
<view class="content">
|
<view class="u-m-t-14" v-if="item.goodsCategory!='优惠券'">需前往店铺自行兑换领取</view>
|
||||||
<view class="bg" :style="{ backgroundImage: `url(${imgs.bg})` }">
|
<view class="u-m-t-14" v-else>优惠券直接到账您的账户中</view>
|
||||||
<image :src="imgs.success" class="success"></image>
|
</view>
|
||||||
<view class="u-font-40 font-700">兑换成功</view>
|
<view class="info u-flex u-flex-col">
|
||||||
<view class="u-font-32 font-700">{{item.pointsGoodsName}}</view>
|
<view class="u-p-22">
|
||||||
<view class="u-m-t-14" v-if="item.goodsCategory!='优惠券'">需前往店铺自行兑换领取</view>
|
<text class="color-666">兑换商品:</text>
|
||||||
<view class="u-m-t-14" v-else>优惠券直接到账您的账户中</view>
|
<text>{{item.pointsGoodsName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info u-flex u-flex-col">
|
<view class="u-p-22">
|
||||||
<view class="u-p-22">
|
<text class="color-666">兑换数量:</text>
|
||||||
<text class="color-666">兑换商品:</text>
|
<text>{{item.number}}份</text>
|
||||||
<text>{{item.pointsGoodsName}}</text>
|
</view>
|
||||||
</view>
|
<view class="u-p-22">
|
||||||
<view class="u-p-22">
|
<text class="color-666">消耗积分:</text>
|
||||||
<text class="color-666">兑换数量:</text>
|
<text>{{item.spendPoints}}</text>
|
||||||
<text>{{item.number}}份</text>
|
</view>
|
||||||
</view>
|
<view class="u-p-22" v-if="item.extraPaymentAmount">
|
||||||
<view class="u-p-22">
|
<text class="color-666">支付金额:</text>
|
||||||
<text class="color-666">消耗积分:</text>
|
<text>{{item.extraPaymentAmount}}</text>
|
||||||
<text>{{item.spendPoints}}</text>
|
</view>
|
||||||
</view>
|
<view class="u-p-22">
|
||||||
<view class="u-p-22" v-if="item.extraPaymentAmount">
|
<text class="color-666">下单时间:</text>
|
||||||
<text class="color-666">支付金额:</text>
|
<text>{{item.createTime}}</text>
|
||||||
<text>{{item.extraPaymentAmount}}</text>
|
</view>
|
||||||
|
<view class="u-p-22">
|
||||||
|
<text class="color-666">订单号:</text>
|
||||||
|
<text>:{{item.orderNo}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex bottom u-row-center">
|
||||||
|
<view class="back btn" @click="back">继续兑换</view>
|
||||||
|
<view class="look btn" @click="lookOrder">查看订单</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-22">
|
</view>
|
||||||
<text class="color-666">下单时间:</text>
|
|
||||||
<text>{{item.createTime}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="u-p-22">
|
|
||||||
<text class="color-666">订单号:</text>
|
|
||||||
<text>:{{item.orderNo}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="u-flex bottom u-row-center">
|
|
||||||
<view class="back btn" @click="back">继续兑换</view>
|
|
||||||
<view class="look btn" @click="lookOrder">查看订单</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
const imgs = {
|
||||||
|
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/b625560a5b75418c9e643841f8674a0c.png",
|
||||||
|
success: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/c2f0865efb444de58ff0d8bb3a51d300.png",
|
||||||
|
};
|
||||||
|
|
||||||
|
function back() {
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
if(pages.length<2){
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/scoreShop/index/index?shopId=' + item.shopId
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const imgs = {
|
function lookOrder() {
|
||||||
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/b625560a5b75418c9e643841f8674a0c.png",
|
uni.redirectTo({
|
||||||
success:
|
url: '/scoreShop/order/index?shopId=' + item.shopId
|
||||||
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/c2f0865efb444de58ff0d8bb3a51d300.png",
|
})
|
||||||
};
|
}
|
||||||
function back() {
|
const item = reactive({
|
||||||
uni.navigateBack();
|
|
||||||
}
|
|
||||||
function lookOrder() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url:'/scoreShop/order/index?shopId='+item.shopId
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const item=reactive({
|
|
||||||
|
|
||||||
})
|
})
|
||||||
onLoad(opt=>{
|
onLoad(opt => {
|
||||||
const exchange_goods_success_data=uni.getStorageSync('exchange_goods_success')
|
const exchange_goods_success_data = uni.getStorageSync('exchange_goods_success')
|
||||||
Object.assign(item,exchange_goods_success_data)
|
Object.assign(item, exchange_goods_success_data)
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
background: linear-gradient(180deg, #f5cd82 0%, rgba(247, 219, 165, 0) 100%);
|
background: linear-gradient(180deg, #f5cd82 0%, rgba(247, 219, 165, 0) 100%);
|
||||||
height: 670rpx;
|
height: 670rpx;
|
||||||
$color: #9c571f;
|
$color: #9c571f;
|
||||||
.bg {
|
|
||||||
width: 100%;
|
|
||||||
height: 586rpx;
|
|
||||||
background-size: cover;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 26rpx;
|
|
||||||
color: $color;
|
|
||||||
|
|
||||||
.success {
|
.bg {
|
||||||
width: 310rpx;
|
width: 100%;
|
||||||
height: 206rpx;
|
height: 586rpx;
|
||||||
}
|
background-size: cover;
|
||||||
}
|
display: flex;
|
||||||
.info {
|
flex-direction: column;
|
||||||
padding-left: 174rpx;
|
justify-content: flex-end;
|
||||||
padding-right: 32rpx;
|
align-items: center;
|
||||||
}
|
padding-bottom: 26rpx;
|
||||||
}
|
color: $color;
|
||||||
.bottom {
|
|
||||||
gap: 48rpx;
|
|
||||||
margin-top: 44rpx;
|
|
||||||
|
|
||||||
.btn {
|
.success {
|
||||||
padding: 14rpx 76rpx;
|
width: 310rpx;
|
||||||
border-radius: 100rpx;
|
height: 206rpx;
|
||||||
font-size: 32rpx;
|
}
|
||||||
border: 1px solid transparent;
|
}
|
||||||
&.back {
|
|
||||||
border-color: $my-main-color;
|
.info {
|
||||||
color: $my-main-color;
|
padding-left: 174rpx;
|
||||||
}
|
padding-right: 32rpx;
|
||||||
&.look {
|
}
|
||||||
background-color: $my-main-color;
|
}
|
||||||
border-color: $my-main-color;
|
|
||||||
color: #fff;
|
.bottom {
|
||||||
}
|
gap: 48rpx;
|
||||||
}
|
margin-top: 44rpx;
|
||||||
}
|
|
||||||
|
.btn {
|
||||||
|
padding: 14rpx 76rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
|
||||||
|
&.back {
|
||||||
|
border-color: $my-main-color;
|
||||||
|
color: $my-main-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.look {
|
||||||
|
background-color: $my-main-color;
|
||||||
|
border-color: $my-main-color;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
1
src/auto-imports.d.ts
vendored
1
src/auto-imports.d.ts
vendored
@@ -39,6 +39,7 @@ declare global {
|
|||||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||||
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
|
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
|
||||||
|
const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
|
||||||
const onShow: typeof import('@dcloudio/uni-app')['onShow']
|
const onShow: typeof import('@dcloudio/uni-app')['onShow']
|
||||||
const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
|
const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
|
||||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||||
|
|||||||
@@ -90,11 +90,13 @@ export const useWebSocket = defineStore('socketTask', () => {
|
|||||||
let onMessage = () => {
|
let onMessage = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
function setOnMessage(onMessageBallBack){
|
|
||||||
onMessage=onMessageBallBack
|
function setOnMessage(onMessageBallBack) {
|
||||||
|
onMessage = onMessageBallBack
|
||||||
}
|
}
|
||||||
function chnageInitMessage(data){
|
|
||||||
initMessage=data
|
function chnageInitMessage(data) {
|
||||||
|
initMessage = data
|
||||||
}
|
}
|
||||||
// 连接 WebSocket
|
// 连接 WebSocket
|
||||||
const connect = async (connectMsg, onMessageBallBack) => {
|
const connect = async (connectMsg, onMessageBallBack) => {
|
||||||
@@ -127,6 +129,8 @@ export const useWebSocket = defineStore('socketTask', () => {
|
|||||||
url: uni.conf.baseUrlwws + '?' + Date.now(),
|
url: uni.conf.baseUrlwws + '?' + Date.now(),
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('连接成功');
|
console.log('连接成功');
|
||||||
|
console.log('connectMsg', connectMsg);
|
||||||
|
console.log('initMessage', initMessage);
|
||||||
isConnected.value = true;
|
isConnected.value = true;
|
||||||
// 监听初始化成功在开启心跳
|
// 监听初始化成功在开启心跳
|
||||||
startHeartbeat();
|
startHeartbeat();
|
||||||
@@ -233,7 +237,7 @@ export const useWebSocket = defineStore('socketTask', () => {
|
|||||||
|
|
||||||
// 发送消息
|
// 发送消息
|
||||||
const sendMessage = (data) => {
|
const sendMessage = (data) => {
|
||||||
if(!data){
|
if (!data) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (isConnected.value && data) {
|
if (isConnected.value && data) {
|
||||||
@@ -369,6 +373,8 @@ export const useWebSocket = defineStore('socketTask', () => {
|
|||||||
initNetworkListener,
|
initNetworkListener,
|
||||||
connect,
|
connect,
|
||||||
allowReconnect,
|
allowReconnect,
|
||||||
socketTask,setOnMessage,chnageInitMessage
|
socketTask,
|
||||||
|
setOnMessage,
|
||||||
|
chnageInitMessage
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -167,6 +167,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
|
<LookQrcode v-model="modalData.show" :qrcode="qrcode"></LookQrcode>
|
||||||
|
<ymf-share-popup ></ymf-share-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -513,9 +514,9 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad((opt) => {
|
||||||
APIusershopInfodetail({
|
APIusershopInfodetail({
|
||||||
shopId: uni.cache.get('shopId')
|
shopId: uni.cache.get('shopId')||opt.shopId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
shopInfo.value = res.shopInfo
|
shopInfo.value = res.shopInfo
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ onShareAppMessage(async () => {
|
|||||||
query
|
query
|
||||||
};
|
};
|
||||||
console.log('onShareAppMessage===', options);
|
console.log('onShareAppMessage===', options);
|
||||||
return options;
|
return wxShare(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad(async (opt) => {
|
onLoad(async (opt) => {
|
||||||
|
|||||||
232
utils/share.js
232
utils/share.js
@@ -2,6 +2,10 @@ import {
|
|||||||
autoBindInviteUser,
|
autoBindInviteUser,
|
||||||
autoGetInviteCode
|
autoGetInviteCode
|
||||||
} from '@/common/api/market/distribution.js'
|
} from '@/common/api/market/distribution.js'
|
||||||
|
|
||||||
|
import {
|
||||||
|
shareClaim
|
||||||
|
} from '@/common/api/market/share.js'
|
||||||
import {
|
import {
|
||||||
APIshopUserInfo,
|
APIshopUserInfo,
|
||||||
APIusershopInfodetail
|
APIusershopInfodetail
|
||||||
@@ -10,8 +14,17 @@ import {
|
|||||||
productStore
|
productStore
|
||||||
} from '@/stores/user.js';
|
} from '@/stores/user.js';
|
||||||
const accountStore = productStore();
|
const accountStore = productStore();
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
const accountInfo = wx.getAccountInfoSync();
|
const accountInfo = wx.getAccountInfoSync();
|
||||||
export const envVersion = accountInfo.miniProgram.envVersion;
|
export const envVersion = accountInfo.miniProgram.envVersion;
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
const accountInfo = {};
|
||||||
|
export const envVersion = 'release'
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
let type = 3;
|
let type = 3;
|
||||||
if (envVersion === 'trial') {
|
if (envVersion === 'trial') {
|
||||||
console.log('当前环境是体验版');
|
console.log('当前环境是体验版');
|
||||||
@@ -24,38 +37,78 @@ if (envVersion === 'trial') {
|
|||||||
console.log('当前环境是开发版或其他');
|
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 {Object} args - 绑定邀请关系的入参对象
|
||||||
* @param {number} [args.shopUserId] - 需要绑定邀请人的用户ID(integer <int64>,可选)
|
* @param {number} args.fromUserId - 需要绑定邀请人的用户ID(integer <int64>,必填)
|
||||||
* @param {number} [args.shopId] - 店铺ID(integer <int64>,可选)
|
* @param {number} args.shopId - 店铺ID(integer <int64>,必填)
|
||||||
* @param {string} args.inviteCode - 邀请人的邀请码(必填,非空校验通过后才会执行绑定逻辑)
|
* @param {string} args.pTag - 来源页面类型
|
||||||
* @returns {void} 无返回值
|
* @returns {void} 无返回值
|
||||||
*/
|
*/
|
||||||
export function bindInvite(args) {
|
export async function bindInvite(args) {
|
||||||
// 解构入参对象,获取需要的核心参数
|
// 解构入参对象,获取需要的核心参数
|
||||||
const {
|
const {
|
||||||
shopUserId,
|
fromUserId,
|
||||||
shopId,
|
shopId,
|
||||||
inviteCode
|
pTag,
|
||||||
} = args;
|
} = args;
|
||||||
|
console.log('bindInvite',args);
|
||||||
// 校验邀请码有效性:若邀请码为空、null、undefined,则直接返回,不执行后续绑定逻辑
|
if (!fromUserId || !shopId) {
|
||||||
if (!inviteCode || inviteCode === null || inviteCode === undefined) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||||
// 邀请码有效,调用自动绑定邀请人接口,传递绑定所需参数
|
// 邀请码有效,调用自动绑定邀请人接口,传递绑定所需参数
|
||||||
autoBindInviteUser({
|
return await shareClaim({
|
||||||
id: shopUserId,
|
tagType: pTag || '',
|
||||||
shopId,
|
shopId,
|
||||||
inviteCode
|
fromUserId: fromUserId,
|
||||||
|
toUserId: shopUserInfo.id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function wxShare(par) {
|
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 {
|
return {
|
||||||
...par,
|
...par,
|
||||||
type
|
type
|
||||||
@@ -66,15 +119,15 @@ export async function returnCommonQuery() {
|
|||||||
const shopId = uni.cache.get('shopId')
|
const shopId = uni.cache.get('shopId')
|
||||||
const shopUserInfo = uni.cache.get('shopUserInfo')
|
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||||
const shopInfo = uni.cache.get('shopInfo')
|
const shopInfo = uni.cache.get('shopInfo')
|
||||||
const inviteCode = await autoGetInviteCode({
|
// const inviteCode = await autoGetInviteCode({
|
||||||
shopId: shopId,
|
// shopId: shopId,
|
||||||
shopUserId: shopUserInfo.id
|
// fromUserId: shopUserInfo.id
|
||||||
})
|
// })
|
||||||
|
|
||||||
const queryJson = {
|
const queryJson = {
|
||||||
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||||
shopId,
|
shopId,
|
||||||
shopUserId: shopUserInfo.id,
|
fromUserId: shopUserInfo.id,
|
||||||
}
|
}
|
||||||
return Promise.resolve(queryJson)
|
return Promise.resolve(queryJson)
|
||||||
}
|
}
|
||||||
@@ -103,10 +156,10 @@ export async function returnQuery(query, showkeys) {
|
|||||||
const shopId = uni.cache.get('shopId')
|
const shopId = uni.cache.get('shopId')
|
||||||
const shopUserInfo = uni.cache.get('shopUserInfo')
|
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||||
const shopInfo = uni.cache.get('shopInfo')
|
const shopInfo = uni.cache.get('shopInfo')
|
||||||
const inviteCode = await autoGetInviteCode({
|
// const inviteCode = await autoGetInviteCode({
|
||||||
shopId: shopId,
|
// shopId: shopId,
|
||||||
shopUserId: shopUserInfo.id
|
// fromUserId: shopUserInfo.id
|
||||||
})
|
// })
|
||||||
|
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
@@ -116,9 +169,9 @@ export async function returnQuery(query, showkeys) {
|
|||||||
|
|
||||||
let sharePath = `/${currentPath}`;
|
let sharePath = `/${currentPath}`;
|
||||||
const queryJson = {
|
const queryJson = {
|
||||||
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||||
shopId,
|
shopId,
|
||||||
shopUserId: shopUserInfo.id,
|
fromUserId: shopUserInfo.id,
|
||||||
...query
|
...query
|
||||||
}
|
}
|
||||||
for (const key in currentOptions) {
|
for (const key in currentOptions) {
|
||||||
@@ -131,8 +184,8 @@ export async function returnQuery(query, showkeys) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryJson.shopId = shopId
|
queryJson.shopId = shopId
|
||||||
queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||||
queryJson.shopUserId = shopUserInfo.id
|
queryJson.fromUserId = shopUserInfo.id
|
||||||
|
|
||||||
let result = ''
|
let result = ''
|
||||||
for (let key in queryJson) {
|
for (let key in queryJson) {
|
||||||
@@ -177,87 +230,64 @@ export async function handleMixinOnLoad(opt, vm) {
|
|||||||
await accountStore.pageOnload()
|
await accountStore.pageOnload()
|
||||||
}
|
}
|
||||||
uni.setStorageSync('loadFinsh', true)
|
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) {
|
if (options.shopId) {
|
||||||
bindInvite(options)
|
return await bindInvite(options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import {
|
||||||
|
isJsonArrayString
|
||||||
|
} from '@/utils/util.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回店铺首页图片
|
||||||
|
*/
|
||||||
|
export function returnIndexBg() {
|
||||||
|
try {
|
||||||
|
const orderVIP = uni.cache.get('orderVIP')
|
||||||
|
if (!orderVIP || !orderVIP.shopExtendList) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
if (!isJsonArrayString(orderVIP.shopExtendList[0].value)) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return JSON.parse(orderVIP.shopExtendList[0].value)[0]
|
||||||
|
} catch (error) {
|
||||||
|
console.error('orderVIP.shopExtendList[0].value 格式不正确')
|
||||||
|
return ''
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// utils/share.js
|
// utils/share.js
|
||||||
export const shareMixin = {
|
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) {
|
async onShareAppMessage(res) {
|
||||||
// const shopId = uni.cache.get('shopId')
|
|
||||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
|
||||||
const shopInfo = uni.cache.get('shopInfo')
|
const shopInfo = uni.cache.get('shopInfo')
|
||||||
// const inviteCode = await autoGetInviteCode({
|
|
||||||
// shopId: shopId,
|
|
||||||
// shopUserId: shopUserInfo.id
|
|
||||||
// })
|
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
const currentPath = currentPage.route;
|
const currentPath = currentPage.route;
|
||||||
const currentOptions = currentPage.options;
|
const currentOptions = currentPage.options;
|
||||||
|
|
||||||
let sharePath = `/${currentPath}`;
|
let sharePath = `/${currentPath}`;
|
||||||
// const queryJson = {
|
|
||||||
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
|
||||||
// shopId,
|
|
||||||
// shopUserId: shopUserInfo.id,
|
|
||||||
// }
|
|
||||||
// for (const key in currentOptions) {
|
|
||||||
// if (currentOptions.hasOwnProperty(key)) {
|
|
||||||
// queryJson[key] = encodeURIComponent(currentOptions[key])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// queryJson.shopId = shopId
|
|
||||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
|
||||||
// queryJson.shopUserId = shopUserInfo.id
|
|
||||||
|
|
||||||
const query =await returnQuery()
|
|
||||||
|
|
||||||
|
let query = await returnQuery()
|
||||||
|
const indexBg = returnIndexBg()
|
||||||
|
console.log('indexBg', indexBg);
|
||||||
|
const imageUrl = indexBg || shopInfo.logo
|
||||||
|
|
||||||
// 全局默认配置(可被页面覆盖)
|
// 全局默认配置(可被页面覆盖)
|
||||||
const defaultShareConfig = {
|
const defaultShareConfig = {
|
||||||
title: shopInfo.shopName,
|
title: shopInfo.shopName,
|
||||||
path: sharePath + '?' + query,
|
path: sharePath + '?' + query,
|
||||||
imageUrl: shopInfo.logo,
|
imageUrl: imageUrl,
|
||||||
query,
|
query,
|
||||||
// desc: '描述',
|
// desc: '描述',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@@ -270,9 +300,6 @@ export const shareMixin = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 页面自定义配置覆盖全局
|
// 页面自定义配置覆盖全局
|
||||||
const pageShareConfig = this.$options.shareConfig || {};
|
const pageShareConfig = this.$options.shareConfig || {};
|
||||||
console.log('mixIn onShareAppMessage', {
|
console.log('mixIn onShareAppMessage', {
|
||||||
@@ -286,16 +313,12 @@ export const shareMixin = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async onShareTimeline() {
|
async onShareTimeline() {
|
||||||
|
|
||||||
|
|
||||||
// const shopId = uni.cache.get('shopId')
|
|
||||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
|
||||||
const shopInfo = uni.cache.get('shopInfo')
|
const shopInfo = uni.cache.get('shopInfo')
|
||||||
// const inviteCode = await autoGetInviteCode({
|
|
||||||
// shopId: shopId,
|
|
||||||
// shopUserId: shopUserInfo.id
|
|
||||||
// })
|
|
||||||
|
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
@@ -304,26 +327,17 @@ export const shareMixin = {
|
|||||||
|
|
||||||
|
|
||||||
let sharePath = `/${currentPath}`;
|
let sharePath = `/${currentPath}`;
|
||||||
// const queryJson = {
|
|
||||||
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
|
||||||
// shopId,
|
|
||||||
// shopUserId: shopUserInfo.id,
|
|
||||||
// }
|
|
||||||
// for (const key in currentOptions) {
|
|
||||||
// if (currentOptions.hasOwnProperty(key)) {
|
|
||||||
// queryJson[key] = encodeURIComponent(currentOptions[key])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// queryJson.shopId = shopId
|
|
||||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
|
||||||
// queryJson.shopUserId = shopUserInfo.id
|
|
||||||
|
|
||||||
const query = await returnQuery()
|
|
||||||
|
let query = await returnQuery()
|
||||||
|
const indexBg = returnIndexBg()
|
||||||
|
const imageUrl = indexBg || shopInfo.logo
|
||||||
|
|
||||||
|
|
||||||
const defaultTimelineConfig = {
|
const defaultTimelineConfig = {
|
||||||
title: shopInfo.shopName,
|
title: shopInfo.shopName,
|
||||||
path: sharePath + '?' + query,
|
path: sharePath + '?' + query,
|
||||||
imageUrl: shopInfo.logo,
|
imageUrl: imageUrl,
|
||||||
query,
|
query,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ module.exports = defineConfig({
|
|||||||
{
|
{
|
||||||
"@dcloudio/uni-app": [
|
"@dcloudio/uni-app": [
|
||||||
"onShareAppMessage",
|
"onShareAppMessage",
|
||||||
|
"onShareTimeline",
|
||||||
"onLoad",
|
"onLoad",
|
||||||
"onShow",
|
"onShow",
|
||||||
"onHide",
|
"onHide",
|
||||||
|
|||||||
Reference in New Issue
Block a user