|
@@ -12,7 +12,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</up-navbar>
|
|
</up-navbar>
|
|
|
<!-- 顶部用户信息 -->
|
|
<!-- 顶部用户信息 -->
|
|
|
- <view class="user-header">
|
|
|
|
|
|
|
+ <view class="user-header jianbianBG">
|
|
|
<view class="user-info">
|
|
<view class="user-info">
|
|
|
<view class="user-main">
|
|
<view class="user-main">
|
|
|
<view>
|
|
<view>
|
|
@@ -95,7 +95,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
|
|
|
|
+import {ref, reactive, watch, computed} from 'vue'
|
|
|
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
|
|
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
|
|
|
import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
|
|
import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
|
|
|
import { isHttpsImage } from "@/utils/util";
|
|
import { isHttpsImage } from "@/utils/util";
|
|
@@ -108,6 +108,12 @@ import { HTTP_REQUEST_URL_IMG } from "@/config/app";
|
|
|
const appStore = useAppStore();
|
|
const appStore = useAppStore();
|
|
|
const { Toast } = useToast();
|
|
const { Toast } = useToast();
|
|
|
const isLogin = appStore.isLogin;
|
|
const isLogin = appStore.isLogin;
|
|
|
|
|
+const showIcons = ref(false);
|
|
|
|
|
+const wxConfig = ref({});
|
|
|
|
|
+const tradeList = ref([]);
|
|
|
|
|
+const useList = ref([]);
|
|
|
|
|
+const wdsyShow = ref(false);
|
|
|
|
|
+const kcglShow = ref(false);
|
|
|
|
|
|
|
|
const navBgColor = ref('rgba(255,255,255,0)');
|
|
const navBgColor = ref('rgba(255,255,255,0)');
|
|
|
|
|
|
|
@@ -134,27 +140,76 @@ const orderStatus = ref([
|
|
|
{ src: `${HTTP_REQUEST_URL_IMG}setting/tuikuan.png`, name: '退款/换货' ,id:5},
|
|
{ src: `${HTTP_REQUEST_URL_IMG}setting/tuikuan.png`, name: '退款/换货' ,id:5},
|
|
|
{ src: `${HTTP_REQUEST_URL_IMG}setting/yiwancheng.png`, name: '已完成',id:4 },
|
|
{ src: `${HTTP_REQUEST_URL_IMG}setting/yiwancheng.png`, name: '已完成',id:4 },
|
|
|
])
|
|
])
|
|
|
-
|
|
|
|
|
// 常用功能
|
|
// 常用功能
|
|
|
-const commonFunctions = ref([
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/fabu.png`, name: '发布商品',pageUrl:'/pages/merchantCenters/postInformation',show:true },
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/shangpin.png`, name: '商品管理',pageUrl:'/pages/merchantCenters/productManagement',show:true },
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/kucun.png`, name: '库存管理',pageUrl:'/pages/users/user_asset/asset_info/asset_info' ,show:true},
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/jinqian.png`, name: '我的收益',pageUrl: '/pages/users/my_merchant/index' ,show:appStore.merchantId?true:false},
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/kabao.png`, name: '卡包管理',pageUrl: '/pages/users/card_page/index' ,show:true},
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/mendian.png`, name: '门店推广',pageUrl: '/pages/users/my_merchant/index',show:true },
|
|
|
|
|
- { src: `${HTTP_REQUEST_URL_IMG}setting/dianpu.png`, name: '我的商城',pageUrl: `/pages/index/index` ,show:true},
|
|
|
|
|
-])
|
|
|
|
|
|
|
+
|
|
|
|
|
+const commonFunctions = computed(() => {
|
|
|
|
|
+ const baseFunctions = [
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/fabu.png`, name: '发布商品',pageUrl:'/pages/merchantCenters/postInformation',show:true },
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/shangpin.png`, name: '商品管理',pageUrl:'/pages/merchantCenters/productManagement',show:true },
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/kucun.png`, name: '库存管理',pageUrl:'/pages/users/user_asset/asset_info/asset_info' ,show:kcglShow.value},
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/jinqian.png`, name: '我的收益',pageUrl: '/pages/users/my_merchant/index' ,show:wdsyShow.value},
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/kabao.png`, name: '卡包管理',pageUrl: '/pages/users/card_page/index' ,show:true},
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/mendian.png`, name: '门店推广',pageUrl: '/pages/users/my_merchant/index',show:true },
|
|
|
|
|
+ { src: `${HTTP_REQUEST_URL_IMG}setting/dianpu.png`, name: '我的商城',pageUrl: `/pages/index/index` ,show:true},
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 根据 show 值过滤
|
|
|
|
|
+ return baseFunctions.filter((func) => func.show);
|
|
|
|
|
+});
|
|
|
const params = ref({
|
|
const params = ref({
|
|
|
page: 1,
|
|
page: 1,
|
|
|
limit: 10,
|
|
limit: 10,
|
|
|
});
|
|
});
|
|
|
const merchantInfo = ref({})
|
|
const merchantInfo = ref({})
|
|
|
|
|
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => appStore.wxConfig,
|
|
|
|
|
+ (newVal) => {
|
|
|
|
|
+ const configDate = newVal || appStore.$wxConfig;
|
|
|
|
|
+ wxConfig.value = configDate;
|
|
|
|
|
+ const list = JSON.parse(configDate.essentialFunctions);
|
|
|
|
|
+
|
|
|
|
|
+ if (list[0].status == false) {
|
|
|
|
|
+ showIcons.value = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showIcons.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ tradeList.value = [list[0], list[1]];
|
|
|
|
|
+ useList.value = [
|
|
|
|
|
+ {
|
|
|
|
|
+ ...list[2],
|
|
|
|
|
+ src: `${HTTP_REQUEST_URL_IMG}setting/mailiao.png`,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ...list[3],
|
|
|
|
|
+ src: `${HTTP_REQUEST_URL_IMG}setting/mailiao2.png`,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ...list[4],
|
|
|
|
|
+ src: `${HTTP_REQUEST_URL_IMG}setting/cunliao.png`,
|
|
|
|
|
+ iconName: "存料",
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ ...list[5],
|
|
|
|
|
+ src: `${HTTP_REQUEST_URL_IMG}setting/tiliao.png`,
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ if(useList.value && useList.value.length>0 && showIcons.value){
|
|
|
|
|
+ kcglShow.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ { deep: true, immediate: true }
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
// 页面加载
|
|
// 页面加载
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
console.log(appStore.userInfo)
|
|
console.log(appStore.userInfo)
|
|
|
merchantInfo.value = appStore.userInfo.merchant;
|
|
merchantInfo.value = appStore.userInfo.merchant;
|
|
|
|
|
+ if (appStore.merchantId || appStore.userInfo?.merchant?.id) {
|
|
|
|
|
+ wdsyShow.value = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ wdsyShow.value = false;
|
|
|
|
|
+ }
|
|
|
getMerchantSalesSummary()
|
|
getMerchantSalesSummary()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -189,14 +244,30 @@ const getMerchantSalesSummary = async () =>{
|
|
|
// 功能点击
|
|
// 功能点击
|
|
|
const handleFunctionClick = (url,name) => {
|
|
const handleFunctionClick = (url,name) => {
|
|
|
if (!url) return;
|
|
if (!url) return;
|
|
|
- if(name != '我的商城'){
|
|
|
|
|
- uni.navigateTo({ url });
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ if(name == '库存管理'){
|
|
|
|
|
+ goDetail(url);
|
|
|
|
|
+ }else if(name == '我的商城'){
|
|
|
uni.switchTab({url})
|
|
uni.switchTab({url})
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.navigateTo({ url });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+const goDetail = (url) => {
|
|
|
|
|
+ console.log('url',url);
|
|
|
|
|
+ const webviewPageUrl = `/pages/webview/index?path=${url}`;
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: webviewPageUrl,
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("跳转到webview页面失败:", err);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "跳转失败,请重试",
|
|
|
|
|
+ icon: "none",
|
|
|
|
|
+ duration: 1500,
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
// 查看商家
|
|
// 查看商家
|
|
|
const viewStore = (store) => {
|
|
const viewStore = (store) => {
|
|
|
if(!store.merchantId ){
|
|
if(!store.merchantId ){
|
|
@@ -259,7 +330,7 @@ function formatMoney(value) {
|
|
|
/* 顶部用户信息 */
|
|
/* 顶部用户信息 */
|
|
|
.user-header {
|
|
.user-header {
|
|
|
height: 600rpx;
|
|
height: 600rpx;
|
|
|
- background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
|
|
|
|
|
|
|
+ //background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
|
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
|
padding: 150rpx 20rpx 20rpx;
|
|
padding: 150rpx 20rpx 20rpx;
|
|
|
color: #fff;
|
|
color: #fff;
|