Jelajahi Sumber

Merge branch 'dev_v3_lqw' into dev_v3

ext.liuqiwen3 1 bulan lalu
induk
melakukan
e3362898ac
6 mengubah file dengan 132 tambahan dan 48 penghapusan
  1. 24 24
      pages.json
  2. 2 2
      pages/index/index.vue
  3. 88 17
      pages/merchantCenter/index.vue
  4. 1 0
      pages/user/index.vue
  5. 5 5
      pages/users/login/index.vue
  6. 12 0
      static/css/base.css

+ 24 - 24
pages.json

@@ -225,30 +225,30 @@
             "navigationBarTextStyle": "black"
           }
         },
-        {
-          "path": "user_asset/stock_in/stock_in",
-          "style": {
-            "navigationBarTitleText": "补仓",
-            "navigationBarBackgroundColor": "#fff",
-            "navigationBarTextStyle": "black"
-          }
-        },
-        {
-          "path": "user_asset/asset_info/asset_info",
-          "style": {
-            "navigationBarTitleText": "资产明细",
-            "navigationBarBackgroundColor": "#fff",
-            "navigationBarTextStyle": "black"
-          }
-        },
-        {
-          "path": "user_asset/record_list/record_list",
-          "style": {
-            "navigationBarTitleText": "交易明细",
-            "navigationBarBackgroundColor": "#fff",
-            "navigationBarTextStyle": "black"
-          }
-        },
+//        {
+//          "path": "user_asset/stock_in/stock_in",
+//          "style": {
+//            "navigationBarTitleText": "补仓",
+//            "navigationBarBackgroundColor": "#fff",
+//            "navigationBarTextStyle": "black"
+//          }
+//        },
+//        {
+//          "path": "user_asset/asset_info/asset_info",
+//          "style": {
+//            "navigationBarTitleText": "资产明细",
+//            "navigationBarBackgroundColor": "#fff",
+//            "navigationBarTextStyle": "black"
+//          }
+//        },
+//        {
+//          "path": "user_asset/record_list/record_list",
+//          "style": {
+//            "navigationBarTitleText": "交易明细",
+//            "navigationBarBackgroundColor": "#fff",
+//            "navigationBarTextStyle": "black"
+//          }
+//        },
         {
           "path": "user_return_list/index",
           "style": {

+ 2 - 2
pages/index/index.vue

@@ -25,7 +25,7 @@
     />
     <!-- <view class="page-index" :class="{ bgf: navIndex > 0 }"> -->
     <view class="page-index">
-      <view class="top-box">
+      <view class="top-box jianbianBG">
         <view class="header">
           <view class="serch-wrapper">
 <!--            <view class="logo" @click="goBack">-->
@@ -1057,7 +1057,7 @@ page {
   .top-box {
     padding-top: 168rpx;
     //background: linear-gradient(180deg, #ffe079 0%, #ffffff 100%);
-    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%;
   }
 }

+ 88 - 17
pages/merchantCenter/index.vue

@@ -12,7 +12,7 @@
       </template>
     </up-navbar>
     <!-- 顶部用户信息 -->
-    <view class="user-header">
+    <view class="user-header jianbianBG">
       <view class="user-info">
         <view class="user-main">
           <view>
@@ -95,7 +95,7 @@
 </template>
 
 <script setup>
-import { ref, reactive } from 'vue'
+import {ref, reactive, watch, computed} from 'vue'
 import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
 import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
 import { isHttpsImage } from "@/utils/util";
@@ -108,6 +108,12 @@ import { HTTP_REQUEST_URL_IMG } from "@/config/app";
 const appStore = useAppStore();
 const { Toast } = useToast();
 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)');
 
@@ -134,27 +140,76 @@ const orderStatus = ref([
   { src: `${HTTP_REQUEST_URL_IMG}setting/tuikuan.png`, name: '退款/换货' ,id:5},
   { 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({
   page: 1,
   limit: 10,
 });
 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(() => {
   console.log(appStore.userInfo)
   merchantInfo.value = appStore.userInfo.merchant;
+  if (appStore.merchantId || appStore.userInfo?.merchant?.id) {
+    wdsyShow.value = true;
+  } else {
+    wdsyShow.value = false;
+  }
   getMerchantSalesSummary()
 })
 
@@ -189,14 +244,30 @@ const getMerchantSalesSummary = async () =>{
 // 功能点击
 const handleFunctionClick = (url,name) => {
   if (!url) return;
-  if(name != '我的商城'){
-    uni.navigateTo({ url });
-  }else{
+  if(name == '库存管理'){
+    goDetail(url);
+  }else if(name == '我的商城'){
     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) => {
   if(!store.merchantId ){
@@ -259,7 +330,7 @@ function formatMoney(value) {
 /* 顶部用户信息 */
 .user-header {
   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%;
   padding: 150rpx 20rpx 20rpx;
   color: #fff;

+ 1 - 0
pages/user/index.vue

@@ -420,6 +420,7 @@ watch(
     const configDate = newVal || appStore.$wxConfig;
     wxConfig.value = configDate;
     const list = JSON.parse(configDate.essentialFunctions);
+    console.log('list',list)
     if (list[0].status == false) {
       showIcons.value = false;
     } else {

+ 5 - 5
pages/users/login/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="login-wrapper">
+	<div class="login-wrapper bglogin">
 		<up-navbar title="登录" placeholder>
 			<template #left>
 				<view class=""></view>
@@ -10,7 +10,7 @@
 			<view class="">欢迎来到水贝搬运工</view>
 		</div>
 		<div class="whiteBg" v-if="formItem === 1">
-			<view class="whiteBg-tab" :class="{'whiteBg-tabs':current == 1}">
+			<view class="whiteBg-tab whiteBg-tabimg" :class="{'whiteBg-tabs whiteBg-tabsimg':current == 1}">
 				<view @click="current = item.type" :class="{active:current != index,noActive:current == index}" class="whiteBg-tab-li" v-for="(item,index) in navList" :key="index">
 					<view class="">{{ item.name }}</view>
 				</view>
@@ -467,7 +467,7 @@
 		background-color: transparent !important;
 	}
 	.login-wrapper {
-		background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png');
+		//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png');
 		background-repeat: no-repeat;
 		background-size: 100% 624rpx;
 		background-color: #FFFFFF;
@@ -584,7 +584,7 @@
 				align-items: center;
 				height: 88rpx;
 				text-align: center;
-				background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab1.png');
+				//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab1.png');
 				background-repeat: no-repeat;
 				background-size: cover;
 				.active {
@@ -612,7 +612,7 @@
 				}
 			}
 			.whiteBg-tabs {
-				background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab.png');
+				//background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab.png');
 				background-repeat: no-repeat;
 				background-size: cover;
 			}

+ 12 - 0
static/css/base.css

@@ -470,4 +470,16 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
 }
 .font333{
 	color:#333 !important;
+}
+.jianbianBG{
+	background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
+}
+.bglogin{
+	background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/login@2x.png');
+}
+.whiteBg-tabimg{
+	background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab1.png');
+}
+.whiteBg-tabsimg{
+	background: url('https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/logintab.png');
 }