checkpoint: 冻结资金开工前龙先生小程序本地备份(不推远程)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
27
pages/gongdan/chongzhi-list/chongzhi-list.js
Normal file
27
pages/gongdan/chongzhi-list/chongzhi-list.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '../../../utils/request.js'
|
||||
|
||||
Page({
|
||||
data: { list: [], loading: false, page: 1 },
|
||||
onShow() { this.load(true) },
|
||||
copy(e) { wx.setClipboardData({ data: String(e.currentTarget.dataset.t || '') }) },
|
||||
complain(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({ url: `/pages/gongdan/create/create?leixing=2&chongzhi_id=${encodeURIComponent(id)}` })
|
||||
},
|
||||
async load(reset) {
|
||||
if (this.data.loading) return
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const page = reset ? 1 : this.data.page
|
||||
const res = await request({ url: '/gongdan/chongzhi-list/', method: 'POST', data: { page, page_size: 20 } })
|
||||
const body = res.data || {}
|
||||
if (body.code === 200 || body.code === 0) {
|
||||
const rows = (body.data && body.data.list) || []
|
||||
this.setData({ list: reset ? rows : this.data.list.concat(rows), page: page + 1 })
|
||||
}
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
onReachBottom() { this.load(false) },
|
||||
})
|
||||
1
pages/gongdan/chongzhi-list/chongzhi-list.json
Normal file
1
pages/gongdan/chongzhi-list/chongzhi-list.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"充值记录","usingComponents":{}}
|
||||
13
pages/gongdan/chongzhi-list/chongzhi-list.wxml
Normal file
13
pages/gongdan/chongzhi-list/chongzhi-list.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<view class="page">
|
||||
<view wx:if="{{!list.length && !loading}}" class="empty">暂无充值记录</view>
|
||||
<view class="card" wx:for="{{list}}" wx:key="dingdan_id">
|
||||
<view class="row">
|
||||
<text class="t">{{item.leixing_label}}</text>
|
||||
<text class="s">{{item.zhuangtai_label}}</text>
|
||||
</view>
|
||||
<view class="amt">¥{{item.jine}}</view>
|
||||
<view class="id" bindtap="copy" data-t="{{item.dingdan_id}}">充值ID:{{item.dingdan_id}}(点复制)</view>
|
||||
<view class="time">{{item.CreateTime}}</view>
|
||||
<view class="act" bindtap="complain" data-id="{{item.dingdan_id}}">投诉此笔充值</view>
|
||||
</view>
|
||||
</view>
|
||||
9
pages/gongdan/chongzhi-list/chongzhi-list.wxss
Normal file
9
pages/gongdan/chongzhi-list/chongzhi-list.wxss
Normal file
@@ -0,0 +1,9 @@
|
||||
.page{padding:24rpx;background:#f5f6f8;min-height:100vh}
|
||||
.empty{text-align:center;color:#999;padding:80rpx}
|
||||
.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:16rpx}
|
||||
.row{display:flex;justify-content:space-between}
|
||||
.t{font-size:30rpx;font-weight:600}
|
||||
.s{font-size:22rpx;color:#856404}
|
||||
.amt{font-size:36rpx;margin-top:8rpx;color:#111}
|
||||
.id,.time{font-size:22rpx;color:#888;margin-top:8rpx}
|
||||
.act{margin-top:16rpx;color:#2b6de5;font-size:26rpx}
|
||||
154
pages/gongdan/create/create.js
Normal file
154
pages/gongdan/create/create.js
Normal file
@@ -0,0 +1,154 @@
|
||||
import request from '../../../utils/request.js'
|
||||
import { openCustomerServiceChat } from '../../../utils/kefu-nav.js'
|
||||
|
||||
const TYPES = [
|
||||
{ value: 1, label: '订单投诉' },
|
||||
{ value: 2, label: '充值投诉' },
|
||||
{ value: 3, label: '罚款投诉' },
|
||||
{ value: 4, label: '管事投诉' },
|
||||
{ value: 5, label: '被骗投诉' },
|
||||
]
|
||||
|
||||
Page({
|
||||
data: {
|
||||
types: TYPES,
|
||||
leixing: 1,
|
||||
order_id: '',
|
||||
chongzhi_id: '',
|
||||
fadan_id: '',
|
||||
guanshi_id: '',
|
||||
shuoming: '',
|
||||
images: [],
|
||||
maxImages: 9,
|
||||
submitting: false,
|
||||
},
|
||||
|
||||
onLoad(q) {
|
||||
const patch = {}
|
||||
if (q.leixing) patch.leixing = Number(q.leixing) || 1
|
||||
if (q.order_id) patch.order_id = decodeURIComponent(q.order_id)
|
||||
if (q.chongzhi_id) patch.chongzhi_id = decodeURIComponent(q.chongzhi_id)
|
||||
if (q.fadan_id) patch.fadan_id = decodeURIComponent(q.fadan_id)
|
||||
if (Object.keys(patch).length) this.setData(patch)
|
||||
},
|
||||
|
||||
onPickType(e) { this.setData({ leixing: Number(e.currentTarget.dataset.v) }) },
|
||||
onOrderId(e) { this.setData({ order_id: e.detail.value }) },
|
||||
onChongzhiId(e) { this.setData({ chongzhi_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 }) },
|
||||
|
||||
openMiniKefu() { openCustomerServiceChat() },
|
||||
openWxKefu() {
|
||||
const app = getApp()
|
||||
const cfg = app.globalData.kefuConfig || {}
|
||||
if (!cfg.link || !cfg.enterpriseId) {
|
||||
wx.showToast({ title: '微信客服未配置', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.openCustomerServiceChat({
|
||||
extInfo: { url: cfg.link },
|
||||
corpId: cfg.enterpriseId,
|
||||
fail: () => wx.showToast({ title: '打开微信客服失败', icon: 'none' }),
|
||||
})
|
||||
},
|
||||
|
||||
goChongzhiList() { wx.navigateTo({ url: '/pages/gongdan/chongzhi-list/chongzhi-list' }) },
|
||||
goPenalty() { wx.navigateTo({ url: '/pages/penalty/penalty/penalty' }) },
|
||||
goMyList() { wx.navigateTo({ url: '/pages/gongdan/list/list' }) },
|
||||
|
||||
chooseImg() {
|
||||
const left = this.data.maxImages - this.data.images.length
|
||||
wx.chooseMedia({
|
||||
count: left,
|
||||
mediaType: ['image'],
|
||||
success: async (res) => {
|
||||
wx.showLoading({ title: '上传中' })
|
||||
try {
|
||||
const urls = [...this.data.images]
|
||||
for (const f of res.tempFiles || []) {
|
||||
const url = await this.uploadOne(f.tempFilePath)
|
||||
if (url) urls.push(url)
|
||||
}
|
||||
this.setData({ images: urls.slice(0, this.data.maxImages) })
|
||||
} catch (e) {
|
||||
wx.showToast({ title: '上传失败', icon: 'none' })
|
||||
} finally {
|
||||
wx.hideLoading()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
uploadOne(filePath) {
|
||||
const app = getApp()
|
||||
const base = (app.globalData.apiBaseUrl || '').replace(/\/$/, '')
|
||||
const token = wx.getStorageSync('token') || ''
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: `${base}/gongdan/upload-image/`,
|
||||
filePath,
|
||||
name: 'file',
|
||||
header: { Authorization: token ? `Bearer ${token}` : '' },
|
||||
success: (res) => {
|
||||
try {
|
||||
const body = JSON.parse(res.data || '{}')
|
||||
if ((body.code === 200 || body.code === 0) && body.data && body.data.url) {
|
||||
resolve(body.data.url)
|
||||
} else reject(new Error(body.message || '上传失败'))
|
||||
} catch (e) { reject(e) }
|
||||
},
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
delImg(e) {
|
||||
const i = e.currentTarget.dataset.i
|
||||
const images = this.data.images.slice()
|
||||
images.splice(i, 1)
|
||||
this.setData({ images })
|
||||
},
|
||||
|
||||
preview(e) {
|
||||
wx.previewImage({ current: e.currentTarget.dataset.url, urls: this.data.images })
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (this.data.submitting) return
|
||||
if (!(this.data.shuoming || '').trim()) {
|
||||
wx.showToast({ title: '请填写投诉说明', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ submitting: true })
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/gongdan/create/',
|
||||
method: 'POST',
|
||||
data: {
|
||||
leixing: this.data.leixing,
|
||||
shuoming: this.data.shuoming,
|
||||
order_id: this.data.order_id,
|
||||
chongzhi_id: this.data.chongzhi_id,
|
||||
fadan_id: this.data.fadan_id,
|
||||
guanshi_id: this.data.guanshi_id,
|
||||
images: this.data.images,
|
||||
},
|
||||
})
|
||||
const body = res.data || {}
|
||||
if (body.code === 200 || body.code === 0) {
|
||||
wx.showToast({ title: '提交成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({ url: '/pages/gongdan/list/list' })
|
||||
}, 500)
|
||||
} else {
|
||||
wx.showToast({ title: body.message || body.msg || '提交失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ submitting: false })
|
||||
}
|
||||
},
|
||||
})
|
||||
1
pages/gongdan/create/create.json
Normal file
1
pages/gongdan/create/create.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"我要投诉","usingComponents":{}}
|
||||
57
pages/gongdan/create/create.wxml
Normal file
57
pages/gongdan/create/create.wxml
Normal file
@@ -0,0 +1,57 @@
|
||||
<view class="page">
|
||||
<view class="cs-bar">
|
||||
<view class="cs-btn" bindtap="openMiniKefu">小程序客服</view>
|
||||
<view class="cs-btn cs-wx" bindtap="openWxKefu">微信客服</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="label">投诉类型</view>
|
||||
<view class="type-row">
|
||||
<view
|
||||
wx:for="{{types}}"
|
||||
wx:key="value"
|
||||
class="type-chip {{leixing==item.value?'on':''}}"
|
||||
data-v="{{item.value}}"
|
||||
bindtap="onPickType"
|
||||
>{{item.label}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section" wx:if="{{leixing==1}}">
|
||||
<view class="label">订单ID <text class="req">*</text></view>
|
||||
<input class="input" placeholder="请输入或粘贴订单ID" value="{{order_id}}" bindinput="onOrderId"/>
|
||||
</view>
|
||||
<view class="section" wx:if="{{leixing==2}}">
|
||||
<view class="label">充值记录ID <text class="req">*</text></view>
|
||||
<input class="input" placeholder="请输入充值记录ID" value="{{chongzhi_id}}" bindinput="onChongzhiId"/>
|
||||
<view class="link" bindtap="goChongzhiList">去充值记录复制 →</view>
|
||||
</view>
|
||||
<view class="section" wx:if="{{leixing==3}}">
|
||||
<view class="label">罚单ID <text class="req">*</text></view>
|
||||
<input class="input" placeholder="请输入罚单ID" value="{{fadan_id}}" bindinput="onFadanId"/>
|
||||
<view class="link" bindtap="goPenalty">去罚款页查看 →</view>
|
||||
</view>
|
||||
<view class="section" wx:if="{{leixing==4}}">
|
||||
<view class="label">管事ID(选填)</view>
|
||||
<input class="input" placeholder="被投诉管事UID,可不填" value="{{guanshi_id}}" bindinput="onGuanshiId"/>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="label">投诉说明 <text class="req">*</text></view>
|
||||
<textarea class="textarea" maxlength="500" placeholder="请详细描述问题" value="{{shuoming}}" bindinput="onShuoming"/>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="label">证据图片(最多{{maxImages}}张)</view>
|
||||
<view class="img-row">
|
||||
<view class="img-item" wx:for="{{images}}" wx:key="*this">
|
||||
<image src="{{item}}" mode="aspectFill" bindtap="preview" data-url="{{item}}"/>
|
||||
<view class="del" data-i="{{index}}" catchtap="delImg">×</view>
|
||||
</view>
|
||||
<view class="img-add" wx:if="{{images.length < maxImages}}" bindtap="chooseImg">+</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="submit" loading="{{submitting}}" bindtap="submit">提交投诉</button>
|
||||
<view class="foot-link" bindtap="goMyList">查看我的投诉记录</view>
|
||||
</view>
|
||||
20
pages/gongdan/create/create.wxss
Normal file
20
pages/gongdan/create/create.wxss
Normal file
@@ -0,0 +1,20 @@
|
||||
.page{padding:24rpx 28rpx 80rpx;background:#f5f6f8;min-height:100vh;box-sizing:border-box}
|
||||
.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-wx{background:#07c160;color:#fff;border-color:#07c160}
|
||||
.section{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx}
|
||||
.label{font-size:28rpx;color:#333;margin-bottom:16rpx;font-weight:500}
|
||||
.req{color:#e54}
|
||||
.type-row{display:flex;flex-wrap:wrap;gap:12rpx}
|
||||
.type-chip{padding:12rpx 22rpx;border-radius:999rpx;background:#f0f1f3;font-size:24rpx;color:#666}
|
||||
.type-chip.on{background:#1a1a1a;color:#fff}
|
||||
.input{height:72rpx;background:#f7f8fa;border-radius:10rpx;padding:0 20rpx;font-size:28rpx}
|
||||
.textarea{width:100%;min-height:180rpx;background:#f7f8fa;border-radius:10rpx;padding:16rpx 20rpx;font-size:28rpx;box-sizing:border-box}
|
||||
.link{margin-top:12rpx;font-size:24rpx;color:#2b6de5}
|
||||
.img-row{display:flex;flex-wrap:wrap;gap:16rpx}
|
||||
.img-item,.img-add{width:160rpx;height:160rpx;border-radius:12rpx;position:relative;overflow:hidden;background:#f0f1f3}
|
||||
.img-item image{width:100%;height:100%}
|
||||
.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}
|
||||
.submit{margin-top:32rpx;background:#1a1a1a;color:#fff;border-radius:12rpx;font-size:30rpx}
|
||||
.foot-link{text-align:center;margin-top:28rpx;color:#666;font-size:26rpx}
|
||||
63
pages/gongdan/detail/detail.js
Normal file
63
pages/gongdan/detail/detail.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '../../../utils/request.js'
|
||||
|
||||
Page({
|
||||
data: {
|
||||
detail: null,
|
||||
imageList: [],
|
||||
shengjiList: [],
|
||||
escShow: false,
|
||||
escText: '',
|
||||
escLoading: false,
|
||||
id: '',
|
||||
},
|
||||
onLoad(q) {
|
||||
this.setData({ id: q.id || '' })
|
||||
this.load()
|
||||
},
|
||||
async load() {
|
||||
const res = await request({ url: '/gongdan/detail/', method: 'POST', data: { gongdan_id: this.data.id } })
|
||||
const body = res.data || {}
|
||||
if (body.code === 200 || body.code === 0) {
|
||||
const d = body.data || {}
|
||||
this.setData({
|
||||
detail: d,
|
||||
imageList: Array.isArray(d.images) ? d.images : [],
|
||||
shengjiList: Array.isArray(d.shengji_list) ? d.shengji_list : [],
|
||||
})
|
||||
}
|
||||
},
|
||||
copy(e) {
|
||||
wx.setClipboardData({ data: String(e.currentTarget.dataset.t || '') })
|
||||
},
|
||||
preview(e) {
|
||||
const urls = (this.data.imageList || []).map(i => i.url).filter(Boolean)
|
||||
wx.previewImage({ current: e.currentTarget.dataset.url, urls })
|
||||
},
|
||||
async markBad() {
|
||||
const res = await request({ url: '/gongdan/dissatisfied/', method: 'POST', data: { gongdan_id: this.data.id } })
|
||||
if ((res.data || {}).code === 200) {
|
||||
wx.showToast({ title: '已标记', icon: 'success' })
|
||||
this.load()
|
||||
} else wx.showToast({ title: (res.data || {}).message || '失败', icon: 'none' })
|
||||
},
|
||||
showEsc() { this.setData({ escShow: true }) },
|
||||
onEsc(e) { this.setData({ escText: e.detail.value }) },
|
||||
async doEsc() {
|
||||
if (!this.data.escText.trim()) return wx.showToast({ title: '请填写补充说明', icon: 'none' })
|
||||
this.setData({ escLoading: true })
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/gongdan/escalate/',
|
||||
method: 'POST',
|
||||
data: { gongdan_id: this.data.id, shuoming: this.data.escText },
|
||||
})
|
||||
if ((res.data || {}).code === 200) {
|
||||
wx.showToast({ title: '已提交', icon: 'success' })
|
||||
this.setData({ escShow: false, escText: '' })
|
||||
this.load()
|
||||
} else wx.showToast({ title: (res.data || {}).message || '失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ escLoading: false })
|
||||
}
|
||||
},
|
||||
})
|
||||
1
pages/gongdan/detail/detail.json
Normal file
1
pages/gongdan/detail/detail.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"工单详情","usingComponents":{}}
|
||||
34
pages/gongdan/detail/detail.wxml
Normal file
34
pages/gongdan/detail/detail.wxml
Normal file
@@ -0,0 +1,34 @@
|
||||
<view class="page" wx:if="{{detail}}">
|
||||
<view class="card">
|
||||
<view class="row"><text>{{detail.leixing_label}}</text><text class="status">{{detail.zhuangtai_label}}</text></view>
|
||||
<view class="line" bindtap="copy" data-t="{{detail.gongdan_id}}">工单号:{{detail.gongdan_id}} 复制</view>
|
||||
<view class="line" wx:if="{{detail.order_id}}" bindtap="copy" data-t="{{detail.order_id}}">订单ID:{{detail.order_id}}</view>
|
||||
<view class="line" wx:if="{{detail.chongzhi_id}}" bindtap="copy" data-t="{{detail.chongzhi_id}}">充值ID:{{detail.chongzhi_id}}</view>
|
||||
<view class="line" wx:if="{{detail.fadan_id}}" bindtap="copy" data-t="{{detail.fadan_id}}">罚单ID:{{detail.fadan_id}}</view>
|
||||
<view class="block">{{detail.shuoming}}</view>
|
||||
<view class="imgs" wx:if="{{imageList.length}}">
|
||||
<image wx:for="{{imageList}}" wx:key="url" src="{{item.url}}" mode="aspectFill" bindtap="preview" data-url="{{item.url}}"/>
|
||||
</view>
|
||||
<view class="line" wx:if="{{detail.chuli_jieguo}}">处理结果:{{detail.chuli_jieguo}}</view>
|
||||
<view class="line" wx:if="{{detail.chuliren_name}}">处理人:{{detail.chuliren_name}}</view>
|
||||
</view>
|
||||
|
||||
<view class="card" wx:if="{{shengjiList.length}}">
|
||||
<view class="h">补充说明记录</view>
|
||||
<view wx:for="{{shengjiList}}" wx:key="cishu" class="sj">
|
||||
<text>第{{item.cishu}}次:{{item.shuoming}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="actions" wx:if="{{detail.zhuangtai == 2}}">
|
||||
<button bindtap="markBad">不满意</button>
|
||||
</view>
|
||||
<view class="actions" wx:if="{{detail.zhuangtai == 2 || detail.zhuangtai == 3}}">
|
||||
<button class="primary" bindtap="showEsc">继续投诉</button>
|
||||
</view>
|
||||
|
||||
<view class="esc" wx:if="{{escShow}}">
|
||||
<textarea placeholder="补充说明" value="{{escText}}" bindinput="onEsc"/>
|
||||
<button class="primary" loading="{{escLoading}}" bindtap="doEsc">提交补充</button>
|
||||
</view>
|
||||
</view>
|
||||
14
pages/gongdan/detail/detail.wxss
Normal file
14
pages/gongdan/detail/detail.wxss
Normal file
@@ -0,0 +1,14 @@
|
||||
.page{padding:24rpx;background:#f5f6f8;min-height:100vh}
|
||||
.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:20rpx}
|
||||
.row{display:flex;justify-content:space-between;font-size:30rpx;font-weight:600}
|
||||
.status{font-size:24rpx;font-weight:400;color:#856404}
|
||||
.line{font-size:24rpx;color:#666;margin-top:12rpx}
|
||||
.block{margin-top:16rpx;font-size:28rpx;color:#333;line-height:1.5}
|
||||
.imgs{display:flex;flex-wrap:wrap;gap:12rpx;margin-top:16rpx}
|
||||
.imgs image{width:160rpx;height:160rpx;border-radius:10rpx}
|
||||
.h{font-size:28rpx;font-weight:600;margin-bottom:12rpx}
|
||||
.sj{font-size:26rpx;color:#555;margin-bottom:8rpx}
|
||||
.actions{margin-top:12rpx}
|
||||
.primary{background:#1a1a1a;color:#fff}
|
||||
.esc{background:#fff;padding:24rpx;border-radius:16rpx;margin-top:20rpx}
|
||||
.esc textarea{width:100%;min-height:160rpx;background:#f7f8fa;padding:16rpx;box-sizing:border-box;margin-bottom:16rpx}
|
||||
26
pages/gongdan/list/list.js
Normal file
26
pages/gongdan/list/list.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '../../../utils/request.js'
|
||||
|
||||
Page({
|
||||
data: { list: [], loading: false, page: 1 },
|
||||
onShow() { this.load(true) },
|
||||
goCreate() { wx.navigateTo({ url: '/pages/gongdan/create/create' }) },
|
||||
goDetail(e) {
|
||||
wx.navigateTo({ url: `/pages/gongdan/detail/detail?id=${e.currentTarget.dataset.id}` })
|
||||
},
|
||||
async load(reset) {
|
||||
if (this.data.loading) return
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const page = reset ? 1 : this.data.page
|
||||
const res = await request({ url: '/gongdan/my-list/', method: 'POST', data: { page, page_size: 20 } })
|
||||
const body = res.data || {}
|
||||
if (body.code === 200 || body.code === 0) {
|
||||
const rows = (body.data && body.data.list) || []
|
||||
this.setData({ list: reset ? rows : this.data.list.concat(rows), page: page + 1 })
|
||||
}
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
onReachBottom() { this.load(false) },
|
||||
})
|
||||
1
pages/gongdan/list/list.json
Normal file
1
pages/gongdan/list/list.json
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"投诉记录","usingComponents":{}}
|
||||
13
pages/gongdan/list/list.wxml
Normal file
13
pages/gongdan/list/list.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<view class="page">
|
||||
<view class="top-btn" bindtap="goCreate">+ 我要投诉</view>
|
||||
<view wx:if="{{!list.length && !loading}}" class="empty">暂无投诉记录</view>
|
||||
<view class="card" wx:for="{{list}}" wx:key="gongdan_id" bindtap="goDetail" data-id="{{item.gongdan_id}}">
|
||||
<view class="row">
|
||||
<text class="title">{{item.leixing_label}}</text>
|
||||
<text class="status s{{item.zhuangtai}}">{{item.zhuangtai_label}}</text>
|
||||
</view>
|
||||
<view class="id">工单号 {{item.gongdan_id}}</view>
|
||||
<view class="desc">{{item.shuoming}}</view>
|
||||
<view class="time">{{item.CreateTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
13
pages/gongdan/list/list.wxss
Normal file
13
pages/gongdan/list/list.wxss
Normal file
@@ -0,0 +1,13 @@
|
||||
.page{padding:24rpx;background:#f5f6f8;min-height:100vh;box-sizing:border-box}
|
||||
.top-btn{background:#1a1a1a;color:#fff;text-align:center;padding:22rpx;border-radius:12rpx;margin-bottom:20rpx;font-size:28rpx}
|
||||
.empty{text-align:center;color:#999;padding:80rpx 0}
|
||||
.card{background:#fff;border-radius:16rpx;padding:24rpx;margin-bottom:16rpx}
|
||||
.row{display:flex;justify-content:space-between;align-items:center}
|
||||
.title{font-size:30rpx;font-weight:600;color:#222}
|
||||
.status{font-size:22rpx;padding:4rpx 12rpx;border-radius:8rpx;background:#eee}
|
||||
.s1{background:#fff3cd;color:#856404}
|
||||
.s2{background:#d4edda;color:#155724}
|
||||
.s3{background:#f8d7da;color:#721c24}
|
||||
.s4{background:#e2e3e5;color:#383d41}
|
||||
.id,.time{font-size:22rpx;color:#999;margin-top:8rpx}
|
||||
.desc{font-size:26rpx;color:#555;margin-top:12rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
Reference in New Issue
Block a user