调整页面错乱问题

This commit is contained in:
cst61
2026-02-01 16:45:15 +08:00
parent eef85dce4a
commit 30b1c8f9ba
14 changed files with 1063 additions and 548 deletions

View File

@@ -1,446 +0,0 @@
"use strict";
const common_vendor = require("./vendor.js");
class BluetoothRecorder {
constructor() {
this.adapterState = false;
this.isScanning = false;
this.connectedDeviceId = null;
this.deviceList = [];
this.services = [];
this.characteristics = [];
this.notifyCharacteristicId = null;
this.writeCharacteristicId = null;
this.audioBuffer = [];
this.isReceiving = false;
this.onDeviceFound = null;
this.onDeviceConnected = null;
this.onDeviceDisconnected = null;
this.onAudioDataReceived = null;
this.onError = null;
}
/**
* 初始化蓝牙适配器
*/
async initBluetoothAdapter() {
return new Promise((resolve, reject) => {
common_vendor.index.openBluetoothAdapter({
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:36", "蓝牙适配器初始化成功", res);
this.adapterState = true;
this._listenAdapterState();
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:42", "蓝牙适配器初始化失败", err);
this.adapterState = false;
this._handleError("蓝牙适配器初始化失败", err);
reject(err);
}
});
});
}
/**
* 监听蓝牙适配器状态变化
*/
_listenAdapterState() {
common_vendor.index.onBluetoothAdapterStateChange((res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:56", "蓝牙适配器状态变化", res);
this.adapterState = res.available;
if (!res.available) {
this.connectedDeviceId = null;
this._handleError("蓝牙适配器不可用", res);
}
});
}
/**
* 开始搜索蓝牙设备
* @param {Object} options - 搜索选项
* @param {Array} options.services - 服务UUID列表可选
* @param {number} options.interval - 上报间隔(毫秒)
* @param {boolean} options.allowDuplicatesKey - 是否允许重复上报
*/
async startScan(options = {}) {
if (this.isScanning) {
common_vendor.index.__f__("warn", "at common/bluetooth.js:74", "已经在扫描中");
return;
}
if (!this.adapterState) {
await this.initBluetoothAdapter();
}
return new Promise((resolve, reject) => {
common_vendor.index.onBluetoothDeviceFound((res) => {
const devices = res.devices || [];
devices.forEach((device) => {
const exists = this.deviceList.find((d) => d.deviceId === device.deviceId);
if (!exists) {
this.deviceList.push({
deviceId: device.deviceId,
name: device.name || "未知设备",
RSSI: device.RSSI,
advertisData: device.advertisData,
advertisServiceUUIDs: device.advertisServiceUUIDs,
localName: device.localName
});
if (this.onDeviceFound) {
this.onDeviceFound(device);
}
}
});
});
common_vendor.index.startBluetoothDevicesDiscovery({
services: options.services || [],
allowDuplicatesKey: options.allowDuplicatesKey || false,
interval: options.interval || 0,
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:113", "开始搜索蓝牙设备", res);
this.isScanning = true;
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:118", "搜索蓝牙设备失败", err);
this.isScanning = false;
this._handleError("搜索蓝牙设备失败", err);
reject(err);
}
});
});
}
/**
* 停止搜索蓝牙设备
*/
async stopScan() {
if (!this.isScanning) {
return;
}
return new Promise((resolve, reject) => {
common_vendor.index.stopBluetoothDevicesDiscovery({
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:138", "停止搜索蓝牙设备", res);
this.isScanning = false;
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:143", "停止搜索失败", err);
this._handleError("停止搜索失败", err);
reject(err);
}
});
});
}
/**
* 连接蓝牙设备
* @param {string} deviceId - 设备ID
*/
async connectDevice(deviceId) {
if (this.connectedDeviceId === deviceId) {
common_vendor.index.__f__("warn", "at common/bluetooth.js:157", "设备已连接");
return;
}
return new Promise((resolve, reject) => {
common_vendor.index.createBLEConnection({
deviceId,
success: async (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:165", "蓝牙设备连接成功", res);
this.connectedDeviceId = deviceId;
this._listenConnectionState(deviceId);
try {
await this.getServices(deviceId);
if (this.onDeviceConnected) {
this.onDeviceConnected(deviceId);
}
resolve(res);
} catch (err) {
reject(err);
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:186", "蓝牙设备连接失败", err);
this._handleError("蓝牙设备连接失败", err);
reject(err);
}
});
});
}
/**
* 监听连接状态
*/
_listenConnectionState(deviceId) {
common_vendor.index.onBLEConnectionStateChange((res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:199", "蓝牙连接状态变化", res);
if (res.deviceId === deviceId) {
if (!res.connected) {
this.connectedDeviceId = null;
this.isReceiving = false;
if (this.onDeviceDisconnected) {
this.onDeviceDisconnected(deviceId);
}
}
}
});
}
/**
* 断开蓝牙设备连接
*/
async disconnectDevice() {
if (!this.connectedDeviceId) {
return;
}
return new Promise((resolve, reject) => {
common_vendor.index.closeBLEConnection({
deviceId: this.connectedDeviceId,
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:225", "蓝牙设备断开成功", res);
this.connectedDeviceId = null;
this.isReceiving = false;
this.audioBuffer = [];
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:232", "蓝牙设备断开失败", err);
this._handleError("蓝牙设备断开失败", err);
reject(err);
}
});
});
}
/**
* 获取蓝牙设备服务列表
* @param {string} deviceId - 设备ID
*/
async getServices(deviceId) {
return new Promise((resolve, reject) => {
common_vendor.index.getBLEDeviceServices({
deviceId,
success: async (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:249", "获取服务列表成功", res);
this.services = res.services || [];
for (const service of this.services) {
try {
await this.getCharacteristics(deviceId, service.uuid);
} catch (err) {
common_vendor.index.__f__("warn", "at common/bluetooth.js:257", "获取特征值失败", service.uuid, err);
}
}
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:264", "获取服务列表失败", err);
this._handleError("获取服务列表失败", err);
reject(err);
}
});
});
}
/**
* 获取特征值列表
* @param {string} deviceId - 设备ID
* @param {string} serviceId - 服务UUID
*/
async getCharacteristics(deviceId, serviceId) {
return new Promise((resolve, reject) => {
common_vendor.index.getBLEDeviceCharacteristics({
deviceId,
serviceId,
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:283", "获取特征值成功", serviceId, res);
const chars = res.characteristics || [];
this.characteristics.push(...chars);
chars.forEach((char) => {
if (char.properties.notify || char.properties.indicate) {
if (!this.notifyCharacteristicId) {
this.notifyCharacteristicId = {
deviceId,
serviceId,
characteristicId: char.uuid
};
this.enableNotify(deviceId, serviceId, char.uuid);
}
}
if (char.properties.write || char.properties.writeNoResponse) {
if (!this.writeCharacteristicId) {
this.writeCharacteristicId = {
deviceId,
serviceId,
characteristicId: char.uuid
};
}
}
});
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:317", "获取特征值失败", err);
reject(err);
}
});
});
}
/**
* 启用特征值通知(用于接收音频数据)
* @param {string} deviceId - 设备ID
* @param {string} serviceId - 服务UUID
* @param {string} characteristicId - 特征值UUID
*/
async enableNotify(deviceId, serviceId, characteristicId) {
return new Promise((resolve, reject) => {
common_vendor.index.notifyBLECharacteristicValueChange({
deviceId,
serviceId,
characteristicId,
state: true,
// 启用通知
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:338", "启用通知成功", res);
common_vendor.index.onBLECharacteristicValueChange((res2) => {
this._handleAudioData(res2.value);
});
this.isReceiving = true;
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:349", "启用通知失败", err);
this._handleError("启用通知失败", err);
reject(err);
}
});
});
}
/**
* 处理接收到的音频数据
* @param {ArrayBuffer} data - 音频数据
*/
_handleAudioData(data) {
const base64 = common_vendor.index.arrayBufferToBase64(data);
this.audioBuffer.push({
data: base64,
timestamp: Date.now()
});
if (this.onAudioDataReceived) {
this.onAudioDataReceived({
data: base64,
arrayBuffer: data,
timestamp: Date.now()
});
}
}
/**
* 读取特征值
* @param {string} deviceId - 设备ID
* @param {string} serviceId - 服务UUID
* @param {string} characteristicId - 特征值UUID
*/
async readCharacteristic(deviceId, serviceId, characteristicId) {
return new Promise((resolve, reject) => {
common_vendor.index.readBLECharacteristicValue({
deviceId,
serviceId,
characteristicId,
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:394", "读取特征值成功", res);
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:398", "读取特征值失败", err);
this._handleError("读取特征值失败", err);
reject(err);
}
});
});
}
/**
* 写入特征值(发送命令到设备)
* @param {ArrayBuffer} value - 要写入的数据
*/
async writeCharacteristic(value) {
if (!this.writeCharacteristicId) {
throw new Error("未找到可写入的特征值");
}
const { deviceId, serviceId, characteristicId } = this.writeCharacteristicId;
return new Promise((resolve, reject) => {
common_vendor.index.writeBLECharacteristicValue({
deviceId,
serviceId,
characteristicId,
value,
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:424", "写入特征值成功", res);
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:428", "写入特征值失败", err);
this._handleError("写入特征值失败", err);
reject(err);
}
});
});
}
/**
* 获取已缓存的音频数据
*/
getAudioBuffer() {
return this.audioBuffer;
}
/**
* 清空音频缓冲区
*/
clearAudioBuffer() {
this.audioBuffer = [];
}
/**
* 合并音频数据为完整文件Base64格式
*/
mergeAudioData() {
return this.audioBuffer.map((item) => item.data).join("");
}
/**
* 处理错误
*/
_handleError(message, error) {
common_vendor.index.__f__("error", "at common/bluetooth.js:461", `[BluetoothRecorder] ${message}`, error);
if (this.onError) {
this.onError({
message,
error
});
}
}
/**
* 关闭蓝牙适配器
*/
async closeBluetoothAdapter() {
if (this.connectedDeviceId) {
await this.disconnectDevice();
}
if (this.isScanning) {
await this.stopScan();
}
return new Promise((resolve, reject) => {
common_vendor.index.closeBluetoothAdapter({
success: (res) => {
common_vendor.index.__f__("log", "at common/bluetooth.js:487", "关闭蓝牙适配器成功", res);
this.adapterState = false;
resolve(res);
},
fail: (err) => {
common_vendor.index.__f__("error", "at common/bluetooth.js:492", "关闭蓝牙适配器失败", err);
reject(err);
}
});
});
}
/**
* 获取设备列表
*/
getDeviceList() {
return this.deviceList;
}
/**
* 清空设备列表
*/
clearDeviceList() {
this.deviceList = [];
}
}
const bluetoothRecorder = new BluetoothRecorder();
exports.bluetoothRecorder = bluetoothRecorder;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/bluetooth.js.map

View File

@@ -7373,7 +7373,7 @@ function isConsoleWritable() {
function initRuntimeSocketService() {
const hosts = "192.168.1.48,127.0.0.1";
const port = "8090";
const id = "mp-weixin_aEAubR";
const id = "mp-weixin_Bom_c8";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();
@@ -8644,7 +8644,7 @@ class S {
function T(e2) {
return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
}
const b = true, E = "mp-weixin", A = T(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), P = E, C = T('{"address":["127.0.0.1","192.168.1.48"],"servePort":7000,"debugPort":9001,"initialLaunchType":"local","skipFiles":["<node_internals>/**","D:/work/soft/HBuilderX.4.87.20251210/plugins/unicloud/**/*.js"]}'), O = T('[{"provider":"alipay","spaceName":"cst-ai-driver-ee202512","spaceId":"env-00jxuge4w6ww","spaceAppId":"2021004146666233","accessKey":"HhDjROscRN3KDytZ","secretKey":"crj8YgPa28tpmANy"}]') || [];
const b = true, E = "mp-weixin", A = T(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), P = E, C = T('{"address":["127.0.0.1","192.168.1.48"],"servePort":7000,"debugPort":9000,"initialLaunchType":"local","skipFiles":["<node_internals>/**","D:/work/soft/HBuilderX.4.87.20251210/plugins/unicloud/**/*.js"]}'), O = T('[{"provider":"alipay","spaceName":"cst-ai-driver-ee202512","spaceId":"env-00jxuge4w6ww","spaceAppId":"2021004146666233","accessKey":"HhDjROscRN3KDytZ","secretKey":"crj8YgPa28tpmANy"}]') || [];
let N = "";
try {
N = "__UNI__9811C86";

View File

@@ -50,6 +50,11 @@ const _sfc_main = {
},
mounted() {
this.loadCurrentUserInfo();
common_vendor.index.onWindowResize(() => {
if (this.showCustomerSourceDropdown) {
this.updateDropdownPosition();
}
});
},
methods: {
/**
@@ -70,7 +75,7 @@ const _sfc_main = {
this.formData.salesId = String(loginResponse.userId);
}
} catch (e) {
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:239", "加载当前登录用户信息失败:", e);
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:247", "加载当前登录用户信息失败:", e);
}
},
onGenderChange(e) {
@@ -78,6 +83,23 @@ const _sfc_main = {
},
toggleCustomerSourceDropdown() {
this.showCustomerSourceDropdown = !this.showCustomerSourceDropdown;
if (this.showCustomerSourceDropdown) {
this.$nextTick(() => {
this.updateDropdownPosition();
});
}
},
updateDropdownPosition() {
const selectEl = this.$refs.customerSourceSelect;
if (selectEl) {
const rect = selectEl.getBoundingClientRect();
const dropdownEl = this.$refs.customerSourceDropdown;
if (dropdownEl) {
dropdownEl.style.top = rect.bottom + 8 + "px";
dropdownEl.style.left = rect.left + "px";
dropdownEl.style.width = rect.width + "px";
}
}
},
selectCustomerSource(option) {
this.formData.customerSource = option;
@@ -126,7 +148,7 @@ const _sfc_main = {
tenantId = common_vendor.index.getStorageSync("backend-tenant-id") || "";
token = common_vendor.index.getStorageSync("backend-token") || "";
} catch (e) {
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:296", "获取认证信息失败:", e);
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:321", "获取认证信息失败:", e);
}
const headers = {};
if (token) {
@@ -170,7 +192,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:348", "查询客户信息失败:", error);
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:373", "查询客户信息失败:", error);
} finally {
this.isFetchingContact = false;
}
@@ -250,7 +272,7 @@ const _sfc_main = {
tenantId = common_vendor.index.getStorageSync("backend-tenant-id") || "";
token = common_vendor.index.getStorageSync("backend-token") || "";
} catch (e) {
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:437", "获取认证信息失败:", e);
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:462", "获取认证信息失败:", e);
}
const headers = {
"Content-Type": "application/json"
@@ -286,7 +308,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:480", "保存失败:", error);
common_vendor.index.__f__("error", "at pages/furniture_reception/common_begin_reception.vue:505", "保存失败:", error);
common_vendor.index.showToast({
title: "保存失败,请重试",
icon: "none"

View File

@@ -1 +1 @@
<view class="reception-form-wrapper"><scroll-view class="reception-form" scroll-y enable-back-to-top><view class="form-card"><view class="form-item"><text class="form-item__label">服务次数</text><view class="form-item__text"><text>{{a}}</text></view></view><view class="form-item"><text class="form-item__label">客户姓名</text><input class="form-item__input" placeholder="请输入客户姓名" placeholder-style="color: #9ca3af" value="{{b}}" bindinput="{{c}}"/></view><view class="form-item"><text class="form-item__label">客户电话</text><input class="form-item__input" bindblur="{{d}}" type="number" placeholder="请输入客户电话" placeholder-style="color: #9ca3af" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item"><text class="form-item__label">客户来源</text><view class="customer-source-select-wrapper"><view class="customer-source-select" catchtap="{{j}}"><text class="{{h}}">{{g}}</text><uni-icons wx:if="{{i}}" u-i="b17c0abe-0" bind:__l="__l" u-p="{{i}}"></uni-icons></view><view wx:if="{{k}}" class="customer-source-select-dropdown" catchtap="{{m}}"><view wx:for="{{l}}" wx:for-item="option" wx:key="c" class="customer-source-select-dropdown__item" bindtap="{{option.d}}"><text class="{{[option.b && 'active']}}">{{option.a}}</text></view></view></view></view><view class="form-item"><text class="form-item__label">门店名称</text><input class="form-item__input" placeholder="请输入门店名称" placeholder-style="color: #9ca3af" value="{{n}}" bindinput="{{o}}"/></view><view class="form-item"><text class="form-item__label">性别</text><radio-group class="gender-radio-group" bindchange="{{q}}"><label wx:for="{{p}}" wx:for-item="option" wx:key="d" class="gender-radio"><radio value="{{option.a}}" checked="{{option.b}}" color="#2563eb"/><text class="gender-radio__text">{{option.c}}</text></label></radio-group></view><view class="form-item"><text class="form-item__label">年龄</text><input class="form-item__input" type="number" placeholder="请输入年龄" placeholder-style="color: #9ca3af" value="{{r}}" bindinput="{{s}}"/></view><view class="form-item"><text class="form-item__label">销售姓名</text><input class="form-item__input" placeholder="请输入销售姓名" placeholder-style="color: #9ca3af" value="{{t}}" bindinput="{{v}}"/></view><view class="form-item"><text class="form-item__label">销售电话</text><input class="form-item__input" type="number" placeholder="请输入销售电话" placeholder-style="color: #9ca3af" value="{{w}}" bindinput="{{x}}"/></view><view class="form-item"><text class="form-item__label">住址</text><input class="form-item__input" placeholder="请输入详细住址" placeholder-style="color: #9ca3af" value="{{y}}" bindinput="{{z}}"/></view></view></scroll-view><view class="form-actions form-actions--triple"><view class="form-btn form-btn--cancel" bindtap="{{B}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{A}}" u-i="b17c0abe-1" bind:__l="__l" u-p="{{A}}"></uni-icons></view><text class="form-btn__text">取消</text></view><view class="form-btn form-btn--save" bindtap="{{D}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{C}}" u-i="b17c0abe-2" bind:__l="__l" u-p="{{C}}"></uni-icons></view><text class="form-btn__text">保存</text></view><view class="form-btn form-btn--start" bindtap="{{F}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{E}}" u-i="b17c0abe-3" bind:__l="__l" u-p="{{E}}"></uni-icons></view><text class="form-btn__text">开始接待</text></view></view><view wx:if="{{G}}" class="customer-source-select-mask" bindtap="{{H}}"></view></view>
<view class="reception-form-wrapper"><scroll-view class="reception-form" scroll-y enable-back-to-top><view class="form-card"><view class="form-item"><text class="form-item__label">服务次数</text><view class="form-item__text"><text>{{a}}</text></view></view><view class="form-item"><text class="form-item__label">客户姓名</text><input class="form-item__input" placeholder="请输入客户姓名" placeholder-style="color: #9ca3af" value="{{b}}" bindinput="{{c}}"/></view><view class="form-item"><text class="form-item__label">客户电话</text><input class="form-item__input" bindblur="{{d}}" type="number" placeholder="请输入客户电话" placeholder-style="color: #9ca3af" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item"><text class="form-item__label">客户来源</text><view class="customer-source-select-wrapper"><view ref="customerSourceSelect" class="customer-source-select" catchtap="{{j}}"><text class="{{h}}">{{g}}</text><uni-icons wx:if="{{i}}" u-i="b17c0abe-0" bind:__l="__l" u-p="{{i}}"></uni-icons></view><view wx:if="{{k}}" ref="customerSourceDropdown" class="customer-source-select-dropdown" catchtap="{{m}}"><view wx:for="{{l}}" wx:for-item="option" wx:key="c" class="customer-source-select-dropdown__item" bindtap="{{option.d}}"><text class="{{[option.b && 'active']}}">{{option.a}}</text></view></view></view></view><view class="form-item"><text class="form-item__label">门店名称</text><input class="form-item__input" placeholder="请输入门店名称" placeholder-style="color: #9ca3af" value="{{n}}" bindinput="{{o}}"/></view><view class="form-item"><text class="form-item__label">性别</text><radio-group class="gender-radio-group" bindchange="{{q}}"><label wx:for="{{p}}" wx:for-item="option" wx:key="d" class="gender-radio"><radio value="{{option.a}}" checked="{{option.b}}" color="#2563eb"/><text class="gender-radio__text">{{option.c}}</text></label></radio-group></view><view class="form-item"><text class="form-item__label">年龄</text><input class="form-item__input" type="number" placeholder="请输入年龄" placeholder-style="color: #9ca3af" value="{{r}}" bindinput="{{s}}"/></view><view class="form-item"><text class="form-item__label">销售姓名</text><input class="form-item__input" placeholder="请输入销售姓名" placeholder-style="color: #9ca3af" value="{{t}}" bindinput="{{v}}"/></view><view class="form-item"><text class="form-item__label">销售电话</text><input class="form-item__input" type="number" placeholder="请输入销售电话" placeholder-style="color: #9ca3af" value="{{w}}" bindinput="{{x}}"/></view><view class="form-item"><text class="form-item__label">住址</text><input class="form-item__input" placeholder="请输入详细住址" placeholder-style="color: #9ca3af" value="{{y}}" bindinput="{{z}}"/></view></view></scroll-view><view class="form-actions form-actions--triple"><view class="form-btn form-btn--cancel" bindtap="{{B}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{A}}" u-i="b17c0abe-1" bind:__l="__l" u-p="{{A}}"></uni-icons></view><text class="form-btn__text">取消</text></view><view class="form-btn form-btn--save" bindtap="{{D}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{C}}" u-i="b17c0abe-2" bind:__l="__l" u-p="{{C}}"></uni-icons></view><text class="form-btn__text">保存</text></view><view class="form-btn form-btn--start" bindtap="{{F}}"><view class="form-btn__icon-circle"><uni-icons wx:if="{{E}}" u-i="b17c0abe-3" bind:__l="__l" u-p="{{E}}"></uni-icons></view><text class="form-btn__text">开始接待</text></view></view><view wx:if="{{G}}" class="customer-source-select-mask" bindtap="{{H}}"></view></view>

View File

@@ -29,7 +29,7 @@
box-sizing: border-box;
background-color: #ffffff;
border-radius: 16rpx;
padding: 32rpx 24rpx;
padding: 40rpx 24rpx 32rpx 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
margin-bottom: 24rpx;
overflow: visible; /* 确保内容不被裁剪 */
@@ -37,14 +37,26 @@
.form-card .form-item:last-child {
margin-bottom: 0;
}
/* 第一个表单项特殊处理,确保顶部空间 */
.form-card .form-item:first-child {
padding-top: 24rpx;
margin-top: 16rpx;
}
.form-item {
display: flex;
align-items: center;
display: flex !important;
align-items: flex-start;
margin-bottom: 32rpx;
min-height: 88rpx;
padding-top: 8rpx;
box-sizing: border-box;
width: 100%;
flex-wrap: nowrap;
flex-wrap: nowrap !important;
overflow: hidden;
flex-shrink: 0;
justify-content: center;
flex-direction: row !important;
padding-left: 0;
}
/* 对于包含 textarea 的表单项label 顶部对齐 */
@@ -53,16 +65,22 @@
}
.gender-radio-group {
flex: 1;
flex-shrink: 1;
display: flex;
gap: 32rpx;
flex-wrap: nowrap;
align-items: center;
min-width: 0;
overflow: hidden;
height: 88rpx;
justify-content: flex-start;
}
.gender-radio {
display: flex;
align-items: center;
gap: 12rpx;
flex-shrink: 0;
height: 88rpx;
}
.gender-radio__text {
color: #374151;
@@ -75,16 +93,30 @@
font-weight: 500;
width: 140rpx;
flex-shrink: 0;
flex-grow: 0;
margin-right: 24rpx;
margin-left: 0;
padding: 12rpx 0 12rpx 16rpx;
white-space: nowrap;
box-sizing: border-box;
min-height: 88rpx;
line-height: 1.4;
text-align: left;
display: flex;
align-items: flex-start;
justify-content: flex-start;
/* 确保标签可见且不被遮挡 */
}
.form-item--half {
width: 50%;
}
.form-item__input {
flex: 1;
min-width: 0;
flex: 1 !important;
flex-shrink: 1 !important;
flex-grow: 1 !important;
min-width: 0 !important;
max-width: none !important;
width: auto !important;
height: 88rpx;
line-height: 88rpx;
background-color: #f9fafb;
@@ -93,9 +125,20 @@
font-size: 28rpx;
color: #333;
box-sizing: border-box;
border: 2rpx solid #e5e7eb;
transition: all 0.2s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.form-item__input:focus {
border-color: #007AFF;
background-color: #FFFFFF;
box-shadow: 0 0 0 4rpx rgba(0, 122, 255, 0.1);
}
.form-item__text {
flex: 1;
flex-shrink: 1;
min-width: 0;
height: 88rpx;
background-color: #f9fafb;
@@ -103,7 +146,9 @@
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
overflow: hidden;
}
.form-item__text text {
font-size: 28rpx;
@@ -168,9 +213,12 @@
.customer-source-select-wrapper {
position: relative;
flex: 1;
flex-shrink: 1;
min-width: 0;
display: flex;
align-items: center;
overflow: hidden;
height: 88rpx;
}
.customer-source-select {
width: 100%;
@@ -191,17 +239,16 @@
margin-left: 12rpx;
}
.customer-source-select-dropdown {
position: absolute;
top: 100%;
left: 0;
right: 0;
position: fixed;
background-color: #fff;
border-radius: 16rpx;
box-shadow: 0 12rpx 30rpx rgba(15, 23, 42, 0.1);
margin-top: 8rpx;
z-index: 11;
z-index: 9999;
padding: 12rpx 0;
box-sizing: border-box;
max-height: 400rpx;
overflow-y: auto;
min-width: 200rpx;
}
.customer-source-select-dropdown__item {
padding: 20rpx 32rpx;
@@ -224,7 +271,7 @@
right: 0;
bottom: 0;
background-color: transparent;
z-index: 10;
z-index: 9998;
}
.form-item__picker-text {
font-size: 28rpx;
@@ -244,3 +291,48 @@
text-overflow: ellipsis;
white-space: nowrap;
}
/* 小屏幕适配 */
@media (max-width: 750rpx) {
.form-item__label {
width: 120rpx;
font-size: 26rpx;
margin-right: 16rpx;
margin-left: 0;
padding: 10rpx 0 10rpx 12rpx;
min-height: 80rpx;
line-height: 1.4;
align-items: flex-start;
}
.form-item {
min-height: 80rpx;
padding-top: 6rpx;
}
.form-item__input,
.form-item__text,
.customer-source-select-wrapper,
.gender-radio-group,
.gender-radio {
height: 80rpx;
}
.form-item__input,
.form-item__text,
.customer-source-select-wrapper,
.gender-radio-group {
flex-shrink: 1;
}
.form-item__input,
.customer-source-select {
font-size: 26rpx;
padding: 0 16rpx;
}
.form-item__text {
padding: 0 16rpx;
}
.form-item__text text {
font-size: 26rpx;
}
.gender-radio-group {
gap: 24rpx;
}
}

View File

@@ -7,7 +7,7 @@
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": true,
"minified": false,
"newFeature": true,
"bigPackageSizeSupport": true,
"minifyJS": true,

View File

@@ -0,0 +1,5 @@
{
"setting": {
"compileHotReLoad": false
}
}

View File

@@ -1,58 +0,0 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
class Gps {
constructor(arg) {
this.lock = false;
}
async getLocation(param = {
type: "wgs84"
}) {
return new Promise(async (callback) => {
if (this.lock) {
callback(false);
return false;
}
this.lock = true;
common_vendor.index.getLocation({
...param,
success: (res) => {
this.lock = false;
callback(res);
},
fail: async (err) => {
common_vendor.index.showToast({
title: "定位获取失败",
icon: "none"
});
common_vendor.index.__f__("error", "at uni_modules/json-gps/js_sdk/gps.js:30", JSON.stringify(err));
callback(false);
if (err.errMsg == "getLocation:fail auth deny") {
common_vendor.index.showModal({
content: "应用无定位权限",
confirmText: "前往设置",
complete: (e) => {
if (e.confirm) {
common_vendor.index.openSetting({
success(res) {
common_vendor.index.__f__("log", "at uni_modules/json-gps/js_sdk/gps.js:46", res.authSetting);
}
});
}
this.lock = false;
}
});
}
if (err.errMsg == "getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF") {
common_vendor.index.showModal({
content: "未开启定位权限,请前往手机系统设置中开启",
showCancel: false,
confirmText: "知道了"
});
}
}
});
});
}
}
exports.Gps = Gps;
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/uni_modules/json-gps/js_sdk/gps.js.map