Compare commits
7 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
984f3e66a0 | |
|
|
66b2cdf8f2 | |
|
|
8cc0df43ad | |
|
|
acc1ac1955 | |
|
|
8e28df3158 | |
|
|
022b1b3a37 | |
|
|
c5c2535cce |
36
App.vue
|
|
@ -3,10 +3,6 @@
|
|||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
onTabItemClick(itemPath) {
|
||||
// 例如,你可以在这里添加一个确认对话框
|
||||
console.log("itemPath", itemPath)
|
||||
},
|
||||
computed: {
|
||||
...mapState(["bleValue"]),
|
||||
},
|
||||
|
|
@ -17,37 +13,11 @@
|
|||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
// this.$ble.closeBLEConnection(this.bleValue.deviceId)
|
||||
// this.$ble.closeBluetoothAdapter()
|
||||
console.log('App Hide')
|
||||
},
|
||||
methods: {
|
||||
$createWatcher(name) {
|
||||
getApp().globalData.watcher = this.$watch(
|
||||
'bleValue',
|
||||
val => {
|
||||
this[name](val)
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
},
|
||||
$removeWatcher() {
|
||||
if (getApp().globalData.watcher) {
|
||||
getApp().globalData.watcher()
|
||||
console.log("watch移除成功")
|
||||
} else {
|
||||
console.log("没有watch可移除")
|
||||
}
|
||||
},
|
||||
// handleHomeConfig() {
|
||||
// let that = this
|
||||
// that.$model.getHomeConfig({}).then(res => {
|
||||
// if (res.code != 0) return
|
||||
// that.$store.commit('changeMenuList', res.data.cook_label)
|
||||
// that.$store.commit('changeFoodList', res.data.food_list)
|
||||
// })
|
||||
// },
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -964,4 +964,38 @@ page {
|
|||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.drawerVisible {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
z-index: 999;
|
||||
|
||||
.bgVisible {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.infoVisible {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 300px;
|
||||
bottom: 0;
|
||||
background-color: #ffffff;
|
||||
transition: -webkit-transform 0.3s ease;
|
||||
transition: transform 0.3s ease;
|
||||
transition: transform 0.3s ease, -webkit-transform 0.3s ease;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5,13 +5,16 @@
|
|||
<image src="/static/zhong.png"></image>
|
||||
<text @click="openBluetoothAdapter">{{bleTipsText}}</text>
|
||||
</view>
|
||||
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 2">
|
||||
断开连接
|
||||
</view>
|
||||
</view>
|
||||
<view class="name">{{name}}</view>
|
||||
<!-- 蓝牙称重 -->
|
||||
<view class="weight-wrap">
|
||||
<view class="weight" @click="inputDialogToggle">
|
||||
<text class="val">{{weight == '' ? '0.0':weight}}</text>
|
||||
<text class="unit">{{unit}}</text>
|
||||
<text class="unit">{{unitConversion(unit)}}</text>
|
||||
</view>
|
||||
<view class="weight">
|
||||
<text class="val">{{kcal?kcal:0}}</text>
|
||||
|
|
@ -22,7 +25,7 @@
|
|||
<view class="btn danwei">
|
||||
<view class="lan border-bottom">
|
||||
<view class="right">
|
||||
<picker mode="selector" :range="unitList" range-key="name" @change="changleUnits"
|
||||
<picker mode="selector" :range="unitA" range-key="name" @change="changleUnits"
|
||||
:value="unitListIndex">
|
||||
<view class="uni-input">
|
||||
单位
|
||||
|
|
@ -52,26 +55,12 @@
|
|||
data() {
|
||||
return {
|
||||
kcal: "",
|
||||
// weight: "",
|
||||
weightALL: "",
|
||||
bleTipsText: "",
|
||||
unit: 'g',
|
||||
weight0: 0,
|
||||
unitA: [],
|
||||
stopblue: false,
|
||||
devicesList: [],
|
||||
unitList: [{
|
||||
name: "克",
|
||||
id: '00',
|
||||
unit: "g"
|
||||
}, {
|
||||
name: "盎司",
|
||||
id: "08",
|
||||
unit: "oz"
|
||||
}],
|
||||
unitListIndex: 0,
|
||||
units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
|
||||
'milkml', 'oz', 'floz', 'lboz'
|
||||
]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
|
@ -91,15 +80,18 @@
|
|||
computed: {
|
||||
...mapState(["user", "isBluetoothTyle", "bleValue"]),
|
||||
weight() {
|
||||
let kcal = (Number(this.weightKcal) * this.bleValue.countWeight).toFixed(2)
|
||||
this.unit = this.unitConversion(this.bleValue.unit)
|
||||
this.kcal = this.convertToGrams(kcal, this.bleValue.unit).toFixed(2)
|
||||
let weightNew = this.convertToGrams(this.bleValue.countWeight, this.bleValue.unit)
|
||||
this.kcal = (Number(this.weightKcal) * weightNew).toFixed(1)
|
||||
this.unit = this.bleValue.unit
|
||||
return this.bleValue.countWeight
|
||||
},
|
||||
isConnection() {
|
||||
this.bleTipsText = this.bleValue.bleTipsText
|
||||
return this.bleValue.isConnectStatus
|
||||
},
|
||||
isShow() {
|
||||
return this.bleValue.serviceId != '' ? true : false
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
|
|
@ -114,10 +106,22 @@
|
|||
that.handleBack()
|
||||
}
|
||||
},
|
||||
isLast: function() {
|
||||
let that = this
|
||||
that.stopblue = that.isLast
|
||||
}
|
||||
isLast: {
|
||||
handler(newVal, oldVal) {
|
||||
this.stopblue = newVal
|
||||
},
|
||||
// deep: true,
|
||||
immediate: true
|
||||
|
||||
},
|
||||
bleValue: {
|
||||
handler(newVal, oldVal) {
|
||||
this.unitA = newVal.unitList
|
||||
this.unitListIndex = newVal.unitList.findIndex(ite => ite.unit == newVal.unit)
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化蓝牙
|
||||
|
|
@ -131,6 +135,8 @@
|
|||
notify: '',
|
||||
write: '',
|
||||
unit: "g",
|
||||
type: 1,
|
||||
unitList: that.$json.unitMinus,
|
||||
countWeight: "",
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0,
|
||||
|
|
@ -139,17 +145,63 @@
|
|||
},
|
||||
changleUnits(e) {
|
||||
let that = this
|
||||
let name = that.unitList[e.detail.value].name
|
||||
console.log("单位切换", name, that.unit)
|
||||
if (that.unit != name) {
|
||||
that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04)
|
||||
let name = that.unitA[e.detail.value].name
|
||||
let val = that.unitA[e.detail.value].unit
|
||||
if (that.isShow && that.unit != name) {
|
||||
that.handletoggleUnit(that.unitConversion2(val))
|
||||
}
|
||||
if (that.bleValue.serviceId == '') {
|
||||
that.unitListIndex = [e.detail.value]
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitA[e.detail.value].unit,
|
||||
})
|
||||
}
|
||||
that.unitListIndex = [e.detail.value]
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitList[e.detail.value].unit
|
||||
})
|
||||
|
||||
},
|
||||
convertToGrams(value, fromUnit) {
|
||||
const conversionFactors = {
|
||||
'lb': 453.59237, // 1磅 = 453.59237克
|
||||
'oz': 28.349523125, // 1盎司 = 28.349523125克
|
||||
'kg': 1000, // 1公斤 = 1000克
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return value * conversionFactors[fromUnit];
|
||||
},
|
||||
unitConversion2(unit) {
|
||||
if (unit == 'kg') {
|
||||
return 0x00
|
||||
} else if (unit == '斤') {
|
||||
return 0x01
|
||||
} else if (unit == 'st:lb') {
|
||||
return 0x02
|
||||
} else if (unit == 'lb') {
|
||||
return 0x03
|
||||
} else if (unit == 'g') {
|
||||
return 0x04
|
||||
} else if (unit == 'ml') {
|
||||
return 0x05
|
||||
} else if (unit == 'Waterml') {
|
||||
return 0x06
|
||||
} else if (unit == 'milkml') {
|
||||
return 0x07
|
||||
} else if (unit == 'oz') {
|
||||
return 0x08
|
||||
} else if (unit == 'floz') {
|
||||
return 0x09
|
||||
} else if (unit == 'lboz') {
|
||||
return 0x0A
|
||||
}
|
||||
return unit
|
||||
},
|
||||
// 下发单位
|
||||
handletoggleUnit(unit) {
|
||||
let that = this
|
||||
let checksum = 0;
|
||||
|
|
@ -184,30 +236,43 @@
|
|||
},
|
||||
})
|
||||
},
|
||||
// 保存测量结果
|
||||
handlesub() {
|
||||
handleBack() {
|
||||
let that = this
|
||||
console.log("测量保存", that.weight, that.unit, that.kcal)
|
||||
if (Number(that.weight) > 0) {
|
||||
that.$emit("handleBle", that.weight, that.unit, that.kcal)
|
||||
} else {
|
||||
that.$tools.msg("数据异常,请清零后重新测量!")
|
||||
}
|
||||
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
unitList: that.$json.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
})
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId)
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
},
|
||||
convertToGrams(value, fromUnit) {
|
||||
const conversionFactors = {
|
||||
'lb': 453.59, // 1磅 = 453.59237克
|
||||
'oz': 28.35, // 1盎司 = 28.349523125克
|
||||
'kg': 1000, // 1公斤 = 1000克
|
||||
'g': 1
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return ''
|
||||
unitConversion(unit) {
|
||||
if (unit == 'kg') {
|
||||
return '千克'
|
||||
} else if (unit == '斤') {
|
||||
return '斤'
|
||||
} else if (unit == 'stlb') {
|
||||
return 'stlb'
|
||||
} else if (unit == 'lb') {
|
||||
return '磅'
|
||||
} else if (unit == 'g') {
|
||||
return '克'
|
||||
} else if (unit == 'ml') {
|
||||
return '毫升'
|
||||
} else if (unit == 'Waterml') {
|
||||
return 'Waterml'
|
||||
} else if (unit == 'milkml') {
|
||||
return 'milkml'
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司'
|
||||
} else if (unit == 'floz') {
|
||||
return 'floz'
|
||||
} else if (unit == 'lboz') {
|
||||
return 'lboz'
|
||||
}
|
||||
|
||||
return value * conversionFactors[fromUnit];
|
||||
return unit
|
||||
},
|
||||
// 备料完成
|
||||
handleDetailSub() {
|
||||
|
|
@ -215,7 +280,7 @@
|
|||
if (Number(that.weight) > 0) {
|
||||
that.$emit("handleDetailSub", that.weight, that.unit, that.kcal)
|
||||
} else {
|
||||
that.$tools.msg("数据异常,请重新测量!")
|
||||
that.$tools.msg("数据异常,请清零后重新测量!")
|
||||
}
|
||||
},
|
||||
//备料下一个
|
||||
|
|
@ -227,33 +292,12 @@
|
|||
that.$tools.msg("数据异常,请清零后重新测量!")
|
||||
}
|
||||
},
|
||||
unitConversion(unit) {
|
||||
if (unit == 'kcal') {
|
||||
return '千卡'
|
||||
} else if (unit == 'g') {
|
||||
return '克'
|
||||
} else if (unit == 'lb') {
|
||||
return '磅'
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司'
|
||||
}
|
||||
return unit
|
||||
},
|
||||
handleBack() {
|
||||
let that = this
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
})
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId)
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
},
|
||||
confirm(value) {
|
||||
console.log("手动输入", value)
|
||||
console.log(value)
|
||||
let that = this
|
||||
this.$store.commit("changeBluetoothValue", {
|
||||
countWeight: value,
|
||||
unit: this.unitList[this.unitListIndex].unit
|
||||
unit: this.unitA[this.unitListIndex].unit
|
||||
})
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
|
|
@ -395,6 +439,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
.duan {
|
||||
width: fit-content;
|
||||
background: linear-gradient(-90deg, #d4f5c4, #a7d5e4 80%, );
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
padding: 3px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<image src="/static/zhong.png"></image>
|
||||
<text @click="openBluetoothAdapter">{{bleTipsText}}</text>
|
||||
</view>
|
||||
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 0">
|
||||
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 2">
|
||||
断开连接
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<view class="btn danwei">
|
||||
<view class="lan border-bottom">
|
||||
<view class="right">
|
||||
<picker mode="selector" :range="unitList" range-key="name" @change="changleUnits"
|
||||
<picker mode="selector" :range="unitA" range-key="name" @change="changleUnits"
|
||||
:value="unitListIndex">
|
||||
<view class="uni-input">
|
||||
单位
|
||||
|
|
@ -56,22 +56,10 @@
|
|||
return {
|
||||
kcal: 0,
|
||||
unit: '',
|
||||
// weight: "",
|
||||
bleTipsText: "",
|
||||
inputDialog: false,
|
||||
unitList: [{
|
||||
name: "克",
|
||||
id: '00',
|
||||
unit: "g"
|
||||
}, {
|
||||
name: "盎司",
|
||||
id: "08",
|
||||
unit: "oz"
|
||||
}],
|
||||
unitA: [],
|
||||
unitListIndex: 0,
|
||||
units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
|
||||
'milkml', 'oz', 'floz', 'lboz'
|
||||
]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
|
@ -82,12 +70,13 @@
|
|||
btnType: {
|
||||
type: Number,
|
||||
default: 1 //1添加食材,2保存测量
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["bleValue", "isBluetoothTyle", "countFoodInfo"]),
|
||||
weight() {
|
||||
this.kcal = (Number(this.weightKcal) / 100 * this.bleValue.countWeight).toFixed(2)
|
||||
let weightNew = this.convertToGrams(this.bleValue.countWeight, this.bleValue.unit)
|
||||
this.kcal = (Number(this.weightKcal) / 100 * weightNew).toFixed(1)
|
||||
this.unit = this.bleValue.unit
|
||||
return this.bleValue.countWeight
|
||||
},
|
||||
|
|
@ -97,8 +86,7 @@
|
|||
},
|
||||
isShow() {
|
||||
return this.bleValue.serviceId != '' ? true : false
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
|
|
@ -118,12 +106,20 @@
|
|||
that.handleBack()
|
||||
}
|
||||
},
|
||||
bleValue: {
|
||||
handler(newVal, oldVal) {
|
||||
this.unitA = newVal.unitList
|
||||
this.unitListIndex = newVal.unitList.findIndex(ite => ite.unit == newVal.unit)
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化蓝牙
|
||||
openBluetoothAdapter() {
|
||||
let that = this
|
||||
if (that.isConnection == 0) return
|
||||
if (that.isConnection == 2) return
|
||||
that.kcal = ""
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
deviceId: "",
|
||||
|
|
@ -131,26 +127,74 @@
|
|||
notify: '',
|
||||
write: '',
|
||||
unit: "g",
|
||||
countWeight: "",
|
||||
type: 1,
|
||||
unitList: that.$json.unitMinus,
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0,
|
||||
})
|
||||
that.$ble.openBluetoothAdapter()
|
||||
},
|
||||
|
||||
changleUnits(e) {
|
||||
let that = this
|
||||
let name = that.unitList[e.detail.value].name
|
||||
console.log("单位切换", name, that.unit)
|
||||
let name = that.unitA[e.detail.value].name
|
||||
let val = that.unitA[e.detail.value].unit
|
||||
if (that.isShow && that.unit != name) {
|
||||
that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04)
|
||||
that.handletoggleUnit(that.unitConversion2(val))
|
||||
}
|
||||
if (that.bleValue.serviceId == '') {
|
||||
that.unitListIndex = [e.detail.value]
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitA[e.detail.value].unit,
|
||||
})
|
||||
}
|
||||
that.unitListIndex = [e.detail.value]
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitList[e.detail.value].unit
|
||||
})
|
||||
|
||||
},
|
||||
convertToGrams(value, fromUnit) {
|
||||
const conversionFactors = {
|
||||
'lb': 453.59237, // 1磅 = 453.59237克
|
||||
'oz': 28.349523125, // 1盎司 = 28.349523125克
|
||||
'kg': 1000, // 1公斤 = 1000克
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
// "stlb": "floz": "lboz":
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return ''
|
||||
}
|
||||
return value * conversionFactors[fromUnit];
|
||||
},
|
||||
unitConversion2(unit) {
|
||||
if (unit == 'kg') {
|
||||
return 0x00
|
||||
} else if (unit == '斤') {
|
||||
return 0x01
|
||||
} else if (unit == 'st:lb') {
|
||||
return 0x02
|
||||
} else if (unit == 'lb') {
|
||||
return 0x03
|
||||
} else if (unit == 'g') {
|
||||
return 0x04
|
||||
} else if (unit == 'ml') {
|
||||
return 0x05
|
||||
} else if (unit == 'Waterml') {
|
||||
return 0x06
|
||||
} else if (unit == 'milkml') {
|
||||
return 0x07
|
||||
} else if (unit == 'oz') {
|
||||
return 0x08
|
||||
} else if (unit == 'floz') {
|
||||
return 0x09
|
||||
} else if (unit == 'lboz') {
|
||||
return 0x0A
|
||||
}
|
||||
return unit
|
||||
},
|
||||
// 下发单位
|
||||
handletoggleUnit(unit) {
|
||||
let that = this
|
||||
let checksum = 0;
|
||||
|
|
@ -162,6 +206,7 @@
|
|||
bytes[5] = checksum
|
||||
that.sendData(new Uint8Array(bytes).buffer)
|
||||
},
|
||||
// 清零
|
||||
handleqingling() {
|
||||
let that = this
|
||||
let str = "C503071100D0"
|
||||
|
|
@ -199,7 +244,8 @@
|
|||
let that = this
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
unitList: that.$json.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
})
|
||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId)
|
||||
|
|
@ -207,14 +253,28 @@
|
|||
},
|
||||
|
||||
unitConversion(unit) {
|
||||
if (unit == 'kcal') {
|
||||
return '千卡'
|
||||
} else if (unit == 'g') {
|
||||
return '克'
|
||||
if (unit == 'kg') {
|
||||
return '千克'
|
||||
} else if (unit == '斤') {
|
||||
return '斤'
|
||||
} else if (unit == 'stlb') {
|
||||
return 'stlb'
|
||||
} else if (unit == 'lb') {
|
||||
return '磅'
|
||||
} else if (unit == 'g') {
|
||||
return '克'
|
||||
} else if (unit == 'ml') {
|
||||
return '毫升'
|
||||
} else if (unit == 'Waterml') {
|
||||
return 'Waterml'
|
||||
} else if (unit == 'milkml') {
|
||||
return 'milkml'
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司'
|
||||
} else if (unit == 'floz') {
|
||||
return 'floz'
|
||||
} else if (unit == 'lboz') {
|
||||
return 'lboz'
|
||||
}
|
||||
return unit
|
||||
},
|
||||
|
|
@ -227,11 +287,13 @@
|
|||
inputDialogToggle() {
|
||||
this.$refs.popup.open()
|
||||
},
|
||||
// 手动输入
|
||||
confirm(value) {
|
||||
console.log(value)
|
||||
let that = this
|
||||
this.$store.commit("changeBluetoothValue", {
|
||||
countWeight: value,
|
||||
unit: this.unitList[this.unitListIndex].unit
|
||||
unit: this.unitA[this.unitListIndex].unit
|
||||
})
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
|
|
|
|||
69
content.json
|
|
@ -10,6 +10,71 @@
|
|||
"name": "晚加餐",
|
||||
"id": 5
|
||||
}
|
||||
]
|
||||
|
||||
],
|
||||
"unitArray": [{
|
||||
"name": "千克",
|
||||
"unit": "kg"
|
||||
},
|
||||
{
|
||||
"name": "斤",
|
||||
"unit": "斤"
|
||||
},
|
||||
{
|
||||
"name": "stlb",
|
||||
"unit": "stlb"
|
||||
},
|
||||
{
|
||||
"name": "磅",
|
||||
"unit": "lb"
|
||||
}, {
|
||||
"name": "克",
|
||||
"unit": "g"
|
||||
}, {
|
||||
"name": "毫升",
|
||||
"unit": "ml"
|
||||
},
|
||||
{
|
||||
"name": "Waterml",
|
||||
"unit": "Waterml"
|
||||
},
|
||||
{
|
||||
"name": "milkml",
|
||||
"unit": "milkml"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "盎司",
|
||||
"unit": "oz"
|
||||
},
|
||||
{
|
||||
"name": "floz",
|
||||
"unit": "floz"
|
||||
},
|
||||
{
|
||||
"name": "lboz",
|
||||
"unit": "lboz"
|
||||
}
|
||||
],
|
||||
"unitMinus": [{
|
||||
"name": "千克",
|
||||
"unit": "kg"
|
||||
},
|
||||
{
|
||||
"name": "磅",
|
||||
"unit": "lb"
|
||||
}, {
|
||||
"name": "克",
|
||||
"unit": "g"
|
||||
}, {
|
||||
"name": "毫升",
|
||||
"unit": "ml"
|
||||
},
|
||||
{
|
||||
"name": "盎司",
|
||||
"unit": "oz"
|
||||
}
|
||||
|
||||
],
|
||||
"units": ["kg", "斤", "stlb", "lb", "g", "ml", "Waterml", "milkml", "oz", "floz", "lboz"]
|
||||
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
"name" : "kitchendDevice",
|
||||
"appid" : "__UNI__20604F1",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"versionName" : "2.0.0",
|
||||
"versionCode" : 200,
|
||||
"transformPx" : false,
|
||||
"sassImplementationName" : "node-sass",
|
||||
/* 5+App特有相关 */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="content" >
|
||||
<view class="content_box">
|
||||
<view class="box">
|
||||
<!-- 类型 -->
|
||||
|
|
@ -65,48 +65,51 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 营养含量分析 -->
|
||||
<uni-drawer ref="showRight" mode="right" width="300">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
<view v-if="drawerVisible" class="drawerVisible">
|
||||
<view class="bgVisible" @click="handleDrawerClose"></view>
|
||||
<view class="infoVisible">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts2" :chartData="chartData2" :cHeight="280"
|
||||
:cWidth="280" />
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item" v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)"
|
||||
:key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}">
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts v-if="chartVisible" type="ring" :opts="opts2"
|
||||
:chartData="chartData2" :cHeight="280" :cWidth="280" />
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item"
|
||||
v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)" :key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}">
|
||||
</view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</uni-drawer>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -134,6 +137,8 @@
|
|||
chartData: {},
|
||||
chartData2: {},
|
||||
activeFoodDetail: {},
|
||||
drawerVisible: false,
|
||||
chartVisible: false, // 单独控制图表显示
|
||||
actionOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
|
|
@ -204,7 +209,7 @@
|
|||
let that = this
|
||||
let chart_data = []
|
||||
this.activeFoodDetail = item
|
||||
this.$refs.showRight.open();
|
||||
this.drawerVisible = true;
|
||||
this.opts2.color = []
|
||||
for (let i = 1; i < item.nutrients_four.length; ++i) {
|
||||
this.opts2.color.push(item.nutrients_four[i].color)
|
||||
|
|
@ -219,6 +224,17 @@
|
|||
data: chart_data
|
||||
}]
|
||||
}));
|
||||
that.$nextTick(() => {
|
||||
// 延迟显示图表,确保容器已渲染
|
||||
setTimeout(() => {
|
||||
that.chartVisible = true
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
handleDrawerClose() {
|
||||
// 先隐藏图表,再隐藏抽屉
|
||||
this.chartVisible = false
|
||||
this.drawerVisible = false;
|
||||
},
|
||||
// 添加食物
|
||||
handleAddFood() {
|
||||
|
|
@ -449,4 +465,9 @@
|
|||
font-weight: bold;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.no-scroll {
|
||||
height: 80vh !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -69,6 +69,10 @@
|
|||
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
|
||||
语音搜索
|
||||
</view>
|
||||
<view class="mic-icon mic-icon2" @click="scanCode">
|
||||
<uni-icons type="scan" size="20" color="#fff"></uni-icons>
|
||||
扫一扫
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索列表 -->
|
||||
<view class="search_list" v-if="search_list.length">
|
||||
|
|
@ -180,7 +184,8 @@
|
|||
v-if="item.color != ''"></view>
|
||||
<text>{{item.name}}({{unitConversion(item.unit)}})</text>
|
||||
</view>
|
||||
<view class="value">{{ Number(activeType.weight/100 * item.value).toFixed(1) }}
|
||||
<view class="value">
|
||||
{{Number((activeType.weight)/100 * item.value).toFixed(1) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -195,14 +200,14 @@
|
|||
<view class="foodContent">
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{Math.floor(activeType.weight)}}克含量</text>
|
||||
<text>{{(activeType.weight).toFixed(1)}}克含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeType.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">
|
||||
{{Number(item.value*activeType.weight/100).toFixed(2)}}{{item.unit}}
|
||||
{{Number((activeType.weight)/100 * item.value).toFixed(1)}}{{item.unit}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -227,6 +232,15 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- s扫一扫弹框 -->
|
||||
<view class="wrapper wrapperScan" v-if="showScanCodeDlg">
|
||||
<view class="auto-search-dialog" @click="showScanCodeDlg = false">
|
||||
<view class="auto-search-inner">
|
||||
<text>提示</text>
|
||||
{{ScanCodeMsg}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -262,7 +276,9 @@
|
|||
ActiveList: [],
|
||||
activeType: {},
|
||||
voiceManager: null,
|
||||
showAutoSearchDlg: false
|
||||
ScanCodeMsg: "",
|
||||
showAutoSearchDlg: false,
|
||||
showScanCodeDlg: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -291,9 +307,12 @@
|
|||
bleValue: {
|
||||
handler(newVal, oldVal) {
|
||||
this.realTimeWeight(newVal.countWeight, newVal.unit)
|
||||
if (newVal.type == 2 && Number(newVal.countWeight) > 0) {
|
||||
this.handletoggleUnit(newVal.countWeight, newVal.unit, this.activeType.nutrients_four)
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
|
|
@ -345,6 +364,34 @@
|
|||
}
|
||||
// #endif
|
||||
},
|
||||
scanCode() {
|
||||
let that = this
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
uni.showLoading({
|
||||
title: '搜索中'
|
||||
});
|
||||
that.$model.getPhotoSearch({
|
||||
barcode: res.result,
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code != 0) {
|
||||
that.ScanCodeMsg = res.msg
|
||||
that.showScanCodeDlg = true
|
||||
return
|
||||
}
|
||||
that.handleDetail(res.data)
|
||||
})
|
||||
},
|
||||
fail: res => {
|
||||
that.$api.msg("您已取消操作")
|
||||
return
|
||||
}
|
||||
});
|
||||
},
|
||||
// 购物车早午晚餐切换
|
||||
handleToggle(name) {
|
||||
this.search_value = ""
|
||||
|
|
@ -354,7 +401,6 @@
|
|||
},
|
||||
//实时重量
|
||||
realTimeWeight(weight, unit) {
|
||||
// console.log("实时重量", weight, unit)
|
||||
this.activeType = Object.assign({}, this.activeType, {
|
||||
weight: this.convertToGrams(weight, unit)
|
||||
})
|
||||
|
|
@ -369,10 +415,15 @@
|
|||
},
|
||||
convertToGrams(value, fromUnit) {
|
||||
const conversionFactors = {
|
||||
'lb': 453.59, // 1磅 = 453.59237克
|
||||
'oz': 28.35, // 1盎司 = 28.349523125克
|
||||
'lb': 453.59237, // 1磅 = 453.59237克
|
||||
'oz': 28.349523125, // 1盎司 = 28.349523125克
|
||||
'kg': 1000, // 1公斤 = 1000克
|
||||
'g': 1
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
// "stlb": "floz": "lboz":
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
|
|
@ -387,19 +438,120 @@
|
|||
that.isBle = true
|
||||
that.isShop = false
|
||||
that.IsWeight = true
|
||||
that.showScanCodeDlg = false
|
||||
that.showAutoSearchDlg = false
|
||||
that.activeType = ite
|
||||
that.weightKcal = ite.kcal
|
||||
if (that.bleValue.serviceId != "") {
|
||||
that.realTimeWeight(that.bleValue.countWeight, that.bleValue.unit)
|
||||
if (that.bleValue.type == 2 && Number(that.bleValue.countWeight) > 0) {
|
||||
that.handletoggleUnit(that.bleValue.countWeight, that.bleValue.unit, ite.nutrients_four)
|
||||
}
|
||||
} else {
|
||||
let weight = Number(that.bleValue.countWeight) > 0 ? Number(that.bleValue.countWeight) : 100
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
countWeight: 100,
|
||||
unit: "g"
|
||||
countWeight: weight,
|
||||
unit: that.bleValue.unit
|
||||
})
|
||||
that.realTimeWeight(100, "g")
|
||||
that.realTimeWeight(weight, that.bleValue.unit)
|
||||
}
|
||||
},
|
||||
// 下发营养含量
|
||||
handletoggleUnit(val, unit, ite) {
|
||||
let that = this
|
||||
let weight = Number(that.convertToGrams(val, unit)) / 100
|
||||
const dataArray = that.buildNutritionData({
|
||||
fat: weight * ite[2].value,
|
||||
calorie: weight * ite[0].value,
|
||||
carbohydrate: weight * ite[3].value,
|
||||
protein: weight * ite[1].value,
|
||||
fiber: 0
|
||||
});
|
||||
const arrayBuffer = new ArrayBuffer(dataArray.length);
|
||||
const uint8Array = new Uint8Array(arrayBuffer);
|
||||
dataArray.forEach((value, index) => {
|
||||
uint8Array[index] = value;
|
||||
});
|
||||
console.log("营养数据", arrayBuffer)
|
||||
that.sendArrayBuffer(arrayBuffer);
|
||||
},
|
||||
// 构建营养成分数据包
|
||||
buildNutritionData(data) {
|
||||
// 头信息
|
||||
const header = 0xC5; // 同步头
|
||||
const dataLength = 0x11; // 数据长度:17字节
|
||||
const cmd = 0x04; // CMD字节
|
||||
const packetInfo = 0x41; // 包信息:总1包,第1包
|
||||
|
||||
// 转换营养成分值(×10并取整)
|
||||
const fatValue = Math.round(data.fat * 10);
|
||||
const calorieValue = Math.round(data.calorie * 10);
|
||||
const carbValue = Math.round(data.carbohydrate * 10);
|
||||
const fiberValue = Math.round(data.fiber * 10);
|
||||
const proteinValue = Math.round(data.protein * 10);
|
||||
|
||||
// 构建数据数组
|
||||
const dataArray = [];
|
||||
|
||||
// 添加头部
|
||||
dataArray.push(header); // 0xC5
|
||||
dataArray.push(dataLength); // 0x11
|
||||
dataArray.push(cmd); // 0x04
|
||||
dataArray.push(packetInfo); // 0x41
|
||||
|
||||
// 添加脂肪数据(大端序,3字节)
|
||||
dataArray.push((fatValue >> 16) & 0xFF); // 高位字节
|
||||
dataArray.push((fatValue >> 8) & 0xFF); // 中位字节
|
||||
dataArray.push(fatValue & 0xFF); // 低位字节
|
||||
|
||||
// 添加卡路里数据(大端序,3字节)
|
||||
dataArray.push((calorieValue >> 16) & 0xFF);
|
||||
dataArray.push((calorieValue >> 8) & 0xFF);
|
||||
dataArray.push(calorieValue & 0xFF);
|
||||
|
||||
// 添加碳水化合物数据(大端序,3字节)
|
||||
dataArray.push((carbValue >> 16) & 0xFF);
|
||||
dataArray.push((carbValue >> 8) & 0xFF);
|
||||
dataArray.push(carbValue & 0xFF);
|
||||
|
||||
// 添加膳食纤维数据(大端序,3字节)
|
||||
dataArray.push((fiberValue >> 16) & 0xFF);
|
||||
dataArray.push((fiberValue >> 8) & 0xFF);
|
||||
dataArray.push(fiberValue & 0xFF);
|
||||
|
||||
// 添加蛋白质数据(大端序,3字节)
|
||||
dataArray.push((proteinValue >> 16) & 0xFF);
|
||||
dataArray.push((proteinValue >> 8) & 0xFF);
|
||||
dataArray.push(proteinValue & 0xFF);
|
||||
|
||||
// 计算校验和(除同步头外的所有字节的和,取低8位)
|
||||
let checksum = 0;
|
||||
for (let i = 1; i < dataArray.length; i++) {
|
||||
checksum = (checksum + dataArray[i]) & 0xFF;
|
||||
}
|
||||
|
||||
// 添加校验和
|
||||
dataArray.push(checksum);
|
||||
console.log('构建的数据包:', dataArray);
|
||||
console.log('十六进制:', dataArray.map(b => b.toString(16).padStart(2, '0')).join(' '));
|
||||
|
||||
return dataArray;
|
||||
},
|
||||
sendArrayBuffer(buffer) {
|
||||
let that = this
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: that.bleValue.deviceId,
|
||||
serviceId: that.bleValue.serviceId,
|
||||
characteristicId: that.bleValue.write,
|
||||
value: buffer,
|
||||
success: res => {
|
||||
console.log('下发指令成功', res.errMsg)
|
||||
},
|
||||
fail: res => {
|
||||
console.log("下发指令失败", res);
|
||||
},
|
||||
})
|
||||
},
|
||||
//测量返回
|
||||
handleBle(weight, unit, kcal) {
|
||||
let that = this
|
||||
|
|
@ -838,7 +990,7 @@
|
|||
}
|
||||
|
||||
.left {
|
||||
width: 110px;
|
||||
width: 31%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
|
@ -881,7 +1033,7 @@
|
|||
|
||||
.mic-icon {
|
||||
color: #fff;
|
||||
width: calc(100% - 120px);
|
||||
width: 31%;
|
||||
padding: 8px 0;
|
||||
background: $maincolor;
|
||||
display: flex;
|
||||
|
|
@ -889,6 +1041,10 @@
|
|||
justify-content: center;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.mic-icon2 {
|
||||
background: $yellowcolor ;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
|
@ -1306,4 +1462,17 @@
|
|||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapperScan {
|
||||
.auto-search-dialog {
|
||||
bottom: 0;
|
||||
|
||||
text {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
</view>
|
||||
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd"
|
||||
@touchcancel="cancelRecording">
|
||||
<uni-icons type="mic-filled" size="20" :color="mic_touch ? '#777777' : '#fff'"></uni-icons>
|
||||
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
|
||||
语音搜索
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -131,7 +131,6 @@
|
|||
search_value: '',
|
||||
mic_touch: false,
|
||||
voiceManager: null,
|
||||
autoSearchContent: "",
|
||||
showAutoSearchDlg: false
|
||||
};
|
||||
},
|
||||
|
|
@ -151,7 +150,8 @@
|
|||
let that = this
|
||||
that.voiceManager = plugin.getRecordRecognitionManager()
|
||||
that.voiceManager.onStop = function(res) {
|
||||
that.autoSearchContent = res.result.replace('。', '')
|
||||
that.search_value = res.result.replace('。', '')
|
||||
that.handleSerach()
|
||||
}
|
||||
that.voiceManager.onError = function(res) {
|
||||
console.error("error msg", res.retcode)
|
||||
|
|
@ -175,11 +175,13 @@
|
|||
handleDetail(ite, ind) {
|
||||
let that = this
|
||||
let list = []
|
||||
let pages = getCurrentPages()
|
||||
let prevPage = pages[pages.length - 2]
|
||||
if (ind == 1) {
|
||||
list.push(ite)
|
||||
that.ActiveList = that.$tools.mergeAndDeduplicate(that.ActiveList, list, 'name')
|
||||
that.$tools.msg("添加成功")
|
||||
that.search_value = ""
|
||||
that.search_list = []
|
||||
that.isShop = true
|
||||
} else {
|
||||
for (var n = 0; n < that.ActiveList.length; n++) {
|
||||
if (ite.name == that.ActiveList[n].name) {
|
||||
|
|
@ -187,6 +189,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
let pages = getCurrentPages()
|
||||
let prevPage = pages[pages.length - 2]
|
||||
prevPage.$vm.getAddFood(that.ActiveList)
|
||||
},
|
||||
// 搜索
|
||||
|
|
@ -221,13 +225,13 @@
|
|||
let that = this
|
||||
that.search_value = text
|
||||
that.showAutoSearchDlg = false
|
||||
that.autoSearchContent = ''
|
||||
that.handleSerach()
|
||||
},
|
||||
// 开始说话
|
||||
onVoiceTouchStart() {
|
||||
let that = this
|
||||
that.showAutoSearchDlg = true
|
||||
that.isShop = false
|
||||
that.voiceManager.start({
|
||||
duration: 60000,
|
||||
lang: "zh_CN"
|
||||
|
|
@ -278,7 +282,7 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
padding: 30rpx 20rpx;
|
||||
z-index: 19;
|
||||
z-index: 9;
|
||||
background-color: #efefef;
|
||||
|
||||
.serach-box {
|
||||
|
|
|
|||
|
|
@ -28,19 +28,21 @@
|
|||
添加食材
|
||||
<text class="close" @click="handleClose" v-if="info.tags.length">清空</text>
|
||||
</view>
|
||||
<view class="foodlist" v-for="(ite,ind) in info.tags[0].list" :key="ind" v-if="info.tags.length">
|
||||
<view class="item">
|
||||
<view class="name">{{ite.name}}</view>
|
||||
<view class="input">
|
||||
<input class="text" placeholder="请输入用量" v-model="ite.weight" type="digit" />{{ite.unit}}
|
||||
</view>
|
||||
<view class="edit">
|
||||
<icon class="iconfont icon-ashbin" @click="handledel(ind,'food')"></icon>
|
||||
<image src="../../static/xia.png" @click="handleMove(ind,0,'food')" class="xia"></image>
|
||||
<image src="../../static/xia.png" @click="handleMove(ind,1,'food')" class="shang xia"></image>
|
||||
<view v-if="info.tags.length">
|
||||
<view class="foodlist" v-for="(ite,ind) in info.tags[0].list" :key="ind">
|
||||
<view class="item">
|
||||
<view class="name">{{ite.name}}</view>
|
||||
<view class="input">
|
||||
<input class="text" placeholder="请输入用量" v-model="ite.weight" type="digit" />{{ite.unit}}
|
||||
</view>
|
||||
<view class="edit">
|
||||
<icon class="iconfont icon-ashbin" @click="handledel(ind,'food')"></icon>
|
||||
<image src="../../static/xia.png" @click="handleMove(ind,0,'food')" class="xia"></image>
|
||||
<image src="../../static/xia.png" @click="handleMove(ind,1,'food')" class="shang xia">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="add" @click="handleAddfood()">+添加食材</view>
|
||||
</view>
|
||||
|
|
@ -91,10 +93,10 @@
|
|||
cook_label: null,
|
||||
title: "",
|
||||
description: "",
|
||||
food_list: [],
|
||||
tags: [],
|
||||
cover: null, //封面id
|
||||
step_list: [],
|
||||
cookbook_id: null
|
||||
cookbook_id: null,
|
||||
},
|
||||
FMimg: "",
|
||||
edit: false,
|
||||
|
|
@ -125,28 +127,30 @@
|
|||
// 食材列表返回
|
||||
getAddFood(list) {
|
||||
let that = this
|
||||
console.log("list", list)
|
||||
list.forEach(ite => {
|
||||
ite.weight = null
|
||||
})
|
||||
that.info.food_list = that.$tools.mergeAndDeduplicate(that.info.food_list, list, 'name')
|
||||
console.log("222222222", that.info.tags[0].list, list)
|
||||
that.info.tags[0].list = that.$tools.mergeAndDeduplicate(that.info.tags[0].list, list, 'name')
|
||||
},
|
||||
// 清空食材
|
||||
handleClose() {
|
||||
let that = this
|
||||
that.info.food_list = []
|
||||
that.info.tags[0].list = []
|
||||
},
|
||||
// 添加食材
|
||||
handleAddfood() {
|
||||
let that = this
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/me/foodlist?list=" + JSON.stringify(that.info.food_list)
|
||||
url: "/pageTwo/me/foodlist?list=" + JSON.stringify(that.info.tags[0].list)
|
||||
})
|
||||
},
|
||||
// 删除指定食材/菜谱
|
||||
handledel(id, type) {
|
||||
let that = this
|
||||
let name = type == 'step' ? '步骤' : '食材'
|
||||
let list = type == 'step' ? that.info.step_list : that.info.food_list
|
||||
let list = type == 'step' ? that.info.step_list : that.info.tags[0].list
|
||||
uni.showModal({
|
||||
title: '友情提示',
|
||||
content: '是否删除当前' + name,
|
||||
|
|
@ -162,9 +166,9 @@
|
|||
// 上下移动食材
|
||||
handleMove(ind, dir, type) {
|
||||
let that = this
|
||||
let list = type == 'step' ? that.info.step_list : that.info.food_list
|
||||
let list = type == 'step' ? that.info.step_list : that.info.tags[0].list
|
||||
let moveComm = (curIndex, nextIndex) => {
|
||||
let arr = type == 'step' ? that.info.step_list : that.info.food_list
|
||||
let arr = type == 'step' ? that.info.step_list : that.info.tags[0].list
|
||||
arr[curIndex] = arr.splice(nextIndex, 1, arr[curIndex])[0]
|
||||
return arr
|
||||
}
|
||||
|
|
@ -296,17 +300,17 @@
|
|||
that.$tools.msg("请输入菜谱简介!")
|
||||
return
|
||||
}
|
||||
if (!that.info.food_list.length) {
|
||||
if (!that.info.tags[0].list.length) {
|
||||
that.$tools.msg("请添加食材!")
|
||||
return
|
||||
}
|
||||
let array = []
|
||||
that.info.food_list.forEach(ite => {
|
||||
that.info.tags[0].list.forEach(ite => {
|
||||
if (ite.weight != null || ite.weight > 0) {
|
||||
array.push(ite.weight)
|
||||
}
|
||||
})
|
||||
if (array.length != that.info.food_list.length) {
|
||||
if (array.length != that.info.tags[0].list.length) {
|
||||
that.$tools.msg("请输入食材重量!")
|
||||
return
|
||||
}
|
||||
|
|
@ -331,11 +335,16 @@
|
|||
that.info.token = uni.getStorageSync('token')
|
||||
console.log("修改", that.info)
|
||||
that.$model.getEditCookbook(that.info).then(res2 => {
|
||||
if (res2.code != 0) {
|
||||
that.$tools.msg(res.msg)
|
||||
return
|
||||
}
|
||||
if (res2.code == 0) {
|
||||
that.$tools.msg("修改成功")
|
||||
setTimeout(function() {
|
||||
uni.redirectTo({
|
||||
url: "/pageTwo/me/menudetail?id=" + that.info.id + '&title=我的菜谱'
|
||||
url: "/pageTwo/me/menudetail?id=" + that.info.id +
|
||||
'&title=我的菜谱'
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
</view>
|
||||
<view class="kcal" v-else>
|
||||
<view class="num" v-if="ite.newweight">
|
||||
{{ite.newweight}}{{ite.newunit=="oz"?'盎司':'克'}}
|
||||
{{ite.newweight}}{{ite.newunit}}
|
||||
</view>
|
||||
<view class="num" v-if="ite.newkcal">
|
||||
{{ite.newkcal}}
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
<view class="title">是否保存至“计食”为今日饮食?</view>
|
||||
<view class="types">
|
||||
<view class="type-item" :class="{'active':selectSaveType == index}"
|
||||
v-for="(item,index) in saveFoodTypes" :key="index" @click="selectSaveType=index">{{item}}</view>
|
||||
v-for="(item,index) in foodItem" :key="index" @click="selectSaveType=index">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="confirm" @click="confirmSaveFood">确定</view>
|
||||
|
|
@ -179,6 +179,9 @@
|
|||
menu() {
|
||||
return this.configInfo.cookbook_label
|
||||
},
|
||||
foodItem() {
|
||||
return this.configInfo.meal_list
|
||||
},
|
||||
endDate() {
|
||||
return this.$tools.getDate("start")
|
||||
},
|
||||
|
|
@ -229,6 +232,7 @@
|
|||
that.isWeightType = false
|
||||
that.activeType = that.info.tags[0].list[0]
|
||||
that.weightKcal = Number(Number(that.activeType.kcal) / 100).toFixed(2)
|
||||
console.log("222222222",that.info.tags[0].list)
|
||||
if (that.info.tags[0].list.length == 1) {
|
||||
that.isLast = true
|
||||
}
|
||||
|
|
@ -285,10 +289,10 @@
|
|||
for (let i = 0; i < that.info.tags[0].list.length; ++i) {
|
||||
if (that.info.tags[0].list[i].newweight) {
|
||||
newFoodList.push({
|
||||
meals_type: that.saveFoodTypes[that.selectSaveType],
|
||||
meals_type: that.foodItem[that.selectSaveType].name,
|
||||
id: that.info.tags[0].list[i].id,
|
||||
weight: that.info.tags[0].list[i].newweight,
|
||||
unit: that.info.tags[0].list[i].newunit == '克' ? '克' : '盎司'
|
||||
unit: that.info.tags[0].list[i].newunit
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<text class="overflow">{{it.create_user_nickname}}</text>
|
||||
</view>
|
||||
<view class="zan" @click="handleZan(it)">
|
||||
<icon class="t-icon" :class="[it.is_me_like_it=='yes'?'t-icon-icon3':'t-icon-icon_collect']">
|
||||
<icon class="t-icon mr-5" :class="[it.is_me_like_it=='yes'?'t-icon-icon3':'t-icon-icon_collect']">
|
||||
</icon>
|
||||
<text>{{it.likes_num}}</text>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@
|
|||
aud_id: that.user.aud_id,
|
||||
page: that.page,
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
that.infoList = that.infoList.concat(res.content_list)
|
||||
that.lastPage = res.page_total
|
||||
if (res.code == 0) {
|
||||
that.infoList = that.infoList.concat(res.data.content_list)
|
||||
that.lastPage = res.data.page_total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -67,48 +67,52 @@
|
|||
</view>
|
||||
<!-- 加餐 -->
|
||||
<!-- 营养含量分析 -->
|
||||
<uni-drawer ref="showRight" mode="right" width="300">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
<view v-if="drawerVisible" class="drawerVisible">
|
||||
<view class="bgVisible" @click="handleDrawerClose"></view>
|
||||
<view class="infoVisible">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts" :canvas2d="true" canvasId="recordetailCharts"
|
||||
:chartData="chartData2" :cHeight="250" :cWidth="250" />
|
||||
<view class="uchart-kcal">{{activeFoodDetail.val}}</view>
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item" v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)"
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts" :canvas2d="true" v-if="chartVisible"
|
||||
canvasId="recordetailCharts" :chartData="chartData2" :cHeight="250"
|
||||
:cWidth="250" />
|
||||
<view class="uchart-kcal">{{activeFoodDetail.val}}</view>
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item"
|
||||
v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)" :key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}"></view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}"></view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</uni-drawer>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -123,6 +127,8 @@
|
|||
return {
|
||||
token: "",
|
||||
index: 0,
|
||||
drawerVisible: false,
|
||||
chartVisible: false, // 单独控制图表显示
|
||||
opts: {
|
||||
dataLabel: false,
|
||||
color: ["#5180D8", "#ED7886", "#FFB169"],
|
||||
|
|
@ -198,6 +204,17 @@
|
|||
data: chart_data
|
||||
}]
|
||||
}));
|
||||
that.$nextTick(() => {
|
||||
// 延迟显示图表,确保容器已渲染
|
||||
setTimeout(() => {
|
||||
that.chartVisible = true
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
handleDrawerClose() {
|
||||
// 先隐藏图表,再隐藏抽屉
|
||||
this.chartVisible = false
|
||||
this.drawerVisible = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,9 +62,10 @@
|
|||
<view class="lan border-bottom">
|
||||
<view class="left">活动系数</view>
|
||||
<view class="right">
|
||||
<picker mode="selector" @change="changeClickType" :range="activityLevel" range-key="name" :value="levelInd">
|
||||
<picker mode="selector" @change="changeClickType" :range="activityLevel" range-key="name"
|
||||
:value="levelInd">
|
||||
<view>
|
||||
{{activityLevel[levelInd].name}}
|
||||
{{memInfo.activity_level?activityLevel[levelInd].name:'请选择'}}
|
||||
<icon class="iconfont icon-arrow-down"></icon>
|
||||
</view>
|
||||
</picker>
|
||||
|
|
@ -95,7 +96,7 @@
|
|||
weight: "",
|
||||
gender: 0,
|
||||
nickname: "",
|
||||
activity_level: 0,
|
||||
activity_level: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
@ -160,7 +161,7 @@
|
|||
that.$model.getUserInfoEdit(data).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$tools.msg("提交成功");
|
||||
that.handleHomeUserInfo()
|
||||
that.$store.dispatch("getUserInfo")
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
|
|
@ -169,14 +170,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
// 获取账号信息
|
||||
handleHomeUserInfo() {
|
||||
let that = this
|
||||
that.$model.getHomeUserInfo({}).then(res => {
|
||||
if (res.code != 0) return
|
||||
that.$store.commit('changeUserInfo', res.data)
|
||||
})
|
||||
},
|
||||
//确定年龄
|
||||
maskClick(e) {
|
||||
console.log("出生日期", e.detail.value)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
所需食材
|
||||
</view>
|
||||
<view class="foodlist">
|
||||
<view class="item" v-for="(ite,ind) in info.food_list" :key="ind" v-if="info.food_list.length">
|
||||
<view class="item" v-for="(ite,ind) in info.tags[0].list" :key="ind" v-if="info.tags[0].list.length">
|
||||
<view class="name">{{ite.name}}</view>
|
||||
<view class="weight">
|
||||
{{ite.weight}}{{ite.unit}}
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
cook_label: null,
|
||||
title: "",
|
||||
description: "",
|
||||
food_list: [],
|
||||
tags: [],
|
||||
cover: null, //封面id
|
||||
step_list: []
|
||||
},
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["configInfo"]),
|
||||
...mapState(["configInfo","user"]),
|
||||
menu() {
|
||||
return this.configInfo.cookbook_label
|
||||
},
|
||||
|
|
@ -270,6 +270,10 @@
|
|||
that.$tools.msg("登录后查看等多!")
|
||||
return
|
||||
}
|
||||
if (that.user.aud_id == '') {
|
||||
that.$tools.msg("完善资料后查看更多")
|
||||
return
|
||||
}
|
||||
if (!that.info.cover) {
|
||||
that.$tools.msg("请上传封面图!")
|
||||
return
|
||||
|
|
@ -334,8 +338,8 @@
|
|||
that.FMimg = ""
|
||||
that.cookIndex = null
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: "/pages/menu/menu"
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/me/mymenu?pageName=我的菜谱"
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="content" >
|
||||
<view v-if="!token" class="list2" @click="handleLogin()">
|
||||
<view class="nolist">
|
||||
<icon class="iconfont icon-zanwushuju"></icon>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
</view>
|
||||
<view v-else class="content_box">
|
||||
<!-- 称重 -->
|
||||
<view class="blue-tooth">
|
||||
<view class="blue-tooth" v-if="user.aud_id!=''">
|
||||
<blue-tooth :btnType="'1'"></blue-tooth>
|
||||
</view>
|
||||
<!-- 每日摄入 -->
|
||||
|
|
@ -102,6 +102,10 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxi" @click="navTo('/pageTwo/count/everyDay?page=count')">
|
||||
<image src="/static/fenxi.png"></image>
|
||||
营养分析
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="list2" @click="handleEditUser()">
|
||||
<view class="nolist">
|
||||
|
|
@ -110,55 +114,54 @@
|
|||
</view>
|
||||
<view class="btn">完善资料</view>
|
||||
</view>
|
||||
<view class="fenxi" @click="navTo('/pageTwo/count/everyDay?page=count')">
|
||||
<image src="/static/fenxi.png"></image>
|
||||
营养分析
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 营养含量分析 -->
|
||||
<uni-drawer ref="showRight" mode="right" width="300">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
<view v-if="drawerVisible" class="drawerVisible">
|
||||
<view class="bgVisible" @click="handleDrawerClose"></view>
|
||||
<view class="infoVisible">
|
||||
<scroll-view style="height: 100%;" scroll-y="true">
|
||||
<view class="foodDetail">
|
||||
<view class="foodInfo">
|
||||
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{activeFoodDetail.name}}</view>
|
||||
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280"
|
||||
:cWidth="280" />
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item" v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)"
|
||||
:key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}">
|
||||
<view class="foodContent">
|
||||
<view class="title">热量和营养</view>
|
||||
<view class="progress">
|
||||
<div class="chart-wrap">
|
||||
<qiun-data-charts v-if="chartVisible" type="ring" :opts="opts"
|
||||
:chartData="chartData2" :cHeight="280" :cWidth="280" />
|
||||
</div>
|
||||
<view class="info" v-if="activeFoodDetail.nutrients_four">
|
||||
<view class="info-item"
|
||||
v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)" :key="index">
|
||||
<view class="color" :style="{'background-color':`${item.color}`}">
|
||||
</view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
<view>{{item.name}}:{{item.proportion}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
<view class="tips">
|
||||
<text>营养素</text>
|
||||
<text>{{activeFoodDetail.weight}}含量</text>
|
||||
</view>
|
||||
<view class="foodDetailList">
|
||||
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
|
||||
:key="index">
|
||||
<view class="name">{{item.name_ch}}</view>
|
||||
<view class="value">{{item.value}}{{item.unit}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</uni-drawer>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -189,6 +192,8 @@
|
|||
handTrue: false,
|
||||
chartData2: {},
|
||||
activeFoodDetail: {},
|
||||
drawerVisible: false,
|
||||
chartVisible: false, // 单独控制图表显示
|
||||
actionOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
|
|
@ -237,7 +242,7 @@
|
|||
console.log("item", item)
|
||||
let that = this
|
||||
let chart_data = []
|
||||
this.$refs.showRight.open();
|
||||
this.drawerVisible = true;
|
||||
that.opts.color = []
|
||||
that.activeFoodDetail = item
|
||||
for (let i = 1; i < item.nutrients_four.length; ++i) {
|
||||
|
|
@ -253,6 +258,17 @@
|
|||
data: chart_data
|
||||
}]
|
||||
}));
|
||||
that.$nextTick(() => {
|
||||
// 延迟显示图表,确保容器已渲染
|
||||
setTimeout(() => {
|
||||
that.chartVisible = true
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
handleDrawerClose() {
|
||||
// 先隐藏图表,再隐藏抽屉
|
||||
this.chartVisible = false
|
||||
this.drawerVisible = false;
|
||||
},
|
||||
changeClickDate(e) {
|
||||
this.$store.dispatch("getCountFoodInfo", {
|
||||
|
|
@ -602,4 +618,10 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.no-scroll {
|
||||
height: 80vh !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -7,15 +7,14 @@
|
|||
</view>
|
||||
<!-- 个人资料 -->
|
||||
<view v-if="token" class="content-box">
|
||||
<view class="box" v-if="info.aud_id!=''">
|
||||
<view class="box" v-if="info.aud_id">
|
||||
<view class="info">
|
||||
<!-- /pageTwo/me/userEdit -->
|
||||
<view class="name" @click="navTo('/pageTwo/me/userEdit')">
|
||||
<view class="name" @click="handleUserEdit">
|
||||
<image :src="info.head_pic"></image>
|
||||
<text class="bold">{{info.nickname}}</text>
|
||||
<text>{{info.gender=='1'?'男':'女'}}</text>
|
||||
</view>
|
||||
<view class="edit" @click="navTo('/pageTwo/me/userEdit')">
|
||||
<view class="edit" @click="handleUserEdit">
|
||||
<image src="/static/26.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -34,7 +33,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box1 box" v-else @click="navTo('/pageTwo/me/userEdit')">
|
||||
<view class="box1 box" v-else @click="handleUserEdit">
|
||||
<view class="info2">
|
||||
完善资料后,记录更准确哦!
|
||||
</view>
|
||||
|
|
@ -168,12 +167,12 @@
|
|||
foodInfo() {
|
||||
let that = this
|
||||
this.handTrue = false
|
||||
this.$nextTick(() => {
|
||||
this.handTrue = true
|
||||
that.chartData.series[0].data = this.user.aud_id != "" ? Number(this.user.food_count
|
||||
that.$nextTick(() => {
|
||||
that.handTrue = true
|
||||
that.chartData.series[0].data = that.user.aud_id ? Number(that.user.food_count
|
||||
.nutrients_four[0].proportion) / 100 : 0
|
||||
})
|
||||
return this.user.aud_id != "" ? this.user.food_count : this.configInfo.default_count_foot
|
||||
return this.user.aud_id ? this.user.food_count : this.configInfo.default_count_foot
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -181,7 +180,12 @@
|
|||
that.token = uni.getStorageSync('token')
|
||||
that.$store.dispatch("getHomeConfig")
|
||||
if (that.token) {
|
||||
that.$ble.openBluetoothAdapter()
|
||||
console.log("首页搜索蓝牙",that.bleValue)
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId)
|
||||
that.$ble.closeBluetoothAdapter()
|
||||
setTimeout(function() {
|
||||
that.$ble.openBluetoothAdapter()
|
||||
}, 500);
|
||||
}
|
||||
that.$ble.onBLEConnectionStateChange()
|
||||
uni.onBluetoothAdapterStateChange(function(res) {
|
||||
|
|
@ -203,7 +207,7 @@
|
|||
that.handTrue = false
|
||||
this.$nextTick(() => {
|
||||
that.handTrue = true
|
||||
that.chartData.series[0].data = that.user.aud_id != "" ? Number(that.user.food_count
|
||||
that.chartData.series[0].data = that.user.aud_id ? Number(that.user.food_count
|
||||
.nutrients_four[0].proportion) / 100 : 0
|
||||
})
|
||||
this.startWatching()
|
||||
|
|
@ -215,12 +219,13 @@
|
|||
handleInfo() {
|
||||
let that = this
|
||||
this.$nextTick(() => {
|
||||
that.chartData.series[0].data = that.user.aud_id == "" ? 0 : Number(that.user.food_count
|
||||
that.chartData.series[0].data = that.user.aud_id ? 0 : Number(that.user.food_count
|
||||
.nutrients_four[0]
|
||||
.proportion) / 100
|
||||
})
|
||||
},
|
||||
startWatching() {
|
||||
console.log("99999999",this.bleValue)
|
||||
this.unwatch = this.$watch('bleValue', (newVal, oldVal) => {
|
||||
// 这里可以执行你的业务逻辑
|
||||
if (newVal.serviceId != '' && newVal.oldCountWeight != newVal.countWeight) {
|
||||
|
|
@ -246,12 +251,22 @@
|
|||
url: "/pageTwo/login/login"
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
handleUserEdit() {
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/me/userEdit"
|
||||
})
|
||||
},
|
||||
handleAddFood(name) {
|
||||
let that = this
|
||||
if (!that.token) {
|
||||
that.$tools.msg("登录后查看更多")
|
||||
return
|
||||
}
|
||||
if (that.info.aud_id == '') {
|
||||
that.$tools.msg("完善资料后查看更多")
|
||||
return
|
||||
}
|
||||
unwatch();
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/count/search?name=" + name + "&time=" + this.foodInfo.date
|
||||
|
|
@ -259,10 +274,15 @@
|
|||
},
|
||||
// 功能页面跳转
|
||||
navTo(url) {
|
||||
let that = this
|
||||
if (!this.token) {
|
||||
this.$tools.msg("登录后查看更多")
|
||||
return
|
||||
}
|
||||
if (that.info.aud_id == '') {
|
||||
that.$tools.msg("完善资料后查看更多")
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
import search from '@/components/search2.vue';
|
||||
export default {
|
||||
name: "list",
|
||||
|
|
@ -49,6 +52,9 @@
|
|||
components: {
|
||||
search
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
},
|
||||
onLoad(options) {
|
||||
let that = this
|
||||
that.search_value = options.name
|
||||
|
|
@ -75,12 +81,17 @@
|
|||
search_data: that.search_value
|
||||
}).then(res => {
|
||||
if (res.code != 0 || res.data instanceof Array) return
|
||||
that.food_search_list = that.food_search_list.concat(res.data.content_list)
|
||||
that.food_search_list = that.food_search_list.concat(res.data.content_list)
|
||||
that.lastPage = res.data.page_total
|
||||
})
|
||||
},
|
||||
// 商品详情
|
||||
handleDetail(id) {
|
||||
let that = this
|
||||
if (that.user.aud_id == '') {
|
||||
that.$tools.msg("完善资料后查看更多")
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pageTwo/me/menudetail?id=" + id
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"appid": "wx1f32af4f93c913f6",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.14.0",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"condition": false
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "kitchendDevice",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
}
|
||||
|
|
@ -21,12 +21,17 @@ export default {
|
|||
}) {
|
||||
return model.getHomeUserInfo({}).then(res => {
|
||||
if (res.code != 0) {
|
||||
commit('changeUserInfo', {
|
||||
aud_id: ""
|
||||
})
|
||||
tools.msg(res.msg)
|
||||
return
|
||||
}
|
||||
commit('changeUserInfo', res.data)
|
||||
if (res.data.weight == 0 || res.data.weight == null || res.data.weight == "") {
|
||||
commit('changeUserInfo', {
|
||||
isEditInfo: true,
|
||||
aud_id: ""
|
||||
})
|
||||
} else {
|
||||
commit('changeUserInfo', res.data)
|
||||
}
|
||||
dispatch("getCountFoodInfo", {
|
||||
aud_id: res.data.aud_id,
|
||||
time: tools.getDate("start")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import actions from './actions.js'
|
||||
import json from '@/content.json'
|
||||
Vue.use(Vuex)
|
||||
export default new Vuex.Store({
|
||||
// state: 存储基本数据
|
||||
|
|
@ -40,7 +41,14 @@ export default new Vuex.Store({
|
|||
},
|
||||
cookbook_label: [],
|
||||
activity_level: [],
|
||||
default_count_foot: {},
|
||||
default_count_foot: {
|
||||
date: "",
|
||||
list: [],
|
||||
details: {},
|
||||
nutrients_four: [],
|
||||
remaining_kcal: "",
|
||||
trace_elements_all_day: []
|
||||
},
|
||||
business_cooperation: {}
|
||||
},
|
||||
// 计食器
|
||||
|
|
@ -58,10 +66,13 @@ export default new Vuex.Store({
|
|||
notify: "",
|
||||
write: "",
|
||||
unit: "g",
|
||||
type: 1,
|
||||
unitList: json.unitArray,
|
||||
isSendVal: false,
|
||||
oldCountWeight: 0,
|
||||
countWeight: 100,
|
||||
bleTipsText: "",
|
||||
isConnectStatus: null,
|
||||
isConnectStatus: 0,
|
||||
},
|
||||
isBluetoothTyle: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,20 +1,31 @@
|
|||
import $store from '@/store'
|
||||
let searchTimer = null
|
||||
import $model from '@/tools/model.js'
|
||||
import $tools from '@/tools/tools.js'
|
||||
import $data from '@/content.json'
|
||||
let unitList = []
|
||||
let devicesList = []
|
||||
let searchTimer = null
|
||||
let UNIT_MAP = $data.units
|
||||
|
||||
// 初始化蓝牙
|
||||
function openBluetoothAdapter() {
|
||||
devicesList = []
|
||||
unitList = []
|
||||
clearTimeout(searchTimer);
|
||||
uni.openBluetoothAdapter({
|
||||
success: e => {
|
||||
$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0
|
||||
isConnectStatus: 0,
|
||||
unitList: $data.unitMinus,
|
||||
})
|
||||
startBluetoothDeviceDiscovery()
|
||||
},
|
||||
fail: e => {
|
||||
$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
isConnectStatus: 1,
|
||||
unitList: $data.unitMinus,
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
@ -23,7 +34,7 @@ function openBluetoothAdapter() {
|
|||
function startBluetoothDeviceDiscovery() {
|
||||
uni.startBluetoothDevicesDiscovery({
|
||||
allowDuplicatesKey: true,
|
||||
services: [],
|
||||
interval: 200,
|
||||
success: res => {
|
||||
onBluetoothDeviceFound();
|
||||
searchTimer = setTimeout(() => {
|
||||
|
|
@ -57,25 +68,56 @@ function onBluetoothDeviceFound() {
|
|||
if (!device.name && !device.localName) {
|
||||
return
|
||||
}
|
||||
if (device.name.indexOf('Chipsea-BLE') != -1 || (device.localName && device
|
||||
.localName.indexOf('Chipsea-BLE') != -1) || id == 'a5fe') {
|
||||
if (device.name.toLowerCase().indexOf('pc-c06pro') != -1 ||
|
||||
device.name.toLowerCase().indexOf('pc-c02pro') != -1 ||
|
||||
device.name.toLowerCase().indexOf('pc-c09pro') != -1 ||
|
||||
device.name.toLowerCase().indexOf('pc-c10pro') != -1 ||
|
||||
device.name.toLowerCase().indexOf('pc-c07pro') != -1 ||
|
||||
(device.localName && device.localName.toLowerCase().indexOf('pc-c07pro') != -1) ||
|
||||
(device.localName && device.localName.toLowerCase().indexOf('pc-c10pro') != -1) ||
|
||||
(device.localName && device.localName.toLowerCase().indexOf('pc-c06pro') != -1) ||
|
||||
(device.localName && device.localName.toLowerCase().indexOf('pc-c02pro') != -1) ||
|
||||
(device.localName && device.localName.toLowerCase().indexOf('pc-c09pro') != -1)) {
|
||||
clearTimeout(searchTimer);
|
||||
const bytes = new Uint8Array(device.advertisData);
|
||||
const macBytes = bytes.slice(6, 12);
|
||||
device.macAddr = $tools.ab2hex(macBytes, ':').toUpperCase()
|
||||
stopBluetoothDevicesDiscovery()
|
||||
Bluetoothfilter(device.deviceId)
|
||||
Bluetoothfilter(device)
|
||||
return
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
// 过滤蓝牙
|
||||
function Bluetoothfilter(device_id) {
|
||||
function Bluetoothfilter(device) {
|
||||
const foundDevices = devicesList
|
||||
const idx = inArray(foundDevices, "deviceId", device_id)
|
||||
const idx = inArray(foundDevices, "deviceId", device.deviceId)
|
||||
if (idx === -1) {
|
||||
devicesList.push(device_id);
|
||||
connectDevice(device_id)
|
||||
devicesList.push(device);
|
||||
// handleDevType(device)
|
||||
connectDevice(device.deviceId)
|
||||
}
|
||||
}
|
||||
// 排查设备
|
||||
function handleDevType(device) {
|
||||
$model.getCheckDevice({
|
||||
mac: device.macAddr,
|
||||
}).then(res => {
|
||||
console.log("排查设备:", device, res)
|
||||
if (res.code == 0) {
|
||||
connectDevice(device.deviceId)
|
||||
} else {
|
||||
devicesList = []
|
||||
$tools.msg('设备未登记,请联系出售方进行系统认证')
|
||||
$store.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//连接设备
|
||||
function connectDevice(device_id) {
|
||||
|
|
@ -87,7 +129,11 @@ function connectDevice(device_id) {
|
|||
}, 200)
|
||||
},
|
||||
fail: res => {
|
||||
console.log("连接失败,点击重新连接", res);
|
||||
$store.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -100,6 +146,7 @@ function getBLEDeviceServices(device_id) {
|
|||
deviceId: device_id,
|
||||
success: res => {
|
||||
console.log("获取设备的UUID成功", res)
|
||||
stopBluetoothDevicesDiscovery();
|
||||
serviceList = res.services;
|
||||
for (let i = 0; i < serviceList.length; i++) {
|
||||
let service = serviceList[i];
|
||||
|
|
@ -110,6 +157,11 @@ function getBLEDeviceServices(device_id) {
|
|||
}
|
||||
},
|
||||
fail: res => {
|
||||
$store.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
})
|
||||
console.log('获取设备的UUID失败:', res)
|
||||
}
|
||||
});
|
||||
|
|
@ -136,6 +188,11 @@ function getBLEDeviceCharacteristics(deviceId, serviceId) {
|
|||
getBLECharacteristicValueChange(deviceId, serviceId, notify, write)
|
||||
},
|
||||
fail: res => {
|
||||
$store.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
})
|
||||
console.log('获取特征值失败:', JSON.stringify(res))
|
||||
}
|
||||
})
|
||||
|
|
@ -155,13 +212,12 @@ function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
|
|||
notify: notify,
|
||||
write: write,
|
||||
unit: "g",
|
||||
countWeight: "",
|
||||
type: 1,
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
bleTipsText: "测量中,请将食物放到秤上",
|
||||
isConnectStatus: 0
|
||||
isConnectStatus: 2
|
||||
})
|
||||
const units = ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
|
||||
'milkml', 'oz', 'floz', 'lboz'
|
||||
]
|
||||
uni.onBLECharacteristicValueChange(function(res) {
|
||||
const value = res.value
|
||||
const dataView = new DataView(value)
|
||||
|
|
@ -189,15 +245,42 @@ function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
|
|||
|
||||
// 计算实际重量
|
||||
let finalWeight = weightValue / Math.pow(10, precision)
|
||||
console.log("类型:", cmd, "重量",
|
||||
finalWeight, "小数点", precision, "单位", UNIT_MAP[unitIndex])
|
||||
|
||||
if (isNegative) finalWeight = -finalWeight
|
||||
$store.commit("changeBluetoothValue", {
|
||||
countWeight: finalWeight,
|
||||
unit: units[unitIndex],
|
||||
unit: UNIT_MAP[unitIndex],
|
||||
type: statusType
|
||||
})
|
||||
break
|
||||
|
||||
case 0x03:
|
||||
break
|
||||
case 0x08:
|
||||
const start0 = []
|
||||
const value2 = $tools.ab2hex(res.value, "");
|
||||
const start = parseUnitMask(value2.substring(8, 10), UNIT_MAP.slice(0,
|
||||
7))
|
||||
const start1 = parseUnitMask(value2.substring(10, 12), UNIT_MAP.slice(8,
|
||||
10))
|
||||
start.push.apply(start, start1)
|
||||
if (start.length) {
|
||||
$data.unitMinus.forEach(item => {
|
||||
start.forEach(item2 => {
|
||||
if (item.unit == item2) {
|
||||
start0.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
$store.commit("changeBluetoothValue", {
|
||||
unitList: start0.length ? start0 : $data.unitMinus
|
||||
})
|
||||
console.log("2222222", start, start0)
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -239,13 +322,19 @@ function ab2hex(buffer, split) {
|
|||
function closeBluetoothAdapter() {
|
||||
uni.closeBluetoothAdapter({
|
||||
success: res => {
|
||||
clearTimeout(searchTimer);
|
||||
$store.commit("changeBluetoothValue", {
|
||||
deviceId: "",
|
||||
serviceId: "",
|
||||
notify: "",
|
||||
write: "",
|
||||
unit: "g",
|
||||
countWeight: '',
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
type: 1,
|
||||
unitList: $data.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
})
|
||||
console.log('蓝牙模块关闭成功');
|
||||
}
|
||||
|
|
@ -269,7 +358,9 @@ function onBLEConnectionStateChange() {
|
|||
if (!res.connected) {
|
||||
$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
unitList: $data.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
type: 1,
|
||||
})
|
||||
closeBLEConnection()
|
||||
closeBluetoothAdapter()
|
||||
|
|
@ -287,9 +378,38 @@ function stopBluetoothDevicesDiscovery() {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
//@param {number|string} hexValue - 16进制值,如 0x19 或 '0x19'
|
||||
// @returns {Array} 使用的单位列表
|
||||
|
||||
|
||||
function parseUnitMask(hexValue, UNIT_MAP) {
|
||||
// 转换为数字
|
||||
const mask = typeof hexValue === 'string' ? parseInt(hexValue, 16) : hexValue;
|
||||
|
||||
// 验证输入
|
||||
if (isNaN(mask) || mask < 0 || mask > 0xFF) {
|
||||
console.error('无效的位掩码值');
|
||||
return [];
|
||||
}
|
||||
|
||||
// 存储结果
|
||||
const usedUnits = [];
|
||||
|
||||
// 遍历每一位
|
||||
for (let i = 0; i < 8; i++) {
|
||||
// 使用位运算检查第 i 位是否为 1
|
||||
if (mask & (1 << i)) {
|
||||
usedUnits.push(UNIT_MAP[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return usedUnits;
|
||||
}
|
||||
export default {
|
||||
ab2hex,
|
||||
inArray,
|
||||
unitList,
|
||||
openBluetoothAdapter,
|
||||
startBluetoothDeviceDiscovery,
|
||||
onBluetoothDeviceFound,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ export default {
|
|||
return res
|
||||
})
|
||||
},
|
||||
getCheckDevice(param) { // 设备过滤
|
||||
return http.post("/de/check_device_msg", param).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
getRegisterPhone(param) { // 手机号快捷登录
|
||||
return http.post("/kitchenscale2/wechat_quick_login", param).then(res => {
|
||||
return res
|
||||
|
|
@ -91,7 +96,7 @@ export default {
|
|||
})
|
||||
},
|
||||
getPhotoSearch(param) { //图像识别
|
||||
return http.post("/kitchenscale2/baidu_identify_food", param).then(res => {
|
||||
return http.post("/kitchenscale2/search_food_barcode", param).then(res => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
|
|
@ -209,20 +214,20 @@ export default {
|
|||
},
|
||||
getMyLogList(param) { // 饮食列表
|
||||
return http.post("/kitchenscale2/get_log_list", param).then(res => {
|
||||
let pkList = {
|
||||
list: [],
|
||||
Dlist: []
|
||||
}
|
||||
if (res.code == 0) {
|
||||
for (var i = 0; i < res.data.content_list.length; i++) {
|
||||
pkList.list.push(res.data.content_list[i])
|
||||
if (!pkList.Dlist.includes(res.data.content_list[i].time)) { //includes 检测数组是否有某个值
|
||||
pkList.Dlist.push(res.data.content_list[i].time);
|
||||
}
|
||||
}
|
||||
}
|
||||
res.data.pkList = pkList
|
||||
return res.data
|
||||
// let pkList = {
|
||||
// list: [],
|
||||
// Dlist: []
|
||||
// }
|
||||
// if (res.code == 0) {
|
||||
// for (var i = 0; i < res.data.content_list.length; i++) {
|
||||
// pkList.list.push(res.data.content_list[i])
|
||||
// if (!pkList.Dlist.includes(res.data.content_list[i].time)) { //includes 检测数组是否有某个值
|
||||
// pkList.Dlist.push(res.data.content_list[i].time);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// res.data.pkList = pkList
|
||||
return res
|
||||
})
|
||||
},
|
||||
// 计食器
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ module.exports = {
|
|||
"ring": {
|
||||
"type": "ring",
|
||||
"color": color,
|
||||
"animation": false,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"rotate": false,
|
||||
"dataLabel": false,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
var isReady=false;var onReadyCallbacks=[];
|
||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||
var __uniConfig = {"pages":["pages/index/index","pages/menu/menu","pages/add/add","pages/count/count","pages/me/me","pages/add/Preview","pages/search/search","pageTwo/login/forgetPassword","pageTwo/login/login","pageTwo/me/feedBack","pageTwo/me/userEdit","pageTwo/me/record","pageTwo/me/mymenu","pageTwo/me/menudetail","pageTwo/me/foodlist","pageTwo/count/setting","pageTwo/count/KcalEdit","pageTwo/count/food","pageTwo/webview/webview","pageTwo/setting/setting","pageTwo/setting/password","pageTwo/setting/email","pageTwo/setting/phone","pageTwo/me/menuEdit"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#efefef","backgroundColor":"#efefef"},"tabBar":{"color":"#333","selectedColor":"#ff4c4f","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/menu/menu","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"菜谱"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食器"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"kitchendDevice","compilerVersion":"4.76","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页","enablePullDownRefresh":true}},{"path":"/pages/menu/menu","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"菜谱","enablePullDownRefresh":true}},{"path":"/pages/add/add","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"添加食谱","enablePullDownRefresh":false}},{"path":"/pages/count/count","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"计食器","enablePullDownRefresh":false}},{"path":"/pages/me/me","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"个人中心","enablePullDownRefresh":false}},{"path":"/pages/add/Preview","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/search/search","meta":{},"window":{"navigationBarTitleText":"搜索"}},{"path":"/pageTwo/login/forgetPassword","meta":{},"window":{"navigationBarTitleText":"密码","enablePullDownRefresh":false}},{"path":"/pageTwo/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pageTwo/me/feedBack","meta":{},"window":{"navigationBarTitleText":"意见反馈","navigationBarBackgroundColor":"#F9FAFC"}},{"path":"/pageTwo/me/userEdit","meta":{},"window":{"navigationBarTitleText":"个人资料","navigationBarBackgroundColor":"#F9FAFC"}},{"path":"/pageTwo/me/record","meta":{},"window":{"navigationBarTitleText":"饮食记录","enablePullDownRefresh":false}},{"path":"/pageTwo/me/mymenu","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menudetail","meta":{},"window":{"navigationBarTitleText":"详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/foodlist","meta":{},"window":{"navigationBarTitleText":"食材库","enablePullDownRefresh":true}},{"path":"/pageTwo/count/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/count/KcalEdit","meta":{},"window":{"navigationBarTitleText":"自定义卡路里","enablePullDownRefresh":false}},{"path":"/pageTwo/count/food","meta":{},"window":{"navigationBarTitleText":"食材库","enablePullDownRefresh":false}},{"path":"/pageTwo/webview/webview","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/password","meta":{},"window":{"navigationBarTitleText":"修改密码","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/email","meta":{},"window":{"navigationBarTitleText":"绑定邮箱","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/phone","meta":{},"window":{"navigationBarTitleText":"绑定手机号","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menuEdit","meta":{},"window":{"navigationBarTitleText":""}}];
|
||||
var __uniConfig = {"pages":["pages/index/index","pages/menu/menu","pages/add/add","pages/count/count","pages/me/me","pages/add/Preview","pages/search/search","pages/search/list","pageTwo/login/forgetPassword","pageTwo/login/login","pageTwo/me/feedBack","pageTwo/me/userEdit","pageTwo/me/record","pageTwo/me/recordetail","pageTwo/me/mymenu","pageTwo/me/menudetail","pageTwo/me/foodlist","pageTwo/count/setting","pageTwo/count/KcalEdit","pageTwo/count/everyMeal","pageTwo/count/search","pageTwo/webview/webview","pageTwo/setting/setting","pageTwo/setting/password","pageTwo/setting/email","pageTwo/setting/phone","pageTwo/me/menuEdit","pageTwo/count/everyDay"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#3CB383","backgroundColor":"#f7f7f7"},"tabBar":{"color":"#333","selectedColor":"#3CB383","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/search/search","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"教你做"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"kitchendDevice","compilerVersion":"4.76","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页","enablePullDownRefresh":true}},{"path":"/pages/menu/menu","meta":{},"window":{"navigationBarTitleText":"菜谱","enablePullDownRefresh":true}},{"path":"/pages/add/add","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"添加食谱","enablePullDownRefresh":false}},{"path":"/pages/count/count","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"计食","enablePullDownRefresh":false}},{"path":"/pages/me/me","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"个人中心","enablePullDownRefresh":false}},{"path":"/pages/add/Preview","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/search/search","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"搜索菜谱"}},{"path":"/pages/search/list","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pageTwo/login/forgetPassword","meta":{},"window":{"navigationBarTitleText":"密码","enablePullDownRefresh":false}},{"path":"/pageTwo/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pageTwo/me/feedBack","meta":{},"window":{"navigationBarTitleText":"意见反馈"}},{"path":"/pageTwo/me/userEdit","meta":{},"window":{"navigationBarTitleText":"个人资料"}},{"path":"/pageTwo/me/record","meta":{},"window":{"navigationBarTitleText":"饮食记录","enablePullDownRefresh":false}},{"path":"/pageTwo/me/recordetail","meta":{},"window":{"navigationBarTitleText":"饮食详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/mymenu","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menudetail","meta":{},"window":{"navigationBarTitleText":"详情","enablePullDownRefresh":false}},{"path":"/pageTwo/me/foodlist","meta":{},"window":{"navigationBarTitleText":"食材库","enablePullDownRefresh":true}},{"path":"/pageTwo/count/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false,"popGesture":"none"}},{"path":"/pageTwo/count/KcalEdit","meta":{},"window":{"navigationBarTitleText":"自定义卡路里","enablePullDownRefresh":false}},{"path":"/pageTwo/count/everyMeal","meta":{},"window":{"navigationBarTitleText":"餐食详情","enablePullDownRefresh":false}},{"path":"/pageTwo/count/search","meta":{},"window":{"navigationBarTitleText":"食材搜索","enablePullDownRefresh":false}},{"path":"/pageTwo/webview/webview","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/password","meta":{},"window":{"navigationBarTitleText":"修改密码","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/email","meta":{},"window":{"navigationBarTitleText":"绑定邮箱","enablePullDownRefresh":false}},{"path":"/pageTwo/setting/phone","meta":{},"window":{"navigationBarTitleText":"绑定手机号","enablePullDownRefresh":false}},{"path":"/pageTwo/me/menuEdit","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pageTwo/count/everyDay","meta":{},"window":{"navigationBarTitleText":"营养分析"}}];
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__9A0614A","name":"kitchendDevice","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#efefef"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"speech":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.76","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#ff4c4f","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/menu/menu","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"菜谱"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食器"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"kitchendDevice","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#3CB383"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"speech":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.76","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#3CB383","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/home.png","selectedIconPath":"static/home01.png","text":"首页"},{"pagePath":"pages/search/search","iconPath":"static/cai.png","selectedIconPath":"static/cai01.png","text":"教你做"},{"pagePath":"pages/add/add","iconPath":"static/add.png","selectedIconPath":"static/add.png","text":""},{"pagePath":"pages/count/count","iconPath":"static/ji.png","selectedIconPath":"static/ji01.png","text":"计食"},{"pagePath":"pages/me/me","iconPath":"static/me.png","selectedIconPath":"static/me01.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
|
||||
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 648 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 258 B |
|
|
@ -16,10 +16,10 @@ __webpack_require__(/*! uni-pages */ 26);
|
|||
var _App = _interopRequireDefault(__webpack_require__(/*! ./App */ 27));
|
||||
var _store = _interopRequireDefault(__webpack_require__(/*! ./store */ 34));
|
||||
var _tools = _interopRequireDefault(__webpack_require__(/*! @/tools/tools.js */ 38));
|
||||
var _bluetooth = _interopRequireDefault(__webpack_require__(/*! @/tools/bluetooth.js */ 40));
|
||||
var _bluetooth = _interopRequireDefault(__webpack_require__(/*! @/tools/bluetooth.js */ 41));
|
||||
var _https = _interopRequireDefault(__webpack_require__(/*! @/tools/https.js */ 37));
|
||||
var _model = _interopRequireDefault(__webpack_require__(/*! @/tools/model.js */ 36));
|
||||
var _content = _interopRequireDefault(__webpack_require__(/*! @/content.json */ 41));
|
||||
var _content = _interopRequireDefault(__webpack_require__(/*! @/content.json */ 40));
|
||||
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
|
|
@ -125,10 +125,6 @@ var _vuex = __webpack_require__(/*! vuex */ 30);
|
|||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
var _default = {
|
||||
onTabItemClick: function onTabItemClick(itemPath) {
|
||||
// 例如,你可以在这里添加一个确认对话框
|
||||
console.log("itemPath", itemPath);
|
||||
},
|
||||
computed: _objectSpread({}, (0, _vuex.mapState)(["bleValue"])),
|
||||
onLaunch: function onLaunch() {
|
||||
console.log('App Launch');
|
||||
|
|
@ -137,34 +133,11 @@ var _default = {
|
|||
console.log('App Show');
|
||||
},
|
||||
onHide: function onHide() {
|
||||
// this.$ble.closeBLEConnection(this.bleValue.deviceId)
|
||||
// this.$ble.closeBluetoothAdapter()
|
||||
console.log('App Hide');
|
||||
},
|
||||
methods: {
|
||||
$createWatcher: function $createWatcher(name) {
|
||||
var _this = this;
|
||||
getApp().globalData.watcher = this.$watch('bleValue', function (val) {
|
||||
_this[name](val);
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
});
|
||||
},
|
||||
$removeWatcher: function $removeWatcher() {
|
||||
if (getApp().globalData.watcher) {
|
||||
getApp().globalData.watcher();
|
||||
console.log("watch移除成功");
|
||||
} else {
|
||||
console.log("没有watch可移除");
|
||||
}
|
||||
} // handleHomeConfig() {
|
||||
// let that = this
|
||||
// that.$model.getHomeConfig({}).then(res => {
|
||||
// if (res.code != 0) return
|
||||
// that.$store.commit('changeMenuList', res.data.cook_label)
|
||||
// that.$store.commit('changeFoodList', res.data.food_list)
|
||||
// })
|
||||
// },
|
||||
}
|
||||
methods: {}
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
|
|
|
|||
|
|
@ -1319,6 +1319,36 @@ page {
|
|||
height: 30px;
|
||||
}
|
||||
}
|
||||
.drawerVisible {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
z-index: 999;
|
||||
}
|
||||
.drawerVisible .bgVisible {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
.drawerVisible .infoVisible {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 300px;
|
||||
bottom: 0;
|
||||
background-color: #ffffff;
|
||||
transition: -webkit-transform 0.3s ease;
|
||||
transition: transform 0.3s ease;
|
||||
transition: transform 0.3s ease, -webkit-transform 0.3s ease;
|
||||
}
|
||||
/*每个页面公共css */
|
||||
.content {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -1027,8 +1027,8 @@ function populateParameters(result) {
|
|||
var parameters = {
|
||||
appId: "__UNI__20604F1",
|
||||
appName: "kitchendDevice",
|
||||
appVersion: "1.0.0",
|
||||
appVersionCode: "100",
|
||||
appVersion: "2.0.0",
|
||||
appVersionCode: "200",
|
||||
appLanguage: getAppLanguage(hostLanguage),
|
||||
uniCompileVersion: "4.76",
|
||||
uniCompilerVersion: "4.76",
|
||||
|
|
@ -1128,8 +1128,8 @@ var getAppBaseInfo = {
|
|||
result = sortObject(Object.assign(result, {
|
||||
appId: "__UNI__20604F1",
|
||||
appName: "kitchendDevice",
|
||||
appVersion: "1.0.0",
|
||||
appVersionCode: "100",
|
||||
appVersion: "2.0.0",
|
||||
appVersionCode: "200",
|
||||
appLanguage: getAppLanguage(hostLanguage),
|
||||
hostVersion: version,
|
||||
hostLanguage: hostLanguage,
|
||||
|
|
@ -25010,6 +25010,7 @@ module.exports = {
|
|||
"ring": {
|
||||
"type": "ring",
|
||||
"color": color,
|
||||
"animation": false,
|
||||
"padding": [5, 5, 5, 5],
|
||||
"rotate": false,
|
||||
"dataLabel": false,
|
||||
|
|
@ -28032,6 +28033,7 @@ exports.default = void 0;
|
|||
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
|
||||
var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 30));
|
||||
var _actions = _interopRequireDefault(__webpack_require__(/*! ./actions.js */ 35));
|
||||
var _content = _interopRequireDefault(__webpack_require__(/*! @/content.json */ 40));
|
||||
_vue.default.use(_vuex.default);
|
||||
var _default = new _vuex.default.Store({
|
||||
// state: 存储基本数据
|
||||
|
|
@ -28071,7 +28073,14 @@ var _default = new _vuex.default.Store({
|
|||
},
|
||||
cookbook_label: [],
|
||||
activity_level: [],
|
||||
default_count_foot: {},
|
||||
default_count_foot: {
|
||||
date: "",
|
||||
list: [],
|
||||
details: {},
|
||||
nutrients_four: [],
|
||||
remaining_kcal: "",
|
||||
trace_elements_all_day: []
|
||||
},
|
||||
business_cooperation: {}
|
||||
},
|
||||
// 计食器
|
||||
|
|
@ -28089,10 +28098,13 @@ var _default = new _vuex.default.Store({
|
|||
notify: "",
|
||||
write: "",
|
||||
unit: "g",
|
||||
type: 1,
|
||||
unitList: _content.default.unitArray,
|
||||
isSendVal: false,
|
||||
oldCountWeight: 0,
|
||||
countWeight: 100,
|
||||
bleTipsText: "",
|
||||
isConnectStatus: null
|
||||
isConnectStatus: 0
|
||||
},
|
||||
isBluetoothTyle: false
|
||||
},
|
||||
|
|
@ -28125,71 +28137,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 35:
|
||||
/*!***************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/store/actions.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _model = _interopRequireDefault(__webpack_require__(/*! ../tools/model.js */ 36));
|
||||
var _tools = _interopRequireDefault(__webpack_require__(/*! @/tools/tools.js */ 38));
|
||||
var _config = _interopRequireDefault(__webpack_require__(/*! @/config.js */ 39));
|
||||
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
||||
var _default = {
|
||||
//配置接口
|
||||
getHomeConfig: function getHomeConfig(_ref) {
|
||||
var commit = _ref.commit,
|
||||
dispatch = _ref.dispatch;
|
||||
return _model.default.getHomeConfig({}).then(function (res) {
|
||||
commit('changeConfig', res.data);
|
||||
dispatch("getUserInfo");
|
||||
return res.data;
|
||||
});
|
||||
},
|
||||
// 用户信息
|
||||
getUserInfo: function getUserInfo(_ref2) {
|
||||
var commit = _ref2.commit,
|
||||
dispatch = _ref2.dispatch;
|
||||
return _model.default.getHomeUserInfo({}).then(function (res) {
|
||||
if (res.code != 0) {
|
||||
commit('changeUserInfo', {
|
||||
aud_id: ""
|
||||
});
|
||||
return;
|
||||
}
|
||||
commit('changeUserInfo', res.data);
|
||||
dispatch("getCountFoodInfo", {
|
||||
aud_id: res.data.aud_id,
|
||||
time: _tools.default.getDate("start")
|
||||
});
|
||||
return res.data;
|
||||
});
|
||||
},
|
||||
// 计食器信息
|
||||
getCountFoodInfo: function getCountFoodInfo(_ref3, account) {
|
||||
var commit = _ref3.commit;
|
||||
return _model.default.getCountFoodInfo(account).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
commit('changeCountFoodInfo', res.data);
|
||||
}
|
||||
return res.data;
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 351:
|
||||
/***/ 344:
|
||||
/*!*******************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/llt-slider-range/components/llt-slider-range/throttle.js ***!
|
||||
\*******************************************************************************************************************/
|
||||
|
|
@ -28239,6 +28187,117 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 35:
|
||||
/*!***************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/store/actions.js ***!
|
||||
\***************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _model = _interopRequireDefault(__webpack_require__(/*! ../tools/model.js */ 36));
|
||||
var _tools = _interopRequireDefault(__webpack_require__(/*! @/tools/tools.js */ 38));
|
||||
var _config = _interopRequireDefault(__webpack_require__(/*! @/config.js */ 39));
|
||||
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
||||
var _default = {
|
||||
//配置接口
|
||||
getHomeConfig: function getHomeConfig(_ref) {
|
||||
var commit = _ref.commit,
|
||||
dispatch = _ref.dispatch;
|
||||
return _model.default.getHomeConfig({}).then(function (res) {
|
||||
commit('changeConfig', res.data);
|
||||
dispatch("getUserInfo");
|
||||
return res.data;
|
||||
});
|
||||
},
|
||||
// 用户信息
|
||||
getUserInfo: function getUserInfo(_ref2) {
|
||||
var commit = _ref2.commit,
|
||||
dispatch = _ref2.dispatch;
|
||||
return _model.default.getHomeUserInfo({}).then(function (res) {
|
||||
if (res.code != 0) {
|
||||
_tools.default.msg(res.msg);
|
||||
return;
|
||||
}
|
||||
if (res.data.weight == 0 || res.data.weight == null || res.data.weight == "") {
|
||||
commit('changeUserInfo', {
|
||||
isEditInfo: true,
|
||||
aud_id: ""
|
||||
});
|
||||
} else {
|
||||
commit('changeUserInfo', res.data);
|
||||
}
|
||||
dispatch("getCountFoodInfo", {
|
||||
aud_id: res.data.aud_id,
|
||||
time: _tools.default.getDate("start")
|
||||
});
|
||||
return res.data;
|
||||
});
|
||||
},
|
||||
// 计食器信息
|
||||
getCountFoodInfo: function getCountFoodInfo(_ref3, account) {
|
||||
var commit = _ref3.commit;
|
||||
return _model.default.getCountFoodInfo(account).then(function (res) {
|
||||
if (res.code == 0) {
|
||||
commit('changeCountFoodInfo', res.data);
|
||||
}
|
||||
return res.data;
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 359:
|
||||
/*!**************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/popup.js ***!
|
||||
\**************************************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {};
|
||||
},
|
||||
created: function created() {
|
||||
this.popup = this.getParent();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取父元素实例
|
||||
*/
|
||||
getParent: function getParent() {
|
||||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'uniPopup';
|
||||
var parent = this.$parent;
|
||||
var parentName = parent.$options.name;
|
||||
while (parentName !== name) {
|
||||
parent = parent.$parent;
|
||||
if (!parent) return false;
|
||||
parentName = parent.$options.name;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 36:
|
||||
/*!*************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/tools/model.js ***!
|
||||
|
|
@ -28285,6 +28344,12 @@ var _default = (_getonlogin$getSendCo = {
|
|||
return res;
|
||||
});
|
||||
},
|
||||
getCheckDevice: function getCheckDevice(param) {
|
||||
// 设备过滤
|
||||
return _https.default.post("/de/check_device_msg", param).then(function (res) {
|
||||
return res;
|
||||
});
|
||||
},
|
||||
getRegisterPhone: function getRegisterPhone(param) {
|
||||
// 手机号快捷登录
|
||||
return _https.default.post("/kitchenscale2/wechat_quick_login", param).then(function (res) {
|
||||
|
|
@ -28366,7 +28431,7 @@ var _default = (_getonlogin$getSendCo = {
|
|||
},
|
||||
getPhotoSearch: function getPhotoSearch(param) {
|
||||
//图像识别
|
||||
return _https.default.post("/kitchenscale2/baidu_identify_food", param).then(function (res) {
|
||||
return _https.default.post("/kitchenscale2/search_food_barcode", param).then(function (res) {
|
||||
return res;
|
||||
});
|
||||
},
|
||||
|
|
@ -28504,21 +28569,20 @@ var _default = (_getonlogin$getSendCo = {
|
|||
getMyLogList: function getMyLogList(param) {
|
||||
// 饮食列表
|
||||
return _https.default.post("/kitchenscale2/get_log_list", param).then(function (res) {
|
||||
var pkList = {
|
||||
list: [],
|
||||
Dlist: []
|
||||
};
|
||||
if (res.code == 0) {
|
||||
for (var i = 0; i < res.data.content_list.length; i++) {
|
||||
pkList.list.push(res.data.content_list[i]);
|
||||
if (!pkList.Dlist.includes(res.data.content_list[i].time)) {
|
||||
//includes 检测数组是否有某个值
|
||||
pkList.Dlist.push(res.data.content_list[i].time);
|
||||
}
|
||||
}
|
||||
}
|
||||
res.data.pkList = pkList;
|
||||
return res.data;
|
||||
// let pkList = {
|
||||
// list: [],
|
||||
// Dlist: []
|
||||
// }
|
||||
// if (res.code == 0) {
|
||||
// for (var i = 0; i < res.data.content_list.length; i++) {
|
||||
// pkList.list.push(res.data.content_list[i])
|
||||
// if (!pkList.Dlist.includes(res.data.content_list[i].time)) { //includes 检测数组是否有某个值
|
||||
// pkList.Dlist.push(res.data.content_list[i].time);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// res.data.pkList = pkList
|
||||
return res;
|
||||
});
|
||||
}
|
||||
}, (0, _defineProperty2.default)(_getonlogin$getSendCo, "getAddIntakeFood", function getAddIntakeFood(param) {
|
||||
|
|
@ -28546,49 +28610,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 366:
|
||||
/*!**************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/popup.js ***!
|
||||
\**************************************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {};
|
||||
},
|
||||
created: function created() {
|
||||
this.popup = this.getParent();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取父元素实例
|
||||
*/
|
||||
getParent: function getParent() {
|
||||
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'uniPopup';
|
||||
var parent = this.$parent;
|
||||
var parentName = parent.$options.name;
|
||||
while (parentName !== name) {
|
||||
parent = parent.$parent;
|
||||
if (!parent) return false;
|
||||
parentName = parent.$options.name;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 367:
|
||||
/***/ 360:
|
||||
/*!*******************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/i18n/index.js ***!
|
||||
\*******************************************************************************************************/
|
||||
|
|
@ -28603,9 +28625,9 @@ Object.defineProperty(exports, "__esModule", {
|
|||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 368));
|
||||
var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 369));
|
||||
var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 370));
|
||||
var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 361));
|
||||
var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 362));
|
||||
var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 363));
|
||||
var _default = {
|
||||
en: _en.default,
|
||||
'zh-Hans': _zhHans.default,
|
||||
|
|
@ -28615,7 +28637,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 368:
|
||||
/***/ 361:
|
||||
/*!******************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/i18n/en.json ***!
|
||||
\******************************************************************************************************/
|
||||
|
|
@ -28626,7 +28648,7 @@ module.exports = JSON.parse("{\"uni-popup.cancel\":\"cancel\",\"uni-popup.ok\":\
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 369:
|
||||
/***/ 362:
|
||||
/*!***********************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json ***!
|
||||
\***********************************************************************************************************/
|
||||
|
|
@ -28637,6 +28659,17 @@ module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 363:
|
||||
/*!***********************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json ***!
|
||||
\***********************************************************************************************************/
|
||||
/*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"確定\",\"uni-popup.placeholder\":\"請輸入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 37:
|
||||
/*!*************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/tools/https.js ***!
|
||||
|
|
@ -28739,18 +28772,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 370:
|
||||
/*!***********************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json ***!
|
||||
\***********************************************************************************************************/
|
||||
/*! exports provided: uni-popup.cancel, uni-popup.ok, uni-popup.placeholder, uni-popup.title, uni-popup.shareTitle, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"uni-popup.cancel\":\"取消\",\"uni-popup.ok\":\"確定\",\"uni-popup.placeholder\":\"請輸入\",\"uni-popup.title\":\"提示\",\"uni-popup.shareTitle\":\"分享到\"}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 378:
|
||||
/***/ 371:
|
||||
/*!**********************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
|
||||
\**********************************************************************************************************************/
|
||||
|
|
@ -29083,6 +29105,17 @@ module.exports = _interopRequireDefault, module.exports.__esModule = true, modul
|
|||
/***/ }),
|
||||
|
||||
/***/ 40:
|
||||
/*!***********************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/content.json ***!
|
||||
\***********************************************************/
|
||||
/*! exports provided: addfoodList, unitArray, unitMinus, units, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"addfoodList\":[{\"name\":\"早加餐\",\"id\":3},{\"name\":\"午加餐\",\"id\":4},{\"name\":\"晚加餐\",\"id\":5}],\"unitArray\":[{\"name\":\"千克\",\"unit\":\"kg\"},{\"name\":\"斤\",\"unit\":\"斤\"},{\"name\":\"stlb\",\"unit\":\"stlb\"},{\"name\":\"磅\",\"unit\":\"lb\"},{\"name\":\"克\",\"unit\":\"g\"},{\"name\":\"毫升\",\"unit\":\"ml\"},{\"name\":\"Waterml\",\"unit\":\"Waterml\"},{\"name\":\"milkml\",\"unit\":\"milkml\"},{\"name\":\"盎司\",\"unit\":\"oz\"},{\"name\":\"floz\",\"unit\":\"floz\"},{\"name\":\"lboz\",\"unit\":\"lboz\"}],\"unitMinus\":[{\"name\":\"千克\",\"unit\":\"kg\"},{\"name\":\"磅\",\"unit\":\"lb\"},{\"name\":\"克\",\"unit\":\"g\"},{\"name\":\"毫升\",\"unit\":\"ml\"},{\"name\":\"盎司\",\"unit\":\"oz\"}],\"units\":[\"kg\",\"斤\",\"stlb\",\"lb\",\"g\",\"ml\",\"Waterml\",\"milkml\",\"oz\",\"floz\",\"lboz\"]}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 41:
|
||||
/*!*****************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/tools/bluetooth.js ***!
|
||||
\*****************************************************************/
|
||||
|
|
@ -29099,22 +29132,33 @@ Object.defineProperty(exports, "__esModule", {
|
|||
exports.default = void 0;
|
||||
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
|
||||
var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 34));
|
||||
var searchTimer = null;
|
||||
var _model = _interopRequireDefault(__webpack_require__(/*! @/tools/model.js */ 36));
|
||||
var _tools = _interopRequireDefault(__webpack_require__(/*! @/tools/tools.js */ 38));
|
||||
var _content = _interopRequireDefault(__webpack_require__(/*! @/content.json */ 40));
|
||||
var unitList = [];
|
||||
var devicesList = [];
|
||||
var searchTimer = null;
|
||||
var UNIT_MAP = _content.default.units;
|
||||
|
||||
// 初始化蓝牙
|
||||
function openBluetoothAdapter() {
|
||||
devicesList = [];
|
||||
unitList = [];
|
||||
clearTimeout(searchTimer);
|
||||
uni.openBluetoothAdapter({
|
||||
success: function success(e) {
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0
|
||||
isConnectStatus: 0,
|
||||
unitList: _content.default.unitMinus
|
||||
});
|
||||
startBluetoothDeviceDiscovery();
|
||||
},
|
||||
fail: function fail(e) {
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
isConnectStatus: 1,
|
||||
unitList: _content.default.unitMinus
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -29123,7 +29167,7 @@ function openBluetoothAdapter() {
|
|||
function startBluetoothDeviceDiscovery() {
|
||||
uni.startBluetoothDevicesDiscovery({
|
||||
allowDuplicatesKey: true,
|
||||
services: [],
|
||||
interval: 200,
|
||||
success: function success(res) {
|
||||
onBluetoothDeviceFound();
|
||||
searchTimer = setTimeout(function () {
|
||||
|
|
@ -29158,24 +29202,47 @@ function onBluetoothDeviceFound() {
|
|||
if (!device.name && !device.localName) {
|
||||
return;
|
||||
}
|
||||
if (device.name.indexOf('Chipsea-BLE') != -1 || device.localName && device.localName.indexOf('Chipsea-BLE') != -1 || id == 'a5fe') {
|
||||
if (device.name.toLowerCase().indexOf('pc-c06pro') != -1 || device.name.toLowerCase().indexOf('pc-c02pro') != -1 || device.name.toLowerCase().indexOf('pc-c09pro') != -1 || device.name.toLowerCase().indexOf('pc-c10pro') != -1 || device.name.toLowerCase().indexOf('pc-c07pro') != -1 || device.localName && device.localName.toLowerCase().indexOf('pc-c07pro') != -1 || device.localName && device.localName.toLowerCase().indexOf('pc-c10pro') != -1 || device.localName && device.localName.toLowerCase().indexOf('pc-c06pro') != -1 || device.localName && device.localName.toLowerCase().indexOf('pc-c02pro') != -1 || device.localName && device.localName.toLowerCase().indexOf('pc-c09pro') != -1) {
|
||||
clearTimeout(searchTimer);
|
||||
var bytes = new Uint8Array(device.advertisData);
|
||||
var macBytes = bytes.slice(6, 12);
|
||||
device.macAddr = _tools.default.ab2hex(macBytes, ':').toUpperCase();
|
||||
stopBluetoothDevicesDiscovery();
|
||||
Bluetoothfilter(device.deviceId);
|
||||
Bluetoothfilter(device);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
// 过滤蓝牙
|
||||
function Bluetoothfilter(device_id) {
|
||||
function Bluetoothfilter(device) {
|
||||
var foundDevices = devicesList;
|
||||
var idx = inArray(foundDevices, "deviceId", device_id);
|
||||
var idx = inArray(foundDevices, "deviceId", device.deviceId);
|
||||
if (idx === -1) {
|
||||
devicesList.push(device_id);
|
||||
connectDevice(device_id);
|
||||
devicesList.push(device);
|
||||
// handleDevType(device)
|
||||
connectDevice(device.deviceId);
|
||||
}
|
||||
}
|
||||
// 排查设备
|
||||
function handleDevType(device) {
|
||||
_model.default.getCheckDevice({
|
||||
mac: device.macAddr
|
||||
}).then(function (res) {
|
||||
console.log("排查设备:", device, res);
|
||||
if (res.code == 0) {
|
||||
connectDevice(device.deviceId);
|
||||
} else {
|
||||
devicesList = [];
|
||||
_tools.default.msg('设备未登记,请联系出售方进行系统认证');
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//连接设备
|
||||
function connectDevice(device_id) {
|
||||
|
|
@ -29187,7 +29254,11 @@ function connectDevice(device_id) {
|
|||
}, 200);
|
||||
},
|
||||
fail: function fail(res) {
|
||||
console.log("连接失败,点击重新连接", res);
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -29200,6 +29271,7 @@ function getBLEDeviceServices(device_id) {
|
|||
deviceId: device_id,
|
||||
success: function success(res) {
|
||||
console.log("获取设备的UUID成功", res);
|
||||
stopBluetoothDevicesDiscovery();
|
||||
serviceList = res.services;
|
||||
for (var i = 0; i < serviceList.length; i++) {
|
||||
var service = serviceList[i];
|
||||
|
|
@ -29210,6 +29282,11 @@ function getBLEDeviceServices(device_id) {
|
|||
}
|
||||
},
|
||||
fail: function fail(res) {
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接"
|
||||
});
|
||||
console.log('获取设备的UUID失败:', res);
|
||||
}
|
||||
});
|
||||
|
|
@ -29236,6 +29313,11 @@ function getBLEDeviceCharacteristics(deviceId, serviceId) {
|
|||
getBLECharacteristicValueChange(deviceId, serviceId, notify, write);
|
||||
},
|
||||
fail: function fail(res) {
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
type: 1,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接"
|
||||
});
|
||||
console.log('获取特征值失败:', JSON.stringify(res));
|
||||
}
|
||||
});
|
||||
|
|
@ -29254,11 +29336,12 @@ function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
|
|||
notify: notify,
|
||||
write: write,
|
||||
unit: "g",
|
||||
countWeight: "",
|
||||
type: 1,
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
bleTipsText: "测量中,请将食物放到秤上",
|
||||
isConnectStatus: 0
|
||||
isConnectStatus: 2
|
||||
});
|
||||
var units = ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml', 'milkml', 'oz', 'floz', 'lboz'];
|
||||
uni.onBLECharacteristicValueChange(function (res) {
|
||||
var value = res.value;
|
||||
var dataView = new DataView(value);
|
||||
|
|
@ -29282,14 +29365,36 @@ function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
|
|||
|
||||
// 计算实际重量
|
||||
var finalWeight = weightValue / Math.pow(10, precision);
|
||||
console.log("类型:", cmd, "重量", finalWeight, "小数点", precision, "单位", UNIT_MAP[unitIndex]);
|
||||
if (isNegative) finalWeight = -finalWeight;
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
countWeight: finalWeight,
|
||||
unit: units[unitIndex]
|
||||
unit: UNIT_MAP[unitIndex],
|
||||
type: statusType
|
||||
});
|
||||
break;
|
||||
case 0x03:
|
||||
break;
|
||||
case 0x08:
|
||||
var start0 = [];
|
||||
var value2 = _tools.default.ab2hex(res.value, "");
|
||||
var start = parseUnitMask(value2.substring(8, 10), UNIT_MAP.slice(0, 7));
|
||||
var start1 = parseUnitMask(value2.substring(10, 12), UNIT_MAP.slice(8, 10));
|
||||
start.push.apply(start, start1);
|
||||
if (start.length) {
|
||||
_content.default.unitMinus.forEach(function (item) {
|
||||
start.forEach(function (item2) {
|
||||
if (item.unit == item2) {
|
||||
start0.push(item);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
unitList: start0.length ? start0 : _content.default.unitMinus
|
||||
});
|
||||
console.log("2222222", start, start0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -29326,13 +29431,19 @@ function ab2hex(buffer, split) {
|
|||
function closeBluetoothAdapter() {
|
||||
uni.closeBluetoothAdapter({
|
||||
success: function success(res) {
|
||||
clearTimeout(searchTimer);
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
deviceId: "",
|
||||
serviceId: "",
|
||||
notify: "",
|
||||
write: "",
|
||||
unit: "g",
|
||||
countWeight: ''
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
type: 1,
|
||||
unitList: _content.default.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
bleTipsText: "连接超时,点击重新连接"
|
||||
});
|
||||
console.log('蓝牙模块关闭成功');
|
||||
}
|
||||
|
|
@ -29356,7 +29467,9 @@ function onBLEConnectionStateChange() {
|
|||
if (!res.connected) {
|
||||
_store.default.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接超时,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
unitList: _content.default.unitMinus,
|
||||
isConnectStatus: 1,
|
||||
type: 1
|
||||
});
|
||||
closeBLEConnection();
|
||||
closeBluetoothAdapter();
|
||||
|
|
@ -29374,9 +29487,36 @@ function stopBluetoothDevicesDiscovery() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
//@param {number|string} hexValue - 16进制值,如 0x19 或 '0x19'
|
||||
// @returns {Array} 使用的单位列表
|
||||
|
||||
function parseUnitMask(hexValue, UNIT_MAP) {
|
||||
// 转换为数字
|
||||
var mask = typeof hexValue === 'string' ? parseInt(hexValue, 16) : hexValue;
|
||||
|
||||
// 验证输入
|
||||
if (isNaN(mask) || mask < 0 || mask > 0xFF) {
|
||||
console.error('无效的位掩码值');
|
||||
return [];
|
||||
}
|
||||
|
||||
// 存储结果
|
||||
var usedUnits = [];
|
||||
|
||||
// 遍历每一位
|
||||
for (var i = 0; i < 8; i++) {
|
||||
// 使用位运算检查第 i 位是否为 1
|
||||
if (mask & 1 << i) {
|
||||
usedUnits.push(UNIT_MAP[i]);
|
||||
}
|
||||
}
|
||||
return usedUnits;
|
||||
}
|
||||
var _default = {
|
||||
ab2hex: ab2hex,
|
||||
inArray: inArray,
|
||||
unitList: unitList,
|
||||
openBluetoothAdapter: openBluetoothAdapter,
|
||||
startBluetoothDeviceDiscovery: startBluetoothDeviceDiscovery,
|
||||
onBluetoothDeviceFound: onBluetoothDeviceFound,
|
||||
|
|
@ -29395,17 +29535,6 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 41:
|
||||
/*!***********************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/content.json ***!
|
||||
\***********************************************************/
|
||||
/*! exports provided: addfoodList, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"addfoodList\":[{\"name\":\"早加餐\",\"id\":3},{\"name\":\"午加餐\",\"id\":4},{\"name\":\"晚加餐\",\"id\":5}]}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/*!**************************************************************!*\
|
||||
!*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["components/bluetooth"],{
|
||||
|
||||
/***/ 339:
|
||||
/***/ 332:
|
||||
/*!***********************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue ***!
|
||||
\***********************************************************************/
|
||||
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& */ 340);
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=script&lang=js& */ 342);
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& */ 333);
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=script&lang=js& */ 335);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& */ 344);
|
||||
/* harmony import */ var _bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& */ 337);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 33);
|
||||
|
||||
var renderjs
|
||||
|
|
@ -41,7 +41,7 @@ component.options.__file = "components/bluetooth.vue"
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 340:
|
||||
/***/ 333:
|
||||
/*!******************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& ***!
|
||||
\******************************************************************************************************************/
|
||||
|
|
@ -50,7 +50,7 @@ component.options.__file = "components/bluetooth.vue"
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& */ 341);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& */ 334);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_template_id_53fa6103_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||
|
|
@ -63,7 +63,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 341:
|
||||
/***/ 334:
|
||||
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=template&id=53fa6103&scoped=true& ***!
|
||||
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -80,10 +80,10 @@ var components
|
|||
try {
|
||||
components = {
|
||||
uniPopup: function () {
|
||||
return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 354))
|
||||
return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 347))
|
||||
},
|
||||
uniPopupDialog: function () {
|
||||
return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 361))
|
||||
return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 354))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -107,6 +107,15 @@ var render = function () {
|
|||
var _vm = this
|
||||
var _h = _vm.$createElement
|
||||
var _c = _vm._self._c || _h
|
||||
var m0 = _vm.unitConversion(_vm.unit)
|
||||
_vm.$mp.data = Object.assign(
|
||||
{},
|
||||
{
|
||||
$root: {
|
||||
m0: m0,
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
var recyclableRender = false
|
||||
var staticRenderFns = []
|
||||
|
|
@ -116,7 +125,7 @@ render._withStripped = true
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 342:
|
||||
/***/ 335:
|
||||
/*!************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=script&lang=js& ***!
|
||||
\************************************************************************************************/
|
||||
|
|
@ -125,14 +134,14 @@ render._withStripped = true
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=script&lang=js& */ 343);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=script&lang=js& */ 336);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 343:
|
||||
/***/ 336:
|
||||
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=script&lang=js& ***!
|
||||
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -155,24 +164,12 @@ var _default = {
|
|||
data: function data() {
|
||||
return {
|
||||
kcal: "",
|
||||
// weight: "",
|
||||
weightALL: "",
|
||||
bleTipsText: "",
|
||||
unit: 'g',
|
||||
weight0: 0,
|
||||
unitA: [],
|
||||
stopblue: false,
|
||||
devicesList: [],
|
||||
unitList: [{
|
||||
name: "克",
|
||||
id: '00',
|
||||
unit: "g"
|
||||
}, {
|
||||
name: "盎司",
|
||||
id: "08",
|
||||
unit: "oz"
|
||||
}],
|
||||
unitListIndex: 0,
|
||||
units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml', 'milkml', 'oz', 'floz', 'lboz']
|
||||
unitListIndex: 0
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
|
@ -192,14 +189,17 @@ var _default = {
|
|||
},
|
||||
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(["user", "isBluetoothTyle", "bleValue"])), {}, {
|
||||
weight: function weight() {
|
||||
var kcal = (Number(this.weightKcal) * this.bleValue.countWeight).toFixed(2);
|
||||
this.unit = this.unitConversion(this.bleValue.unit);
|
||||
this.kcal = this.convertToGrams(kcal, this.bleValue.unit).toFixed(2);
|
||||
var weightNew = this.convertToGrams(this.bleValue.countWeight, this.bleValue.unit);
|
||||
this.kcal = (Number(this.weightKcal) * weightNew).toFixed(1);
|
||||
this.unit = this.bleValue.unit;
|
||||
return this.bleValue.countWeight;
|
||||
},
|
||||
isConnection: function isConnection() {
|
||||
this.bleTipsText = this.bleValue.bleTipsText;
|
||||
return this.bleValue.isConnectStatus;
|
||||
},
|
||||
isShow: function isShow() {
|
||||
return this.bleValue.serviceId != '' ? true : false;
|
||||
}
|
||||
}),
|
||||
mounted: function mounted() {
|
||||
|
|
@ -215,9 +215,22 @@ var _default = {
|
|||
that.handleBack();
|
||||
}
|
||||
},
|
||||
isLast: function isLast() {
|
||||
var that = this;
|
||||
that.stopblue = that.isLast;
|
||||
isLast: {
|
||||
handler: function handler(newVal, oldVal) {
|
||||
this.stopblue = newVal;
|
||||
},
|
||||
// deep: true,
|
||||
immediate: true
|
||||
},
|
||||
bleValue: {
|
||||
handler: function handler(newVal, oldVal) {
|
||||
this.unitA = newVal.unitList;
|
||||
this.unitListIndex = newVal.unitList.findIndex(function (ite) {
|
||||
return ite.unit == newVal.unit;
|
||||
});
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -232,6 +245,8 @@ var _default = {
|
|||
notify: '',
|
||||
write: '',
|
||||
unit: "g",
|
||||
type: 1,
|
||||
unitList: that.$json.unitMinus,
|
||||
countWeight: "",
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0
|
||||
|
|
@ -240,16 +255,64 @@ var _default = {
|
|||
},
|
||||
changleUnits: function changleUnits(e) {
|
||||
var that = this;
|
||||
var name = that.unitList[e.detail.value].name;
|
||||
console.log("单位切换", name, that.unit);
|
||||
if (that.unit != name) {
|
||||
that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04);
|
||||
var name = that.unitA[e.detail.value].name;
|
||||
var val = that.unitA[e.detail.value].unit;
|
||||
if (that.isShow && that.unit != name) {
|
||||
that.handletoggleUnit(that.unitConversion2(val));
|
||||
}
|
||||
if (that.bleValue.serviceId == '') {
|
||||
that.unitListIndex = [e.detail.value];
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitA[e.detail.value].unit
|
||||
});
|
||||
}
|
||||
that.unitListIndex = [e.detail.value];
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitList[e.detail.value].unit
|
||||
});
|
||||
},
|
||||
convertToGrams: function convertToGrams(value, fromUnit) {
|
||||
var conversionFactors = {
|
||||
'lb': 453.59237,
|
||||
// 1磅 = 453.59237克
|
||||
'oz': 28.349523125,
|
||||
// 1盎司 = 28.349523125克
|
||||
'kg': 1000,
|
||||
// 1公斤 = 1000克
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
};
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return '';
|
||||
}
|
||||
return value * conversionFactors[fromUnit];
|
||||
},
|
||||
unitConversion2: function unitConversion2(unit) {
|
||||
if (unit == 'kg') {
|
||||
return 0x00;
|
||||
} else if (unit == '斤') {
|
||||
return 0x01;
|
||||
} else if (unit == 'st:lb') {
|
||||
return 0x02;
|
||||
} else if (unit == 'lb') {
|
||||
return 0x03;
|
||||
} else if (unit == 'g') {
|
||||
return 0x04;
|
||||
} else if (unit == 'ml') {
|
||||
return 0x05;
|
||||
} else if (unit == 'Waterml') {
|
||||
return 0x06;
|
||||
} else if (unit == 'milkml') {
|
||||
return 0x07;
|
||||
} else if (unit == 'oz') {
|
||||
return 0x08;
|
||||
} else if (unit == 'floz') {
|
||||
return 0x09;
|
||||
} else if (unit == 'lboz') {
|
||||
return 0x0A;
|
||||
}
|
||||
return unit;
|
||||
},
|
||||
// 下发单位
|
||||
handletoggleUnit: function handletoggleUnit(unit) {
|
||||
var that = this;
|
||||
var checksum = 0;
|
||||
|
|
@ -284,30 +347,42 @@ var _default = {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 保存测量结果
|
||||
handlesub: function handlesub() {
|
||||
handleBack: function handleBack() {
|
||||
var that = this;
|
||||
console.log("测量保存", that.weight, that.unit, that.kcal);
|
||||
if (Number(that.weight) > 0) {
|
||||
that.$emit("handleBle", that.weight, that.unit, that.kcal);
|
||||
} else {
|
||||
that.$tools.msg("数据异常,请清零后重新测量!");
|
||||
}
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
unitList: that.$json.unitMinus,
|
||||
isConnectStatus: 1
|
||||
});
|
||||
that.$ble.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId);
|
||||
that.$ble.closeBluetoothAdapter();
|
||||
},
|
||||
convertToGrams: function convertToGrams(value, fromUnit) {
|
||||
var conversionFactors = {
|
||||
'lb': 453.59,
|
||||
// 1磅 = 453.59237克
|
||||
'oz': 28.35,
|
||||
// 1盎司 = 28.349523125克
|
||||
'kg': 1000,
|
||||
// 1公斤 = 1000克
|
||||
'g': 1
|
||||
};
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return '';
|
||||
unitConversion: function unitConversion(unit) {
|
||||
if (unit == 'kg') {
|
||||
return '千克';
|
||||
} else if (unit == '斤') {
|
||||
return '斤';
|
||||
} else if (unit == 'stlb') {
|
||||
return 'stlb';
|
||||
} else if (unit == 'lb') {
|
||||
return '磅';
|
||||
} else if (unit == 'g') {
|
||||
return '克';
|
||||
} else if (unit == 'ml') {
|
||||
return '毫升';
|
||||
} else if (unit == 'Waterml') {
|
||||
return 'Waterml';
|
||||
} else if (unit == 'milkml') {
|
||||
return 'milkml';
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司';
|
||||
} else if (unit == 'floz') {
|
||||
return 'floz';
|
||||
} else if (unit == 'lboz') {
|
||||
return 'lboz';
|
||||
}
|
||||
return value * conversionFactors[fromUnit];
|
||||
return unit;
|
||||
},
|
||||
// 备料完成
|
||||
handleDetailSub: function handleDetailSub() {
|
||||
|
|
@ -315,7 +390,7 @@ var _default = {
|
|||
if (Number(that.weight) > 0) {
|
||||
that.$emit("handleDetailSub", that.weight, that.unit, that.kcal);
|
||||
} else {
|
||||
that.$tools.msg("数据异常,请重新测量!");
|
||||
that.$tools.msg("数据异常,请清零后重新测量!");
|
||||
}
|
||||
},
|
||||
//备料下一个
|
||||
|
|
@ -327,33 +402,12 @@ var _default = {
|
|||
that.$tools.msg("数据异常,请清零后重新测量!");
|
||||
}
|
||||
},
|
||||
unitConversion: function unitConversion(unit) {
|
||||
if (unit == 'kcal') {
|
||||
return '千卡';
|
||||
} else if (unit == 'g') {
|
||||
return '克';
|
||||
} else if (unit == 'lb') {
|
||||
return '磅';
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司';
|
||||
}
|
||||
return unit;
|
||||
},
|
||||
handleBack: function handleBack() {
|
||||
var that = this;
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
isConnectStatus: 1
|
||||
});
|
||||
that.$ble.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||
that.$ble.closeBLEConnection(that.bleValue.deviceId);
|
||||
that.$ble.closeBluetoothAdapter();
|
||||
},
|
||||
confirm: function confirm(value) {
|
||||
console.log("手动输入", value);
|
||||
console.log(value);
|
||||
var that = this;
|
||||
this.$store.commit("changeBluetoothValue", {
|
||||
countWeight: value,
|
||||
unit: this.unitList[this.unitListIndex].unit
|
||||
unit: this.unitA[this.unitListIndex].unit
|
||||
});
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
|
@ -370,7 +424,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 344:
|
||||
/***/ 337:
|
||||
/*!*********************************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& ***!
|
||||
\*********************************************************************************************************************************/
|
||||
|
|
@ -379,14 +433,14 @@ exports.default = _default;
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& */ 345);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& */ 338);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_vue_vue_type_style_index_0_id_53fa6103_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 345:
|
||||
/***/ 338:
|
||||
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth.vue?vue&type=style&index=0&id=53fa6103&scoped=true&lang=scss& ***!
|
||||
\*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -405,7 +459,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
'components/bluetooth-create-component',
|
||||
{
|
||||
'components/bluetooth-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(339))
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(332))
|
||||
})
|
||||
},
|
||||
[['components/bluetooth-create-component']]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<view class="weightPages data-v-53fa6103"><view class="table data-v-53fa6103"><view class="text data-v-53fa6103"><image src="/static/zhong.png" class="data-v-53fa6103"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-53fa6103">{{bleTipsText}}</text></view></view><view class="name data-v-53fa6103">{{name}}</view><view class="weight-wrap data-v-53fa6103"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-53fa6103" bindtap="__e"><text class="val data-v-53fa6103">{{weight==''?'0.0':weight}}</text><text class="unit data-v-53fa6103">{{unit}}</text></view><view class="weight data-v-53fa6103"><text class="val data-v-53fa6103">{{kcal?kcal:0}}</text><text class="unit data-v-53fa6103">kcal</text></view></view><view class="groupbtn data-v-53fa6103"><view class="btn danwei data-v-53fa6103"><view class="lan border-bottom data-v-53fa6103"><view class="right data-v-53fa6103"><picker mode="selector" range="{{unitList}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-53fa6103"><view class="uni-input data-v-53fa6103">单位</view></picker></view></view></view><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-53fa6103" style="{{'width:'+(!stopblue?'20%':'45%')+';'}}" bindtap="__e">保存</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-53fa6103" bindtap="__e">下一味</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-53fa6103" bindtap="__e">清零</view></view><view class="data-v-53fa6103"><uni-popup vue-id="2b524063-1" type="dialog" data-ref="popup" class="data-v-53fa6103 vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('2b524063-2')+','+('2b524063-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-53fa6103" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>
|
||||
<view class="weightPages data-v-53fa6103"><view class="table data-v-53fa6103"><view class="text data-v-53fa6103"><image src="/static/zhong.png" class="data-v-53fa6103"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-53fa6103">{{bleTipsText}}</text></view><block wx:if="{{isShow&&isConnection==2}}"><view data-event-opts="{{[['tap',[['handleBack',['$event']]]]]}}" class="duan data-v-53fa6103" bindtap="__e">断开连接</view></block></view><view class="name data-v-53fa6103">{{name}}</view><view class="weight-wrap data-v-53fa6103"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-53fa6103" bindtap="__e"><text class="val data-v-53fa6103">{{weight==''?'0.0':weight}}</text><text class="unit data-v-53fa6103">{{$root.m0}}</text></view><view class="weight data-v-53fa6103"><text class="val data-v-53fa6103">{{kcal?kcal:0}}</text><text class="unit data-v-53fa6103">kcal</text></view></view><view class="groupbtn data-v-53fa6103"><view class="btn danwei data-v-53fa6103"><view class="lan border-bottom data-v-53fa6103"><view class="right data-v-53fa6103"><picker mode="selector" range="{{unitA}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-53fa6103"><view class="uni-input data-v-53fa6103">单位</view></picker></view></view></view><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-53fa6103" style="{{'width:'+(!stopblue?'20%':'45%')+';'}}" bindtap="__e">保存</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-53fa6103" bindtap="__e">下一味</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-53fa6103" bindtap="__e">清零</view></view><view class="data-v-53fa6103"><uni-popup vue-id="2b524063-1" type="dialog" data-ref="popup" class="data-v-53fa6103 vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('2b524063-2')+','+('2b524063-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-53fa6103" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>
|
||||
|
|
@ -135,6 +135,15 @@
|
|||
border-radius: 8rpx;
|
||||
background-color: #F0AE43;
|
||||
}
|
||||
.weightPages .duan.data-v-53fa6103 {
|
||||
width: -webkit-fit-content;
|
||||
width: fit-content;
|
||||
background: linear-gradient(-90deg, #d4f5c4, #a7d5e4 80%);
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
padding: 3px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.weightPages .name.data-v-53fa6103 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["components/bluetooth_food"],{
|
||||
|
||||
/***/ 325:
|
||||
/***/ 318:
|
||||
/*!****************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue ***!
|
||||
\****************************************************************************/
|
||||
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& */ 326);
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=script&lang=js& */ 328);
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& */ 319);
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=script&lang=js& */ 321);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& */ 330);
|
||||
/* harmony import */ var _bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& */ 323);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 33);
|
||||
|
||||
var renderjs
|
||||
|
|
@ -41,7 +41,7 @@ component.options.__file = "components/bluetooth_food.vue"
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 326:
|
||||
/***/ 319:
|
||||
/*!***********************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& ***!
|
||||
\***********************************************************************************************************************/
|
||||
|
|
@ -50,7 +50,7 @@ component.options.__file = "components/bluetooth_food.vue"
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& */ 327);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& */ 320);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_template_id_5fc22dca_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||
|
|
@ -63,7 +63,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 327:
|
||||
/***/ 320:
|
||||
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=template&id=5fc22dca&scoped=true& ***!
|
||||
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -80,10 +80,10 @@ var components
|
|||
try {
|
||||
components = {
|
||||
uniPopup: function () {
|
||||
return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 354))
|
||||
return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 347))
|
||||
},
|
||||
uniPopupDialog: function () {
|
||||
return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 361))
|
||||
return Promise.all(/*! import() | uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue */ 354))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -125,7 +125,7 @@ render._withStripped = true
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 328:
|
||||
/***/ 321:
|
||||
/*!*****************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=script&lang=js& ***!
|
||||
\*****************************************************************************************************/
|
||||
|
|
@ -134,14 +134,14 @@ render._withStripped = true
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=script&lang=js& */ 329);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=script&lang=js& */ 322);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 329:
|
||||
/***/ 322:
|
||||
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=script&lang=js& ***!
|
||||
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -167,20 +167,10 @@ var _default = {
|
|||
return {
|
||||
kcal: 0,
|
||||
unit: '',
|
||||
// weight: "",
|
||||
bleTipsText: "",
|
||||
inputDialog: false,
|
||||
unitList: [{
|
||||
name: "克",
|
||||
id: '00',
|
||||
unit: "g"
|
||||
}, {
|
||||
name: "盎司",
|
||||
id: "08",
|
||||
unit: "oz"
|
||||
}],
|
||||
unitListIndex: 0,
|
||||
units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml', 'milkml', 'oz', 'floz', 'lboz']
|
||||
unitA: [],
|
||||
unitListIndex: 0
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
|
@ -197,7 +187,8 @@ var _default = {
|
|||
|
||||
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(["bleValue", "isBluetoothTyle", "countFoodInfo"])), {}, {
|
||||
weight: function weight() {
|
||||
this.kcal = (Number(this.weightKcal) / 100 * this.bleValue.countWeight).toFixed(2);
|
||||
var weightNew = this.convertToGrams(this.bleValue.countWeight, this.bleValue.unit);
|
||||
this.kcal = (Number(this.weightKcal) / 100 * weightNew).toFixed(1);
|
||||
this.unit = this.bleValue.unit;
|
||||
return this.bleValue.countWeight;
|
||||
},
|
||||
|
|
@ -226,13 +217,23 @@ var _default = {
|
|||
if (!that.isBluetoothTyle) {
|
||||
that.handleBack();
|
||||
}
|
||||
},
|
||||
bleValue: {
|
||||
handler: function handler(newVal, oldVal) {
|
||||
this.unitA = newVal.unitList;
|
||||
this.unitListIndex = newVal.unitList.findIndex(function (ite) {
|
||||
return ite.unit == newVal.unit;
|
||||
});
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始化蓝牙
|
||||
openBluetoothAdapter: function openBluetoothAdapter() {
|
||||
var that = this;
|
||||
if (that.isConnection == 0) return;
|
||||
if (that.isConnection == 2) return;
|
||||
that.kcal = "";
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
deviceId: "",
|
||||
|
|
@ -240,7 +241,10 @@ var _default = {
|
|||
notify: '',
|
||||
write: '',
|
||||
unit: "g",
|
||||
countWeight: "",
|
||||
type: 1,
|
||||
unitList: that.$json.unitMinus,
|
||||
countWeight: 0,
|
||||
oldCountWeight: 0,
|
||||
bleTipsText: "蓝牙搜索中",
|
||||
isConnectStatus: 0
|
||||
});
|
||||
|
|
@ -248,16 +252,66 @@ var _default = {
|
|||
},
|
||||
changleUnits: function changleUnits(e) {
|
||||
var that = this;
|
||||
var name = that.unitList[e.detail.value].name;
|
||||
console.log("单位切换", name, that.unit);
|
||||
var name = that.unitA[e.detail.value].name;
|
||||
var val = that.unitA[e.detail.value].unit;
|
||||
if (that.isShow && that.unit != name) {
|
||||
that.handletoggleUnit(name == '盎司' ? 0x08 : 0x04);
|
||||
that.handletoggleUnit(that.unitConversion2(val));
|
||||
}
|
||||
if (that.bleValue.serviceId == '') {
|
||||
that.unitListIndex = [e.detail.value];
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitA[e.detail.value].unit
|
||||
});
|
||||
}
|
||||
that.unitListIndex = [e.detail.value];
|
||||
that.$store.commit('changeBluetoothValue', {
|
||||
unit: that.unitList[e.detail.value].unit
|
||||
});
|
||||
},
|
||||
convertToGrams: function convertToGrams(value, fromUnit) {
|
||||
var conversionFactors = {
|
||||
'lb': 453.59237,
|
||||
// 1磅 = 453.59237克
|
||||
'oz': 28.349523125,
|
||||
// 1盎司 = 28.349523125克
|
||||
'kg': 1000,
|
||||
// 1公斤 = 1000克
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
// "stlb": "floz": "lboz":
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return '';
|
||||
}
|
||||
return value * conversionFactors[fromUnit];
|
||||
},
|
||||
unitConversion2: function unitConversion2(unit) {
|
||||
if (unit == 'kg') {
|
||||
return 0x00;
|
||||
} else if (unit == '斤') {
|
||||
return 0x01;
|
||||
} else if (unit == 'st:lb') {
|
||||
return 0x02;
|
||||
} else if (unit == 'lb') {
|
||||
return 0x03;
|
||||
} else if (unit == 'g') {
|
||||
return 0x04;
|
||||
} else if (unit == 'ml') {
|
||||
return 0x05;
|
||||
} else if (unit == 'Waterml') {
|
||||
return 0x06;
|
||||
} else if (unit == 'milkml') {
|
||||
return 0x07;
|
||||
} else if (unit == 'oz') {
|
||||
return 0x08;
|
||||
} else if (unit == 'floz') {
|
||||
return 0x09;
|
||||
} else if (unit == 'lboz') {
|
||||
return 0x0A;
|
||||
}
|
||||
return unit;
|
||||
},
|
||||
// 下发单位
|
||||
handletoggleUnit: function handletoggleUnit(unit) {
|
||||
var that = this;
|
||||
var checksum = 0;
|
||||
|
|
@ -269,6 +323,7 @@ var _default = {
|
|||
bytes[5] = checksum;
|
||||
that.sendData(new Uint8Array(bytes).buffer);
|
||||
},
|
||||
// 清零
|
||||
handleqingling: function handleqingling() {
|
||||
var that = this;
|
||||
var str = "C503071100D0";
|
||||
|
|
@ -306,6 +361,7 @@ var _default = {
|
|||
var that = this;
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
bleTipsText: "连接失败,点击重新连接",
|
||||
unitList: that.$json.unitMinus,
|
||||
isConnectStatus: 1
|
||||
});
|
||||
that.$ble.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||
|
|
@ -313,14 +369,28 @@ var _default = {
|
|||
that.$ble.closeBluetoothAdapter();
|
||||
},
|
||||
unitConversion: function unitConversion(unit) {
|
||||
if (unit == 'kcal') {
|
||||
return '千卡';
|
||||
} else if (unit == 'g') {
|
||||
return '克';
|
||||
if (unit == 'kg') {
|
||||
return '千克';
|
||||
} else if (unit == '斤') {
|
||||
return '斤';
|
||||
} else if (unit == 'stlb') {
|
||||
return 'stlb';
|
||||
} else if (unit == 'lb') {
|
||||
return '磅';
|
||||
} else if (unit == 'g') {
|
||||
return '克';
|
||||
} else if (unit == 'ml') {
|
||||
return '毫升';
|
||||
} else if (unit == 'Waterml') {
|
||||
return 'Waterml';
|
||||
} else if (unit == 'milkml') {
|
||||
return 'milkml';
|
||||
} else if (unit == 'oz') {
|
||||
return '盎司';
|
||||
} else if (unit == 'floz') {
|
||||
return 'floz';
|
||||
} else if (unit == 'lboz') {
|
||||
return 'lboz';
|
||||
}
|
||||
return unit;
|
||||
},
|
||||
|
|
@ -333,11 +403,13 @@ var _default = {
|
|||
inputDialogToggle: function inputDialogToggle() {
|
||||
this.$refs.popup.open();
|
||||
},
|
||||
// 手动输入
|
||||
confirm: function confirm(value) {
|
||||
console.log(value);
|
||||
var that = this;
|
||||
this.$store.commit("changeBluetoothValue", {
|
||||
countWeight: value,
|
||||
unit: this.unitList[this.unitListIndex].unit
|
||||
unit: this.unitA[this.unitListIndex].unit
|
||||
});
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
|
|
@ -351,7 +423,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 330:
|
||||
/***/ 323:
|
||||
/*!**************************************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& ***!
|
||||
\**************************************************************************************************************************************/
|
||||
|
|
@ -360,14 +432,14 @@ exports.default = _default;
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& */ 331);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& */ 324);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_bluetooth_food_vue_vue_type_style_index_0_id_5fc22dca_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 331:
|
||||
/***/ 324:
|
||||
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/bluetooth_food.vue?vue&type=style&index=0&id=5fc22dca&scoped=true&lang=scss& ***!
|
||||
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -386,7 +458,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
'components/bluetooth_food-create-component',
|
||||
{
|
||||
'components/bluetooth_food-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(325))
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(318))
|
||||
})
|
||||
},
|
||||
[['components/bluetooth_food-create-component']]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<view class="weightPages data-v-5fc22dca"><view class="table data-v-5fc22dca"><view class="text data-v-5fc22dca"><image src="/static/zhong.png" class="data-v-5fc22dca"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-5fc22dca">{{bleTipsText}}</text></view><block wx:if="{{isShow&&isConnection==0}}"><view data-event-opts="{{[['tap',[['handleBack',['$event']]]]]}}" class="duan data-v-5fc22dca" bindtap="__e">断开连接</view></block></view><view class="weight-wrap data-v-5fc22dca"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-5fc22dca" bindtap="__e"><text class="val data-v-5fc22dca">{{weight==''?'0.0':weight}}</text><text class="unit data-v-5fc22dca">{{$root.m0}}</text></view></view><view class="groupbtn data-v-5fc22dca"><view class="btn danwei data-v-5fc22dca"><view class="lan border-bottom data-v-5fc22dca"><view class="right data-v-5fc22dca"><picker mode="selector" range="{{unitList}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-5fc22dca"><view class="uni-input data-v-5fc22dca">单位</view></picker></view></view></view><block wx:if="{{btnType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn addbtn size14 data-v-5fc22dca" bindtap="__e">保存</view></block><block wx:if="{{btnType==1}}"><view data-event-opts="{{[['tap',[['handleAddFood',['$event']]]]]}}" class="btn addbtn data-v-5fc22dca" bindtap="__e">+</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-5fc22dca" bindtap="__e">清零</view></view><view class="data-v-5fc22dca"><uni-popup vue-id="cef7e708-1" type="dialog" data-ref="popup" class="data-v-5fc22dca vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('cef7e708-2')+','+('cef7e708-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-5fc22dca" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>
|
||||
<view class="weightPages data-v-5fc22dca"><view class="table data-v-5fc22dca"><view class="text data-v-5fc22dca"><image src="/static/zhong.png" class="data-v-5fc22dca"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-5fc22dca">{{bleTipsText}}</text></view><block wx:if="{{isShow&&isConnection==2}}"><view data-event-opts="{{[['tap',[['handleBack',['$event']]]]]}}" class="duan data-v-5fc22dca" bindtap="__e">断开连接</view></block></view><view class="weight-wrap data-v-5fc22dca"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-5fc22dca" bindtap="__e"><text class="val data-v-5fc22dca">{{weight==''?'0.0':weight}}</text><text class="unit data-v-5fc22dca">{{$root.m0}}</text></view></view><view class="groupbtn data-v-5fc22dca"><view class="btn danwei data-v-5fc22dca"><view class="lan border-bottom data-v-5fc22dca"><view class="right data-v-5fc22dca"><picker mode="selector" range="{{unitA}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-5fc22dca"><view class="uni-input data-v-5fc22dca">单位</view></picker></view></view></view><block wx:if="{{btnType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn addbtn size14 data-v-5fc22dca" bindtap="__e">保存</view></block><block wx:if="{{btnType==1}}"><view data-event-opts="{{[['tap',[['handleAddFood',['$event']]]]]}}" class="btn addbtn data-v-5fc22dca" bindtap="__e">+</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-5fc22dca" bindtap="__e">清零</view></view><view class="data-v-5fc22dca"><uni-popup vue-id="cef7e708-1" type="dialog" data-ref="popup" class="data-v-5fc22dca vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('cef7e708-2')+','+('cef7e708-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-5fc22dca" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["components/search"],{
|
||||
|
||||
/***/ 332:
|
||||
/***/ 325:
|
||||
/*!********************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue ***!
|
||||
\********************************************************************/
|
||||
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./search.vue?vue&type=template&id=039252a3&scoped=true& */ 333);
|
||||
/* harmony import */ var _search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./search.vue?vue&type=script&lang=js& */ 335);
|
||||
/* harmony import */ var _search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./search.vue?vue&type=template&id=039252a3&scoped=true& */ 326);
|
||||
/* harmony import */ var _search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./search.vue?vue&type=script&lang=js& */ 328);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony import */ var _search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& */ 337);
|
||||
/* harmony import */ var _search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& */ 330);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 33);
|
||||
|
||||
var renderjs
|
||||
|
|
@ -41,7 +41,7 @@ component.options.__file = "components/search.vue"
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 333:
|
||||
/***/ 326:
|
||||
/*!***************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=template&id=039252a3&scoped=true& ***!
|
||||
\***************************************************************************************************************/
|
||||
|
|
@ -50,7 +50,7 @@ component.options.__file = "components/search.vue"
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=template&id=039252a3&scoped=true& */ 334);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=template&id=039252a3&scoped=true& */ 327);
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_template_id_039252a3_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||
|
|
@ -63,7 +63,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 334:
|
||||
/***/ 327:
|
||||
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=template&id=039252a3&scoped=true& ***!
|
||||
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -113,7 +113,7 @@ render._withStripped = true
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 335:
|
||||
/***/ 328:
|
||||
/*!*********************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=script&lang=js& ***!
|
||||
\*********************************************************************************************/
|
||||
|
|
@ -122,14 +122,14 @@ render._withStripped = true
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=script&lang=js& */ 336);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=script&lang=js& */ 329);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 336:
|
||||
/***/ 329:
|
||||
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=script&lang=js& ***!
|
||||
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -197,7 +197,7 @@ exports.default = _default;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 337:
|
||||
/***/ 330:
|
||||
/*!******************************************************************************************************************************!*\
|
||||
!*** E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& ***!
|
||||
\******************************************************************************************************************************/
|
||||
|
|
@ -206,14 +206,14 @@ exports.default = _default;
|
|||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& */ 338);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& */ 331);
|
||||
/* harmony import */ var _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||
/* harmony default export */ __webpack_exports__["default"] = (_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_HBuilderX_3_6_4_20220922_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_search_vue_vue_type_style_index_0_id_039252a3_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 338:
|
||||
/***/ 331:
|
||||
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/小程序/天晟厨房秤/kitchendDevice/components/search.vue?vue&type=style&index=0&id=039252a3&scoped=true&lang=scss& ***!
|
||||
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
|
@ -232,7 +232,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
'components/search-create-component',
|
||||
{
|
||||
'components/search-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(332))
|
||||
__webpack_require__('2')['createComponent'](__webpack_require__(325))
|
||||
})
|
||||
},
|
||||
[['components/search-create-component']]
|
||||
|
|
|
|||
|
|
@ -106,9 +106,6 @@ try {
|
|||
uniSwipeActionItem: function () {
|
||||
return Promise.all(/*! import() | uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue */ 306))
|
||||
},
|
||||
uniDrawer: function () {
|
||||
return __webpack_require__.e(/*! import() | uni_modules/uni-drawer/components/uni-drawer/uni-drawer */ "uni_modules/uni-drawer/components/uni-drawer/uni-drawer").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue */ 318))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
if (
|
||||
|
|
@ -133,9 +130,10 @@ var render = function () {
|
|||
var _c = _vm._self._c || _h
|
||||
var l0 = _vm.info.nutrients_four ? _vm.info.nutrients_four.slice(1) : null
|
||||
var g0 = _vm.info.list.length
|
||||
var l1 = _vm.activeFoodDetail.nutrients_four
|
||||
? _vm.activeFoodDetail.nutrients_four.slice(1)
|
||||
: null
|
||||
var l1 =
|
||||
_vm.drawerVisible && _vm.activeFoodDetail.nutrients_four
|
||||
? _vm.activeFoodDetail.nutrients_four.slice(1)
|
||||
: null
|
||||
_vm.$mp.data = Object.assign(
|
||||
{},
|
||||
{
|
||||
|
|
@ -214,6 +212,9 @@ var _default = {
|
|||
chartData: {},
|
||||
chartData2: {},
|
||||
activeFoodDetail: {},
|
||||
drawerVisible: false,
|
||||
chartVisible: false,
|
||||
// 单独控制图表显示
|
||||
actionOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
|
|
@ -282,7 +283,7 @@ var _default = {
|
|||
var that = this;
|
||||
var chart_data = [];
|
||||
this.activeFoodDetail = item;
|
||||
this.$refs.showRight.open();
|
||||
this.drawerVisible = true;
|
||||
this.opts2.color = [];
|
||||
for (var i = 1; i < item.nutrients_four.length; ++i) {
|
||||
this.opts2.color.push(item.nutrients_four[i].color);
|
||||
|
|
@ -297,6 +298,17 @@ var _default = {
|
|||
data: chart_data
|
||||
}]
|
||||
}));
|
||||
that.$nextTick(function () {
|
||||
// 延迟显示图表,确保容器已渲染
|
||||
setTimeout(function () {
|
||||
that.chartVisible = true;
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
handleDrawerClose: function handleDrawerClose() {
|
||||
// 先隐藏图表,再隐藏抽屉
|
||||
this.chartVisible = false;
|
||||
this.drawerVisible = false;
|
||||
},
|
||||
// 添加食物
|
||||
handleAddFood: function handleAddFood() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
"usingComponents": {
|
||||
"uni-swipe-action": "/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action",
|
||||
"uni-swipe-action-item": "/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item",
|
||||
"uni-drawer": "/uni_modules/uni-drawer/components/uni-drawer/uni-drawer",
|
||||
"qiun-data-charts": "/uni_modules/qiun-data-charts/components/qiun-data-charts"
|
||||
}
|
||||
}
|
||||
|
|
@ -184,4 +184,8 @@
|
|||
font-weight: bold;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
.no-scroll.data-v-1c5f368e {
|
||||
height: 80vh !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,11 +154,11 @@ var render = function () {
|
|||
}
|
||||
})
|
||||
: null
|
||||
var g9 = _vm.IsWeight ? Math.floor(_vm.activeType.weight) : null
|
||||
var g9 = _vm.IsWeight ? _vm.activeType.weight.toFixed(1) : null
|
||||
var l2 = _vm.IsWeight
|
||||
? _vm.__map(_vm.activeType.nutrients_list, function (item, index) {
|
||||
var $orig = _vm.__get_orig(item)
|
||||
var g10 = Number((item.value * _vm.activeType.weight) / 100).toFixed(2)
|
||||
var g10 = Number((_vm.activeType.weight / 100) * item.value).toFixed(1)
|
||||
return {
|
||||
$orig: $orig,
|
||||
g10: g10,
|
||||
|
|
@ -188,6 +188,9 @@ var render = function () {
|
|||
_vm.e5 = function ($event) {
|
||||
_vm.IsWeight = false
|
||||
}
|
||||
_vm.e6 = function ($event) {
|
||||
_vm.showScanCodeDlg = false
|
||||
}
|
||||
}
|
||||
_vm.$mp.data = Object.assign(
|
||||
{},
|
||||
|
|
@ -255,12 +258,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|||
var plugin = requirePlugin("WechatSI");
|
||||
var search = function search() {
|
||||
__webpack_require__.e(/*! require.ensure | components/search */ "components/search").then((function () {
|
||||
return resolve(__webpack_require__(/*! ../../components/search.vue */ 332));
|
||||
return resolve(__webpack_require__(/*! ../../components/search.vue */ 325));
|
||||
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
|
||||
};
|
||||
var blueTooth = function blueTooth() {
|
||||
__webpack_require__.e(/*! require.ensure | components/bluetooth_food */ "components/bluetooth_food").then((function () {
|
||||
return resolve(__webpack_require__(/*! ../../components/bluetooth_food.vue */ 325));
|
||||
return resolve(__webpack_require__(/*! ../../components/bluetooth_food.vue */ 318));
|
||||
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
|
||||
};
|
||||
var qiunDataCharts = function qiunDataCharts() {
|
||||
|
|
@ -292,7 +295,9 @@ var _default = {
|
|||
ActiveList: [],
|
||||
activeType: {},
|
||||
voiceManager: null,
|
||||
showAutoSearchDlg: false
|
||||
ScanCodeMsg: "",
|
||||
showAutoSearchDlg: false,
|
||||
showScanCodeDlg: false
|
||||
};
|
||||
},
|
||||
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(["configInfo", "user", 'bleValue', "countFoodInfo"])), {}, {
|
||||
|
|
@ -320,6 +325,9 @@ var _default = {
|
|||
bleValue: {
|
||||
handler: function handler(newVal, oldVal) {
|
||||
this.realTimeWeight(newVal.countWeight, newVal.unit);
|
||||
if (newVal.type == 2 && Number(newVal.countWeight) > 0) {
|
||||
this.handletoggleUnit(newVal.countWeight, newVal.unit, this.activeType.nutrients_four);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
|
@ -372,6 +380,34 @@ var _default = {
|
|||
this.showAutoSearchDlg = false;
|
||||
}
|
||||
},
|
||||
scanCode: function scanCode() {
|
||||
var that = this;
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function success(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
uni.showLoading({
|
||||
title: '搜索中'
|
||||
});
|
||||
that.$model.getPhotoSearch({
|
||||
barcode: res.result
|
||||
}).then(function (res) {
|
||||
uni.hideLoading();
|
||||
if (res.code != 0) {
|
||||
that.ScanCodeMsg = res.msg;
|
||||
that.showScanCodeDlg = true;
|
||||
return;
|
||||
}
|
||||
that.handleDetail(res.data);
|
||||
});
|
||||
},
|
||||
fail: function fail(res) {
|
||||
that.$api.msg("您已取消操作");
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 购物车早午晚餐切换
|
||||
handleToggle: function handleToggle(name) {
|
||||
this.search_value = "";
|
||||
|
|
@ -381,7 +417,6 @@ var _default = {
|
|||
},
|
||||
//实时重量
|
||||
realTimeWeight: function realTimeWeight(weight, unit) {
|
||||
// console.log("实时重量", weight, unit)
|
||||
this.activeType = Object.assign({}, this.activeType, {
|
||||
weight: this.convertToGrams(weight, unit)
|
||||
});
|
||||
|
|
@ -396,14 +431,20 @@ var _default = {
|
|||
},
|
||||
convertToGrams: function convertToGrams(value, fromUnit) {
|
||||
var conversionFactors = {
|
||||
'lb': 453.59,
|
||||
'lb': 453.59237,
|
||||
// 1磅 = 453.59237克
|
||||
'oz': 28.35,
|
||||
'oz': 28.349523125,
|
||||
// 1盎司 = 28.349523125克
|
||||
'kg': 1000,
|
||||
// 1公斤 = 1000克
|
||||
'g': 1
|
||||
'g': 1,
|
||||
'ml': 1,
|
||||
'斤': 500,
|
||||
'Waterml': 1,
|
||||
'milkml': 1.03
|
||||
// "stlb": "floz": "lboz":
|
||||
};
|
||||
|
||||
if (!conversionFactors.hasOwnProperty(fromUnit)) {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -415,19 +456,121 @@ var _default = {
|
|||
that.isBle = true;
|
||||
that.isShop = false;
|
||||
that.IsWeight = true;
|
||||
that.showScanCodeDlg = false;
|
||||
that.showAutoSearchDlg = false;
|
||||
that.activeType = ite;
|
||||
that.weightKcal = ite.kcal;
|
||||
if (that.bleValue.serviceId != "") {
|
||||
that.realTimeWeight(that.bleValue.countWeight, that.bleValue.unit);
|
||||
if (that.bleValue.type == 2 && Number(that.bleValue.countWeight) > 0) {
|
||||
that.handletoggleUnit(that.bleValue.countWeight, that.bleValue.unit, ite.nutrients_four);
|
||||
}
|
||||
} else {
|
||||
var weight = Number(that.bleValue.countWeight) > 0 ? Number(that.bleValue.countWeight) : 100;
|
||||
that.$store.commit("changeBluetoothValue", {
|
||||
countWeight: 100,
|
||||
unit: "g"
|
||||
countWeight: weight,
|
||||
unit: that.bleValue.unit
|
||||
});
|
||||
that.realTimeWeight(100, "g");
|
||||
that.realTimeWeight(weight, that.bleValue.unit);
|
||||
}
|
||||
},
|
||||
// 下发营养含量
|
||||
handletoggleUnit: function handletoggleUnit(val, unit, ite) {
|
||||
var that = this;
|
||||
var weight = Number(that.convertToGrams(val, unit)) / 100;
|
||||
var dataArray = that.buildNutritionData({
|
||||
fat: weight * ite[2].value,
|
||||
calorie: weight * ite[0].value,
|
||||
carbohydrate: weight * ite[3].value,
|
||||
protein: weight * ite[1].value,
|
||||
fiber: 0
|
||||
});
|
||||
var arrayBuffer = new ArrayBuffer(dataArray.length);
|
||||
var uint8Array = new Uint8Array(arrayBuffer);
|
||||
dataArray.forEach(function (value, index) {
|
||||
uint8Array[index] = value;
|
||||
});
|
||||
console.log("营养数据", arrayBuffer);
|
||||
that.sendArrayBuffer(arrayBuffer);
|
||||
},
|
||||
// 构建营养成分数据包
|
||||
buildNutritionData: function buildNutritionData(data) {
|
||||
// 头信息
|
||||
var header = 0xC5; // 同步头
|
||||
var dataLength = 0x11; // 数据长度:17字节
|
||||
var cmd = 0x04; // CMD字节
|
||||
var packetInfo = 0x41; // 包信息:总1包,第1包
|
||||
|
||||
// 转换营养成分值(×10并取整)
|
||||
var fatValue = Math.round(data.fat * 10);
|
||||
var calorieValue = Math.round(data.calorie * 10);
|
||||
var carbValue = Math.round(data.carbohydrate * 10);
|
||||
var fiberValue = Math.round(data.fiber * 10);
|
||||
var proteinValue = Math.round(data.protein * 10);
|
||||
|
||||
// 构建数据数组
|
||||
var dataArray = [];
|
||||
|
||||
// 添加头部
|
||||
dataArray.push(header); // 0xC5
|
||||
dataArray.push(dataLength); // 0x11
|
||||
dataArray.push(cmd); // 0x04
|
||||
dataArray.push(packetInfo); // 0x41
|
||||
|
||||
// 添加脂肪数据(大端序,3字节)
|
||||
dataArray.push(fatValue >> 16 & 0xFF); // 高位字节
|
||||
dataArray.push(fatValue >> 8 & 0xFF); // 中位字节
|
||||
dataArray.push(fatValue & 0xFF); // 低位字节
|
||||
|
||||
// 添加卡路里数据(大端序,3字节)
|
||||
dataArray.push(calorieValue >> 16 & 0xFF);
|
||||
dataArray.push(calorieValue >> 8 & 0xFF);
|
||||
dataArray.push(calorieValue & 0xFF);
|
||||
|
||||
// 添加碳水化合物数据(大端序,3字节)
|
||||
dataArray.push(carbValue >> 16 & 0xFF);
|
||||
dataArray.push(carbValue >> 8 & 0xFF);
|
||||
dataArray.push(carbValue & 0xFF);
|
||||
|
||||
// 添加膳食纤维数据(大端序,3字节)
|
||||
dataArray.push(fiberValue >> 16 & 0xFF);
|
||||
dataArray.push(fiberValue >> 8 & 0xFF);
|
||||
dataArray.push(fiberValue & 0xFF);
|
||||
|
||||
// 添加蛋白质数据(大端序,3字节)
|
||||
dataArray.push(proteinValue >> 16 & 0xFF);
|
||||
dataArray.push(proteinValue >> 8 & 0xFF);
|
||||
dataArray.push(proteinValue & 0xFF);
|
||||
|
||||
// 计算校验和(除同步头外的所有字节的和,取低8位)
|
||||
var checksum = 0;
|
||||
for (var i = 1; i < dataArray.length; i++) {
|
||||
checksum = checksum + dataArray[i] & 0xFF;
|
||||
}
|
||||
|
||||
// 添加校验和
|
||||
dataArray.push(checksum);
|
||||
console.log('构建的数据包:', dataArray);
|
||||
console.log('十六进制:', dataArray.map(function (b) {
|
||||
return b.toString(16).padStart(2, '0');
|
||||
}).join(' '));
|
||||
return dataArray;
|
||||
},
|
||||
sendArrayBuffer: function sendArrayBuffer(buffer) {
|
||||
var that = this;
|
||||
uni.writeBLECharacteristicValue({
|
||||
deviceId: that.bleValue.deviceId,
|
||||
serviceId: that.bleValue.serviceId,
|
||||
characteristicId: that.bleValue.write,
|
||||
value: buffer,
|
||||
success: function success(res) {
|
||||
console.log('下发指令成功', res.errMsg);
|
||||
},
|
||||
fail: function fail(res) {
|
||||
console.log("下发指令失败", res);
|
||||
}
|
||||
});
|
||||
},
|
||||
//测量返回
|
||||
handleBle: function handleBle(weight, unit, kcal) {
|
||||
var that = this;
|
||||
|
|
|
|||