Procházet zdrojové kódy

Merge branch 'zhongqi-delivery'

shish před 7 měsíci
rodič
revize
85ce6c2e01

+ 7 - 0
ghsApp/src/admin/delivery/components/PlatformItem.vue

@@ -33,6 +33,7 @@
 			<view class="actions">
 				<template v-if="platform.is_authorized">
 					<!-- <button class="action-btn" @click="handleRecharge">充值</button> -->
+					<!-- <button class="action-btn secondary-btn" @click="customSettings">设置</button> -->
 					<button class="action-btn secondary-btn" @click="handleShop">门店</button>
 					<button class="action-btn secondary-btn" @click="handleCancelAuth">取消授权</button>
 				</template>
@@ -67,6 +68,12 @@ export default {
 					url: `/admin/delivery/shopDetail?platformId=${this.platform.id}`
 				});
 			}
+
+			if(this.platform.id == 'shunfeng') {
+				uni.navigateTo({
+					url: `/admin/delivery/shunfengShopDetail?platformId=${this.platform.id}`
+				});
+			}
 		},
 		handleCancelAuth() {
 			this.$emit('cancel-auth', this.platform);

+ 1 - 1
ghsApp/src/admin/delivery/shopDetail.vue

@@ -68,7 +68,7 @@ export default {
     // 获取平台ID
     if (options.platformId) {
       this.platformId = options.platformId;
-      console.log(this.platformId);
+      //console.log(this.platformId);
     }
     this.fetchShopList();
   },

+ 424 - 0
ghsApp/src/admin/delivery/shunfengShopDetail.vue

@@ -0,0 +1,424 @@
+<template>
+  <view class="app-content" style="padding-bottom:30upx;">
+      <view class="app-round_bg"></view>
+      
+      <!-- 头部展示 -->
+      <view class="module-com user-info" v-if="shopInfo && (shopInfo.shop_name || shopInfo.shop_id)">
+        <view class="user-info_top">
+            <view class="user-info_lf">
+                <view class="dec-bx">
+                  <view>
+                      <text style="font-weight:bold;font-size:32upx;">{{ formData.shop_name || '未设置店铺名称' }}</text>
+                  </view>
+                  <view style="margin-top:10upx;">ID: {{ shopInfo.shop_id || platformId || '--' }}</view>
+                  <view style="font-size:26upx;margin-top:10upx;">
+                    <text class="tag-status" v-if="shopInfo.shop_type">{{ getShopType(shopInfo.shop_type) }}</text>
+                    <text class="tag-status" style="margin-left: 20upx;" v-if="shopInfo.settlement_type">{{ getSettlementType(shopInfo.settlement_type) }}</text>
+                  </view>
+                </view>
+            </view>
+        </view>
+      </view>
+
+      <!-- 编辑表单 -->
+      <view class="module-com user-open_bx">
+        <view class="section-title">店铺信息配置</view>
+        
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">店铺名称</div>
+             <input v-model="formData.shop_name" class="tui-input" placeholder="请输入店铺名称" />
+        </tui-list-cell>
+        
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">店铺地址</div>
+             <input v-model="formData.shop_address" class="tui-input" placeholder="请输入店铺地址" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">联系人</div>
+             <input v-model="formData.shop_contact_name" class="tui-input" placeholder="请输入联系人姓名" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">联系电话</div>
+             <input v-model="formData.shop_contact_phone" class="tui-input" placeholder="请输入联系电话" />
+        </tui-list-cell>
+        
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">经度</div>
+             <input v-model="formData.longitude" class="tui-input" placeholder="请输入经度" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">纬度</div>
+             <input v-model="formData.latitude" class="tui-input" placeholder="请输入纬度" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">位置</div>
+             <text class="action-text" @click="chooseLocation">地图选择</text>
+        </tui-list-cell>
+
+        <view style="padding: 20upx 20upx;">
+            <button class="admin-button-com blue big" @click="submitUpdate">保存修改</button>
+        </view>
+      </view>
+
+      <!-- 物流产品 -->
+      <view class="module-com user-open_bx" v-if="shopInfo.logistic_type_list && shopInfo.logistic_type_list.length">
+        <view class="section-title" style="margin-bottom: 20upx;">物流产品</view>
+        <view v-for="(item, index) in shopInfo.logistic_type_list" :key="index" class="logistic-item">
+            <view class="logistic-header">
+                <text class="logistic-name">{{ item.logistics_type_name }}</text>
+                <text class="logistic-tag" v-if="item.is_master_logistics_type === 1">主要</text>
+            </view>
+            <view class="logistic-desc">{{ item.logistics_type_desc }}</view>
+        </view>
+      </view>
+
+      <!-- 基础配置信息 -->
+      <view class="module-com user-open_bx" v-if="shopInfo">
+        <view class="section-title" style="margin-bottom: 20upx;">基础配置</view>
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">扫码下单</div>
+             <div class="info-val">{{ shopInfo.is_scan_rider_code === 1 ? '支持' : '不支持' }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">保价服务</div>
+             <div class="info-val">{{ shopInfo.is_insured === 1 ? '支持' : '不支持' }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false">
+             <div class="tui-title">专人直送</div>
+             <div class="info-val">
+                 {{ shopInfo.is_person_direct === 1 ? '支持' : (shopInfo.is_person_direct === 2 ? '仅支持独享专送' : '不支持') }}
+             </div>
+        </tui-list-cell>
+      </view>
+
+      <!-- 等级信息 -->
+      <view class="module-com user-open_bx" v-if="levelInfo">
+        <view class="section-title" style="margin-bottom: 20upx;">等级信息</view>
+        <tui-list-cell class="line-cell" :hover="false" v-if="levelInfo.level_desc">
+            <div class="tui-title">当前等级</div>
+            <div class="info-val">{{ levelInfo.level_desc }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false" v-if="levelInfo.level_points">
+            <div class="tui-title">当前积分</div>
+            <div class="info-val">{{ levelInfo.level_points }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false" v-if="levelInfo.next_level_desc">
+            <div class="tui-title">下一等级</div>
+            <div class="info-val">{{ levelInfo.next_level_desc }} (需{{ levelInfo.next_level_need_points }}积分)</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false" v-if="levelInfo.priority_assigned_surplus_numbers !== undefined">
+            <div class="tui-title">剩余优先派单</div>
+            <div class="info-val">{{ levelInfo.priority_assigned_surplus_numbers }}次</div>
+        </tui-list-cell>
+      </view>
+
+      <!-- 补贴信息 -->
+      <view class="module-com user-open_bx" v-if="subsidyInfo">
+        <view class="section-title" style="margin-bottom: 20upx;">补贴信息</view>
+        <tui-list-cell class="line-cell" :hover="false" v-if="subsidyInfo.overflow_subsidy">
+            <div class="tui-title">溢价补贴</div>
+            <div class="info-val">{{ subsidyInfo.overflow_subsidy }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false" v-if="subsidyInfo.cancel_subsidy">
+            <div class="tui-title">取消补贴</div>
+            <div class="info-val">{{ subsidyInfo.cancel_subsidy }}</div>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :hover="false" v-if="subsidyInfo.insured_subsidy">
+            <div class="tui-title">保价补贴</div>
+            <div class="info-val">{{ subsidyInfo.insured_subsidy }}</div>
+        </tui-list-cell>
+      </view>
+
+      <!-- 物品类型 -->
+      <!-- <view class="module-com user-open_bx" v-if="shopInfo.shop_product_types">
+        <view class="section-title" style="margin-bottom: 20upx;">物品类型</view>
+        <view class="tags-wrap">
+            <text v-for="(val, key) in shopInfo.shop_product_types" :key="key" class="tag-simple">{{ val }}</text>
+        </view>
+      </view> -->
+
+  </view>
+</template>
+
+<script>
+import { storeDetail, updateStore } from '@/api/express/shop.js';
+import TuiListCell from '@/components/plugin/list-cell'
+
+export default {
+    name: 'ShunfengShopDetail',
+    components: {
+        TuiListCell
+    },
+    data() {
+        return {
+            platformId: '',
+            loading: false,
+            shopInfo: {},
+            levelInfo: null,
+            subsidyInfo: null,
+            // 表单数据
+            formData: {
+                shop_name: '',
+                shop_address: '',
+                shop_contact_name: '',
+                shop_contact_phone: '',
+                longitude: '',
+                latitude: ''
+            }
+        };
+    },
+    onLoad(options) {
+        if (options.platformId) {
+            this.platformId = options.platformId;
+        }
+        this.fetchShopDetail();
+    },
+    methods: {
+        init() {},
+        getShopType(type) {
+            const map = {
+                1: '普通型店铺',
+                2: '平台型店铺'
+            };
+            return map[type] || '未知类型';
+        },
+        getSettlementType(type) {
+            const map = {
+                1: '同城月结',
+                2: '在线支付',
+                3: '急送大网月结',
+                4: '储值卡',
+                5: 'KA大网月结',
+                6: '预付费'
+            };
+            return map[type] || '未知结算方式';
+        },
+        async fetchShopDetail() {
+            this.loading = true;
+            try {
+                const res = await storeDetail({ platform: this.platformId });
+                console.log('storeDetail res:', res);
+                if (res.code === 1 && res.data) {
+                    const data = res.data;
+                    this.shopInfo = data.shop_info || {};
+                    this.levelInfo = data.level_info || null;
+                    this.subsidyInfo = data.subsidy_info || null;
+                    
+                    // 初始化表单
+                    if (this.shopInfo) {
+                        this.formData = {
+                            shop_name: this.shopInfo.shop_name || '',
+                            shop_address: this.shopInfo.shop_address || '',
+                            shop_contact_name: this.shopInfo.shop_contact_name || '',
+                            shop_contact_phone: this.shopInfo.shop_contact_phone || '',
+                            longitude: this.shopInfo.longitude || '',
+                            latitude: this.shopInfo.latitude || ''
+                        };
+                    }
+                } else {
+                    uni.showToast({
+                        title: res.msg || '获取详情失败',
+                        icon: 'none'
+                    });
+                }
+            } catch (error) {
+                console.error('获取门店详情失败', error);
+                uni.showToast({
+                    title: '网络错误',
+                    icon: 'none'
+                });
+            }
+            this.loading = false;
+        },
+        chooseLocation() {
+            uni.chooseLocation({
+                success: (res) => {
+                    this.formData.latitude = res.latitude;
+                    this.formData.longitude = res.longitude;
+                    if (res.address) {
+                        this.formData.shop_address = res.address;
+                    }
+                }
+            });
+        },
+        // 更新店铺信息提交
+        async submitUpdate() {
+            if (!this.formData.shop_name) {
+                uni.showToast({ title: '请输入店铺名称', icon: 'none' });
+                return;
+            }
+            if (!this.formData.shop_address) {
+                uni.showToast({ title: '请输入店铺地址', icon: 'none' });
+                return;
+            }
+
+            const payload = {
+                platform: this.platformId,
+                // out_shop_id: '', // 可选
+                shop_name: this.formData.shop_name,
+                shop_address: this.formData.shop_address,
+                longitude: this.formData.longitude,
+                latitude: this.formData.latitude,
+                shop_contact_name: this.formData.shop_contact_name,
+                shop_contact_phone: this.formData.shop_contact_phone,
+            };
+
+            console.log('提交更新参数:', payload);
+            
+            // 调用更新API
+            const res = await updateStore(payload);
+            console.log('updateStore res:', res);
+            if (res.code === 1) {
+                uni.showToast({
+                    title: '更新成功',
+                    icon: 'success'
+                });
+                this.fetchShopDetail();
+            } else {
+                uni.showToast({
+                    title: res.msg || '更新失败',
+                    icon: 'none'
+                });
+            }
+            uni.showToast({
+                title: '提交逻辑已就绪(接口待补)',
+                icon: 'none'
+            });
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.module-com {
+  margin: 0 30upx 20upx;
+  padding: 20upx;
+  background-color: #fff;
+  border-radius: 10upx;
+  position: relative;
+  z-index: 10;
+}
+
+.user-info {
+  padding: 40upx 20upx;
+  position: relative;
+  top: 30upx;
+  
+  .user-info_top {
+    position: relative;
+    display: flex;
+    align-items: center;
+    
+    .user-info_lf {
+      position: relative;
+      padding-left: 10upx;
+      flex: 1;
+      
+      .dec-bx {
+         color: #333;
+      }
+    }
+  }
+}
+
+.user-open_bx {
+  margin-top: 20upx;
+  padding: 0;
+  
+  .section-title {
+      padding: 30upx 30upx 10upx;
+      font-size: 30upx;
+      font-weight: bold;
+      color: #333;
+      border-bottom: 1px solid #f5f5f5;
+  }
+  
+  .tui-title {
+      min-width: 140upx;
+      font-size: 28upx;
+      color: #666;
+  }
+  
+  .tui-input {
+      flex: 1;
+      text-align: right;
+      font-size: 28upx;
+      color: #333;
+  }
+  
+  .action-text {
+      color: #3385ff;
+      margin-left: 20upx;
+      font-size: 28upx;
+  }
+  
+  .info-val {
+      flex: 1;
+      text-align: right;
+      color: #333;
+      font-size: 28upx;
+  }
+}
+
+.tag-status {
+    background: #e6f1ff;
+    color: #3385ff;
+    padding: 4upx 12upx;
+    border-radius: 6upx;
+    font-size: 24upx;
+}
+
+.logistic-item {
+    padding: 20upx 30upx;
+    border-bottom: 1px solid #f5f5f5;
+    
+    &:last-child {
+        border-bottom: none;
+    }
+    
+    .logistic-header {
+        display: flex;
+        align-items: center;
+        margin-bottom: 10upx;
+        
+        .logistic-name {
+            font-size: 28upx;
+            font-weight: bold;
+            margin-right: 20upx;
+        }
+        
+        .logistic-tag {
+            background: #ffecd9;
+            color: #ff6a00;
+            font-size: 20upx;
+            padding: 2upx 8upx;
+            border-radius: 4upx;
+        }
+    }
+    
+    .logistic-desc {
+        font-size: 24upx;
+        color: #999;
+    }
+}
+
+.tags-wrap {
+    padding: 20upx 30upx;
+    display: flex;
+    flex-wrap: wrap;
+    
+    .tag-simple {
+        background: #f5f5f5;
+        color: #666;
+        font-size: 24upx;
+        padding: 6upx 16upx;
+        border-radius: 6upx;
+        margin-right: 16upx;
+        margin-bottom: 16upx;
+    }
+}
+</style>

+ 7 - 0
ghsApp/src/api/express/shop.js

@@ -12,3 +12,10 @@ export const storeList = data => {
     return https.get('/delivery-shop/store-list', data)
 }
 
+export const storeDetail = data => {
+    return https.post('/delivery-shop/store-detail', data)
+}
+
+export const updateStore = data => {
+    return https.post('/delivery-shop/update-store', data)
+}