feat: 投诉仅限邀请人+人工客服展示+抢单池商家指标与平台标签

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-27 01:55:45 +08:00
parent 16eecd1278
commit 2a8f7c427c
6 changed files with 255 additions and 22 deletions

View File

@@ -7,6 +7,7 @@ const TYPES = [
{ value: 3, label: '罚款投诉' }, { value: 3, label: '罚款投诉' },
{ value: 4, label: '管事投诉' }, { value: 4, label: '管事投诉' },
{ value: 5, label: '被骗投诉' }, { value: 5, label: '被骗投诉' },
{ value: 6, label: '组长投诉' },
] ]
Page({ Page({
@@ -16,7 +17,16 @@ Page({
order_id: '', order_id: '',
chongzhi_id: '', chongzhi_id: '',
fadan_id: '', fadan_id: '',
guanshi_id: '', target_user_id: '',
target_nicheng: '',
canComplainInviter: false,
inviterReason: '',
humanKefu: {
available: false,
wechat: '',
link: '',
tip: '',
},
shuoming: '', shuoming: '',
images: [], images: [],
maxImages: 9, maxImages: 9,
@@ -30,13 +40,88 @@ Page({
if (q.chongzhi_id) patch.chongzhi_id = decodeURIComponent(q.chongzhi_id) if (q.chongzhi_id) patch.chongzhi_id = decodeURIComponent(q.chongzhi_id)
if (q.fadan_id) patch.fadan_id = decodeURIComponent(q.fadan_id) if (q.fadan_id) patch.fadan_id = decodeURIComponent(q.fadan_id)
if (Object.keys(patch).length) this.setData(patch) if (Object.keys(patch).length) this.setData(patch)
this.loadMeta()
}, },
onPickType(e) { this.setData({ leixing: Number(e.currentTarget.dataset.v) }) }, async loadMeta() {
try {
const res = await request({ url: '/gongdan/meta/', method: 'GET' })
const body = res.data || {}
if (!(body.code === 200 || body.code === 0)) return
const data = body.data || {}
const hk = data.human_kefu || {}
this.setData({
humanKefu: {
available: !!hk.available,
wechat: hk.wechat || '',
link: hk.link || '',
tip: hk.tip || '',
},
maxImages: data.max_images || 9,
})
this.applyInviterFromMeta(data.inviter_targets)
} catch (e) {
// ignore
}
if (this.data.leixing === 4 || this.data.leixing === 6) {
this.loadInviterTarget(this.data.leixing)
}
},
applyInviterFromMeta(targets) {
if (!targets) return
const leixing = this.data.leixing
const info = leixing === 4 ? targets.guanshi : (leixing === 6 ? targets.zuzhang : null)
if (!info) return
this.setData({
canComplainInviter: !!info.can_complain,
target_user_id: info.user_id || '',
target_nicheng: info.nicheng || '',
inviterReason: info.reason || '',
})
},
async loadInviterTarget(leixing) {
try {
const res = await request({
url: '/gongdan/my-inviter-target/',
method: 'POST',
data: { leixing },
})
const body = res.data || {}
const info = body.data || {}
this.setData({
canComplainInviter: !!info.can_complain,
target_user_id: info.user_id || '',
target_nicheng: info.nicheng || '',
inviterReason: info.reason || (body.message || ''),
})
} catch (e) {
this.setData({
canComplainInviter: false,
target_user_id: '',
target_nicheng: '',
inviterReason: '无法获取邀请人信息',
})
}
},
onPickType(e) {
const leixing = Number(e.currentTarget.dataset.v)
this.setData({
leixing,
target_user_id: '',
target_nicheng: '',
canComplainInviter: false,
inviterReason: '',
})
if (leixing === 4 || leixing === 6) {
this.loadInviterTarget(leixing)
}
},
onOrderId(e) { this.setData({ order_id: e.detail.value }) }, onOrderId(e) { this.setData({ order_id: e.detail.value }) },
onChongzhiId(e) { this.setData({ chongzhi_id: e.detail.value }) }, onChongzhiId(e) { this.setData({ chongzhi_id: e.detail.value }) },
onFadanId(e) { this.setData({ fadan_id: e.detail.value }) }, onFadanId(e) { this.setData({ fadan_id: e.detail.value }) },
onGuanshiId(e) { this.setData({ guanshi_id: e.detail.value }) },
onShuoming(e) { this.setData({ shuoming: e.detail.value }) }, onShuoming(e) { this.setData({ shuoming: e.detail.value }) },
openMiniKefu() { openCustomerServiceChat() }, openMiniKefu() { openCustomerServiceChat() },
@@ -54,7 +139,43 @@ Page({
}) })
}, },
goChongzhiList() { wx.navigateTo({ url: '/pages/gongdan/chongzhi-list/chongzhi-list' }) }, openHumanLink() {
const link = (this.data.humanKefu.link || '').trim()
if (!link) return
// 企业微信客服链接优先用官方能力打开
const app = getApp()
const cfg = app.globalData.kefuConfig || {}
if (cfg.enterpriseId && (link.indexOf('work.weixin.qq.com') >= 0 || link.indexOf('kf') >= 0)) {
wx.openCustomerServiceChat({
extInfo: { url: link },
corpId: cfg.enterpriseId,
fail: () => {
wx.setClipboardData({
data: link,
success: () => wx.showToast({ title: '链接已复制', icon: 'none' }),
})
},
})
return
}
wx.setClipboardData({
data: link,
success: () => wx.showToast({ title: '客服链接已复制', icon: 'none' }),
})
},
copyHumanWechat() {
const wxid = (this.data.humanKefu.wechat || '').trim()
if (!wxid) return
wx.setClipboardData({
data: wxid,
success: () => wx.showToast({ title: '微信号已复制', icon: 'success' }),
})
},
goChongzhiList() {
wx.navigateTo({ url: '/pages/gongdan/chongzhi-list/chongzhi-list?from=complaint' })
},
goPenalty() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) }, goPenalty() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) },
goMyList() { wx.navigateTo({ url: '/pages/gongdan/list/list' }) }, goMyList() { wx.navigateTo({ url: '/pages/gongdan/list/list' }) },
@@ -121,26 +242,44 @@ Page({
wx.showToast({ title: '请填写投诉说明', icon: 'none' }) wx.showToast({ title: '请填写投诉说明', icon: 'none' })
return return
} }
if (this.data.leixing === 4 || this.data.leixing === 6) {
if (!this.data.canComplainInviter || !this.data.target_user_id) {
wx.showToast({
title: this.data.inviterReason || '没有邀请人,无法投诉',
icon: 'none',
})
return
}
}
this.setData({ submitting: true }) this.setData({ submitting: true })
try { try {
const res = await request({ const payload = {
url: '/gongdan/create/',
method: 'POST',
data: {
leixing: this.data.leixing, leixing: this.data.leixing,
shuoming: this.data.shuoming, shuoming: this.data.shuoming,
order_id: this.data.order_id, order_id: this.data.order_id,
chongzhi_id: this.data.chongzhi_id, chongzhi_id: this.data.chongzhi_id,
fadan_id: this.data.fadan_id, fadan_id: this.data.fadan_id,
guanshi_id: this.data.guanshi_id,
images: this.data.images, images: this.data.images,
}, }
if (this.data.leixing === 4) {
payload.target_role = 'guanshi'
// 后端会强制本人邀请人,这里仅作兼容提交
payload.target_user_id = this.data.target_user_id
payload.guanshi_id = this.data.target_user_id
} else if (this.data.leixing === 6) {
payload.target_role = 'zuzhang'
payload.target_user_id = this.data.target_user_id
}
const res = await request({
url: '/gongdan/create/',
method: 'POST',
data: payload,
}) })
const body = res.data || {} const body = res.data || {}
if (body.code === 200 || body.code === 0) { if (body.code === 200 || body.code === 0) {
wx.showToast({ title: '提交成功', icon: 'success' }) wx.showToast({ title: '提交成功', icon: 'success' })
setTimeout(() => { setTimeout(() => {
wx.redirectTo({ url: '/pages/gongdan/list/list' }) wx.redirectTo({ url: '/pages/gongdan/list/list?tab=created' })
}, 500) }, 500)
} else { } else {
wx.showToast({ title: body.message || body.msg || '提交失败', icon: 'none' }) wx.showToast({ title: body.message || body.msg || '提交失败', icon: 'none' })

View File

@@ -1,5 +1,14 @@
<view class="page"> <view class="page">
<view class="cs-bar"> <view class="cs-card" wx:if="{{humanKefu.available}}">
<view class="cs-title">人工客服</view>
<view class="cs-tip" wx:if="{{humanKefu.tip}}">{{humanKefu.tip}}</view>
<view class="cs-actions">
<view class="cs-btn cs-link" wx:if="{{humanKefu.link}}" bindtap="openHumanLink">一键联系客服</view>
<view class="cs-btn cs-wx" wx:if="{{humanKefu.wechat}}" bindtap="copyHumanWechat">复制微信号</view>
</view>
<view class="cs-wechat" wx:if="{{humanKefu.wechat}}">微信:{{humanKefu.wechat}}</view>
</view>
<view class="cs-bar" wx:else>
<view class="cs-btn" bindtap="openMiniKefu">小程序客服</view> <view class="cs-btn" bindtap="openMiniKefu">小程序客服</view>
<view class="cs-btn cs-wx" bindtap="openWxKefu">微信客服</view> <view class="cs-btn cs-wx" bindtap="openWxKefu">微信客服</view>
</view> </view>
@@ -24,16 +33,21 @@
<view class="section" wx:if="{{leixing==2}}"> <view class="section" wx:if="{{leixing==2}}">
<view class="label">充值记录ID <text class="req">*</text></view> <view class="label">充值记录ID <text class="req">*</text></view>
<input class="input" placeholder="请输入充值记录ID" value="{{chongzhi_id}}" bindinput="onChongzhiId"/> <input class="input" placeholder="请输入充值记录ID" value="{{chongzhi_id}}" bindinput="onChongzhiId"/>
<view class="link" bindtap="goChongzhiList">去充值记录复制 →</view> <view class="link" bindtap="goChongzhiList">去充值记录选择 →</view>
</view> </view>
<view class="section" wx:if="{{leixing==3}}"> <view class="section" wx:if="{{leixing==3}}">
<view class="label">罚单ID <text class="req">*</text></view> <view class="label">罚单ID <text class="req">*</text></view>
<input class="input" placeholder="请输入罚单ID" value="{{fadan_id}}" bindinput="onFadanId"/> <input class="input" placeholder="请输入罚单ID" value="{{fadan_id}}" bindinput="onFadanId"/>
<view class="link" bindtap="goPenalty">去罚款页查看 →</view> <view class="link" bindtap="goPenalty">去罚款页查看 →</view>
</view> </view>
<view class="section" wx:if="{{leixing==4}}">
<view class="label">管事ID选填</view> <view class="section" wx:if="{{leixing==4 || leixing==6}}">
<input class="input" placeholder="被投诉管事UID可不填" value="{{guanshi_id}}" bindinput="onGuanshiId"/> <view class="label">{{leixing==4?'被投诉管事':'被投诉组长'}} <text class="req">*</text></view>
<view class="picked fixed" wx:if="{{target_nicheng && canComplainInviter}}">
<text>你的邀请人:{{target_nicheng}}</text>
</view>
<view class="inviter-tip" wx:if="{{canComplainInviter}}">仅可投诉本人邀请人,不可选择其他人</view>
<view class="inviter-block" wx:else>{{inviterReason || '你没有邀请人,无法发起此类投诉'}}</view>
</view> </view>
<view class="section"> <view class="section">
@@ -52,6 +66,6 @@
</view> </view>
</view> </view>
<button class="submit" loading="{{submitting}}" bindtap="submit">提交投诉</button> <button class="submit" loading="{{submitting}}" disabled="{{(leixing==4 || leixing==6) && !canComplainInviter}}" bindtap="submit">提交投诉</button>
<view class="foot-link" bindtap="goMyList">查看我的投诉记录</view> <view class="foot-link" bindtap="goMyList">查看我的投诉记录</view>
</view> </view>

View File

@@ -2,6 +2,13 @@
.cs-bar{display:flex;gap:16rpx;margin-bottom:24rpx} .cs-bar{display:flex;gap:16rpx;margin-bottom:24rpx}
.cs-btn{flex:1;text-align:center;padding:20rpx 0;border-radius:12rpx;background:#fff;font-size:28rpx;color:#1a1a1a;border:1rpx solid #e5e5e5} .cs-btn{flex:1;text-align:center;padding:20rpx 0;border-radius:12rpx;background:#fff;font-size:28rpx;color:#1a1a1a;border:1rpx solid #e5e5e5}
.cs-wx{background:#07c160;color:#fff;border-color:#07c160} .cs-wx{background:#07c160;color:#fff;border-color:#07c160}
.cs-card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx;border:1rpx solid #e8f5ee}
.cs-title{font-size:30rpx;font-weight:600;color:#1a1a1a;margin-bottom:8rpx}
.cs-tip{font-size:24rpx;color:#666;margin-bottom:16rpx;line-height:1.5}
.cs-actions{display:flex;gap:12rpx}
.cs-actions .cs-btn{flex:1}
.cs-link{background:#1a1a1a;color:#fff;border-color:#1a1a1a}
.cs-wechat{margin-top:14rpx;font-size:24rpx;color:#07c160}
.section{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx} .section{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx}
.label{font-size:28rpx;color:#333;margin-bottom:16rpx;font-weight:500} .label{font-size:28rpx;color:#333;margin-bottom:16rpx;font-weight:500}
.req{color:#e54} .req{color:#e54}
@@ -17,4 +24,9 @@
.del{position:absolute;right:0;top:0;width:40rpx;height:40rpx;background:rgba(0,0,0,.55);color:#fff;text-align:center;line-height:40rpx;font-size:28rpx} .del{position:absolute;right:0;top:0;width:40rpx;height:40rpx;background:rgba(0,0,0,.55);color:#fff;text-align:center;line-height:40rpx;font-size:28rpx}
.img-add{display:flex;align-items:center;justify-content:center;font-size:64rpx;color:#bbb} .img-add{display:flex;align-items:center;justify-content:center;font-size:64rpx;color:#bbb}
.submit{margin-top:32rpx;background:#1a1a1a;color:#fff;border-radius:12rpx;font-size:30rpx} .submit{margin-top:32rpx;background:#1a1a1a;color:#fff;border-radius:12rpx;font-size:30rpx}
.submit[disabled]{opacity:.45}
.foot-link{text-align:center;margin-top:28rpx;color:#666;font-size:26rpx} .foot-link{text-align:center;margin-top:28rpx;color:#666;font-size:26rpx}
.picked{display:flex;justify-content:space-between;align-items:center;background:#f7f8fa;border-radius:10rpx;padding:20rpx;margin-bottom:12rpx;font-size:28rpx}
.picked.fixed{margin-bottom:8rpx}
.inviter-tip{font-size:22rpx;color:#888;line-height:1.4}
.inviter-block{background:#fff5f5;color:#c0392b;border-radius:10rpx;padding:20rpx;font-size:26rpx;line-height:1.5}

View File

@@ -3,6 +3,7 @@ const app = getApp();
import request from '../../utils/request.js'; import request from '../../utils/request.js';
import PopupService from '../../services/popupService.js'; import PopupService from '../../services/popupService.js';
import { refreshDashouMembership, userHasHuiyuan } from '../../utils/dashou-profile.js'; import { refreshDashouMembership, userHasHuiyuan } from '../../utils/dashou-profile.js';
import { ensureRoleAgreement } from '../../utils/role-agreement-gate.js';
Page({ Page({
data: { data: {
@@ -406,6 +407,9 @@ Page({
return; return;
} }
const signed = await ensureRoleAgreement('dashou', 'qiangdan');
if (!signed) return;
const that = this; const that = this;
wx.showModal({ wx.showModal({
title: '确认抢单', title: '确认抢单',

View File

@@ -114,6 +114,12 @@
<text class="pingtai-tag">平台订单</text> <text class="pingtai-tag">平台订单</text>
</view> </view>
<view class="platform-badge-row">
<text class="platform-badge">老板自助下单</text>
<text class="platform-badge">结算快</text>
<text class="platform-badge accent">价格高</text>
</view>
<!-- 指定单标识行 - 新增头像和昵称 --> <!-- 指定单标识行 - 新增头像和昵称 -->
<view wx:if="{{item.isZhiding}}" class="zhiding-row"> <view wx:if="{{item.isZhiding}}" class="zhiding-row">
<text class="zhiding-icon">指定</text> <text class="zhiding-icon">指定</text>
@@ -211,7 +217,14 @@
src="{{item.full_tupian_url}}" src="{{item.full_tupian_url}}"
mode="aspectFill" mode="aspectFill"
/> />
<view class="shangjia-meta">
<text class="shangjia-nicheng">{{item.sjnicheng || '未知商家'}}</text> <text class="shangjia-nicheng">{{item.sjnicheng || '未知商家'}}</text>
<view class="merchant-stat-row" wx:if="{{item.shangjia_deal_stat}}">
<text class="merchant-stat" wx:if="{{item.shangjia_deal_stat.deal_rate_text}}">成交 {{item.shangjia_deal_stat.deal_rate_text}}</text>
<text class="merchant-stat" wx:if="{{item.shangjia_deal_stat.fine_rate_text}}">罚款 {{item.shangjia_deal_stat.fine_rate_text}}</text>
<text class="merchant-stat highlight" wx:if="{{item.shangjia_deal_stat.avg_deal_hours_text}}">均时 {{item.shangjia_deal_stat.avg_deal_hours_text}}</text>
</view>
</view>
</view> </view>
<!-- 介绍区 --> <!-- 介绍区 -->

View File

@@ -340,6 +340,29 @@
border-radius: 20rpx; border-radius: 20rpx;
} }
.platform-badge-row {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
margin: -4rpx 0 16rpx;
}
.platform-badge {
font-size: 20rpx;
color: #2f6b3a;
background: rgba(47, 107, 58, 0.08);
border: 1rpx solid rgba(47, 107, 58, 0.16);
padding: 4rpx 12rpx;
border-radius: 8rpx;
line-height: 1.4;
}
.platform-badge.accent {
color: #b45309;
background: rgba(180, 83, 9, 0.08);
border-color: rgba(180, 83, 9, 0.18);
}
.zhiding-row { .zhiding-row {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -444,12 +467,40 @@
border: 2rpx solid rgba(114, 46, 209, 0.15); border: 2rpx solid rgba(114, 46, 209, 0.15);
box-shadow: 0 6rpx 18rpx rgba(114, 46, 209, 0.12); box-shadow: 0 6rpx 18rpx rgba(114, 46, 209, 0.12);
object-fit: cover; object-fit: cover;
flex-shrink: 0;
}
.shangjia-meta {
flex: 1;
min-width: 0;
} }
.shangjia-nicheng { .shangjia-nicheng {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
font-weight: 600; font-weight: 600;
display: block;
}
.merchant-stat-row {
display: flex;
flex-wrap: wrap;
gap: 8rpx;
margin-top: 8rpx;
}
.merchant-stat {
font-size: 20rpx;
color: #6b5b95;
background: rgba(114, 46, 209, 0.08);
padding: 2rpx 10rpx;
border-radius: 8rpx;
line-height: 1.4;
}
.merchant-stat.highlight {
color: #0f766e;
background: rgba(15, 118, 110, 0.08);
} }
.shangjia-jieshao, .shangjia-jieshao,