chore: remove all mock/debug code for production release
Miniprogram: - ENV switched to 'prod' (disables __DEV__ flag) - Deleted mock.js and test-ble-frame.js - Removed mockBind/mockPurchase from api.js - Removed all debug UI panels and onMock* handlers from 6 pages - Removed mock purchase fallback in subscribe-plans - Removed SIMPLE PERIPHERAL dev board from BLE scan Server: - Removed /device/mock-bind route - Removed /subscription/mock-purchase route - Removed dev_openid fallback in wechat.js - Removed mockBind() from binding.dao.js - Removed mock fallback in purchase endpoint - NODE_ENV default changed to 'production' Admin: - ENV switched to 'prod' All mock code preserved in 'test' branch for future development use.
这个提交包含在:
@@ -1,6 +1,5 @@
|
||||
var ble = require('../../services/ble')
|
||||
var api = require('../../utils/api')
|
||||
var config = require('../../config/env')
|
||||
var app = getApp()
|
||||
|
||||
Page({
|
||||
@@ -14,14 +13,9 @@ Page({
|
||||
bleState: 'disconnected',
|
||||
hasDevice: false,
|
||||
deviceInfo: null,
|
||||
devMode: false,
|
||||
loading: true
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
this.setData({ devMode: config.__DEV__ || false })
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.checkState()
|
||||
this._onStatus = this.onBleStatus.bind(this)
|
||||
@@ -173,26 +167,6 @@ Page({
|
||||
wx.navigateTo({ url: '/pages/wear-check/wear-check' })
|
||||
},
|
||||
|
||||
onMockBind: function () {
|
||||
var self = this
|
||||
wx.showModal({
|
||||
title: '模拟绑定',
|
||||
editable: true,
|
||||
placeholderText: '输入设备编号(需先在后台创建)',
|
||||
success: function (res) {
|
||||
if (res.confirm && res.content) {
|
||||
var deviceId = res.content.trim()
|
||||
api.mockBind(deviceId).then(function () {
|
||||
wx.showToast({ title: '模拟绑定成功', icon: 'success' })
|
||||
self.checkState()
|
||||
}).catch(function (err) {
|
||||
wx.showToast({ title: err.message || '绑定失败', icon: 'none' })
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onViewSubscription: function () {
|
||||
wx.navigateTo({ url: '/pages/subscribe-plans/subscribe-plans' })
|
||||
}
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<text class="empty-icon">📱</text>
|
||||
<view class="empty-text">还没有绑定设备</view>
|
||||
<button class="btn-primary mt-30" bindtap="onAddDevice">扫码添加设备</button>
|
||||
<view class="debug-actions" wx:if="{{devMode}}">
|
||||
<view class="debug-label">🔧 调试工具</view>
|
||||
<button class="btn-secondary btn-sm" bindtap="onMockBind">模拟绑定设备</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户