修正了 pages 名为拼音的问题
This commit is contained in:
418
pages/merchant-dispatch/merchant-dispatch.js
Normal file
418
pages/merchant-dispatch/merchant-dispatch.js
Normal file
@@ -0,0 +1,418 @@
|
||||
// pages/merchant-dispatch/merchant-dispatch.js
|
||||
import request from '../../utils/request.js'
|
||||
import PopupService from '../../services/popupService.js' // 引入弹窗服务
|
||||
|
||||
Page({
|
||||
data: {
|
||||
// 商家余额 (从全局变量获取)
|
||||
sjyue: '0.00',
|
||||
|
||||
// 商品类型列表
|
||||
shangpinList: [],
|
||||
// 当前选中的商品类型信息
|
||||
selectedTypeId: null,
|
||||
selectedHuiyuanId: null,
|
||||
selectedYaoqiuleixing: null,
|
||||
// 当前商品类型下的称号列表(用于标签选择器)
|
||||
currentTypeChenghaoList: [],
|
||||
|
||||
// 表单字段
|
||||
dingdanJieshao: '', // 订单介绍
|
||||
dingdanBeizhu: '', // 订单备注
|
||||
laobanName: '', // 老板游戏昵称/UID
|
||||
zhidingUid: '', // 指定打手UID
|
||||
jiage: '', // 订单价格
|
||||
|
||||
// 新增字段:抢单标签(称号)
|
||||
selectedLabelId: '', // 选中的标签ID
|
||||
selectedLabelName: '', // 选中的标签名称
|
||||
|
||||
// 新增字段:佣金要求(压金)
|
||||
commissionEnabled: false, // 是否开启佣金要求
|
||||
commissionValue: '', // 佣金金额(元)
|
||||
|
||||
// 页面状态
|
||||
isLoading: false, // 加载商品类型中
|
||||
isSubmitting: false, // 提交派单中
|
||||
|
||||
// 教程按钮状态
|
||||
tutorialBtnHidden: false, // false=完全显示,true=缩进隐藏(只露边)
|
||||
|
||||
// 背景图URL(动态拼接)
|
||||
bgImageUrl: ''
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadBgImage() // 拼接背景图
|
||||
this.loadShangjiaYue() // 从全局变量获取商家余额
|
||||
this.loadShangpinTypes() // 加载商品类型
|
||||
this.startTutorialBtnTimer() // 启动按钮缩进定时器
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 每次显示页面时刷新余额(可能从其他页面充值后返回)
|
||||
this.loadShangjiaYue()
|
||||
// 重新拼接背景图(确保最新)
|
||||
this.loadBgImage()
|
||||
|
||||
// 注册通知组件(用于全局消息提示)
|
||||
this.registerNotificationComponent()
|
||||
|
||||
// 重置按钮缩进定时器(重新开始5秒倒计时)
|
||||
this.startTutorialBtnTimer()
|
||||
},
|
||||
|
||||
onHide() {
|
||||
// 页面隐藏时重置弹窗服务状态,避免影响其他页面
|
||||
PopupService.reset()
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
// 清除缩进定时器,避免内存泄漏
|
||||
if (this.tutorialTimer) {
|
||||
clearTimeout(this.tutorialTimer)
|
||||
}
|
||||
// 页面卸载时重置弹窗服务
|
||||
PopupService.reset()
|
||||
},
|
||||
|
||||
// ==================== 背景图动态拼接 ====================
|
||||
loadBgImage() {
|
||||
const app = getApp()
|
||||
const ossBase = app.globalData.ossImageUrl || 'https://your-oss-bucket.oss-cn-region.aliyuncs.com'
|
||||
// 拼接完整路径:beijing/shangjiapaidan/bg.jpg
|
||||
const bgUrl = ossBase.replace(/\/$/, '') + '/beijing/shangjiapaidan/bg.jpg'
|
||||
this.setData({ bgImageUrl: bgUrl })
|
||||
},
|
||||
|
||||
// ==================== 基础数据加载 ====================
|
||||
loadShangjiaYue() {
|
||||
const app = getApp()
|
||||
const shangjiaData = app.globalData.shangjia || {}
|
||||
this.setData({
|
||||
sjyue: shangjiaData.sjyue || '0.00'
|
||||
})
|
||||
},
|
||||
|
||||
// 加载商品类型(与极速派单完全一致)
|
||||
async loadShangpinTypes() {
|
||||
this.setData({ isLoading: true })
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/dingdan/sjspleixing',
|
||||
method: 'POST'
|
||||
})
|
||||
if (res && res.data.code === 200) {
|
||||
let list = res.data.data || []
|
||||
// 强制倒序排列(与极速派单保持一致)
|
||||
list.reverse()
|
||||
this.setData({
|
||||
shangpinList: list,
|
||||
isLoading: false
|
||||
})
|
||||
// 默认选中第一个
|
||||
if (list.length > 0) {
|
||||
this.setSelectedType(list[0])
|
||||
}
|
||||
} else {
|
||||
throw new Error(res.data.msg || '加载失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载商品类型失败:', error)
|
||||
this.setData({ isLoading: false })
|
||||
wx.showToast({
|
||||
title: '加载类型失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 设置选中的商品类型,并提取该类型下的称号列表
|
||||
setSelectedType(item) {
|
||||
this.setData({
|
||||
selectedTypeId: item.id,
|
||||
selectedHuiyuanId: item.huiyuan_id,
|
||||
selectedYaoqiuleixing: item.yaoqiuleixing,
|
||||
currentTypeChenghaoList: item.chenghaoList || [],
|
||||
// 切换商品类型时,清空之前选择的标签和佣金
|
||||
selectedLabelId: '',
|
||||
selectedLabelName: '',
|
||||
commissionEnabled: false,
|
||||
commissionValue: ''
|
||||
})
|
||||
},
|
||||
|
||||
// 注册全局通知组件(用于顶部提示)
|
||||
registerNotificationComponent() {
|
||||
const app = getApp()
|
||||
const notificationComp = this.selectComponent('#global-notification')
|
||||
if (notificationComp && notificationComp.showNotification) {
|
||||
app.globalData.globalNotification = {
|
||||
show: (data) => notificationComp.showNotification(data),
|
||||
hide: () => notificationComp.hideNotification()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// ==================== 教程按钮控制 ====================
|
||||
// 启动定时器:5秒后让按钮缩进
|
||||
startTutorialBtnTimer() {
|
||||
// 清除旧的定时器
|
||||
if (this.tutorialTimer) {
|
||||
clearTimeout(this.tutorialTimer)
|
||||
}
|
||||
// 5秒后将按钮缩进隐藏
|
||||
this.tutorialTimer = setTimeout(() => {
|
||||
this.setData({ tutorialBtnHidden: true })
|
||||
}, 5000)
|
||||
},
|
||||
|
||||
// 重置按钮状态(完全显示)并重新开始5秒倒计时
|
||||
resetTutorialBtn() {
|
||||
// 如果按钮当前是缩进状态,先恢复完全显示
|
||||
if (this.data.tutorialBtnHidden) {
|
||||
this.setData({ tutorialBtnHidden: false })
|
||||
}
|
||||
// 重新开始计时(清除旧定时器,新定时器5秒后缩进)
|
||||
if (this.tutorialTimer) {
|
||||
clearTimeout(this.tutorialTimer)
|
||||
}
|
||||
this.tutorialTimer = setTimeout(() => {
|
||||
this.setData({ tutorialBtnHidden: true })
|
||||
}, 5000)
|
||||
},
|
||||
|
||||
// 点击教程按钮:重置按钮状态,并调用 PopupService 弹出教程
|
||||
async onTutorialBtnTap() {
|
||||
// 首先重置按钮状态(完全显示并重新计时)
|
||||
this.resetTutorialBtn()
|
||||
// 调用弹窗服务,页面标识为 'sjpd1'
|
||||
PopupService.checkAndShow(this, 'sjpd1')
|
||||
},
|
||||
|
||||
// ==================== 表单输入事件 ====================
|
||||
onDingdanJieshaoInput(e) {
|
||||
this.setData({ dingdanJieshao: e.detail.value })
|
||||
},
|
||||
onDingdanBeizhuInput(e) {
|
||||
this.setData({ dingdanBeizhu: e.detail.value })
|
||||
},
|
||||
onLaobanNameInput(e) {
|
||||
this.setData({ laobanName: e.detail.value })
|
||||
},
|
||||
onZhidingUidInput(e) {
|
||||
this.setData({ zhidingUid: e.detail.value })
|
||||
},
|
||||
onJiageInput(e) {
|
||||
let value = e.detail.value
|
||||
// 前端验证:确保是数字且最多两位小数
|
||||
if (value === '' || /^\d+(\.\d{0,2})?$/.test(value)) {
|
||||
this.setData({ jiage: value })
|
||||
}
|
||||
},
|
||||
|
||||
// 标签选择器(picker事件)
|
||||
onLabelChange(e) {
|
||||
const idx = e.detail.value
|
||||
const label = this.data.currentTypeChenghaoList[idx]
|
||||
if (label) {
|
||||
this.setData({
|
||||
selectedLabelId: label.id,
|
||||
selectedLabelName: label.mingcheng
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
selectedLabelId: '',
|
||||
selectedLabelName: ''
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 佣金开关
|
||||
onCommissionToggle() {
|
||||
this.setData({ commissionEnabled: !this.data.commissionEnabled })
|
||||
},
|
||||
onCommissionValueInput(e) {
|
||||
let value = e.detail.value
|
||||
if (value === '' || /^\d+(\.\d{0,2})?$/.test(value)) {
|
||||
this.setData({ commissionValue: value })
|
||||
}
|
||||
},
|
||||
|
||||
// ==================== 表单验证与提交 ====================
|
||||
validateForm() {
|
||||
const {
|
||||
selectedTypeId,
|
||||
dingdanJieshao,
|
||||
laobanName,
|
||||
jiage,
|
||||
sjyue,
|
||||
commissionEnabled,
|
||||
commissionValue
|
||||
} = this.data
|
||||
|
||||
// 1. 验证必填项
|
||||
if (!selectedTypeId) {
|
||||
wx.showToast({ title: '请选择订单类型', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (!dingdanJieshao.trim()) {
|
||||
wx.showToast({ title: '请输入订单介绍', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (!laobanName.trim()) {
|
||||
wx.showToast({ title: '请输入老板游戏昵称', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (!jiage) {
|
||||
wx.showToast({ title: '请输入订单价格', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
|
||||
// 2. 验证价格格式和范围
|
||||
const price = parseFloat(jiage)
|
||||
if (isNaN(price) || price < 0.1 || price > 10000) {
|
||||
wx.showToast({ title: '价格需在0.1-10000元之间', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (jiage.includes('.') && jiage.split('.')[1].length > 2) {
|
||||
wx.showToast({ title: '最多支持两位小数', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
|
||||
// 3. 验证佣金要求(若开启)
|
||||
if (commissionEnabled) {
|
||||
const commission = parseFloat(commissionValue)
|
||||
if (isNaN(commission) || commission <= 0) {
|
||||
wx.showToast({ title: '请输入有效的佣金金额', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (commission > 50000) {
|
||||
wx.showToast({ title: '佣金建议不超过50000元', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 验证余额是否足够
|
||||
const balance = parseFloat(sjyue)
|
||||
if (price > balance) {
|
||||
wx.showModal({
|
||||
title: '余额不足',
|
||||
content: `当前余额${sjyue}元,需要${jiage}元。请先充值。`,
|
||||
confirmText: '去充值',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/merchant-recharge/merchant-recharge'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
// 重置表单(保留商品类型选中状态)
|
||||
resetForm() {
|
||||
this.setData({
|
||||
dingdanJieshao: '',
|
||||
dingdanBeizhu: '',
|
||||
laobanName: '',
|
||||
zhidingUid: '',
|
||||
jiage: '',
|
||||
selectedLabelId: '',
|
||||
selectedLabelName: '',
|
||||
commissionEnabled: false,
|
||||
commissionValue: ''
|
||||
})
|
||||
// 重置选中第一个商品类型(可选)
|
||||
if (this.data.shangpinList.length > 0) {
|
||||
this.setSelectedType(this.data.shangpinList[0])
|
||||
}
|
||||
},
|
||||
|
||||
// 提交派单
|
||||
async onSubmit() {
|
||||
if (this.data.isSubmitting) return
|
||||
if (!this.validateForm()) return
|
||||
|
||||
this.setData({ isSubmitting: true })
|
||||
|
||||
// 准备提交数据(原有字段 + 新增字段)
|
||||
const postData = {
|
||||
// 原有必传字段
|
||||
shangpinTypeId: this.data.selectedTypeId,
|
||||
huiyuanId: this.data.selectedHuiyuanId,
|
||||
yaoqiuleixing: this.data.selectedYaoqiuleixing,
|
||||
dingdanJieshao: this.data.dingdanJieshao.trim(),
|
||||
dingdanBeizhu: this.data.dingdanBeizhu.trim() || '',
|
||||
laobanName: this.data.laobanName.trim(),
|
||||
zhidingUid: this.data.zhidingUid.trim() || '',
|
||||
jiage: this.data.jiage,
|
||||
// 新增字段
|
||||
labelId: this.data.selectedLabelId || '',
|
||||
labelName: this.data.selectedLabelName || '',
|
||||
commissionEnabled: this.data.commissionEnabled,
|
||||
commissionValue: this.data.commissionEnabled ? this.data.commissionValue : ''
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/dingdan/sjpaifa',
|
||||
method: 'POST',
|
||||
data: postData
|
||||
})
|
||||
|
||||
if (res && res.data.code === 200) {
|
||||
// 派单成功
|
||||
wx.showToast({
|
||||
title: '派单成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
|
||||
// 更新全局变量中的商家信息(余额、发单量、流水)
|
||||
const orderAmount = parseFloat(this.data.jiage)
|
||||
const app = getApp()
|
||||
if (app.globalData.shangjia) {
|
||||
const newBalance = parseFloat(app.globalData.shangjia.sjyue || '0') - orderAmount
|
||||
app.globalData.shangjia.sjyue = newBalance.toFixed(2)
|
||||
app.globalData.shangjia.fadanzong = (parseInt(app.globalData.shangjia.fadanzong || '0') + 1).toString()
|
||||
app.globalData.shangjia.riliushui = (parseFloat(app.globalData.shangjia.riliushui || '0') + orderAmount).toFixed(2)
|
||||
app.globalData.shangjia.yueliushui = (parseFloat(app.globalData.shangjia.yueliushui || '0') + orderAmount).toFixed(2)
|
||||
this.setData({ sjyue: app.globalData.shangjia.sjyue })
|
||||
}
|
||||
|
||||
// 延迟重置表单,避免用户连续提交
|
||||
setTimeout(() => {
|
||||
this.resetForm()
|
||||
this.setData({ isSubmitting: false })
|
||||
}, 1500)
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '派单失败',
|
||||
content: res.data.msg || '请稍后重试',
|
||||
showCancel: false
|
||||
})
|
||||
this.setData({ isSubmitting: false })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('派单请求失败:', error)
|
||||
wx.showModal({
|
||||
title: '请求失败',
|
||||
content: error.message || '网络错误,请检查连接',
|
||||
showCancel: false
|
||||
})
|
||||
this.setData({ isSubmitting: false })
|
||||
}
|
||||
},
|
||||
|
||||
// ==================== 商品类型选择 ====================
|
||||
onSelectType(e) {
|
||||
const { id, item } = e.currentTarget.dataset
|
||||
this.setSelectedType(item)
|
||||
}
|
||||
})
|
||||
12
pages/merchant-dispatch/merchant-dispatch.json
Normal file
12
pages/merchant-dispatch/merchant-dispatch.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"global-notification": "/components/global-notification/global-notification",
|
||||
"popup-notice": "/components/popup-notice/popup-notice"
|
||||
},
|
||||
"backgroundTextStyle": "dark",
|
||||
"navigationBarBackgroundColor": "#0a0a0f",
|
||||
"navigationBarTitleText": "商家派单",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#0a0a0f",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
159
pages/merchant-dispatch/merchant-dispatch.wxml
Normal file
159
pages/merchant-dispatch/merchant-dispatch.wxml
Normal file
@@ -0,0 +1,159 @@
|
||||
<!-- pages/merchant-dispatch/merchant-dispatch.wxml -->
|
||||
<view class="page-container" style="background-image: url('{{bgImageUrl}}');">
|
||||
<!-- 顶部商家余额展示 (黑金卡片) -->
|
||||
<view class="balance-card">
|
||||
<text class="balance-label">可用余额</text>
|
||||
<view class="balance-amount">
|
||||
<text class="amount-value">{{sjyue}}</text>
|
||||
<text class="amount-unit">元</text>
|
||||
</view>
|
||||
<text class="balance-tip">派单将从此余额扣除</text>
|
||||
</view>
|
||||
|
||||
<!-- 商品类型选择 (横向滑动) -->
|
||||
<view class="section">
|
||||
<text class="section-title">选择订单类型</text>
|
||||
<scroll-view class="type-scroll" scroll-x="true" enable-flex>
|
||||
<block wx:for="{{shangpinList}}" wx:key="id">
|
||||
<view
|
||||
class="type-item {{selectedTypeId === item.id ? 'type-active' : ''}}"
|
||||
data-id="{{item.id}}"
|
||||
data-item="{{item}}"
|
||||
bindtap="onSelectType"
|
||||
>
|
||||
<text class="type-text">{{item.jieshao}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<view class="form-container">
|
||||
<!-- 订单介绍 -->
|
||||
<view class="form-item">
|
||||
<text class="form-label required">订单介绍</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入订单主要内容(必填,最多50字)"
|
||||
maxlength="50"
|
||||
value="{{dingdanJieshao}}"
|
||||
bindinput="onDingdanJieshaoInput"
|
||||
/>
|
||||
<text class="word-count">{{dingdanJieshao.length}}/50</text>
|
||||
</view>
|
||||
|
||||
<!-- 订单备注 -->
|
||||
<view class="form-item">
|
||||
<text class="form-label">订单备注(选填)</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="填写或补充其他信息"
|
||||
maxlength="50"
|
||||
value="{{dingdanBeizhu}}"
|
||||
bindinput="onDingdanBeizhuInput"
|
||||
/>
|
||||
<text class="word-count">{{dingdanBeizhu.length}}/50</text>
|
||||
</view>
|
||||
|
||||
<!-- 老板游戏昵称/UID -->
|
||||
<view class="form-item">
|
||||
<text class="form-label required">老板昵称/ID</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入(必填,最多15字)"
|
||||
maxlength="15"
|
||||
value="{{laobanName}}"
|
||||
bindinput="onLaobanNameInput"
|
||||
/>
|
||||
<text class="word-count">{{laobanName.length}}/15</text>
|
||||
</view>
|
||||
|
||||
<!-- 指定打手UID -->
|
||||
<view class="form-item">
|
||||
<text class="form-label">指定UID(选填)</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入指定UID"
|
||||
maxlength="10"
|
||||
value="{{zhidingUid}}"
|
||||
bindinput="onZhidingUidInput"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 订单价格 -->
|
||||
<view class="form-item">
|
||||
<text class="form-label required">订单价格(元)</text>
|
||||
<input
|
||||
class="form-input"
|
||||
type="digit"
|
||||
placeholder="0.1 - 10000,支持两位小数"
|
||||
value="{{jiage}}"
|
||||
bindinput="onJiageInput"
|
||||
/>
|
||||
<text class="price-tip">范围:0.1 - 10000元</text>
|
||||
</view>
|
||||
|
||||
<!-- 新增:抢单要求标签(从商品类型的称号列表选择) -->
|
||||
<view class="form-item" wx:if="{{currentTypeChenghaoList.length > 0}}">
|
||||
<text class="form-label">要求打手标签*如金牌打手(选填)</text>
|
||||
<picker
|
||||
mode="selector"
|
||||
range="{{currentTypeChenghaoList}}"
|
||||
range-key="mingcheng"
|
||||
bindchange="onLabelChange"
|
||||
>
|
||||
<view class="picker-view">
|
||||
<text>{{selectedLabelName || '无'}}</text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 新增:佣金要求(压金) -->
|
||||
<view class="form-item commission-item">
|
||||
<text class="form-label">要求打手押金(建议≤50元)</text>
|
||||
<switch checked="{{commissionEnabled}}" bindchange="onCommissionToggle"/>
|
||||
<input
|
||||
wx:if="{{commissionEnabled}}"
|
||||
class="commission-input"
|
||||
type="digit"
|
||||
placeholder="押金金额"
|
||||
value="{{commissionValue}}"
|
||||
bindinput="onCommissionValueInput"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 立即派发按钮 -->
|
||||
<view class="btn-container">
|
||||
<view
|
||||
class="submit-btn {{isSubmitting ? 'btn-disabled' : ''}}"
|
||||
bindtap="onSubmit"
|
||||
hover-class="btn-hover"
|
||||
>
|
||||
<text class="btn-text">{{isSubmitting ? '派发中...' : '立即派发'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加载遮罩 -->
|
||||
<view class="loading-mask" wx:if="{{isLoading}}">
|
||||
<view class="loading-content">
|
||||
<view class="loading-spinner"></view>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 全局通知组件 -->
|
||||
<global-notification id="global-notification" />
|
||||
|
||||
<!-- 教程按钮(紧贴右侧,5秒后缩进) -->
|
||||
<view
|
||||
class="tutorial-btn {{tutorialBtnHidden ? 'tutorial-btn-hidden' : ''}}"
|
||||
bindtap="onTutorialBtnTap"
|
||||
hover-class="tutorial-btn-hover"
|
||||
>
|
||||
<text class="tutorial-btn-text">教程</text>
|
||||
</view>
|
||||
|
||||
<!-- 使用教程弹窗组件 -->
|
||||
<popup-notice id="popupNotice" />
|
||||
</view>
|
||||
374
pages/merchant-dispatch/merchant-dispatch.wxss
Normal file
374
pages/merchant-dispatch/merchant-dispatch.wxss
Normal file
@@ -0,0 +1,374 @@
|
||||
/* pages/merchant-dispatch/merchant-dispatch.wxss - 黑金升级版 + 背景图由js动态拼接 */
|
||||
page {
|
||||
background-color: #0a0a0f;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
/* 背景图通过内联 style 动态设置,此处不再写死 */
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-attachment: fixed;
|
||||
position: relative;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
|
||||
/* 半透明遮罩增强文字可读性 - 不使用通配符 */
|
||||
.page-container::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(10, 10, 15, 0.75);
|
||||
backdrop-filter: blur(6rpx);
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* 所有直接子元素手动提升层级(替代 * 选择器) */
|
||||
.balance-card,
|
||||
.section,
|
||||
.form-container,
|
||||
.btn-container,
|
||||
.loading-mask {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 余额卡片 - 黑金风格 */
|
||||
.balance-card {
|
||||
background: linear-gradient(135deg, rgba(20,20,30,0.95), rgba(30,30,50,0.95));
|
||||
border-radius: 24rpx;
|
||||
padding: 36rpx;
|
||||
margin-bottom: 40rpx;
|
||||
color: #fff;
|
||||
box-shadow: 0 15rpx 35rpx rgba(0,0,0,0.4), 0 0 40rpx rgba(0,180,255,0.15);
|
||||
text-align: center;
|
||||
border: 1.5rpx solid rgba(0,180,255,0.2);
|
||||
backdrop-filter: blur(10rpx);
|
||||
overflow: hidden;
|
||||
}
|
||||
.balance-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -50%; left: -50%;
|
||||
width: 200%; height: 200%;
|
||||
background: linear-gradient(45deg, transparent 30%, rgba(0,180,255,0.1) 50%, transparent 70%);
|
||||
animation: cardShine 6s infinite linear;
|
||||
z-index: 1;
|
||||
}
|
||||
@keyframes cardShine {
|
||||
0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
|
||||
100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
|
||||
}
|
||||
.balance-label {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255,255,255,0.8);
|
||||
margin-bottom: 18rpx;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.balance-amount {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
margin-bottom: 15rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.amount-value {
|
||||
font-size: 64rpx;
|
||||
font-weight: bold;
|
||||
color: #FFD700;
|
||||
text-shadow: 0 0 20rpx rgba(255,215,0,0.7);
|
||||
animation: amountGlow 3s infinite alternate;
|
||||
}
|
||||
@keyframes amountGlow {
|
||||
0% { color: #FFD700; text-shadow: 0 0 15rpx rgba(255,215,0,0.6); }
|
||||
100% { color: #FFE44D; text-shadow: 0 0 25rpx rgba(255,215,0,0.9); }
|
||||
}
|
||||
.amount-unit {
|
||||
font-size: 36rpx;
|
||||
color: #FFD700;
|
||||
margin-left: 12rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.balance-tip {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.6);
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/* 区域标题 */
|
||||
.section {
|
||||
margin-bottom: 35rpx;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 25rpx;
|
||||
padding-left: 12rpx;
|
||||
border-left: 6rpx solid #9C27B0;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* 商品类型横向滚动 */
|
||||
.type-scroll {
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
height: 90rpx;
|
||||
}
|
||||
.type-item {
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 85rpx;
|
||||
padding: 0 40rpx;
|
||||
margin-right: 20rpx;
|
||||
background: rgba(255,255,255,0.08);
|
||||
border-radius: 45rpx;
|
||||
border: 2rpx solid rgba(255,255,255,0.15);
|
||||
font-size: 28rpx;
|
||||
color: rgba(255,255,255,0.8);
|
||||
transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
|
||||
backdrop-filter: blur(10rpx);
|
||||
}
|
||||
.type-active {
|
||||
background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
|
||||
border-color: #9C27B0;
|
||||
color: white;
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 10rpx 25rpx rgba(156,39,176,0.4);
|
||||
}
|
||||
.type-text {
|
||||
max-width: 220rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 表单容器 - 玻璃态 */
|
||||
.form-container {
|
||||
background: rgba(30,30,45,0.85);
|
||||
backdrop-filter: blur(20rpx);
|
||||
border-radius: 30rpx;
|
||||
padding: 30rpx;
|
||||
box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.3);
|
||||
border: 1.5rpx solid rgba(255,255,255,0.1);
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 35rpx;
|
||||
position: relative;
|
||||
}
|
||||
.form-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-label {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: rgba(255,255,255,0.9);
|
||||
display: block;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.form-label.required::after {
|
||||
content: '*';
|
||||
color: #ff4444;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
.form-input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background: rgba(255,255,255,0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 0 25rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
border: 2rpx solid rgba(255,255,255,0.2);
|
||||
box-sizing: border-box;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.form-input:focus {
|
||||
border-color: #9C27B0;
|
||||
background: rgba(255,255,255,0.15);
|
||||
}
|
||||
.word-count {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.5);
|
||||
}
|
||||
.price-tip {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,255,255,0.5);
|
||||
margin-top: 10rpx;
|
||||
display: block;
|
||||
}
|
||||
.picker-view {
|
||||
background: rgba(255,255,255,0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 25rpx;
|
||||
border: 2rpx solid rgba(255,255,255,0.2);
|
||||
color: rgba(255,255,255,0.9);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.commission-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.commission-item .form-label {
|
||||
width: 100%;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.commission-input {
|
||||
flex: 1;
|
||||
background: rgba(255,255,255,0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
color: #fff;
|
||||
border: 2rpx solid rgba(255,255,255,0.2);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 提交按钮区域 */
|
||||
.btn-container {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(to top, rgba(10,10,15,0.95), transparent);
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
z-index: 9999;
|
||||
}
|
||||
.submit-btn {
|
||||
background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
|
||||
border-radius: 50rpx;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 10rpx 30rpx rgba(255,68,68,0.3);
|
||||
transition: all 0.3s;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit-btn::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
|
||||
animation: shine 2s infinite;
|
||||
}
|
||||
.btn-hover {
|
||||
transform: translateY(-2rpx);
|
||||
box-shadow: 0 15rpx 40rpx rgba(255,68,68,0.4);
|
||||
}
|
||||
.btn-disabled {
|
||||
opacity: 0.6;
|
||||
filter: grayscale(0.3);
|
||||
pointer-events: none;
|
||||
}
|
||||
.btn-text {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
letter-spacing: 4rpx;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
@keyframes shine {
|
||||
0% { left: -100%; }
|
||||
100% { left: 100%; }
|
||||
}
|
||||
|
||||
/* 加载遮罩 */
|
||||
.loading-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0,0,0,0.8);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10000;
|
||||
}
|
||||
.loading-content {
|
||||
background: rgba(40,40,60,0.95);
|
||||
padding: 60rpx 80rpx;
|
||||
border-radius: 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-shadow: 0 25rpx 70rpx rgba(0,0,0,0.6);
|
||||
}
|
||||
.loading-spinner {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border: 8rpx solid rgba(0,180,255,0.2);
|
||||
border-top: 8rpx solid #00B4FF;
|
||||
border-radius: 50%;
|
||||
animation: spin 1.2s linear infinite;
|
||||
margin-bottom: 35rpx;
|
||||
}
|
||||
.loading-text {
|
||||
font-size: 30rpx;
|
||||
color: #00B4FF;
|
||||
font-weight: 600;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* ========== 教程按钮样式(修改后:右上角,更大更显眼) ========== */
|
||||
.tutorial-btn {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 20%; /* 右上区域,不再是垂直居中 */
|
||||
transform: translateY(-50%);
|
||||
width: 120rpx; /* 增大宽度 */
|
||||
height: 120rpx; /* 增大高度 */
|
||||
background: rgba(0, 0, 0, 0.75);
|
||||
backdrop-filter: blur(15rpx);
|
||||
border-radius: 60rpx 0 0 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10001;
|
||||
box-shadow: -8rpx 0 20rpx rgba(0,0,0,0.3);
|
||||
transition: right 0.3s ease-out;
|
||||
border: 2rpx solid rgba(255,215,0,0.5);
|
||||
border-right: none;
|
||||
}
|
||||
.tutorial-btn-text {
|
||||
color: #FFD700;
|
||||
font-size: 36rpx; /* 文字更大 */
|
||||
font-weight: bold;
|
||||
writing-mode: vertical-rl;
|
||||
letter-spacing: 6rpx;
|
||||
}
|
||||
.tutorial-btn-hidden {
|
||||
right: -80rpx; /* 缩进后只露出约40rpx边缘 */
|
||||
}
|
||||
.tutorial-btn-hover {
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
transform: translateY(-50%) scale(1.05);
|
||||
}
|
||||
Reference in New Issue
Block a user