Liuyi
2024-10-07 134c7e51d33dfd0cdb9e7d47b22d181ebc1bcdc8
添加用户详情页,修改主页用户及会员卡信息
已修改7个文件
已添加1个文件
257 ■■■■ 文件已修改
pages/index/index.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/userInfo/index.vue 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/other/more.png 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/common/assets.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/pages/address/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/pages/index/index.js 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/pages/index/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/pages/index/index.wxss 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue
@@ -24,14 +24,15 @@
    })
    const isVip = ref(false)
    //获取会员卡信息
    async function getVipInfo(){
    async function getInfo(){
        let res = await getUserInfo()
        console.log('res',res.data)
        cardInfo.value.userName = res.data.userInfo.userName
        cardInfo.value.headImg = res.data.userInfo.headImg
        cardInfo.value.userPhone = res.data.userInfo.userPhone
        if(res.data.userInfo.waterCardNumber){
            let res1 = await getVipInfoApi()
            cardInfo.value.waterCardNumber = res1.data.userInfo.waterCardNumber
            cardInfo.value.waterCardNumber = res1.data.cardNumber
            if(res1.data.cardType == 1){
                cardInfo.value.balance = res1.data.balance
            }else if(res1.data.cardType == 2){
@@ -41,6 +42,7 @@
        }else{
            isVip.value = false
        }
        uni.setStorageSync('userInfo',JSON.stringify(cardInfo.value))
    }
    /**
     * 扫码取水相关
@@ -88,11 +90,11 @@
    }
    onMounted( async() =>{
        getTopHeight()
        await getVipInfo()
        await getInfo()
        // await getUserLocation()
    })
    onShow(async() =>{
    await getVipInfo()
    await getInfo()
    })
</script>
@@ -100,12 +102,12 @@
    <view class="container">
        <view class="content">
            <view class="card-box" :style="{paddingTop:topHeight + 'rpx'}">
                <view class="user-info">
                <view class="user-info" @click="navTo('/pages/userInfo/index')">
                    <image class="user-img" src='../../static/images/index/hend1.png' alt=''></image>
                    <text>{{cardInfo.userName}}</text>
                    <image class="uesr-more"src="../../static/images/index/back.png"></image>
                    <image class="user-more"src="../../static/images/index/back.png"></image>
                </view>
                <view class="card" @click="navTo('/pages/userInfo/index')">
                <view class="card">
                    <view class="card-content">
                        <view class="card-left">
                            <view class="left-top">
@@ -115,11 +117,15 @@
                                </view>
                                <view>ID:{{cardInfo.waterCardNumber}}</view>
                            </view>
                            <view></view>
                            <view class="left-bottom">电话:{{cardInfo.userPhone}}</view>
                        </view>
                        <view class="card-right">
                            <view></view>
                            <view></view>
                            <view>金额卡</view>
                            <view>
                                <span>余额:</span>
                                <span class="card-balance">{{cardInfo.balance}}</span>
                                <span>元</span>
                            </view>
                        </view>
                    </view>
                </view>
@@ -237,9 +243,9 @@
                        margin-right:20rpx;
                        color: #fff;
                    }
                    .uesr-more{
                    .user-more{
                        width: 12rpx;
                        height: 28rpx;;
                        height: 28rpx;
                    }
                }
                .card{
@@ -252,9 +258,12 @@
                        width: 100%;
                        height: 100%;
                        box-sizing: border-box;
                        padding:15rpx;
                        padding:20rpx 15rpx;
                        display: flex;
                        justify-content:space-between;
                        font-weight: 300;
                        font-size: 30rpx;
                        color: #FFFFFF;
                        .card-left{
                            height:100%;
                            display: flex;
@@ -277,6 +286,19 @@
                                        color: #FFFFFF;
                                    }
                                }
                                view:last-child{
                                    margin-left:10rpx;
                                }
                            }
                        }
                        .card-right{
                            display: flex;
                            justify-content: space-between;
                            align-items:flex-end;
                            flex-direction: column;
                            height:100%;
                            .card-balance{
                                font-weight:600;
                            }
                        }
                    }
pages/userInfo/index.vue
@@ -1,27 +1,38 @@
<script setup>
    import { ref } from 'vue'
    const infoList = ref([
        {text:'',value:''},
        {text:'',value:''},
        {text:'',value:''},
        {text:'',value:''},
    ])
    import { onMounted, ref } from 'vue'
    const userInfo = ref(JSON.parse(uni.getStorageSync('userInfo')))
</script>
<template>
    <view class="container">
        <navbar title = '账户详情'></navbar>
        <navbar title = '用户资料'></navbar>
        <view class="content">
            <view class="info-box">
                <view class="info-up"></view>
                <view class="info-up">
                    <view>
                        <text>头像</text>
                        <image src='../../static/logo.png' alt=''></image>
                    </view>
                    <view>
                        <text>用户名称</text>
                        <text class="info-value">{{userInfo.userName}}</text>
                    </view>
                </view>
                <view class="info-list">
                    <block v-for="(item,index) in infoList" :key = index>
                        <view class="item">
                            <text></text>
                            <text></text>
                    <view class="item">
                        <text>会员卡号</text>
                        <text>{{userInfo.waterCardNumber}}</text>
                    </view>
                    <view class="item">
                        <text>联系方式</text>
                        <view>
                            <text>{{userInfo.userPhone}}</text>
                            <image class="edit"src="../../static/images//other/more.png" alt=''></image>
                        </view>
                    </block>
                    </view>
                </view>
            </view>
            <view class="subBtn">确认修改</view>
        </view>
    </view>
</template>
@@ -35,17 +46,95 @@
            height:calc(100vh - 176rpx);
            background:linear-gradient(to top,#FFFFFF,#E8EFFF);  
            padding-top:36rpx;
            position: relative;
            .info-value{
                font-size:32rpx;
                color: #777777;
            }
            .edit{
                margin-left:15rpx;
                width: 20rpx;
                height:28rpx;
            }
            .info-box{
                width: 100%;
                .info-up{
                    height:308rpx;
                    width:100%;
                    background: #FFFFFF;
                    padding:32rpx;
                    display: flex;
                    justify-content:space-between;
                    align-items:center;
                    flex-direction: column;
                    box-sizing: border-box;
                    font-size: 32rpx;
                    color: #343434;
                    view:first-child{
                        width:100%;
                        display: flex;
                        justify-content:space-between;
                        align-items:center;
                        image{
                            width:100rpx;
                            height:100rpx;
                            border-radius: 50rpx;
                        }
                    }
                    view:last-child{
                        width:100%;
                        display: flex;
                        justify-content:space-between;
                        align-items:center;
                    }
                }
                .info-list{
                    width:100%;
                    height:252rpx;
                    display: flex;
                    flex-direction:column;
                    justify-content:space-between;
                    align-items: center;
                    margin-top:20rpx;
                    .item{
                        width:100%;
                        height: 116rpx;
                        background-color: #FFFFFF;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        padding:0 32rpx;
                        box-sizing: border-box;
                        text:last-child{
                            color: #777777;
                        }
                        view{
                            height: 116rpx;
                            display: flex;
                            justify-content:flex-end;
                            align-items: center;
                            text{
                                color: #777777;
                            }
                        }
                    }
                }
            }
            .subBtn{
                width: 686rpx;
                height: 98rpx;
                background:#5EA1FA;
                border-radius:50rpx;
                text-align: center;
                line-height: 98rpx;
                letter-spacing:3rpx;
                font-weight: 300;
                font-size: 36rpx;
                color: #FFFFFF;
                position: absolute;
                bottom:100rpx;
                left:32rpx;
            }
        }
    }
</style>
static/images/other/more.png
unpackage/dist/dev/mp-weixin/common/assets.js
@@ -1,6 +1,6 @@
"use strict";
const _imports_0$5 = "/static/images/index/hend1.png";
const _imports_1$1 = "/static/images/index/back.png";
const _imports_0$6 = "/static/images/index/hend1.png";
const _imports_1$2 = "/static/images/index/back.png";
const _imports_2 = "/static/images/index/code1.png";
const _imports_3 = "/static/images/index/home21.png";
const _imports_4 = "/static/images/index/icon23.png";
@@ -8,20 +8,24 @@
const _imports_6 = "/static/images/index/icon51.png";
const _imports_7 = "/static/images/index/more-info5.png";
const _imports_8 = "/static/images/index/notice5.png";
const _imports_0$4 = "/static/images/addCard/code.png";
const _imports_0$5 = "/static/images/addCard/code.png";
const _imports_0$4 = "/static/logo.png";
const _imports_1$1 = "/static/images/other/more.png";
const _imports_0$3 = "/static/images/address/edit.png";
const _imports_1 = "/static/images/address/delete.png";
const _imports_0$2 = "/static/images/address/expand.png";
const _imports_0$1 = "/static/images/other/success.svg";
const _imports_0 = "/static/images/addCard/back.png";
exports._imports_0 = _imports_0;
exports._imports_0$1 = _imports_0$5;
exports._imports_0$2 = _imports_0$4;
exports._imports_0$3 = _imports_0$3;
exports._imports_0$4 = _imports_0$2;
exports._imports_0$5 = _imports_0$1;
exports._imports_1 = _imports_1$1;
exports._imports_1$1 = _imports_1;
exports._imports_0$1 = _imports_0$6;
exports._imports_0$2 = _imports_0$5;
exports._imports_0$3 = _imports_0$4;
exports._imports_0$4 = _imports_0$3;
exports._imports_0$5 = _imports_0$2;
exports._imports_0$6 = _imports_0$1;
exports._imports_1 = _imports_1$2;
exports._imports_1$1 = _imports_1$1;
exports._imports_1$2 = _imports_1;
exports._imports_2 = _imports_2;
exports._imports_3 = _imports_3;
exports._imports_4 = _imports_4;
unpackage/dist/dev/mp-weixin/pages/address/index.js
@@ -88,8 +88,8 @@
            h: common_vendor.o(($event) => deleteAddress(item.id))
          };
        }),
        c: common_assets._imports_0$3,
        d: common_assets._imports_1$1,
        c: common_assets._imports_0$4,
        d: common_assets._imports_1$2,
        e: common_vendor.o(($event) => navToAdd())
      };
    };
unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -20,14 +20,15 @@
      userPhone: ""
    });
    const isVip = common_vendor.ref(false);
    async function getVipInfo() {
    async function getInfo() {
      let res = await api_index.getUserInfo();
      console.log("res", res.data);
      cardInfo.value.userName = res.data.userInfo.userName;
      cardInfo.value.headImg = res.data.userInfo.headImg;
      cardInfo.value.userPhone = res.data.userInfo.userPhone;
      if (res.data.userInfo.waterCardNumber) {
        let res1 = await api_index.getVipInfoApi();
        cardInfo.value.waterCardNumber = res1.data.userInfo.waterCardNumber;
        cardInfo.value.waterCardNumber = res1.data.cardNumber;
        if (res1.data.cardType == 1) {
          cardInfo.value.balance = res1.data.balance;
        } else if (res1.data.cardType == 2) {
@@ -37,6 +38,7 @@
      } else {
        isVip.value = false;
      }
      common_vendor.index.setStorageSync("userInfo", JSON.stringify(cardInfo.value));
    }
    function toScan() {
      common_vendor.index.navigateTo({
@@ -62,26 +64,28 @@
    }
    common_vendor.onMounted(async () => {
      getTopHeight();
      await getVipInfo();
      await getInfo();
    });
    common_vendor.onShow(async () => {
      await getVipInfo();
      await getInfo();
    });
    return (_ctx, _cache) => {
      return {
        a: common_assets._imports_0$1,
        b: common_vendor.t(cardInfo.value.userName),
        c: common_assets._imports_1,
        d: common_assets._imports_2,
        e: common_vendor.t(cardInfo.value.waterCardNumber),
        f: common_vendor.o(($event) => navTo("/pages/userInfo/index")),
        g: topHeight.value + "rpx",
        h: common_assets._imports_3,
        i: common_vendor.o(($event) => navTo("/pages/sendWater/index")),
        j: common_vendor.o(($event) => navTo("/pages/recharge/index")),
        k: common_assets._imports_4,
        l: common_vendor.o(($event) => toScan()),
        m: common_vendor.f(functionList.value, (item, index, i0) => {
        d: common_vendor.o(($event) => navTo("/pages/userInfo/index")),
        e: common_assets._imports_2,
        f: common_vendor.t(cardInfo.value.waterCardNumber),
        g: common_vendor.t(cardInfo.value.userPhone),
        h: common_vendor.t(cardInfo.value.balance),
        i: topHeight.value + "rpx",
        j: common_assets._imports_3,
        k: common_vendor.o(($event) => navTo("/pages/sendWater/index")),
        l: common_vendor.o(($event) => navTo("/pages/recharge/index")),
        m: common_assets._imports_4,
        n: common_vendor.o(($event) => toScan()),
        o: common_vendor.f(functionList.value, (item, index, i0) => {
          return {
            a: item.icon,
            b: common_vendor.t(item.text),
@@ -89,11 +93,11 @@
            d: index
          };
        }),
        n: common_assets._imports_5,
        o: common_assets._imports_6,
        p: common_assets._imports_7,
        q: common_assets._imports_8,
        r: common_assets._imports_7
        p: common_assets._imports_5,
        q: common_assets._imports_6,
        r: common_assets._imports_7,
        s: common_assets._imports_8,
        t: common_assets._imports_7
      };
    };
  }
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
@@ -1 +1 @@
<view class="container data-v-1cf27b2a"><view class="content data-v-1cf27b2a"><view class="card-box data-v-1cf27b2a" style="{{'padding-top:' + g}}"><view class="user-info data-v-1cf27b2a"><image class="user-img data-v-1cf27b2a" src="{{a}}" alt=""></image><text class="data-v-1cf27b2a">{{b}}</text><image class="uesr-more data-v-1cf27b2a" src="{{c}}"></image></view><view class="card data-v-1cf27b2a" bindtap="{{f}}"><view class="card-content data-v-1cf27b2a"><view class="card-left data-v-1cf27b2a"><view class="left-top data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{d}}" alt=""></image><text class="data-v-1cf27b2a">会员卡</text></view><view class="data-v-1cf27b2a">ID:{{e}}</view></view><view class="data-v-1cf27b2a"></view></view><view class="card-right data-v-1cf27b2a"><view class="data-v-1cf27b2a"></view><view class="data-v-1cf27b2a"></view></view></view></view></view><view class="function-box1 data-v-1cf27b2a"><view class="box1-bg box1-one data-v-1cf27b2a" bindtap="{{i}}"><image class="data-v-1cf27b2a" src="{{h}}" alt=""></image><view class="data-v-1cf27b2a">送水到家</view></view><view class="box1-bg box1-two data-v-1cf27b2a"><view class="data-v-1cf27b2a">账户余额(元)</view><view class="recharge data-v-1cf27b2a"><text class="data-v-1cf27b2a">¥</text><text class="data-v-1cf27b2a">120.00</text></view><view class="data-v-1cf27b2a" bindtap="{{j}}"> 充值 </view></view><view class="box1-bg box1-three data-v-1cf27b2a" bindtap="{{l}}"><image class="data-v-1cf27b2a" src="{{k}}" alt=""></image><view class="data-v-1cf27b2a">扫码取水</view></view></view><view class="function-box2 data-v-1cf27b2a"><view class="box2-title data-v-1cf27b2a"><text class="data-v-1cf27b2a">功能列表</text></view><view class="box2-content data-v-1cf27b2a"><block wx:for="{{m}}" wx:for-item="item" wx:key="d"><view class="box2-item data-v-1cf27b2a" bindtap="{{item.c}}"><image class="data-v-1cf27b2a" src="{{item.a}}" alt=""></image><view class="box2-item-text data-v-1cf27b2a">{{item.b}}</view></view></block></view></view><view class="advertisement-box data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{n}}" alt=""></image></view><view class="service-box data-v-1cf27b2a"><view class="service-title data-v-1cf27b2a"><text class="data-v-1cf27b2a">服务指南</text></view><view class="service-content data-v-1cf27b2a"><view class="service-bg data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{o}}" alt=""></image><text class="data-v-1cf27b2a">附近站点</text></view><view class="service-info data-v-1cf27b2a">蔡家供水服务中心正在营业中……</view><view class="data-v-1cf27b2a"><text class="data-v-1cf27b2a">查看更多</text><image class="data-v-1cf27b2a" src="{{p}}" alt=""></image></view></view><view class="service-bg data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{q}}" alt=""></image><text class="data-v-1cf27b2a">公示公告</text></view><view class="service-info data-v-1cf27b2a">停水公告的部分摘要的内容展示……</view><view class="data-v-1cf27b2a"><text class="data-v-1cf27b2a">查看更多</text><image class="data-v-1cf27b2a" src="{{r}}" alt=""></image></view></view></view></view></view></view>
<view class="container data-v-1cf27b2a"><view class="content data-v-1cf27b2a"><view class="card-box data-v-1cf27b2a" style="{{'padding-top:' + i}}"><view class="user-info data-v-1cf27b2a" bindtap="{{d}}"><image class="user-img data-v-1cf27b2a" src="{{a}}" alt=""></image><text class="data-v-1cf27b2a">{{b}}</text><image class="user-more data-v-1cf27b2a" src="{{c}}"></image></view><view class="card data-v-1cf27b2a"><view class="card-content data-v-1cf27b2a"><view class="card-left data-v-1cf27b2a"><view class="left-top data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{e}}" alt=""></image><text class="data-v-1cf27b2a">会员卡</text></view><view class="data-v-1cf27b2a">ID:{{f}}</view></view><view class="left-bottom data-v-1cf27b2a">电话:{{g}}</view></view><view class="card-right data-v-1cf27b2a"><view class="data-v-1cf27b2a">金额卡</view><view class="data-v-1cf27b2a"><label class="data-v-1cf27b2a">余额:</label><label class="card-balance data-v-1cf27b2a">{{h}}</label><label class="data-v-1cf27b2a">元</label></view></view></view></view></view><view class="function-box1 data-v-1cf27b2a"><view class="box1-bg box1-one data-v-1cf27b2a" bindtap="{{k}}"><image class="data-v-1cf27b2a" src="{{j}}" alt=""></image><view class="data-v-1cf27b2a">送水到家</view></view><view class="box1-bg box1-two data-v-1cf27b2a"><view class="data-v-1cf27b2a">账户余额(元)</view><view class="recharge data-v-1cf27b2a"><text class="data-v-1cf27b2a">¥</text><text class="data-v-1cf27b2a">120.00</text></view><view class="data-v-1cf27b2a" bindtap="{{l}}"> 充值 </view></view><view class="box1-bg box1-three data-v-1cf27b2a" bindtap="{{n}}"><image class="data-v-1cf27b2a" src="{{m}}" alt=""></image><view class="data-v-1cf27b2a">扫码取水</view></view></view><view class="function-box2 data-v-1cf27b2a"><view class="box2-title data-v-1cf27b2a"><text class="data-v-1cf27b2a">功能列表</text></view><view class="box2-content data-v-1cf27b2a"><block wx:for="{{o}}" wx:for-item="item" wx:key="d"><view class="box2-item data-v-1cf27b2a" bindtap="{{item.c}}"><image class="data-v-1cf27b2a" src="{{item.a}}" alt=""></image><view class="box2-item-text data-v-1cf27b2a">{{item.b}}</view></view></block></view></view><view class="advertisement-box data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{p}}" alt=""></image></view><view class="service-box data-v-1cf27b2a"><view class="service-title data-v-1cf27b2a"><text class="data-v-1cf27b2a">服务指南</text></view><view class="service-content data-v-1cf27b2a"><view class="service-bg data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{q}}" alt=""></image><text class="data-v-1cf27b2a">附近站点</text></view><view class="service-info data-v-1cf27b2a">蔡家供水服务中心正在营业中……</view><view class="data-v-1cf27b2a"><text class="data-v-1cf27b2a">查看更多</text><image class="data-v-1cf27b2a" src="{{r}}" alt=""></image></view></view><view class="service-bg data-v-1cf27b2a"><view class="data-v-1cf27b2a"><image class="data-v-1cf27b2a" src="{{s}}" alt=""></image><text class="data-v-1cf27b2a">公示公告</text></view><view class="service-info data-v-1cf27b2a">停水公告的部分摘要的内容展示……</view><view class="data-v-1cf27b2a"><text class="data-v-1cf27b2a">查看更多</text><image class="data-v-1cf27b2a" src="{{t}}" alt=""></image></view></view></view></view></view></view>
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
@@ -58,7 +58,7 @@
  margin-right: 20rpx;
  color: #fff;
}
.container .content .card-box .user-info .uesr-more.data-v-1cf27b2a {
.container .content .card-box .user-info .user-more.data-v-1cf27b2a {
  width: 12rpx;
  height: 28rpx;
}
@@ -73,9 +73,12 @@
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 15rpx;
  padding: 20rpx 15rpx;
  display: flex;
  justify-content: space-between;
  font-weight: 300;
  font-size: 30rpx;
  color: #FFFFFF;
}
.container .content .card-box .card .card-content .card-left.data-v-1cf27b2a {
  height: 100%;
@@ -101,6 +104,19 @@
  font-size: 36rpx;
  color: #FFFFFF;
}
.container .content .card-box .card .card-content .card-left .left-top view.data-v-1cf27b2a:last-child {
  margin-left: 10rpx;
}
.container .content .card-box .card .card-content .card-right.data-v-1cf27b2a {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-direction: column;
  height: 100%;
}
.container .content .card-box .card .card-content .card-right .card-balance.data-v-1cf27b2a {
  font-weight: 600;
}
.container .content .function-box1.data-v-1cf27b2a {
  width: 100%;
  box-sizing: border-box;