d9a780fa538cb7a83aefa04e75cb53185d690d7d..b84ced02cc40cad7cdd99d80b54638f72ccab7e6
2025-06-05 tj
change editor controller
b84ced 对比 | 目录
2025-06-05 tj
solve the MiniProgramError: process is not defined
fd9cfc 对比 | 目录
2025-06-05 tj
user edit
859352 对比 | 目录
已修改5个文件
已添加1个文件
185 ■■■■■ 文件已修改
components/setting/setting-popup.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
plugins/storage.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub-pages/film-list/film-detail.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub-pages/mine/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub-pages/mine/profile-edit.vue 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/setting/setting-popup.vue
@@ -93,7 +93,7 @@
);
// 监听内部 showPopup 变化,通知外部更新 modelValue
watch(showPopup, (val) => {
watch(showPopup, (val) => {
    emit('update:modelValue', val);
});
</script>
pages.json
@@ -101,6 +101,13 @@
                        "enablePullDownRefresh": true
                    }
                }
                ,{
                    "path": "profile-edit",
                    "style": {
                        "navigationBarTitleText": "编辑资料",
                        "enablePullDownRefresh": true
                    }
                }
            ]
        }
        ,{
plugins/storage.js
@@ -1,5 +1,8 @@
// import Vue from 'vue'
let APPID = 'film-token' + process.env.PUB_TYPE
// let APPID = 'film-token' + process.env.PUB_TYPE
let APPID = 'film-token' + import.meta.env.PUB_TYPE
// #ifdef PUB_CUSTOMER
APPID = 'film-token-customer'
// #endif
sub-pages/film-list/film-detail.vue
@@ -35,7 +35,8 @@
                    </view>
                    <view class="content-item">
                        <rich-text :nodes="filmInfo.filmContent" />
                        <!-- <rich-text :nodes="filmInfo.filmContent" /> -->
                        <up-parse :content="filmInfo.filmContent"></up-parse>
                    </view>
                    <view class="annotation content-item">
                        <text>{{ formatRelativeTime(filmInfo.createTime) }} 美国</text>
@@ -162,7 +163,7 @@
        const tmpPicture = JSON.parse(data.filmPictures) as FilmPicture[]
        filmPictureList.value = tmpPicture.map(item => item.url)
        // 如果 filmPictureList.value是空的情况下,则把封面放入到图片列表中
        debugger;
        // debugger;
        if (filmPictureList.value.length === 0) {
          filmPictureList.value.push(data.coverUrl)
        }
sub-pages/mine/index.vue
@@ -27,7 +27,7 @@
          </view>
        </view>
        <view class="edit-profile" @click="goToProfile">点击这里,填写简介</view>
        <view class="edit-profile" >点击这里,填写简介</view>
        <view class="stats">
          <view class="stat-row">
@@ -45,9 +45,9 @@
            </view>
          </view>
          <view class="action-buttons">
            <up-button text="编辑资料" size="mini" type="info" plain hairline
            <up-button text="编辑资料" size="mini" type="info" plain hairline @click="navigateTo('/sub-pages/mine/profile-edit')"
              :custom-style="{ backgroundColor: 'transparent', borderColor: '#B1ABA9' }" />
            <up-icon name="setting" size="40rpx" @click="gotoUrl('/sub-pages/mine/settings')" />
            <up-icon name="setting" size="40rpx" @click="navigateTo('/sub-pages/mine/settings')" />
          </view>
        </view>
      </view>
@@ -99,10 +99,6 @@
const { navigateTo } = useNavigator()
const {getLocation,province } = useLocation()
const gotoUrl = (url: string) => {
  navigateTo(url)
}
watch(
  () => userStore.userInfo,      // 监听 userInfo 这个响应式属性
@@ -163,7 +159,7 @@
const goToProfile=  ()=> {
  navigateTo('/profile');
  navigateTo('/sub-pages/mine/edit-profile');
}
</script>
sub-pages/mine/profile-edit.vue
对比新文件
@@ -0,0 +1,154 @@
<template>
  <view class="edit-profile">
    <view class="avatar-box">
      <up-avatar :src="form.avatar" size="80" @click="onChangeAvatar" />
    </view>
    <up-cell-group :border="false" :customStyle="cellGroupStyle">
      <up-cell title="名字" isLink @click="editField('nickname')">
        <template #value>
          <view class="cell-value">{{ form.nickname }}</view>
        </template>
      </up-cell>
      <up-cell title="小红书号" isLink @click="editField('xhsId')">
        <template #value>
          <view class="cell-value">{{ form.xhsId }}</view>
        </template>
      </up-cell>
      <up-cell title="背景图" isLink @click="editField('backgroundImg')">
        <template #value>
          <view class="cell-value">
            <image class="bg-img" :src="form.backgroundImg" mode="aspectFill" @click="onChangeBackground" />
          </view>
        </template>
      </up-cell>
    </up-cell-group>
    <up-cell-group :border="false" :customStyle="cellGroupStyle">
      <up-cell title="简介" isLink @click="editField('intro')">
        <template #value>
          <view class="cell-value">{{ form.intro }}</view>
        </template>
      </up-cell>
    </up-cell-group>
    <up-cell-group :border="false" :customStyle="cellGroupStyle">
      <up-cell title="性别" isLink @click="selectGender">
        <template #value>
          <view class="cell-value">{{ form.gender }}</view>
        </template>
      </up-cell>
      <up-cell title="生日" isLink @click="selectBirthday">
        <template #value>
          <view class="cell-value">{{ form.birthday }}</view>
        </template>
      </up-cell>
      <up-cell title="地区" isLink @click="selectRegion">
        <template #value>
          <view class="cell-value">{{ form.region }}</view>
        </template>
      </up-cell>
      <up-cell title="职业" isLink @click="selectJob">
        <template #value>
          <view class="cell-value">{{ form.job }}</view>
        </template>
      </up-cell>
      <up-cell title="学校" isLink @click="editField('school')">
        <template #value>
          <view class="cell-value">{{ form.school }}</view>
        </template>
      </up-cell>
    </up-cell-group>
    <view class="save-btn">
      <up-button type="primary" shape="circle" text="保存" @click="onSave" />
    </view>
  </view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useGlobal } from '@/composables/useGlobal'
const { $http, $message, $store } = useGlobal()
const cellGroupStyle = 'background-color: #ffffff; margin-bottom: 20rpx; border-radius: 16rpx;'
const form = ref({
  avatar: 'https://cdn.uviewui.com/uview/album/1.jpg',
  nickname: '小红薯6786F040',
  xhsId: '95619601810',
  backgroundImg: 'https://smart-manager-new.tos-cn-beijing.volces.com/sms/avatar/avatar.png',
  intro: '介绍一下自己',
  gender: '女',
  birthday: '选择生日',
  region: '选择所在的地区',
  job: '选择职业',
  school: '选择学校'
});
const onPreview = () => {
  $message.showToast('预览功能暂未实现');
};
const onChangeAvatar = () => {
  $message.showToast('更换头像');
};
const onChangeBackground = () => {
  $message.showToast('更换背景图');
};
const editField = (field: string) => {
  $message.showToast(`编辑字段: ${field}`);
};
const selectGender = () => {
  $message.showToast('选择性别');
};
const selectBirthday = () => {
  $message.showToast('选择生日');
};
const selectRegion = () => {
  $message.showToast('选择地区');
};
const selectJob = () => {
  $message.showToast('选择职业');
};
const onSave = () => {
  $message.showToast('资料已保存');
};
</script>
<style lang="scss" scoped>
.cell-value {
  // text-align: center;
  text-align: left;
  width: 60%;
}
.edit-profile {
  background-color: #f7f7f7;
  min-height: 100vh;
  padding: 20rpx;
  .avatar-box {
    display: flex;
    justify-content: center;
    // margin: 40rpx 0;
  }
  .bg-img {
    width: 120rpx;
    height: 80rpx;
    border-radius: 12rpx;
  }
  .save-btn {
    padding: 40rpx;
  }
}
</style>