Browse Source

feat: 学习本落地页

huangziyang 3 days ago
parent
commit
e375cc65ff

+ 108 - 52
App.vue

@@ -1,60 +1,116 @@
-<script>
-export default {
-  onLaunch: function () {
+<template>
+  <Container title="学习本">
+    <view class="header">
+      <view class="stats">
+        <text>10000/20000</text>
+        <text>正确率50%</text>
+      </view>
+      <view class="tabs">
+        <view class="tab active">法规</view>
+        <view class="tab">药一</view>
+        <view class="tab">药综</view>
+        <view class="tab">中药一</view>
+        <view class="tab">中药二</view>
+        <view class="tab">中药二</view>
+      </view>
+      <view class="sub-tabs">
+        <view class="sub-tab active">答案正确(2301)</view>
+        <view class="sub-tab">答案错误(2301)</view>
+      </view>
+    </view>
+    <view class="content">
+      <view class="question-card" v-for="(question, index) in questions" :key="index">
+        <view class="question-header">
+          <text class="question-type">单选题</text>
+          <text class="question-date">2025-03-20 20:30:20</text>
+        </view>
+        <view class="question-text">
+          根据中药七情配伍理论,属于相畏的药组是?
+        </view>
+        <view class="options">
+          <view class="option" v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']" :key="i">
+            <text>{{ option }}</text>
+            <text>选项内容</text>
+          </view>
+        </view>
+        <view class="footer">
+          <button class="button">查看解析与考点</button>
+        </view>
+      </view>
+    </view>
+  </Container>
+</template>
 
-    console.log("App Launch");
-  },
-  onShow: function () {
-    console.log("App Show");
-  },
-  onHide: function () {
-    console.log("App Hide");
-  },
-};
+<script setup>
+import Container from "@/components/Container/Container.vue";
+console.log(11);
+
+// 示例数据
+const questions = Array(2).fill({});
 </script>
 
-<style lang="scss">
-@import "@/uni.scss";
-/*每个页面公共css */
-@import "@/uni_modules/uni-scss/index.scss";
-button {
-  background-color: $primary;
-  font-weight: 500;
-  font-size: 32rpx;
-  color: #fff;
-  margin: 0;
-  width: 100%;
-  &::after {
-    border: 0;
-  }
-}
+<style scoped lang="scss">
+@import '@/uni.scss';
 
-.button {
-  background-color: $primary;
-  font-weight: 500;
-  font-size: 32rpx;
-  color: #fff;
-  margin: 0;
-  width: 100%;
-  border-radius: 20rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  padding: 20rpx 0;
-  &::after {
-    border: 0;
+.header {
+  padding: 16rpx;
+  background-color: #fff;
+  .stats {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 8rpx;
+  }
+  .tabs, .sub-tabs {
+    display: flex;
+    margin-bottom: 8rpx;
+    .tab, .sub-tab {
+      padding: 8rpx 16rpx;
+      border-radius: 8rpx;
+      &.active {
+        background-color: $uni-primary;
+        color: #fff;
+      }
+    }
   }
 }
 
-.tip {
-  font-family: PingFang SC, PingFang SC;
-  font-weight: 400;
-  font-size: 24rpx;
-  color: #999999;
-}
-
-.button.plain {
-  background: $uni-primary-light;
-  color: $primary;
+.content {
+  padding: 16rpx;
+  .question-card {
+    background-color: #fff;
+    border-radius: 8rpx;
+    margin-bottom: 16rpx;
+    padding: 16rpx;
+    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
+    .question-header {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 8rpx;
+      .question-type {
+        color: $uni-primary;
+      }
+    }
+    .options {
+      margin-top: 8rpx;
+      .option {
+        display: flex;
+        align-items: center;
+        margin-bottom: 4rpx;
+        text {
+          margin-right: 8rpx;
+        }
+      }
+    }
+    .footer {
+      margin-top: 8rpx;
+      .button {
+        background-color: $uni-primary;
+        color: #fff;
+        padding: 8rpx 16rpx;
+        border-radius: 8rpx;
+        text-align: center;
+      }
+    }
+  }
 }
-</style>
+</style>

+ 32 - 14
components/Container/Container.vue

@@ -1,10 +1,10 @@
 <script setup>
 import Empty from "../Empty/Empty.vue";
-import pages from "@/pages.json";
 import { ref, onMounted, watchEffect } from "vue";
-import { getRoute, router } from "../../utils/router";
+import { router, getRoute } from "../../utils/router";
 import { getRect, debounce } from "../../utils";
 import { getCurrentInstance } from "vue";
+import pages from "@/pages.json";
 
 const props = defineProps({
   showBottom: {
@@ -93,7 +93,21 @@ const safeArea = ref({
 });
 const footerHeight = ref(0);
 
+const menuButtonInfo = ref({
+  top: 0,
+  height: 0,
+  width: 0,
+});
+
 onMounted(() => {
+  const _menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+
+  menuButtonInfo.value = {
+    top: _menuButtonInfo.top,
+    height: _menuButtonInfo.height,
+    width: _menuButtonInfo.width,
+  };
+
   const systemInfo = uni.getWindowInfo();
   // 判断是否为tabbar页面
   safeArea.value = {
@@ -103,19 +117,20 @@ onMounted(() => {
 
   // 解决部分安卓手机安全顶部为0 的bug
   if (!safeArea.value.top) {
-    safeArea.value.top = systemInfo.statusBarHeight || 40;
+    safeArea.value.top = systemInfo.statusBarHeight;
   }
 
   const isTarbarPage = pages.tabBar.list
     .map((item) => item.pagePath)
     .includes(getRoute().routeList[0].path);
 
-  if (isTarbarPage) {
-    console.log(systemInfo);
-    
-    // 高度再减掉tabbar高度
-    safeArea.value.height -= 48;
+  if (
+    safeArea.value.source.bottom === safeArea.value.source.height &&
+    isTarbarPage
+  ) {
+    safeArea.value.height -= 50;
   }
+
   // 24是内边距
   safeArea.value.width -= 24;
 
@@ -126,7 +141,9 @@ onMounted(() => {
     onSuccess(res) {
       safeArea.value.title = res;
       safeArea.value.height -= props.showTitle
-        ? safeArea.value.title?.height
+        ? isTarbarPage
+          ? safeArea.value.title?.height + safeArea.value.top
+          : safeArea.value.title?.height
         : 0;
     },
     instance,
@@ -193,7 +210,11 @@ defineExpose({
       <view
         :class="['scroll-view', scrollX ? 'topic-scroll' : '']"
         :style="{
-          height: `${safeArea.height}px`,
+          height: `calc(100vh - ${
+            menuButtonInfo.top +
+            menuButtonInfo.height +
+            40
+          }px - env(safe-area-inset-bottom))`,
           whiteSpace: scrollX ? 'nowrap' : 'normal',
           ...scrollStyle,
         }"
@@ -256,11 +277,8 @@ defineExpose({
 
 .scroll-view {
   position: relative;
-  padding: 24rpx 24rpx 0;
+  padding: 24rpx;
   box-sizing: content-box;
-  display: flex;
-  flex-direction: column;
-  gap: 24rpx;
 }
 
 .bottom-text {

+ 2 - 2
components/Tree/Tree.vue

@@ -40,7 +40,7 @@ const emit = defineEmits(["onChnage", "onClickButton"]);
           <Tree
             :chaptersList="items[keys.children]"
             :leave="leave + 1"
-            @onClickButton="emit('onClickButton', items)"
+            @onClickButton="(e) => emit('onClickButton', e)"
             @change="emit('onChnage')"
           />
         </view>
@@ -99,7 +99,7 @@ const emit = defineEmits(["onChnage", "onClickButton"]);
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 8rpx 20rpx 10rpx 0;
+  padding: 20rpx 20rpx 10rpx 0;
   .buttons {
     display: flex;
     gap: 10rpx;

+ 1 - 1
ext.json

@@ -4,7 +4,7 @@
   "directCommit": false,
   "ext": {
     "host_url": "https://openwork.dfwy.tech/",
-    "release_host_url": "https://openwork.dfwy.tech/",
+    "release_host_url": "https://api.kailin.com.cn/",
     "app_id": "wx37802f7af7be337e"
   }
 }

+ 17 - 38
main.js

@@ -1,51 +1,30 @@
-// #ifndef VUE3
-import Vue from 'vue'
-import App from './App'
-// 全局请求
-import http from './utils/request.js'
-// 精度计算
-import decimal from './utils/decimal.js'
-// 精度计算
-import checkAccess from './utils/checkaccess.js'
-// 获取ext配置
-import ext from './utils/ext.js'
-
-Vue.config.productionTip = false
-
-App.mpType = 'app'
-
-const app = new Vue({
-    ...App
-})
-app.$mount()
-// #endif
+import { createSSRApp } from "vue";
+import App from "./App.vue";
+import * as Pinia from "pinia";
+import shareMixin from "./mixin/shareMixin.js";
 
-// #ifdef VUE3
-import { createSSRApp } from 'vue'
-import App from './App.vue'
-import * as Pinia from 'pinia';
 // 全局请求
-import http from './utils/request.js'
+import http from "./utils/request.js";
 // 精度计算
-import decimal from './utils/decimal.js'
+import decimal from "./utils/decimal.js";
 // 权限检查
-import checkAccess from './utils/checkaccess.js'
+import checkAccess from "./utils/checkaccess.js";
 // 获取ext配置
-import ext from './utils/ext.js'
+import ext from "./utils/ext.js";
 
 export function createApp() {
-  const app = createSSRApp(App)
-  app.use(Pinia.createPinia())
+  const app = createSSRApp(App);
+  app.mixin(shareMixin);
+  app.use(Pinia.createPinia());
   // 挂载全局属性
-  app.config.globalProperties.$http = http
+  app.config.globalProperties.$http = http;
   // 挂载全局属性
-  app.config.globalProperties.$decimal = decimal
+  app.config.globalProperties.$decimal = decimal;
   // 挂载全局属性
-  app.config.globalProperties.$checkAccess = checkAccess
-  app.config.globalProperties.$ext = ext
+  app.config.globalProperties.$checkAccess = checkAccess;
+  app.config.globalProperties.$ext = ext;
   return {
     app,
-    Pinia
-  }
+    Pinia,
+  };
 }
-// #endif

+ 52 - 0
mixin/shareMixin.js

@@ -0,0 +1,52 @@
+export default {
+  data() {
+    return {
+      share: {
+        title: "开邻做题家",
+        path: "/pages/index/index",
+        imageUrl: "分享显示的图片链接",
+        desc: "简介",
+      },
+    };
+  },
+  // 分享到微信好友功能
+  onShareAppMessage(res) {
+    return {
+      title: this.share.title,
+      path: this.share.path,
+      desc: this.share.desc,
+      imageUrl: this.share.imageUrl,
+      success(res) {
+        uni.showToast({
+          title: "分享成功",
+        });
+      },
+      fail(res) {
+        uni.showToast({
+          title: "分享失败",
+          icon: "none",
+        });
+      },
+    };
+  },
+  // 分享到朋友圈功能
+  onShareTimeline(res) {
+    return {
+      title: this.share.title,
+      path: this.share.path,
+      desc: this.share.desc,
+      imageUrl: this.share.imageUrl,
+      success(res) {
+        uni.showToast({
+          title: "分享成功",
+        });
+      },
+      fail(res) {
+        uni.showToast({
+          title: "分享失败",
+          icon: "none",
+        });
+      },
+    };
+  },
+};

+ 6 - 6
pages.json

@@ -156,12 +156,12 @@
         "selectedIconPath": "static/icons/home_select.png",
         "text": "首页"
       },
-      // {
-      //   "pagePath": "pages/learn/index",
-      //   "iconPath": "static/icons/learn.png",
-      //   "selectedIconPath": "static/icons/learn_select.png",
-      //   "text": "学习本"
-      // },
+      {
+        "pagePath": "pages/learn/index",
+        "iconPath": "static/icons/learn.png",
+        "selectedIconPath": "static/icons/learn_select.png",
+        "text": "学习本"
+      },
       {
         "pagePath": "pages/challenge/index",
         "iconPath": "static/icons/challenge.png",

+ 1 - 1
pages/challenge/addContant.vue

@@ -8,7 +8,7 @@
     <view class="bg">
       <view class="bg-1">
         <image
-          src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/S8CkzXdkVdToQYvRmfs9u9hbFpx3jaiBsfIor51m.png"
+          src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/lW8ekxb2fdipLnTFDC4njYTMqz4ZsoDV6iQy6JRu.jpg"
           show-menu-by-longpress
           class="qrcode"
         ></image>

+ 11 - 2
pages/index/index.vue

@@ -90,7 +90,9 @@
           </view>
         </uni-section>
       </view>
-      <view></view>
+      <!-- #ifdef  MP-WEIXIN -->
+      <official-account @load="onload"></official-account>
+      <!-- #endif -->
     </view>
   </Container>
 </template>
@@ -99,7 +101,7 @@
 import { ref, onMounted, computed, onBeforeUnmount } from "vue";
 
 import Container from "../../components/Container/Container.vue";
-import { router } from "../../utils/router";
+import { router, getRoute } from "../../utils/router";
 import { request } from "../../utils/request";
 import { arrayToTree } from "../../utils";
 
@@ -121,6 +123,9 @@ const splitDays = computed(() => {
   // 如果不足3位数,前面补0(例如5变成["0","0","5"])
   return str.padStart(3, "0").split("");
 });
+const onload = (e) => {
+  console.log(e);
+};
 
 const calculateDays = () => {
   // const targetDate = new Date('2025-12-31');
@@ -163,6 +168,10 @@ const goto_notice_list = (link_url) => {
   });
 };
 onMounted(async () => {
+  const params = getRoute().params
+  if (params.share_uid) {
+    uni.setStorageSync("share_uid", params.share_uid);
+  }
   const res = await request(
     "api/question_bank/question_reception/chapter/get",
     {},

+ 119 - 2
pages/learn/index.vue

@@ -1,9 +1,126 @@
 <template>
-  <Container title="学习本" empty></Container>
+  <Container title="学习本">
+    <view class="header">
+      <view class="stats">
+        <text>10000/20000</text>
+        <text>正确率50%</text>
+      </view>
+      <view class="tabs">
+        <view class="tab active">法规</view>
+        <view class="tab">药一</view>
+        <view class="tab">药综</view>
+        <!-- 其他标签 -->
+      </view>
+      <view class="sub-tabs">
+        <view class="sub-tab active">答案正确(2301)</view>
+        <view class="sub-tab">答案错误(2301)</view>
+      </view>
+    </view>
+    <view class="content">
+      <view class="question-card" v-for="(question, index) in questions" :key="index">
+        <view class="question-header">
+          <text class="question-type">单选题</text>
+          <text class="question-date">2025-03-20 20:30:20</text>
+        </view>
+        <view class="question-text">
+          根据中药七情配伍理论,属于相畏的药组是?
+        </view>
+        <view class="options">
+          <view class="option" v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']" :key="i">
+            <text>{{ option }}</text>
+            <text>选项内容</text>
+          </view>
+        </view>
+        <view class="footer">
+          <button class="explain-btn">查看解析与考点</button>
+        </view>
+      </view>
+    </view>
+  </Container>
 </template>
 
 <script setup>
 import Container from "@/components/Container/Container.vue";
+
+// 示例数据
+const questions = Array(2).fill({});
 </script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+@import '@/uni.scss';
+
+.header {
+  padding: 16rpx;
+  background-color: #fff;
+  .stats {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 8rpx;
+  }
+  .tabs, .sub-tabs {
+    display: flex;
+    margin-bottom: 8rpx;
+    .tab, .sub-tab {
+      padding: 8rpx 16rpx;
+      border-radius: 8rpx;
+      &.active {
+        background-color: $uni-primary;
+        color: #fff;
+      }
+    }
+  }
+}
+
+.content {
+  padding: 16rpx;
+  .question-card {
+    background-color: #fff;
+    border-radius: 8rpx;
+    margin-bottom: 16rpx;
+    padding: 16rpx;
+    .question-header {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 8rpx;
+      .question-type {
+        color: $uni-primary;
+      }
+    }
+    .options {
+      margin-top: 8rpx;
+      .option {
+        display: flex;
+        align-items: center;
+        margin-bottom: 4rpx;
+        text {
+          margin-right: 8rpx;
+        }
+      }
+    }
+    .footer {
+      margin-top: 8rpx;
+      .explain-btn {
+        background-color: $uni-primary;
+        color: #fff;
+        padding: 8rpx 16rpx;
+        border-radius: 8rpx;
+        text-align: center;
+      }
+    }
+  }
+}
+
+.bottom-nav {
+  display: flex;
+  justify-content: space-around;
+  padding: 16rpx 0;
+  background-color: #fff;
+  .nav-item {
+    flex: 1;
+    text-align: center;
+    &.active {
+      color: $uni-primary;
+    }
+  }
+}
+</style>

+ 4 - 3
pages/regulations/index.vue

@@ -13,7 +13,6 @@
     >
       <view class="free-content">
         <uni-collapse-item
-          open
           :title="item.name"
           v-for="item in freeChaptersList"
           :key="item.id"
@@ -101,6 +100,8 @@ const freeChaptersList = ref([]);
 
 // 点击学习按钮
 const onClickButton = (item) => {
+  console.log(item);
+
   router.push({
     url: "/pages/regulations/learing",
     params: {
@@ -135,8 +136,8 @@ const onChnage = () => {
 
 const onClickMask = () => {
   router.push({
-    url: '/pages/user/share'
-  })
+    url: "/pages/user/share",
+  });
 };
 
 onShow(async () => {

+ 470 - 413
pages/user/index.vue

@@ -1,449 +1,506 @@
 <template>
-	<Container
-		title="我的"
-		:scrollStyle="{
-			padding: 0
-		}"
-		:showBack="false"
-		bgColor="#f8f8f8"
-	>
-	<template #bg>
-		<image
-			src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/bHbLzGDSB07Gc0tqCVCI3NLUx4sbUU4KHKSolvBq.png"
-			mode="scaleToFill"
-			class="bg"
-		/>
-	</template>
-		<view>
-			<view class="user_box">
-				<view class="box_left">
-					<navigator url="/pages/user/settings">
-						<image class="user_image" :src="userInfo.userpic"></image>
-					</navigator>
-				</view>
-				<view class="box_center">
-					<view class="user_name" v-if="is_login">{{ userInfo.username }}</view>
-					<navigator class="user_name" url="/pages/login/index" v-if="!is_login">请登录</navigator>
-					<view class="user_info_vip" v-if="userInfo.vip_info != null">
-						<image class="user_info_vip_icon" src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/g9ot7hsUGLWA87qyEe1wWRf7agCv911K2bqOHRiX.png"></image>
-						<view  class="user_info_vip_type" v-if="userInfo.vip_info != null && userInfo.vip_info.vip_type == 1">月卡VIP</view>
-						<view  class="user_info_vip_type" v-if="userInfo.vip_info != null && userInfo.vip_info.vip_type == 2">年卡VIP</view>
-						<view  class="user_info_vip_type" v-if="userInfo.vip_info != null && userInfo.vip_info.vip_type == 3">季卡VIP</view>
-					</view>
-					<view class="user_info" v-if="userInfo.vip_info != null">有效期至:{{ userInfo.vip_info.vip_end_time }}</view>
-				</view>
-				<view class="box_right">
-					<navigator url="/pages/user/settings" class="setting_page" v-if="is_login">
-						<uni-icons type="gear" size="30"></uni-icons>
-					</navigator>
-				</view>
-			</view>
-			<view class="page_content">
-				<view class="navigator_list">
-					<view class="navigator_list_vip" v-if="vip_info ==null || (vip_info !=null && vip_info.status =='2')">
-						<navigator class="navigator_item_banner" url="/pages/recharge/index">
-							<view class="navigator_title_vip_banner">
-								<image
-									class="vip-banner-image"
-									src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/vWGL312rGs2zmtaUqQOmzG8YVgdLSmxV8NaUvcQR.png"
-									mode="aspectFill"
-								></image>
-							</view>
-						</navigator>
-					</view>
-					<view class="navigator_list_other">
-						<navigator class="navigator_item_one" url="/pages/order/index">
-							<view class="navigator_title">订单记录</view>
-							<view class="navigator_title_ico"><uni-icons type="right" size="20"></uni-icons></view>
-						</navigator>
-						<navigator class="navigator_item_two" url="/pages/user/share">
-							<view class="navigator_title">分享有礼</view>
-							<view class="navigator_title_ico"><uni-icons type="right" size="20"></uni-icons></view>
-						</navigator>
-						<navigator class="navigator_item_three" url="/pages/user/invited">
-							<view class="navigator_title_three">邀请有礼</view>
-							<view class="navigator_title_ico"><uni-icons type="right" size="20"></uni-icons></view>
-						</navigator>
-					</view>
-				</view>
-				<view class="packet_content" v-if="show_packet">
-					<view class="close_btn" @click="closePacket">X</view>
-					<image src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/red_packet.gif" class="red_packet" @click="_getredpacket" />
-				</view>
-			</view>
-		</view>
-		<view class="service">
-			<CustomerService>联系客服</CustomerService>
-		</view>
-	</Container>
+  <Container
+    title="我的"
+    :scrollStyle="{
+      padding: 0,
+    }"
+    :showBack="false"
+    bgColor="#f8f8f8"
+  >
+    <template #bg>
+      <image
+        src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/bHbLzGDSB07Gc0tqCVCI3NLUx4sbUU4KHKSolvBq.png"
+        mode="scaleToFill"
+        class="bg"
+      />
+    </template>
+    <view>
+      <view class="user_box">
+        <view class="box_left">
+          <navigator url="/pages/user/settings">
+            <image class="user_image" :src="userInfo.userpic"></image>
+          </navigator>
+        </view>
+        <view class="box_center">
+          <view class="user_name" v-if="is_login">{{ userInfo.username }}</view>
+          <navigator class="user_name" url="/pages/login/index" v-if="!is_login"
+            >请登录</navigator
+          >
+          <view class="user_info_vip" v-if="userInfo.vip_info != null">
+            <image
+              class="user_info_vip_icon"
+              src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/g9ot7hsUGLWA87qyEe1wWRf7agCv911K2bqOHRiX.png"
+            ></image>
+            <view
+              class="user_info_vip_type"
+              v-if="
+                userInfo.vip_info != null && userInfo.vip_info.vip_type == 1
+              "
+              >月卡VIP</view
+            >
+            <view
+              class="user_info_vip_type"
+              v-if="
+                userInfo.vip_info != null && userInfo.vip_info.vip_type == 2
+              "
+              >年卡VIP</view
+            >
+            <view
+              class="user_info_vip_type"
+              v-if="
+                userInfo.vip_info != null && userInfo.vip_info.vip_type == 3
+              "
+              >季卡VIP</view
+            >
+          </view>
+          <view class="user_info" v-if="userInfo.vip_info != null"
+            >有效期至:{{ userInfo.vip_info.vip_end_time }}</view
+          >
+        </view>
+        <view class="box_right">
+          <navigator
+            url="/pages/user/settings"
+            class="setting_page"
+            v-if="is_login"
+          >
+            <uni-icons type="gear" size="30"></uni-icons>
+          </navigator>
+        </view>
+      </view>
+      <view class="page_content">
+        <view class="navigator_list">
+          <view
+            class="navigator_list_vip"
+            v-if="
+              vip_info == null || (vip_info != null && vip_info.status == '2')
+            "
+          >
+            <navigator
+              class="navigator_item_banner"
+              url="/pages/recharge/index"
+            >
+              <view class="navigator_title_vip_banner">
+                <image
+                  class="vip-banner-image"
+                  src="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/vWGL312rGs2zmtaUqQOmzG8YVgdLSmxV8NaUvcQR.png"
+                  mode="aspectFill"
+                ></image>
+              </view>
+            </navigator>
+          </view>
+          <view class="navigator_list_other">
+            <navigator class="navigator_item_one" url="/pages/order/index">
+              <view class="navigator_title">订单记录</view>
+              <view class="navigator_title_ico"
+                ><uni-icons type="right" size="20"></uni-icons
+              ></view>
+            </navigator>
+            <navigator class="navigator_item_two" url="/pages/user/share">
+              <view class="navigator_title">分享有礼</view>
+              <view class="navigator_title_ico"
+                ><uni-icons type="right" size="20"></uni-icons
+              ></view>
+            </navigator>
+            <navigator class="navigator_item_three" url="/pages/user/invited">
+              <view class="navigator_title_three">邀请有礼</view>
+              <view class="navigator_title_ico"
+                ><uni-icons type="right" size="20"></uni-icons
+              ></view>
+            </navigator>
+          </view>
+        </view>
+        <view class="packet_content" v-if="show_packet">
+          <view class="close_btn" @click="closePacket">X</view>
+          <image
+            src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/red_packet.gif"
+            class="red_packet"
+            @click="_getredpacket"
+          />
+        </view>
+      </view>
+    </view>
+    <view class="service">
+      <CustomerService>联系客服</CustomerService>
+    </view>
+  </Container>
 </template>
 
 <script>
-import Container from '../../components/Container/Container.vue';
-import CustomerService from '@/components/CustomerService/CustomerService.vue';
+import Container from "../../components/Container/Container.vue";
+import CustomerService from "@/components/CustomerService/CustomerService.vue";
 
 export default {
-	data() {
-		return {
-			userInfo: {
-				username: '请登录',
-				userpic: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png',
-				phone: 'kailin',
-				status: 0,
-				city_id: 0
-			},
-			is_login: 0,
-			packetList: [],
-			show_packet: false,
-			windowHeight: 0,
-			vip_info:null
-		};
-	},
-	onLoad(param) {
-		// 存储分享标识
-		if (param.share_uid) {
-			uni.setStorageSync('share_uid', param.share_uid);
-			console.log('share_uid', param.share_uid);
-		}
-		// #ifdef MP-WEIXIN
-		//分享按钮
-		uni.showShareMenu({
-			withShareTicket: true,
-			menus: ['shareAppMessage', 'shareTimeline']
-		});
-		// #endif
-	},
-	mounted() {
-		this.updateWindowHeight();
-		// 监听窗口变化(H5、小程序生效,App需用 onWindowResize)
-		uni.onWindowResize((res) => {
-			this.windowHeight = res.size.windowHeight;
-		});
-		console.log(this.windowHeight);
-	},
-	onShareAppMessage(obj) {
-		// 店铺ID
-		let shopId = uni.getStorageSync('shopId');
-		//获取当前用户信息
-		let userInfo = uni.getStorageSync('userInfo');
-		let param = '?shop_id' + shopId;
-		if (userInfo.uid) {
-			param = '&share_uid=' + userInfo.uid;
-		}
-		// 获取分享信息
-		let shareList = getApp().globalData.shareList;
-		// 获取分享信息
-		let shareObj = {
-			title: '999智控终端平台\n药优惠 得积分 兑豪礼',
-			//path: '/pages/score/lottery',
-			path: '/pages/user/index',
-			imageUrl: ''
-		};
-		// 循环列表
-		for (let i in shareList) {
-			if (shareList[i].pages == 'pages/user/index') {
-				shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
-				shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
-				shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
-			}
-		}
-		if (param) {
-			shareObj.path += param;
-		}
-		// 返回分享信息
-		return shareObj;
-	},
-	onShow() {
-		// 登录提示
-		this.is_login = this.$checkAccess.checkLogin();
-		// 未登录不请求
-		if (!this.is_login) {
-			this.userInfo = {
-				username: '请登录',
-				userpic: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png',
-				phone: 'kailin',
-				status: 0,
-				city_id: 0,
-				is_video_vip: 0,
-				amount: 0.0,
-				transfer_amount: 0.0
-			};
-			return;
-		}
-		// 判断数据
-		this.$http.request('api/question_bank/question_reception/custom/get_info').then((callback) => {
-			if (callback.code == 'success') {
-				if (!callback.data.userpic) callback.data.userpic = 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png';
-				// 赋值
-				this.userInfo = callback.data;
-				// 存储登录标识
-				this.vip_info=callback.data.vip_info;
-				uni.setStorageSync('userInfo', callback.data);
-			}
-		});
-	},
-	methods: {
-		updateWindowHeight() {
-			const systemInfo = uni.getSystemInfoSync();
-			this.windowHeight = systemInfo.windowHeight;
-			console.log(this.windowHeight);
-		},
-		_getredpacket() {
-			let url = '/pages/redpacket/list';
-			if (this.packetList.length == 1) {
-				url = `/pages/redpacket/index?packet_id=${this.packetList[0].custom_redpacket_id}`;
-			}
-			uni.navigateTo({
-				url: url
-			});
-		},
-		_goWithdraw() {
-			uni.navigateTo({
-				url: '/pages/user/withdraw'
-			});
-		},
-		_goBalance() {
-			uni.navigateTo({
-				url: '/pages/balance/index'
-			});
-		},
-		closePacket() {
-			this.show_packet = false;
-		},
-		onChange(e) {
-			console.log(e);
-		}
-	}
+  data() {
+    return {
+      userInfo: {
+        username: "请登录",
+        userpic:
+          "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png",
+        phone: "kailin",
+        status: 0,
+        city_id: 0,
+      },
+      is_login: 0,
+      packetList: [],
+      show_packet: false,
+      windowHeight: 0,
+      vip_info: null,
+    };
+  },
+  onLoad(param) {
+    // 存储分享标识
+    if (param.share_uid) {
+      uni.setStorageSync("share_uid", param.share_uid);
+      console.log("share_uid", param.share_uid);
+    }
+    // #ifdef MP-WEIXIN
+    //分享按钮
+    uni.showShareMenu({
+      withShareTicket: true,
+      menus: ["shareAppMessage", "shareTimeline"],
+    });
+    // #endif
+  },
+  mounted() {
+    this.updateWindowHeight();
+    // 监听窗口变化(H5、小程序生效,App需用 onWindowResize)
+    uni.onWindowResize((res) => {
+      this.windowHeight = res.size.windowHeight;
+    });
+    console.log(this.windowHeight);
+  },
+  onShareAppMessage(obj) {
+    // 店铺ID
+    let shopId = uni.getStorageSync("shopId");
+    //获取当前用户信息
+    let userInfo = uni.getStorageSync("userInfo");
+    let param = "?shop_id" + shopId;
+    if (userInfo.uid) {
+      param = "&share_uid=" + userInfo.uid;
+    }
+    // 获取分享信息
+    let shareList = getApp().globalData.shareList;
+    // 获取分享信息
+    let shareObj = {
+      title: "999智控终端平台\n药优惠 得积分 兑豪礼",
+      //path: '/pages/score/lottery',
+      path: "/pages/user/index",
+      imageUrl: "",
+    };
+    // 循环列表
+    for (let i in shareList) {
+      if (shareList[i].pages == "pages/user/index") {
+        shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
+        shareObj.title = shareList[i].title
+          ? `999智控终端平台\n${shareList[i].title}`
+          : shareObj.title;
+        shareObj.imageUrl = shareList[i].image_url
+          ? shareList[i].image_url
+          : shareObj.imageUrl;
+      }
+    }
+    if (param) {
+      shareObj.path += param;
+    }
+    // 返回分享信息
+    return shareObj;
+  },
+  onShow() {
+    // 登录提示
+    this.is_login = this.$checkAccess.checkLogin();
+    // 未登录不请求
+    if (!this.is_login) {
+      this.userInfo = {
+        username: "请登录",
+        userpic:
+          "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png",
+        phone: "kailin",
+        status: 0,
+        city_id: 0,
+        is_video_vip: 0,
+        amount: 0.0,
+        transfer_amount: 0.0,
+      };
+      return;
+    }
+    // 判断数据
+    this.$http
+      .request("api/question_bank/question_reception/custom/get_info")
+      .then((callback) => {
+        if (callback.code == "success") {
+          if (!callback.data.userpic)
+            callback.data.userpic =
+              "https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png";
+          // 赋值
+          this.userInfo = callback.data;
+          // 存储登录标识
+          this.vip_info = callback.data.vip_info;
+          uni.setStorageSync("userInfo", callback.data);
+        }
+      });
+  },
+  methods: {
+    updateWindowHeight() {
+      const systemInfo = uni.getSystemInfoSync();
+      this.windowHeight = systemInfo.windowHeight;
+      console.log(this.windowHeight);
+    },
+    _getredpacket() {
+      let url = "/pages/redpacket/list";
+      if (this.packetList.length == 1) {
+        url = `/pages/redpacket/index?packet_id=${this.packetList[0].custom_redpacket_id}`;
+      }
+      uni.navigateTo({
+        url: url,
+      });
+    },
+    _goWithdraw() {
+      uni.navigateTo({
+        url: "/pages/user/withdraw",
+      });
+    },
+    _goBalance() {
+      uni.navigateTo({
+        url: "/pages/balance/index",
+      });
+    },
+    closePacket() {
+      this.show_packet = false;
+    },
+    onChange(e) {
+      console.log(e);
+    },
+  },
 };
 </script>
 
 <style lang="scss" scoped>
-@import '@/uni.scss'; // 引入全局scss变量
+@import "@/uni.scss"; // 引入全局scss变量
 .page_content {
-	background: #f8f8f8;
+  background: #f8f8f8;
 }
 
 .bg {
-	width: 750rpx;
-	height: 456rpx;
+  width: 750rpx;
+  height: 456rpx;
 }
 .user_box {
-	width: 680rpx;
-	height: 180rpx;
-	overflow: hidden;
-	padding: 10rpx 35rpx;
-	.box_left {
-		float: left;
-		display: block;
-		width: 140rpx;
-		height: 140rpx;
-		.user_image {
-			display: block;
-			width: 120rpx;
-			height: 120rpx;
-			border-radius: 50%;
-			margin: 10rpx auto;
-		}
-	}
-	.box_center {
-		float: left;
-		width: 300rpx;
-		height: 140rpx;
-		margin-left: 35rpx;
-		.user_name {
-			font-size: 30rpx;
-			line-height: 80rpx;
-			padding-bottom: 20rpx;
-		}
-		.user_info {
-			color: #999999;
-			font-size: 24rpx;
-			line-height: 60rpx;
-			margin-left: 50rpx;
-		}
-		.user_info_vip{
-			color: #999999;
-			font-size: 24rpx;
-			line-height: 40rpx;
-			display: flex;
-		}
-		.user_info_vip_icon{
-			width: 35rpx;
-			height: 35rpx;
-			margin-top: 5rpx;
-			padding-right: 15rpx;
-		}
-		.user_info_vip_type{
-			color: #3F75FF;
-		}
-	}
-	.box_right {
-		float: right;
-		width: 70rpx;
-		height: 80rpx;
-		font-size: 20rpx;
-		line-height: 80rpx;
-		.setting_page {
-			width: 80rpx;
-			height: 80rpx;
-			display: block;
-			overflow: hidden;
-			.setting_icon {
-				width: 60rpx;
-				height: 60rpx;
-				display: block;
-				margin: 40rpx auto;
-			}
-		}
-		.company_text {
-			color: #e03519;
-			width: 140rpx;
-			height: 140rpx;
-			font-size: 20rpx;
-			text-align: center;
-			line-height: 140rpx;
-		}
-	}
+  width: 680rpx;
+  height: 180rpx;
+  overflow: hidden;
+  padding: 10rpx 35rpx;
+  .box_left {
+    float: left;
+    display: block;
+    width: 140rpx;
+    height: 140rpx;
+    .user_image {
+      display: block;
+      width: 120rpx;
+      height: 120rpx;
+      border-radius: 50%;
+      margin: 10rpx auto;
+    }
+  }
+  .box_center {
+    float: left;
+    width: 300rpx;
+    height: 140rpx;
+    margin-left: 35rpx;
+    .user_name {
+      font-size: 30rpx;
+      line-height: 80rpx;
+      padding-bottom: 20rpx;
+    }
+    .user_info {
+      color: #999999;
+      font-size: 24rpx;
+      line-height: 60rpx;
+      margin-left: 50rpx;
+    }
+    .user_info_vip {
+      color: #999999;
+      font-size: 24rpx;
+      line-height: 40rpx;
+      display: flex;
+    }
+    .user_info_vip_icon {
+      width: 35rpx;
+      height: 35rpx;
+      margin-top: 5rpx;
+      padding-right: 15rpx;
+    }
+    .user_info_vip_type {
+      color: #3f75ff;
+    }
+  }
+  .box_right {
+    float: right;
+    width: 70rpx;
+    height: 80rpx;
+    font-size: 20rpx;
+    line-height: 80rpx;
+    .setting_page {
+      width: 80rpx;
+      height: 80rpx;
+      display: block;
+      overflow: hidden;
+      .setting_icon {
+        width: 60rpx;
+        height: 60rpx;
+        display: block;
+        margin: 40rpx auto;
+      }
+    }
+    .company_text {
+      color: #e03519;
+      width: 140rpx;
+      height: 140rpx;
+      font-size: 20rpx;
+      text-align: center;
+      line-height: 140rpx;
+    }
+  }
 }
 .navigator_list_vip {
-	height: 108rpx;
-	border-radius: 30rpx;
-	background: #ffffff;
-	margin-bottom: 50rpx;
+  height: 108rpx;
+  border-radius: 30rpx;
+  background: #ffffff;
+  margin-bottom: 50rpx;
 }
 .navigator_list_other {
-	background: #ffffff;
-	margin-bottom: 50rpx;
-	height: 296rpx;
-	border-radius: 30rpx;
+  background: #ffffff;
+  margin-bottom: 50rpx;
+  height: 296rpx;
+  border-radius: 30rpx;
 }
 .navigator_title_vip_banner {
-	width: 100%;
-	display: block;
-	height: 108rpx;
-	font-size: 30rpx;
-	.vip-banner-image {
-		width: 100%;
-		height: 108rpx;
-		display: block;
-	}
+  width: 100%;
+  display: block;
+  height: 108rpx;
+  font-size: 30rpx;
+  .vip-banner-image {
+    width: 100%;
+    height: 108rpx;
+    display: block;
+  }
 }
 .navigator_list {
-	border-top: 1rpx solid #eeeeee;
-	height: 505rpx;
-	margin: 30rpx;
-	border-radius: 30rpx;
-	.navigator_item_one {
-		position: relative;
-		border-radius: 30rpx 30rpx 0rpx 0rpx;
-	}
-	.navigator_item_two {
-		position: relative;
-	}
-	.navigator_item_three {
-		position: relative;
-		border-radius: 0rpx 0rpx 30rpx 30rpx;
-	}
-	.navigator_title_ico {
-		position: absolute;
-		right: 30rpx;
-		top: 25rpx;
-	}
-	.navigator_title {
-		display: block;
-		font-size: 30rpx;
-		line-height: 40rpx;
-		border-bottom: 1rpx solid #eeeeee;
-		padding: 30rpx 30rpx;
-	}
-	.navigator_title_three{
-		display: block;
-		font-size: 30rpx;
-		line-height: 40rpx;
-		padding: 30rpx 30rpx;
-	}
+  border-top: 1rpx solid #eeeeee;
+  height: 505rpx;
+  margin: 30rpx;
+  border-radius: 30rpx;
+  .navigator_item_one {
+    position: relative;
+    border-radius: 30rpx 30rpx 0rpx 0rpx;
+  }
+  .navigator_item_two {
+    position: relative;
+  }
+  .navigator_item_three {
+    position: relative;
+    border-radius: 0rpx 0rpx 30rpx 30rpx;
+  }
+  .navigator_title_ico {
+    position: absolute;
+    right: 30rpx;
+    top: 25rpx;
+  }
+  .navigator_title {
+    display: block;
+    font-size: 30rpx;
+    line-height: 40rpx;
+    border-bottom: 1rpx solid #eeeeee;
+    padding: 30rpx 30rpx;
+  }
+  .navigator_title_three {
+    display: block;
+    font-size: 30rpx;
+    line-height: 40rpx;
+    padding: 30rpx 30rpx;
+  }
 }
 
 .alter_info {
-	display: block;
-	color: #e03519;
-	font-size: 20rpx;
-	overflow: hidden;
-	margin: 20rpx auto;
-	background: #ffffff;
-	line-height: 40rpx;
-	padding: 35rpx 35rpx;
+  display: block;
+  color: #e03519;
+  font-size: 20rpx;
+  overflow: hidden;
+  margin: 20rpx auto;
+  background: #ffffff;
+  line-height: 40rpx;
+  padding: 35rpx 35rpx;
 }
 .balance_content {
-	margin: 20rpx;
-	padding: 35rpx;
-	background-color: #fff;
-	box-sizing: border-box;
-	.balance_content_main {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		margin-bottom: 36rpx;
-		.price_content {
-			display: flex;
-			flex-direction: column;
-			> .title {
-				font-size: 24rpx;
-				margin-bottom: 15rpx;
-			}
-		}
-		.withdraw_btn {
-			color: #ffffff;
-			background-color: #169bd5;
-			border-radius: 60rpx;
-			padding: 10rpx 20rpx;
-			width: 90rpx;
-			text-align: center;
-			line-height: 40rpx;
-		}
-	}
-	.balance_content_detail {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		border-top: 2rpx solid #f3f3f3;
-		font-size: 24rpx;
-		padding-top: 18rpx;
-	}
+  margin: 20rpx;
+  padding: 35rpx;
+  background-color: #fff;
+  box-sizing: border-box;
+  .balance_content_main {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 36rpx;
+    .price_content {
+      display: flex;
+      flex-direction: column;
+      > .title {
+        font-size: 24rpx;
+        margin-bottom: 15rpx;
+      }
+    }
+    .withdraw_btn {
+      color: #ffffff;
+      background-color: #169bd5;
+      border-radius: 60rpx;
+      padding: 10rpx 20rpx;
+      width: 90rpx;
+      text-align: center;
+      line-height: 40rpx;
+    }
+  }
+  .balance_content_detail {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-top: 2rpx solid #f3f3f3;
+    font-size: 24rpx;
+    padding-top: 18rpx;
+  }
 }
 .packet_content {
-	position: absolute;
-	right: 0;
-	bottom: 15%;
-	width: 160rpx;
-	height: 160rpx;
-	.red_packet {
-		width: 100%;
-		height: 100%;
-	}
-	.close_btn {
-		width: 40rpx;
-		height: 40rpx;
-		font-size: 24rpx;
-		line-height: 40rpx;
-		border-radius: 50%;
-		border: 1rpx solid #ddd;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		position: absolute;
-		top: 5rpx;
-		left: 0;
-	}
+  position: absolute;
+  right: 0;
+  bottom: 15%;
+  width: 160rpx;
+  height: 160rpx;
+  .red_packet {
+    width: 100%;
+    height: 100%;
+  }
+  .close_btn {
+    width: 40rpx;
+    height: 40rpx;
+    font-size: 24rpx;
+    line-height: 40rpx;
+    border-radius: 50%;
+    border: 1rpx solid #ddd;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    position: absolute;
+    top: 5rpx;
+    left: 0;
+  }
 }
 
 .service {
-	position: absolute;
-	bottom: 20%;
-	right: 5%;
-	color: $uni-primary;
-	font-size: 28rpx;
-	margin-bottom: 40rpx;
-	text-align: right;
+  position: absolute;
+  bottom: 20%;
+  right: 5%;
+  color: $uni-primary;
+  font-size: 28rpx;
+  margin-bottom: 40rpx;
+  text-align: right;
 }
 </style>

+ 19 - 5
pages/user/share.vue

@@ -4,8 +4,9 @@ import lPainter from "@/uni_modules/lime-painter/components/l-painter/l-painter.
 import lPainterView from "@/uni_modules/lime-painter/components/l-painter-view/l-painter-view.vue";
 import lPainterImage from "@/uni_modules/lime-painter/components/l-painter-image/l-painter-image.vue";
 
-import { ref, onMounted } from "vue";
+import { ref } from "vue";
 import { request } from "../../utils/request";
+import { onShow } from "@dcloudio/uni-app";
 const qrCode = ref("");
 const painter = ref(null);
 const showShare = ref(false);
@@ -31,13 +32,25 @@ const onSaveImage = () => {
   });
 };
 
-onMounted(() => {
+
+onShow(() => {
+  const userInfo = uni.getStorageSync("userInfo");
   // 生成二维码
   request("api/question_bank/question_reception/user_share/get_invite_qrcode", {
-    page_url: "/pages/index/index",
+    page_url: "pages/index/index",
+    scene: `share_uid=${userInfo.uid}`
   }).then((res) => {
-    console.log(res);
-    qrCode.value = res.data?.image;
+    let url = res.data?.image;
+    if (url.startsWith("data:")) {
+      var imgPath =
+        uni.env.USER_DATA_PATH + "/e-invoice" + Date.parse(new Date()) + ".png";
+      var imageData = url.replace(/^data:image\/\w+;base64,/, "");
+      var fs = uni.getFileSystemManager();
+      fs.writeFileSync(imgPath, imageData, "base64");
+      fs.close();
+      url = imgPath;
+    }
+    qrCode.value = url;
   });
 });
 </script>
@@ -51,6 +64,7 @@ onMounted(() => {
   >
     <view>
       <view class="bg">
+        
         <image class="qr-code" :src="qrCode" mode="scaleToFill" />
       </view>
     </view>

+ 1 - 1
uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue

@@ -317,7 +317,7 @@ export default {
     }
 
     &-box {
-      padding: 8rpx 0;
+      padding: 20rpx 0;
       /* #ifndef APP-NVUE */
       display: flex;
       width: 100%;

+ 4 - 1
utils/request.js

@@ -6,7 +6,10 @@ var domain = "https://openwork.dfwy.tech/";
 // #ifdef MP-WEIXIN
 // 'http://127.0.0.1:8000/';
 // domain = uni.getAccountInfoSync().miniProgram.envVersion == 'release' ? 'https://openwork.dfwy.tech/' : 'https://openwork.dfwy.tech/';
-// domain = uni.getAccountInfoSync().miniProgram.envVersion == 'release' ? ext.getExtStoreId('release_host_url') : ext.getExtStoreId('host_url');
+domain =
+  uni.getAccountInfoSync().miniProgram.envVersion == "release"
+    ? ext.ext.release_host_url
+    : ext.ext.host_url;
 // var app_id = ext.getExtStoreId('app_id') ? ext.getExtStoreId('app_id') : '';
 var app_id = ext.extAppid;
 // #endif