4 Revize dfde8f2c12 ... c108ec60cb

Autor SHA1 Zpráva Datum
  快乐的梦鱼 c108ec60cb 🎨 优化修改昵称报错提示 před 5 dny
  快乐的梦鱼 dc356e60fe 🎨 修复重新进入后我的关注列表为空问题 před 5 dny
  快乐的梦鱼 eb1b4652c9 🎨 按要求修改文章预览页样式 před 5 dny
  快乐的梦鱼 0ba9a6560b 📦 对接乡源果支付1 před 5 dny

+ 2 - 1
src/api/light/OfficialApi.ts

@@ -329,13 +329,14 @@ export class OfficialApi extends AppServerRequestModule<DataModel> {
    * 个人升级村社管理
    * @param staffLevelId 管理等级ID: 1=村社管理, 2=测试
    */
-  async upgradeStaff(villageId: number, staffLevelId = 1) {
+  async upgradeStaff(villageId: number, staffLevelId = 1, payType: 1 | 3 = 1) {
     const res = await this.post<{
       order: KeyValue,
       pay: WxPayParams,
     }>('/village/growth/staff', '升级村社管理', {
       village_id: villageId,
       staff_level_id: staffLevelId,
+      pay_type: payType,
     });
     const data = res.requireData();
     return {

+ 3 - 2
src/api/light/TreeApi.ts

@@ -738,10 +738,11 @@ export class TreeApi extends AppServerRequestModule<DataModel> {
   }
 
   /** 下单赐福套餐 */
-  async createBlessOrder(villageId: number, blessId: number) {
+  async createBlessOrder(villageId: number, blessId: number, payType: 1 | 2 | 3) {
     const res = await this.post<KeyValue>('/village/growth/bless', '下单赐福', {
       village_id: villageId,
       bless_id: blessId,
+      pay_type: payType,
     });
     const data = res.requireData();
     return transformDataModel<BlessOrderConfirm>(BlessOrderConfirm, data);
@@ -801,7 +802,7 @@ export class TreeApi extends AppServerRequestModule<DataModel> {
   async createUpgradeOrder(
     villageId: number,
     upgradeLevelId: number,
-    payType: 1 | 2,
+    payType: 1 | 2 | 3,
   ) {
     const res = await this.post<KeyValue>('/village/growth/upgrade', '升级订单下单', {
       village_id: villageId,

+ 0 - 5
src/components/display/block/ImageBlock.vue

@@ -137,11 +137,6 @@ defineProps({
 defineEmits([	
   "click"	
 ])
-defineOptions({
-  options: {
-    virtualHost: true,
-  },
-})
 </script>
 
 <style lang="scss">

+ 1 - 0
src/components/display/block/ImageBlock3.vue

@@ -36,6 +36,7 @@
       </slot>
       <slot name="footer" />
     </FlexView>
+    <slot name="right" />
   </Touchable>
 </template>
 

+ 30 - 17
src/pages/home/discover/details.vue

@@ -34,7 +34,6 @@
                   :src="item" 
                   width="100%"
                   :height="500"
-                  radius="radius.md"
                   mode="aspectFill" 
                   @click="onPreviewImage(key)"
                 />
@@ -65,28 +64,32 @@
               </FlexRow>
             </FlexCol>
           </FlexRow>
-          <FlexRow :padding="[0,30,30,30]" gap="gap.md">
+          <FlexRow :padding="[0,30,30,30]" gap="gap.lg">
             <ImageBlock3
               :src="loader.content.value.image"
-              :imageWidth="100"
-              :imageHeight="100"
-              :innerStyle="{ 
-                flex: '1 1 100%',
-                width: '100%',
-              }"
-              radius="radius.md"
-              :title="loader.content.value.villageName"
-              :desc="`${loader.content.value.villageProvince}${loader.content.value.villageCity}`"
+              :imageWidth="80"
+              :imageHeight="50"
+              backgroundColor="transparent"
               @click="handleGoVillageDetails(loader.content.value.villageId)"
-            />
-            <Touchable align="center" gap="gap.md" @click="handleGoUserDetails">
+            >
+              <template #desc>
+                <FlexCol>
+                  <Text 
+                    :text="`来源于:${loader.content.value.villageName}`" 
+                    fontConfig="lightGoldTitle" 
+                    fontSize="30" 
+                  />
+                </FlexCol>
+              </template>
+            </ImageBlock3>
+            <Touchable align="center" gap="gap.md" @click.stop="handleGoUserDetails">
               <Avatar
                 :src="loader.content.value.villageVolunteerAvatar"
-                width="50"
-                height="50"
+                defaultAvatar="https://xy.wenlvti.net/app_static/images/village/PlaceholderVolunteerNew.png"
+                size="50"
                 radius="radius.md"
               />
-              <Text class="size-ll color-title-text" :wrap="false" :maxWidth="100">{{ loader.content.value.villageVolunteerName }}</Text>
+              <Text class="size-ll color-title-text" :wrap="false" :maxWidth="100">投稿人:{{ loader.content.value.villageVolunteerName }}</Text>
             </Touchable>
           </FlexRow>
           <FlexCol :padding="30">
@@ -99,6 +102,15 @@
               :content="(loader.content.value.overview as string)"
             />
             <Text v-if="emptyContent">暂无简介</Text>
+
+            <FlexRow gap="gap.md" align="center">
+              <Icon icon="info" size="40" />
+              <template v-if="true" >
+                <Text fontConfig="subText" text="本文章仅代表作者个人观点," />
+                <Text fontConfig="subText" bold text="暂未通过村(社区)审核" />
+              </template>
+              <Text v-else fontConfig="subText" text="本文章仅代表作者个人观点" />
+            </FlexRow>
           </FlexCol>
           
           <!-- 推荐 -->
@@ -145,13 +157,14 @@ import Image from "@/components/basic/Image.vue";
 import Text from "@/components/basic/Text.vue";
 import H5 from "@/components/typography/H5.vue";
 import H3 from "@/components/typography/H3.vue";
-import ImageBlock3 from "@/components/display/block/ImageBlock3.vue";
 import Avatar from "@/components/display/Avatar.vue";
 import Touchable from "@/components/feedback/Touchable.vue";
 import StatusBarSpace from "@/components/layout/space/StatusBarSpace.vue";
 import NavBar from "@/components/nav/NavBar.vue";
 import LikeFooter from "./components/LikeFooter.vue";
 import Height from "@/components/layout/space/Height.vue";
+import Icon from "@/components/basic/Icon.vue";
+import ImageBlock3 from "@/components/display/block/ImageBlock3.vue";
 
 const { onPreviewImage } = useSwiperImagePreview(() => loader.content.value?.images || []);
 const emptyContent = computed(() => 

+ 5 - 1
src/pages/home/index.vue

@@ -393,6 +393,10 @@ async function loadInfo() {
   //加载我的关注村庄
   try {
     await villageStore.loadMyFollowVillages();
+  } catch (error) {
+    console.error(error);
+  }
+  try {
     await villageStore.loadMyJoinedVillages();
   } catch (error) {
     console.error(error);
@@ -411,7 +415,7 @@ watch(() => authStore.isLogged, async (newVal) => {
   if (newVal) {
     await loadInfo();
   }
-});
+}, { immediate: true });
 
 onMounted(async () => {
   try {

+ 5 - 1
src/pages/home/village/bless/dialogs/DirectPayDialog.vue

@@ -6,7 +6,10 @@
         <Height :height="10" />
         <FlexCol gap="gap.md">
           <BoxMid direction="row" justify="space-between">
-            <Text text="微信支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            <FlexRow align="center">
+              <Icon icon="wechat" size="40" />
+              <Text text="微信支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            </FlexRow>
             <CheckBox :modelValue="payMethod == 'wechat'" shape="round" @update="payMethod = 'wechat'" />
           </BoxMid>
         </FlexCol>
@@ -44,6 +47,7 @@ import BoxMid from "@/common/components/box/BoxMid.vue";
 import TreeApi from "@/api/light/TreeApi";
 import CheckBox from "@/components/form/CheckBox.vue";
 import type { BlessOrderConfirm } from "@/api/light/TreeApi";
+import Icon from "@/components/basic/Icon.vue";
 
 const emit = defineEmits(['success']);
 

+ 1 - 1
src/pages/home/village/introd/tree.vue

@@ -274,7 +274,7 @@ async function handleBuyBlessConfirm() {
     uni.showLoading({
       title: '请稍后...',
     });
-    const payInfo = await TreeApi.createBlessOrder(villageStore.currentVillage?.id, currentBless.value.id);
+    const payInfo = await TreeApi.createBlessOrder(villageStore.currentVillage?.id, currentBless.value.id, 1);
     if (payInfo) {  
       uni.requestPayment({
         provider: 'wxpay',

+ 11 - 1
src/pages/home/village/upgrade/dialogs/DirectPayDialog.vue

@@ -6,7 +6,10 @@
         <Height :height="10" />
         <FlexCol gap="gap.md">
           <BoxMid direction="row" justify="space-between">
-            <Text text="微信支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            <FlexRow align="center">
+              <Icon icon="wechat" size="40" />
+              <Text text="微信支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            </FlexRow>
             <CheckBox :modelValue="payMethod == 'wechat'" shape="round" @update="payMethod = 'wechat'" />
           </BoxMid>
         </FlexCol>
@@ -33,6 +36,7 @@
 import { ref } from "vue";
 import { toast } from "@/components/dialog/CommonRoot";
 import { showError } from "@/common/composeabe/ErrorDisplay";
+import { useAuthStore } from "@/store/auth";
 import CommonDialog from "@/common/components/CommonDialog.vue";
 import FrameButton from "@/common/components/FrameButton.vue";
 import FlexCol from "@/components/layout/FlexCol.vue";
@@ -44,8 +48,10 @@ import BoxMid from "@/common/components/box/BoxMid.vue";
 import TreeApi from "@/api/light/TreeApi";
 import CheckBox from "@/components/form/CheckBox.vue";
 import type { UpgradeOrderConfirm } from "@/api/light/TreeApi";
+import Icon from "@/components/basic/Icon.vue";
 
 const emit = defineEmits(['success']);
+const authStore = useAuthStore();
 
 const show = ref(false);
 const uploadStep = ref<'form' | 'finished'>('form');
@@ -98,5 +104,9 @@ defineExpose({
     uploadStep.value = 'form';
     show.value = true;
   },
+  openSuccess() {
+    show.value = true;
+    uploadStep.value = 'finished';
+  },
 });
 </script>

+ 3 - 1
src/pages/home/village/upgrade/my-orders.vue

@@ -20,7 +20,9 @@
             <FlexCol>
               <Text fontConfig="lightImportantTitle" fontFamily="SongtiSCBlack">{{ item.levelName }}</Text>
               <Text :fontSize="23" :text="`${item.villageName} ${item.vipLevel}级`" />
-              <Text :fontSize="21" fontConfig="secondText">{{ item.payType === 1 ? '线上支付' : '对公付款' }}</Text>
+              <Text v-if="item.payType === 1" :fontSize="21" fontConfig="secondText">线上支付</Text>
+              <Text v-else-if="item.payType === 2" :fontSize="21" fontConfig="secondText">对公付款</Text>
+              <Text v-else-if="item.payType === 3" :fontSize="21" fontConfig="secondText">乡源果支付</Text>
             </FlexCol>
             <FlexRow gap="gap.xl">
               <FlexCol align="flex-end">

+ 23 - 16
src/pages/home/village/upgrade/my-upgrade-management.vue

@@ -22,29 +22,29 @@
       </FlexCol>
 
       <FlexCol gap="gap.md">
-        <BoxMid
-          direction="row"
-          justify="space-between"
-          align="center"
-          gap="gap.md"
-        >
+        <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
           <FlexCol width="74%">
             <Text text="在线支付" fontConfig="lightImportantTitle" :fontSize="42" />
             <Text text="推荐使用微信线支付方式,方便快捷,立即生效" fontConfig="lightGoldTitle" :fontSize="30" />
           </FlexCol>
-          <FrameButton primary text="选择" @click="handleDirectPay(1)" />
+          <FrameButton primary text="选择" @click="handleDirectPay(1, 1)" />
         </BoxMid>
-        <BoxMid
-          direction="row"
-          justify="space-between"
-          align="center"
-          gap="gap.md"
-        >
+        <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
+          <FlexCol width="74%">
+            <FlexRow align="center" gap="gap.md">
+              <Icon icon="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" size="40" />
+              <Text text="乡源果支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            </FlexRow>
+            <Text :text="`余额 ${0} 乡源果`" fontConfig="lightGoldTitle" :fontSize="30" />
+          </FlexCol>
+          <FrameButton primary text="选择" @click="handleDirectPay(1, 3)" />
+        </BoxMid>
+        <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
           <FlexCol width="74%">
             <Text text="测试" fontConfig="lightImportantTitle" :fontSize="42" />
             <Text text="¥ 0.01" fontConfig="lightGoldTitle" :fontSize="30" />
           </FlexCol>
-          <FrameButton primary text="选择" @click="handleDirectPay(2)" />
+          <FrameButton primary text="选择" @click="handleDirectPay(2, 1)" />
         </BoxMid>
       </FlexCol>
     </FlexCol>
@@ -68,6 +68,8 @@ import Text from '@/components/basic/Text.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import OfficialApi from '@/api/light/OfficialApi';
 import UpgradeManagementSuccessDialog from './dialogs/UpgradeManagementSuccess.vue';
+import FlexRow from '@/components/layout/FlexRow.vue';
+import Icon from '@/components/basic/Icon.vue';
 
 const upgradeManagementSuccessDialog = ref<InstanceType<typeof UpgradeManagementSuccessDialog>>();
 
@@ -93,7 +95,7 @@ async function handleMyOrders() {
   });
 }
 
-async function handleDirectPay(levelType: number) {
+async function handleDirectPay(levelType: number, payType: 1 | 3) {
   if (!requireLoginAsync('登录后为村社升级,做出你的贡献哦'))
     return;
   try {
@@ -101,8 +103,11 @@ async function handleDirectPay(levelType: number) {
     const { order: orderInfo, pay: payInfo } = await OfficialApi.upgradeStaff(
       querys.value.villageId,
       levelType,
+      payType,
     );
-    if (payInfo) {
+    if (payType === 1) {
+      if (!payInfo) 
+        throw new Error('支付信息不存在');
       uni.requestPayment({
         provider: 'wxpay',
         appId: payInfo.appId,
@@ -118,6 +123,8 @@ async function handleDirectPay(levelType: number) {
           showError(`支付失败: ${err.errMsg}`);
         },
       });
+    } else if (payType === 3) { 
+      upgradeManagementSuccessDialog.value?.open();
     }
   } catch (e) {
     showError(e);

+ 24 - 11
src/pages/home/village/upgrade/select.vue

@@ -21,17 +21,25 @@
       </FlexCol>
 
       <FlexCol gap="gap.md">
-        <BoxMid
-          direction="row"
-          justify="space-between"
-          align="center"
-          gap="gap.md"
-        >
+        <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
           <FlexCol width="74%">
-            <Text text="在线支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            <FlexRow align="center" gap="gap.md">
+              <Icon icon="wechat" size="36" />
+              <Text text="在线支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            </FlexRow>
             <Text text="推荐使用微信线支付方式,方便快捷,立即生效" fontConfig="lightGoldTitle" :fontSize="30" />
           </FlexCol>
-          <FrameButton primary text="选择" @click="handleDirectPay" />
+          <FrameButton primary text="选择" @click="handleDirectPay(1)" />
+        </BoxMid>
+        <BoxMid direction="row" justify="space-between" align="center" gap="gap.md">
+          <FlexCol width="74%">
+            <FlexRow align="center" gap="gap.md">
+              <Icon icon="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" size="40" />
+              <Text text="乡源果支付" fontConfig="lightImportantTitle" :fontSize="42" />
+            </FlexRow>
+            <Text :text="`余额 ${0} 乡源果`" fontConfig="lightGoldTitle" :fontSize="30" />
+          </FlexCol>
+          <FrameButton primary text="选择" @click="handleDirectPay(3)" />
         </BoxMid>
         <BoxMid
           v-if="false"
@@ -73,6 +81,7 @@ import Image from '@/components/basic/Image.vue';
 import DirectPayDialog from './dialogs/DirectPayDialog.vue';
 import TreeApi from '@/api/light/TreeApi';
 import Touchable from '@/components/feedback/Touchable.vue';
+import Icon from '@/components/basic/Icon.vue';
 
 const { requireLoginAsync } = useRequireLogin();
 
@@ -99,7 +108,7 @@ async function handleMyOrders() {
   });
 }
 
-async function handleDirectPay() {
+async function handleDirectPay(payType: 1 | 3) {
   if (!requireLoginAsync('登录后为村社升级,做出你的贡献哦'))
     return;
   try {
@@ -107,9 +116,13 @@ async function handleDirectPay() {
     const result = await TreeApi.createUpgradeOrder(
       querys.value.villageId,
       querys.value.upgradePackageId,
-      1,
+      payType,
     );
-    directPayDialog.value?.open(result.order.id);
+    if (payType === 1) {
+      directPayDialog.value?.open(result.order.id);
+    } else {
+      directPayDialog.value?.openSuccess();
+    }
   } catch (e) {
     showError(e);
   } finally {

+ 2 - 5
src/pages/user/update/profile.vue

@@ -48,6 +48,7 @@ import Button from '@/components/basic/Button.vue';
 import Height from '@/components/layout/space/Height.vue';
 import type { Rules } from 'async-validator';
 import { navTo } from '@/components/utils/PageAction';
+import { showError } from '@/common/composeabe/ErrorDisplay';
 
 const DefaultAvatar = 'https://mncdn.wenlvti.net/app_static/xiangyuan/images/home/UserHead.png';
 
@@ -163,11 +164,7 @@ const submitForm = async () => {
     }, 2000);
     
   } catch (error: any) {
-    uni.showToast({
-      title: error?.message || '更新失败,请稍后重试',
-      icon: 'none',
-      duration: 2000
-    });
+    showError(error, '个人信息更新失败');
   } finally {
     loading.value = false;
   }