Browse Source

fix: 兑换按钮隐藏+仓库价格+兑换码去重+提现路径+头像URI兼容 build 30

zbb 1 tháng trước cách đây
mục cha
commit
4c28b3108f
7 tập tin đã thay đổi với 20 bổ sung39 xóa
  1. 1 1
      app.json
  2. 2 2
      app/profile/index.tsx
  3. 1 27
      app/store/detail.tsx
  4. 6 2
      app/store/index.tsx
  5. 1 1
      services/award.ts
  6. 7 4
      services/base.ts
  7. 2 2
      services/wallet.ts

+ 1 - 1
app.json

@@ -12,7 +12,7 @@
       "supportsTablet": false,
       "bundleIdentifier": "com.asios",
       "appleTeamId": "Y9ZVX3FRX6",
-      "buildNumber": "29",
+      "buildNumber": "30",
       "infoPlist": {
         "CFBundleDisplayName": "艾斯潮盒",
         "ITSAppUsesNonExemptEncryption": false,

+ 2 - 2
app/profile/index.tsx

@@ -99,9 +99,9 @@ export default function ProfileScreen() {
     try {
       setLoading(true);
       
-      // 如果头像是本地文件(file://开头),需要先上传
+      // 如果头像是本地文件(非http开头),需要先上传
       let avatarUrl = formData.avatar;
-      if (formData.avatar && formData.avatar.startsWith('file://')) {
+      if (formData.avatar && !formData.avatar.startsWith('http')) {
         const uploadedUrl = await uploadFile(formData.avatar, 'avatar');
         if (uploadedUrl) {
           avatarUrl = uploadedUrl;

+ 1 - 27
app/store/detail.tsx

@@ -176,33 +176,7 @@ export default function StoreDetailScreen() {
           </View>
         </View>
 
-        {/* 兑换按钮 */}
-        {item.magicAmount > 0 && (
-          <View
-            style={[
-              styles.bottomBar,
-              { paddingBottom: Math.max(insets.bottom, 20) },
-            ]}
-          >
-            <TouchableOpacity
-              style={styles.convertBtn}
-              onPress={handleConvert}
-              disabled={converting}
-              activeOpacity={0.8}
-            >
-              <ImageBackground
-                source={{ uri: Images.common.loginBtn }}
-                style={styles.convertBtnBg}
-                resizeMode="stretch"
-              >
-                <Text style={styles.convertBtnText}>兑换果实</Text>
-                <Text style={styles.convertBtnSub}>
-                  可兑换 {item.magicAmount} 果实
-                </Text>
-              </ImageBackground>
-            </TouchableOpacity>
-          </View>
-        )}
+        {/* 兑换按钮 - 已关闭 */}
       </ImageBackground>
     </View>
   );

+ 6 - 2
app/store/index.tsx

@@ -62,7 +62,7 @@ interface StoreItem {
   safeFlag: number;
   magicAmount?: number;
   fromRelationType: string;
-  spu: { id: string; name: string; cover: string };
+  spu: { id: string; name: string; cover: string; marketPrice?: number };
 }
 
 interface PickupItem {
@@ -255,6 +255,9 @@ export default function StoreScreen() {
             </ImageBackground>
             <View style={styles.goodsInfo}>
               <Text style={styles.goodsName} numberOfLines={2}>{item.spu?.name}</Text>
+              {(item.spu?.marketPrice ?? 0) > 0 && (
+                <Text style={styles.goodsPrice}>¥{item.spu?.marketPrice}</Text>
+              )}
               <Text style={styles.goodsSource}>从{FROM_TYPE_MAP[item.fromRelationType] || '其他'}获得</Text>
             </View>
             <Text style={styles.arrow}>{'>'}</Text>
@@ -582,7 +585,8 @@ const styles = StyleSheet.create({
   goodsImgBg: { width: 65, height: 65, justifyContent: 'center', alignItems: 'center', marginRight: 12, padding: 7 },
   goodsImg: { width: '100%', height: '100%' },
   goodsInfo: { flex: 1, justifyContent: 'center', paddingRight: 8 },
-  goodsName: { fontSize: 15, color: '#333', fontWeight: 'bold', marginBottom: 6 },
+  goodsName: { fontSize: 15, color: '#333', fontWeight: 'bold', marginBottom: 4 },
+  goodsPrice: { fontSize: 14, color: '#ff6b00', fontWeight: 'bold', marginBottom: 4 },
   goodsDesc: { fontSize: 12, color: '#999' },
   arrowIcon: { fontSize: 18, color: '#ccc', marginLeft: 8 },
 

+ 1 - 1
services/award.ts

@@ -421,7 +421,7 @@ export const getSumInventory = async () => {
 
 // 兑换码兑换
 export const harryExchange = async (params: { code: string }) => {
-  const res = await postL(apis.HARRY_EXCHANGE, params);
+  const res = await post(apis.HARRY_EXCHANGE, params, { silent: true });
   return res;
 };
 

+ 7 - 4
services/base.ts

@@ -84,10 +84,13 @@ export const uploadFile = async (
   folder = "avatar",
 ): Promise<string | null> => {
   try {
-    // iOS ImagePicker 可能返回带空格的路径,需要处理
-    let processedUri = fileUri;
-    if (Platform.OS === "ios" && !processedUri.startsWith("file://")) {
-      processedUri = `file://${processedUri}`;
+    // iOS ImagePicker 可能返回各种格式的路径,统一处理
+    let processedUri = decodeURI(fileUri);
+    if (Platform.OS === "ios") {
+      // 确保有 file:// 前缀
+      if (!processedUri.startsWith("file://") && !processedUri.startsWith("http")) {
+        processedUri = `file://${processedUri}`;
+      }
     }
 
     const formData = new FormData();

+ 2 - 2
services/wallet.ts

@@ -5,8 +5,8 @@ const apis = {
     COUPON: '/api/coupon/pageMyValidCoupon',
     BILL: '/api/wallet/bill',
     
-    WITHDRAW_PRE: '/api/wallet/withdrawPre',
-    WITHDRAW: '/api/wallet/withdraw',
+    WITHDRAW_PRE: '/api/wallet/withdraw/preInfo',
+    WITHDRAW: '/api/wallet/withdraw/submit',
     WITHDRAW_INFO: '/api/user/withdraw/info', // Bank info
     WITHDRAW_SAVE: '/api/user/withdraw/save',