chenyao
2025-10-29 a27b5ac3a2fea69bf07e5f492b274ff986c11cc0
Merge remote-tracking branch 'origin/master'
5 files modified
4 files added
434 ■■■■ changed files
pnpm-lock.yaml 16 ●●●●● patch | view | raw | blame | history
src/App.vue 2 ●●● patch | view | raw | blame | history
src/pages/user/index.vue 384 ●●●● patch | view | raw | blame | history
src/static/images/user/info.png patch | view | raw | blame | history
src/static/images/user/logo1.png patch | view | raw | blame | history
src/static/images/user/logo2.png patch | view | raw | blame | history
src/static/images/user/password.png patch | view | raw | blame | history
src/subPackages/inProgress/index.vue 14 ●●●● patch | view | raw | blame | history
src/subPackages/workDetail/index.vue 18 ●●●●● patch | view | raw | blame | history
pnpm-lock.yaml
@@ -62,6 +62,9 @@
  dayjs:
    specifier: ^1.11.18
    version: 1.11.18
  js-audio-recorder:
    specifier: ^1.0.7
    version: 1.0.7
  js-base64:
    specifier: ^3.7.4
    version: 3.7.4
@@ -157,9 +160,6 @@
  sass-loader:
    specifier: ^16.0.4
    version: 16.0.4(sass@1.79.6)
  simple-git-hooks:
    specifier: ^2.13.1
    version: 2.13.1
  stylelint:
    specifier: ^16.23.0
    version: 16.23.0(typescript@5.9.3)
@@ -7821,6 +7821,10 @@
    resolution: {integrity: sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==}
    dev: false
  /js-audio-recorder@1.0.7:
    resolution: {integrity: sha512-JiDODCElVHGrFyjGYwYyNi7zCbKk9va9C77w+zCPMmi4C6ix7zsX2h3ddHugmo4dOTOTCym9++b/wVW9nC0IaA==}
    dev: false
  /js-base64@3.7.4:
    resolution: {integrity: sha512-wpM/wi20Tl+3ifTyi0RdDckS4YTD4Lf953mBRrpG8547T7hInHNPEj8+ck4gB8VDcGyeAWFK++Wb/fU1BeavKQ==}
    dev: false
@@ -9931,12 +9935,6 @@
  /signal-exit@4.1.0:
    resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
    engines: {node: '>=14'}
    dev: true
  /simple-git-hooks@2.13.1:
    resolution: {integrity: sha512-WszCLXwT4h2k1ufIXAgsbiTOazqqevFCIncOuUBZJ91DdvWcC5+OFkluWRQPrcuSYd8fjq+o2y1QfWqYMoAToQ==}
    hasBin: true
    requiresBuild: true
    dev: true
  /sirv@3.0.2:
src/App.vue
@@ -53,6 +53,6 @@
 color: #222324 !important;
}
.uni-page-head {
    background-image: url(/drone-app/src/static/images/user/allBg.svg) !important;
  background: transparent !important;
}
</style>
src/pages/user/index.vue
@@ -1,209 +1,225 @@
<!-- 我的 -->
<template>
    <view class="page-wrap">
        <view class="flex items-center pb-30rpx pl-30rpx pr-20rpx">
            <view class="mr-20rpx">
                <u-avatar :src="user.avatar" size="70" />
            </view>
            <view class="flex-1">
                <view class="userName">{{ userStore?.userInfo?.nick_name }}</view>
                <view class="departs">
                    <img src="/src/static/images/user/mobile.svg" alt="" />
                    <span>{{user.deptName}}</span>
                </view>
            </view>
            <view class="rightLogo">
                <img src="/src/static/images/user/logo2.svg" alt="" />
            </view>
        </view>
        <view class="personalInformation">
            <div class="message">
                <div class="messagebox">个人信息</div>
                <div class="editInfo" @click="handelEdit(1)">点击编辑
                <img src="/src/static/images/user/rightBtn.svg" alt="" /></div>
            </div>
            <div class="passwordBox">
                <div class="messagebox">修改密码</div>
                <div class="editInfo" @click="handelEdit(2)">点击编辑 <img src="/src/static/images/user/rightBtn.svg" alt="" /></div>
            </div>
        </view>
  <view class="page-wrap">
        <view class="mt-20rpx">
            <div class="goOutStyle" @click="logOut">退出登录</div>
        </view>
        <div class="bottomLogo"><img src="/src/static/images/user/logo1.svg" alt="" /></div>
    </view>
    <view class="flex items-center pb-30rpx pl-30rpx pr-20rpx">
      <view class="mr-20rpx">
        <u-avatar :src="user.avatar" size="70" />
      </view>
      <view class="flex-1">
        <view class="userName">{{ userStore?.userInfo?.nick_name }}</view>
        <view class="departs">
          <img src="/src/static/images/user/mobile.svg" alt="" />
          <span>{{user.deptName}}</span>
        </view>
      </view>
      <view class="rightLogo">
        <img src="/src/static/images/user/logo2.png" alt="" />
      </view>
    </view>
    <view class="personalInformation">
      <div class="message">
        <div class="messagebox">个人信息</div>
        <div class="editInfo" @click="handelEdit(1)">点击编辑
          <img src="/src/static/images/user/rightBtn.svg" alt="" />
        </div>
      </div>
      <div class="passwordBox">
        <div class="messagebox">修改密码</div>
        <div class="editInfo" @click="handelEdit(2)">点击编辑 <img src="/src/static/images/user/rightBtn.svg" alt="" />
        </div>
      </div>
    </view>
    <view class="mt-20rpx">
      <div class="goOutStyle" @click="logOut">退出登录</div>
    </view>
    <div class="bottomLogo"><img src="/src/static/images/user/logo1.png" alt="" /></div>
  </view>
</template>
<script setup>
    import {
        getUserInfo,
        updateInfo,
        updatePassword
    } from '@/api/user/index.js';
    import {
        useClipboard
    } from "@/hooks";
    import {
        useUserStore
    } from "@/store/index.js";
    import {
        onShow
    } from "@dcloudio/uni-app";
    import {
        getDeviceRegionApi
    } from "@/api/map.js";
  import {
    getUserInfo,
    updateInfo,
    updatePassword
  } from '@/api/user/index.js';
  import {
    useClipboard
  } from "@/hooks";
  import {
    useUserStore
  } from "@/store/index.js";
  import {
    onShow
  } from "@dcloudio/uni-app";
  import {
    getDeviceRegionApi
  } from "@/api/map.js";
    const {
        setClipboardData,
        getClipboardData
    } = useClipboard();
    const userStore = useUserStore();
    const user = ref('')
    const getUserInfoData = () => {
        getUserInfo().then(res => {
             user.value = res.data.data;
        });
    };
  const {
    setClipboardData,
    getClipboardData
  } = useClipboard();
  const userStore = useUserStore();
  const user = ref('')
  const getUserInfoData = () => {
    getUserInfo().then(res => {
      user.value = res.data.data;
    });
  };
    function logOut() {
        userStore.setUserInfo(null)
        uni.redirectTo({
            url: '/pages/login/index'
        })
    }
  function logOut() {
    userStore.setUserInfo(null)
    uni.redirectTo({
      url: '/pages/login/index'
    })
  }
    function getDeviceRegion() {
        getDeviceRegionApi().then(res => {
            // console.log(res.data.data, '用户设备')
        })
    }
    const handelEdit=(val)=>{
  function getDeviceRegion() {
    getDeviceRegionApi().then(res => {
      // console.log(res.data.data, '用户设备')
    })
  }
  const handelEdit = (val) => {
        if(val === 1){
            uni.navigateTo({
              url: `/subPackages/userDetail/infos/index`
            });
        }else {
            uni.navigateTo({
              url: `/subPackages/userDetail/password/index`
            });
        }
    if (val === 1) {
      uni.navigateTo({
        url: `/subPackages/userDetail/infos/index`
      });
    } else {
      uni.navigateTo({
        url: `/subPackages/userDetail/password/index`
      });
    }
    }
    // 登录鉴权,微信小程序端点击tabbar的底层逻辑不触发uni.switchTab,需要在页面onShow生命周期中校验权限
    onShow(async () => {
        getDeviceRegion()
        getUserInfoData()
        uni.setTabBarItem({
          index: 2, // Tab 的索引(从0开始)
          visible: false,
        })
        uni.setTabBarItem({
          index: 3, // Tab
          visible: true,
        });
    });
  }
  // 登录鉴权,微信小程序端点击tabbar的底层逻辑不触发uni.switchTab,需要在页面onShow生命周期中校验权限
  onShow(async () => {
    getDeviceRegion()
    getUserInfoData()
    uni.setTabBarItem({
      index: 2, // Tab 的索引(从0开始)
      visible: false,
    })
    uni.setTabBarItem({
      index: 3, // Tab
      visible: true,
    });
  });
</script>
<style scoped lang="scss">
    .page-wrap {
        width: 100%;
        height: 100%;
        padding-top: 88rpx;
    }
  .page-wrap {
    width: 100%;
    height: 100%;
    .userName {
        font-family: "Source Han Sans CN";
        font-weight: 500;
        font-size: 36rpx;
        color: #000000;
    padding-top: 88rpx;
  }
    }
  .userName {
    font-weight: 700;
    font-size: 36rpx;
    color: #000000;
    .departs {
        display: flex;
        align-items: center;
        margin-top: 22rpx;
  }
        span {
            font-family: "Source Han Sans CN";
            font-weight: 400;
            font-size: 28rpx;
            color: rgba(0, 0, 0, 0.6);
            margin-left: 6rpx;
        }
    }
  .departs {
    display: flex;
    align-items: center;
    margin-top: 22rpx;
    .rightLogo {
        width: 200rpx;
        height: 80rpx;
    }
       .bottomLogo {
           position: absolute;
           bottom:50rpx;
           left: 0;
           right: 0;
           margin: 0 auto;
           text-align: center;
       }
    .goOutStyle {
        width: 590rpx;
        height: 76rpx;
        background: #1D6FE9;
        border-radius: 40rpx;
        font-family: "Source Han Sans CN";
        font-weight: 400;
        font-size: 28rpx;
        color: #FFFFFF;
        text-align: center;
        line-height: 76rpx;
        margin: auto;
        margin-top: 114rpx;
    }
    span {
      font-family: "Source Han Sans CN";
      font-weight: 400;
      font-size: 28rpx;
      color: rgba(0, 0, 0, 0.6);
      margin-left: 6rpx;
    }
  }
    .personalInformation {
        display: flex;
        justify-content: space-between;
        padding: 0 24rpx;
  .rightLogo {
    width: 200rpx;
    height: 80rpx;
        .message,
        .passwordBox {
            width: 340rpx;
            height:160rpx;
            .messagebox{
                padding: 20rpx 24rpx;
                font-family: "Source Han Sans CN";
                font-weight: 500;
                font-size: 28rpx;
                color: #000000;
            }
            .editInfo {
                padding: 20rpx 24rpx;
                color: rgba(0, 0, 0, 0.5);
                font-family: "Source Han Sans CN";
                font-weight: 400;
                font-size: 24rpx;
                display: flex;
                align-items: center;
                img{
                    width: 28rpx;
                    height: 28rpx;
                }
            }
        }
    img {
      width: 100%;
      height: 100%;
    }
  }
        .message {
            background: url('/src/static/images/user/info.svg') no-repeat center;
            background-size: 100% 100%;
  .bottomLogo {
    position: absolute;
    bottom: 50rpx;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
        }
    img {
      width: 128rpx;
      height: 52rpx;
    }
  }
        .passwordBox {
            background: url('/src/static/images/user/password.svg') no-repeat center;
            background-size: 100% 100%;
  .goOutStyle {
    width: 590rpx;
    height: 76rpx;
    background: #1D6FE9;
    border-radius: 40rpx;
    font-family: "Source Han Sans CN";
    font-weight: 400;
    font-size: 28rpx;
    color: #FFFFFF;
    text-align: center;
    line-height: 76rpx;
    margin: auto;
    margin-top: 114rpx;
  }
        }
    }
  .personalInformation {
    display: flex;
    justify-content: space-between;
    padding: 0 24rpx;
    .message,
    .passwordBox {
      width: 340rpx;
      height: 160rpx;
      .messagebox {
        padding: 20rpx 24rpx;
        font-family: "Source Han Sans CN";
        font-weight: 500;
        font-size: 28rpx;
        color: #000000;
      }
      .editInfo {
        padding: 20rpx 24rpx;
        color: rgba(0, 0, 0, 0.5);
        font-family: "Source Han Sans CN";
        font-weight: 400;
        font-size: 24rpx;
        display: flex;
        align-items: center;
        img {
          width: 28rpx;
          height: 28rpx;
        }
      }
    }
    .message {
      background: url('/src/static/images/user/info.png') no-repeat center;
      background-size: 100% 100%;
    }
    .passwordBox {
      background: url('/src/static/images/user/password.png') no-repeat center;
      background-size: 100% 100%;
    }
  }
</style>
src/static/images/user/info.png
src/static/images/user/logo1.png
src/static/images/user/logo2.png
src/static/images/user/password.png
src/subPackages/inProgress/index.vue
@@ -1,15 +1,15 @@
<template>
  <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>
  <WebViewPlus v-if="showComponent" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup>
import WebViewPlus from "@/components/WebViewPlus.vue";
import {getWebViewUrl} from "@/utils/index.js";
import {onLoad} from "@dcloudio/uni-app";
import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
const wayLineJodInfoId = ref(null)
const viewUrl = ref('')
const showComponent = ref(false)
function onPostMessage(data) {
  if (data.type === 'back') {
    uni.switchTab({
@@ -26,6 +26,14 @@
  wayLineJodInfoId.value = options.wayLineJodInfoId
  viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJodInfoId: wayLineJodInfoId.value})
})
onShow(function () {
  showComponent.value = true
})
onHide(() =>{
  showComponent.value = false
})
</script>
<style scoped lang="scss">
src/subPackages/workDetail/index.vue
@@ -14,14 +14,14 @@
    const sWebViewRef = ref(null);
    const viewUrl = ref('')
    onLoad( (options) => {
        const eventNum= options.eventNum;
        viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum})
        const eventNum= options.eventNum;
        viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum})
    });
    function onPostMessage(data) {
      if (data.type === 'workback'){
        uni.switchTab({
          url: '/pages/work/index'
        });
@@ -36,12 +36,10 @@
<style lang="scss" scoped>
    .workDetailContainer {
        padding: 0 10px;
width: 100%;
  width: 100%;
    height: 100%;
    background: url('/src/static/images/user/allBg.svg') no-repeat center center;
    background-size: cover;
    }
</style>
</style>