浏览代码

fix:冲突解决

jiayubo 3 天之前
父节点
当前提交
3802992426
共有 3 个文件被更改,包括 33 次插入5 次删除
  1. 9 0
      api/volunteerDetailsApi/details.js
  2. 19 3
      pages/index.vue
  3. 5 2
      pages_home/pages/Volunteerside/goodsDetails.vue

+ 9 - 0
api/volunteerDetailsApi/details.js

@@ -129,3 +129,12 @@ export function volunteerVolunteerPicture(params) {
   })
 }
 
+// 滚动文字
+export function systemConfig(params) {
+  return request({
+    url: '/system/config/getHomeRollText',
+    method: 'get',
+    params: params,
+  })
+}
+

+ 19 - 3
pages/index.vue

@@ -23,10 +23,15 @@
         <view v-if="ValueZone.length > 0">
           <up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
         </view>
+        <view>
+          <up-notice-bar :text="text1" class="notice-bar"></up-notice-bar>
+        </view>
+
       </view>
 
 
 
+
       <view class="home-ranking" :class="{ 'no-margin': userType === 2 }">
         <ServIces :leftList="leftList" :rightList="rightList" :ValueZoneSwiper="ValueZoneSwiper" v-if="userType == 1">
         </ServIces>
@@ -50,7 +55,7 @@ import { onShow, onReachBottom, onUnload, onPageScroll } from '@dcloudio/uni-app
 import RankingList from '@/pages/common/rankingList/index.vue'
 import ServIces from '@/components/Services/services.vue'
 import { Client } from '@/components/Client/new_file.vue'
-import { volunteerinfolist } from '@/api/volunteerDetailsApi/details.js'
+import { volunteerinfolist, systemConfig } from '@/api/volunteerDetailsApi/details.js'
 import { slideshow, settingHomeAddress } from '@/api/home.js'
 import { chooseLocationInit, locateTheCurrentAddress } from '@/utils/adress'
 import CustomTabBar from '@/components/CustomTabBar/index.vue'
@@ -65,6 +70,8 @@ const ValueZone = ref(['']) // Initialize with at least one empty item
 const hotList = ref([])
 const ValueZoneSwiper = ref([''])
 const userType = uni.getStorageSync('userType'); //读取本地存储
+const text1 = ref('');
+
 
 const globalData = ref({
   statusBarHeight: 47,
@@ -118,6 +125,12 @@ async function handleLoadmore(e) {
   }
 }
 
+// 加载滚动文字
+const getNotice = async () => {
+  const res = await systemConfig()
+  text1.value = res.data
+}
+
 const getList = async () => {
   try {
     loadmoreInfo.value.status = 'loading'
@@ -270,7 +283,7 @@ onPageScroll(e => {
 })
 
 onMounted(async () => {
-
+  getNotice()
   const token = getToken();
   // console.log("TCL: token", token || 'null')
   if (token) {
@@ -359,11 +372,14 @@ onUnload(() => { })
   height: 180rpx;
   border-radius: 16rpx;
   background: linear-gradient(180deg, #FEF9ED 0%, #FFF9F3 100%);
+  .notice-bar{
+    margin-top: 10rpx;
+  }
 }
 
 // 瀑布流
 .home-ranking {
-  margin-top: 93rpx;
+  margin-top: 160rpx;
   margin-left: 11rpx;
   margin-right: 17rpx;
   margin-bottom: 120rpx;

+ 5 - 2
pages_home/pages/Volunteerside/goodsDetails.vue

@@ -413,12 +413,15 @@ const businessDurationComputed = computed(() => {
   // listData.value.businessDuration
 
   let result = 0
-  if (listData.value.businessDuration < 30) {
+  if (listData.value.businessDuration <= 30) {
     result = 30
   } else { 
     const num = Math.floor(listData.value.businessDuration / 30)
 
-     result = (num + 1) * 30
+    //  result = (num + 1) * 30
+    const n = listData.value.businessDuration % 30
+
+    result = (n ? (num + 1) : num) * 30
   }
   console.log(result, '>>>>>>>result')