This commit is contained in:
2025-01-08 09:44:25 +08:00
parent 06f6e29972
commit 4d21314fc6
60 changed files with 5477 additions and 4495 deletions
+179 -106
View File
@@ -20,87 +20,150 @@
<!-- 我的订单 -->
<!-- <ws-user-order :order="order" :is-login="isLogin" @done="openLogin"></ws-user-order> -->
<!-- 其他功能 -->
<uni-card :border="false" :padding="0">
<!-- 场馆管理可见-->
<block v-if="hasMerchantRole || hasMerchantClerkRole">
<view class="server" style="min-height: 200px">
<uni-list :border="false">
<block v-for="(item, index) in mpMenus" :key="index">
<block v-if="index === '1981'" v-for="(v,i) in item">
<uni-list-item :thumb="v.avatar" link @click="navTo(v)">
<template v-slot:body>
<view class="slot-box">
<text class="slot-text" :style="{ color: v.color ? v.color : '#333333' }">{{
v.title
}}
</text>
</view>
</template>
</uni-list-item>
</block>
</block>
</uni-list>
<uni-card :border="false" :padding="0">
<!-- 场馆管理可见-->
<block v-if="hasMerchantRole || hasMerchantClerkRole">
<view class="card">
<block v-for="(item, index) in mpMenus" :key="index">
<block v-if="index === '1981'" v-for="(v, i) in item" :key="i">
<view class="flex justify-between items-center py-20 border-bottom" @click="navTo(v)">
<view class="flex justify-start items-center">
<uv-icon :name="v.avatar"/>
<text class="text-30 ml-20">{{ v.title }}</text>
</view>
<uv-icon name="arrow-right" size="24rpx"/>
</view>
</block>
<block v-else>
<!-- 普通会员菜单 -->
<view class="server" style="min-height: 200px">
<uni-list :border="false">
<block v-for="(item, index) in mpMenus" :key="index">
<block v-if="index === '1981'" v-for="(v,i) in item">
<uni-list-item :thumb="v.avatar" link @click="navTo(v)">
<template v-slot:body>
<view class="slot-box">
<text class="slot-text" :style="{ color: v.color ? v.color : '#333333' }">{{
v.title
}}
</text>
</view>
</template>
</uni-list-item>
</block>
</block>
</uni-list>
</view>
</block>
<view class="flex justify-between items-center py-20 border-bottom" @click="scan">
<view class="flex justify-start items-center">
<uv-icon name="https://oss.wsdns.cn/20241126/92f728b3b4e146d6a916259bde11a209.png"/>
<text class="text-30 ml-20">扫码核销</text>
</view>
<uv-icon name="arrow-right" size="24rpx"/>
</view>
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
</view>
<!-- <view class="server" style="min-height: 200px">-->
<!-- <uni-list :border="false">-->
<!-- <block v-for="(item, index) in mpMenus" :key="index">-->
<!-- <block v-if="index === '1981'" v-for="(v,i) in item">-->
<!-- <uni-list-item :thumb="v.avatar" link @click="navTo(v)">-->
<!-- <template v-slot:body>-->
<!-- <view class="slot-box">-->
<!-- <text class="slot-text" :style="{ color: v.color ? v.color : '#333333' }">{{-->
<!-- v.title-->
<!-- }}-->
<!-- </text>-->
<!-- </view>-->
<!-- </template>-->
<!-- </uni-list-item>-->
<!-- </block>-->
<!-- </block>-->
<!-- <uni-list-item thumb="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png" link>-->
<!-- <template v-slot:body>-->
<!-- <view class="slot-box">-->
<!-- <button class="share-btn" open-type="contact">联系客服</button>-->
<!-- </view>-->
<!-- </template>-->
<!-- </uni-list-item>-->
<!-- </uni-list>-->
<!-- </view>-->
</block>
<block v-else>
<!-- 普通会员菜单 -->
<view class="server" style="min-height: 200px">
<view class="card">
<block v-for="(item, index) in mpMenus" :key="index">
<block v-if="index === '1981'" v-for="(v, i) in item" :key="i">
<view class="flex justify-between items-center py-20 border-bottom" @click="navTo(v)">
<view class="flex justify-start items-center">
<uv-icon :name="v.avatar"/>
<text class="text-30 ml-20">{{ v.title }}</text>
</view>
<uv-icon name="arrow-right" size="24rpx"/>
</view>
</block>
</block>
</uni-card>
<!-- <button class="share-btn" open-type="contact">-->
<!-- <view class="flex justify-between items-center py-20 border-bottom">-->
<!-- <view class="flex justify-start items-center">-->
<!-- <uv-icon name="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png"/>-->
<!-- <text class="text-30 ml-20" style="font-weight: normal!important;">联系客服</text>-->
<!-- </view>-->
<!-- <uv-icon name="arrow-right" size="24rpx"/>-->
<!-- </view>-->
<!-- </button>-->
</view>
<!-- <uni-list :border="false">-->
<!-- <block v-for="(item, index) in mpMenus" :key="index">-->
<!-- <block v-if="index === '1981'" v-for="(v,i) in item">-->
<!-- <uni-list-item :thumb="v.avatar" link @click="navTo(v)">-->
<!-- <template v-slot:body>-->
<!-- <view class="slot-box">-->
<!-- <text class="slot-text" :style="{ color: v.color ? v.color : '#333333' }">{{-->
<!-- v.title-->
<!-- }}-->
<!-- </text>-->
<!-- </view>-->
<!-- </template>-->
<!-- </uni-list-item>-->
<!-- </block>-->
<!-- </block>-->
<!-- <uni-list-item thumb="https://oss.wsdns.cn/20240806/670b965e729b4a92a60927bf51bc8afe.png" link>-->
<!-- <template v-slot:body>-->
<!-- <button class="share-btn" open-type="contact">联系客服</button>-->
<!-- </template>-->
<!-- </uni-list-item>-->
<!-- </uni-list>-->
</view>
</block>
</uni-card>
<!-- <block v-for="(item, index) in mpMenus" :key="index">-->
<!-- <block v-if="index === '1981'">-->
<!-- <uni-card :title="item[0].groupName" :border="false" :padding="0">-->
<!-- <uv-skeleton rows="1" rowsHeight="30" rowsWidth="100%" :loading="mpMenus.length === 0" :title="false">-->
<!-- <div class="flex space-around py-6 flex-wrap">-->
<!-- <block v-for="(item,index) in item" :key="index">-->
<!-- <div-->
<!-- class="service-item flex flex-col justify-center items-center web-cell-content web-text-center px-20"-->
<!-- @click="navTo(item)">-->
<!-- <uv-avatar :src="item.avatar" :size="24" mode="widthFix"></uv-avatar>-->
<!-- <text style="white-space: nowrap">{{ item.title }}</text>-->
<!-- </div>-->
<!-- </block>-->
<!-- </div>-->
<!-- <w-gap height="5"></w-gap>-->
<!-- </uv-skeleton>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- <block v-if="index === '1982' && (hasMerchantClerkRole || hasMerchantRole)">-->
<!-- <uni-card :title="item[0].groupName" :border="false" :padding="0">-->
<!-- <uv-skeleton rows="1" rowsHeight="30" rowsWidth="100%" :loading="mpMenus.length === 0" :title="false">-->
<!-- <div class="flex space-around py-6 flex-wrap">-->
<!-- <block v-for="(item,index) in item" :key="index">-->
<!-- <div-->
<!-- class="service-item flex flex-col justify-center items-center web-cell-content web-text-center px-20"-->
<!-- @click="navTo(item)">-->
<!-- <image :src="item.avatar" style="width: 30px; height: 30px;" mode="widthFix"></image>-->
<!-- <text style="white-space: nowrap">{{ item.title }}</text>-->
<!-- </div>-->
<!-- </block>-->
<!-- </div>-->
<!-- <w-gap height="5"></w-gap>-->
<!-- </uv-skeleton>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- </block>-->
<!-- <block v-for="(item, index) in mpMenus" :key="index">-->
<!-- <block v-if="index === '1981'">-->
<!-- <uni-card :title="item[0].groupName" :border="false" :padding="0">-->
<!-- <uv-skeleton rows="1" rowsHeight="30" rowsWidth="100%" :loading="mpMenus.length === 0" :title="false">-->
<!-- <div class="flex space-around py-6 flex-wrap">-->
<!-- <block v-for="(item,index) in item" :key="index">-->
<!-- <div-->
<!-- class="service-item flex flex-col justify-center items-center web-cell-content web-text-center px-20"-->
<!-- @click="navTo(item)">-->
<!-- <uv-avatar :src="item.avatar" :size="24" mode="widthFix"></uv-avatar>-->
<!-- <text style="white-space: nowrap">{{ item.title }}</text>-->
<!-- </div>-->
<!-- </block>-->
<!-- </div>-->
<!-- <w-gap height="5"></w-gap>-->
<!-- </uv-skeleton>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- <block v-if="index === '1982' && (hasMerchantClerkRole || hasMerchantRole)">-->
<!-- <uni-card :title="item[0].groupName" :border="false" :padding="0">-->
<!-- <uv-skeleton rows="1" rowsHeight="30" rowsWidth="100%" :loading="mpMenus.length === 0" :title="false">-->
<!-- <div class="flex space-around py-6 flex-wrap">-->
<!-- <block v-for="(item,index) in item" :key="index">-->
<!-- <div-->
<!-- class="service-item flex flex-col justify-center items-center web-cell-content web-text-center px-20"-->
<!-- @click="navTo(item)">-->
<!-- <image :src="item.avatar" style="width: 30px; height: 30px;" mode="widthFix"></image>-->
<!-- <text style="white-space: nowrap">{{ item.title }}</text>-->
<!-- </div>-->
<!-- </block>-->
<!-- </div>-->
<!-- <w-gap height="5"></w-gap>-->
<!-- </uv-skeleton>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- </block>-->
<!-- <ws-personal :form="users" ref="personal" @done="reload" />-->
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
@@ -114,7 +177,7 @@
import {useUserStore} from '@/store/modules/user';
import * as MpMenuApi from '@/api/cms/mp-menu';
import * as UserCardApi from '@/api/booking/userCard';
import {getThinkUsers,updateThinkUsers} from '@/api/think/thinkUsers';
import {getThinkUsers, updateThinkUsers} from '@/api/think/thinkUsers';
import {openUrl} from '@/utils/common';
import {useMpStore} from "@/store/modules/mp";
import {getWxOpenId, loginByOpenId} from '@/api/passport/login';
@@ -123,6 +186,7 @@ import Layout from "@/components/layout.vue";
import {useTenantStore} from '@/store/modules/tenant';
import {authUser} from "@/api/user";
import UvAvatar from "@/uni_modules/uv-avatar/components/uv-avatar/uv-avatar.vue";
import {getThinkOrderByCode} from "@/api/think/thinkOrder";
const tenantStore = useTenantStore();
const mpStore = useMpStore();
@@ -185,10 +249,10 @@ export default {
app.isLogin = true;
}
// 获取旧系统用户信息
if(uni.getStorageSync('uid')){
if (uni.getStorageSync('uid')) {
await getThinkUsers(uni.getStorageSync('uid')).then(data => {
app.users = data;
console.log(app.users,'>>>>')
console.log(app.users, '>>>>')
})
}
// 当前登录用户信息
@@ -199,7 +263,7 @@ export default {
uni.setStorageSync('user_id', app.userInfo.userId);
// 更新第三方系统的用户ID
if(!userInfo.uid && uni.getStorageSync('uid')){
if (!userInfo.uid && uni.getStorageSync('uid')) {
await authUser({uid: uni.getStorageSync('uid')}).then(res => {
console.log('更新第三方系统的用户ID')
})
@@ -267,31 +331,21 @@ export default {
}
// 菜单数据
MpMenuApi.pageMpMenu({type: 0, limit: 100})
.then((res) => {
app.order = res.list.filter((d) => d.rows == 0);
app.server = res.list.filter((d) => d.rows == 1);
// console.log('app.hasMerchantRole: ',app.hasMerchantRole);
// console.log('app.hasMerchantClerkRole: ',app.hasMerchantClerkRole);
// console.log('app.hasSuperAdminRole: ',app.hasSuperAdminRole);
if (!app.hasMerchantRole && !app.hasMerchantClerkRole) {
// console.log('11111: ',11111);
app.server = res.list.filter((d) => d.rows == 1 && d.adminShow == 0);
}
app.hideTools = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
app.hideTools = false;
.then((res) => {
app.order = res.list.filter((d) => d.rows == 0);
app.server = res.list.filter((d) => d.rows == 1);
if (!app.hasMerchantRole && !app.hasMerchantClerkRole) {
app.server = res.list.filter((d) => d.rows == 1 && d.adminShow == 0);
}
app.hideTools = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
UserCardApi.pageUserCard({payStatus: 1, userId: uni.getStorageSync('user_id')}).then(res => {
console.log('res8888889: ', res);
app.userInfo.cards = res.count
app.userInfo.coupon = 1;
})
app.hideTools = false;
});
},
navTo(item) {
if (!this.isLogin) {
@@ -312,9 +366,28 @@ export default {
this.$refs.login.open('bottom');
return false;
}
if(text){
if (text) {
uni.navigateTo({url: text})
}
},
scan() {
uni.scanCode({
onlyFromCamera: true,
success: async ({result}) => {
const res = await getThinkOrderByCode(result)
if (!res.res) return uni.showToast({
title: res.msg,
icon: 'none'
})
uni.navigateTo({url: `/package/order/check?id=${res.data.id}`})
},
fail: (err) => {
uni.showToast({
title: '扫码失败',
icon: 'none'
})
}
});
}
}
};