新版厨房秤

This commit is contained in:
qcl_123 2025-11-08 16:50:26 +08:00
parent 14bb27829d
commit 29816185bb
450 changed files with 50909 additions and 7786 deletions

View File

@ -27,7 +27,13 @@
}
</script>
<style>
<style lang="scss">
/* #ifndef APP-NVUE */
@import "/assets/common.scss";
@import "/assets/iconfont.css";
@import "/assets/iconfont-weapp-icon.css";
/* #endif*/
/*每个页面公共css */
.content {
display: flex;

View File

@ -1,6 +1,6 @@
page {
font-family: "Microsoft YaHei";
font-size: 14px;
font-size: 28rpx;
color: #333;
background-color: #f7f7f7;
}
@ -22,7 +22,10 @@ page {
.mt-20 {
margin-top: 20px !important;
}
.size22{
font-size: 36rpx !important;
font-weight: bold !important;
}
.bold {
font-weight: bold;
}
@ -34,7 +37,7 @@ page {
.btn{
width: auto;
border-radius: 10px;
background-color: #f0ae43;
background-color: #45C570;
text-align: center;
height: 40px;
line-height: 40px;
@ -44,6 +47,36 @@ page {
color: #999;
margin-top: 20px;
text-align: center;
width: 100%;
margin-bottom: 15px;
}
.quan {
width: 60rpx;
height: 40rpx;
position: relative;
}
.quan::before {
content: "";
position: absolute;
width: 40rpx;
height: 40rpx;
left: 0px;
z-index: 22;
background: #3CB383;
border-radius: 50%;
}
.quan::after {
content: "";
position: absolute;
width: 40rpx;
height: 40rpx;
left: 15rpx;
z-index: 11;
background: #9CDCBF;
border-radius: 50%;
}
// .列表样式
.footlist {
@ -79,8 +112,7 @@ page {
}
.topimg{
width: 335rpx;
height: 370rpx;
height:320rpx;
overflow: hidden;
position: relative;
}
@ -102,20 +134,11 @@ page {
}
}
.list:nth-of-type(2n) {
.topimg {
height: 300rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
}
.footbox {
width: calc(100% - 30px);
margin-top: 40px;
// width: calc(100% - 30px);
// margin-top: 40px;
position: relative;
.item {
position: absolute;
@ -126,6 +149,7 @@ page {
background: #403f3f5c;
padding: 5px;
font-size: 15px;
z-index: 999999;
border-radius:0 0 10px 10px;
.title {
@ -474,11 +498,11 @@ page {
.box {
background-color: #fff;
position: absolute;
top:15%;
left: 0;
right: 0;
bottom: 0;
padding: 10px;
height: 630rpx;
border-radius: 10px 10px 0 0;
.title {

View File

@ -1,6 +1,6 @@
<template>
<view class="weightPages">
<view class="table" v-if="isConnection == 0">称重请将食物放到秤上</view>
<view class="table" v-if="isConnection == 0">测量请将食物放到秤上</view>
<view class="table" v-if="isConnection == 1" @click="openBluetoothAdapter">连接失败点击重新连接</view>
<view class="image" v-if="isConnection != 3">
<image src="../static/cheng.png"></image>
@ -11,7 +11,7 @@
<view>热量<text>{{kcal}}</text>千卡</view>
</view>
<view class="tips">
重新称重可更新当前数据
重新测量可更新当前数据
</view>
<view class="groupbtn" v-if="weightType!=2">
<view class="btn" @click="handleDetailSub">完成</view>
@ -32,7 +32,6 @@
} from "vuex";
let myTime
let nextCnt = 0
const plugin = requirePlugin("sdkPlugin").AiLink;
export default {
data() {
return {
@ -52,11 +51,11 @@
props: {
weightKcal: {
type: Number,
default: 0 //100gkcal
default: 0 //100gkcal
},
weightType: {
type: Number,
default: -1 //0,1,2
default: -1 //0,1,2
},
isLast: {
type: Boolean,
@ -374,20 +373,20 @@
that.closeBLEConnection()
that.closeBluetoothAdapter()
} else {
that.$tools.msg("数据异常,请清零后重新称重!")
that.$tools.msg("数据异常,请清零后重新测量!")
}
},
//
handleDetailSub() {
let that = this
if (that.weightType == 1) { //
if (that.weightType == 1) { //
// that.weight0 = Number(that.weight) - Number(that.weightALL)
that.weight0 = Number((Number(that.weight) - Number(that.weightALL)).toFixed(2))
if(that.weight0 > 0) {
that.weightALL = that.weight
}else {
that.$tools.msg("数据异常,请清零后重新称重!")
that.$tools.msg("数据异常,请清零后重新测量!")
}
} else {
that.weight0 = that.weight
@ -400,7 +399,7 @@
that.weight = 0
that.weight0 = 0
} else {
that.$tools.msg("数据异常,请重新称重!")
that.$tools.msg("数据异常,请重新测量!")
}
},
//
@ -415,7 +414,7 @@
if(that.weight0 > 0) {
that.weightALL = that.weight
}else {
that.$tools.msg("数据异常,请清零后重新称重!")
that.$tools.msg("数据异常,请清零后重新测量!")
}
} else {
that.weight0 = that.weight
@ -426,7 +425,7 @@
that.weight = 0
that.weight0 = 0
} else {
that.$tools.msg("数据异常,请清零后重新称重!")
that.$tools.msg("数据异常,请清零后重新测量!")
}
},

View File

@ -0,0 +1,618 @@
<template>
<view class="weightPages">
<view class="table" v-if="isConnection == 0">测量中请将食物放到秤上</view>
<view class="table" v-if="isConnection == 1" @click="openBluetoothAdapter">连接失败点击重新连接</view>
<view class="image" v-if="isConnection != 3">
<image src="../static/cheng.png"></image>
</view>
<view v-if="isConnection == 3">
<view class="weight-wrap">
<view class="weight">
<text class="val">{{weight == '' ? '--':weight}}</text>
<text class="unit">{{unitConversion(dw)}}</text>
</view>
<view class="kcal">
<text class="val">{{kcal == '' ? 0 : kcal}}</text>
<text class="unit">千卡</text>
</view>
</view>
<view class="tips">
重新测量可更新当前数据
</view>
<view class="groupbtn" v-if="weightType!=2">
<view class="btn" @click="handleDetailSub">完成</view>
<view class="btn" @click="handleDetailNext" v-if="!stopblue">下一位</view>
</view>
<view class="btn" @click="handlesub" v-if="weightType==2">确认添加</view>
</view>
<view class="tips" v-if="isConnection == 1">
<uni-icons type="info-filled" color="#dd524d" size="20"></uni-icons>
请确定设备是开机状态手机蓝牙权限已打开
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
let myTime
let nextCnt = 0
export default {
data() {
return {
dw: "g",
kcal: 0,
weight: "",
weightALL: "",
unit: '',
weight0: 0,
stopblue: false,
isConnection: 0, //
units: ['kg', '斤', 'st:lb', 'lb', 'g', 'ml', 'Waterml',
'milkml', 'oz', 'floz', 'lboz'
]
}
},
props: {
weightKcal: {
type: Number,
default: 0 //100gkcal
},
weightType: {
type: Number,
default: -1 //0,1,2
},
isLast: {
type: Boolean,
default: false
}
},
computed: {
...mapState(["user", 'isConnected', "isBluetoothTyle"]),
},
mounted() {
let that = this
console.log("mounted_new", that.weightType)
that.openBluetoothAdapter()
that.onBLEConnectionStateChange()
uni.onBluetoothAdapterStateChange(function(res) {
that.$store.commit("changeBluetooth", res.available);
})
},
destroyed() {
this.isConnection = 1
this.closeBLEConnection()
this.closeBluetoothAdapter()
},
watch: {
// weightType: function() {
// let that = this
// that.openBluetoothAdapter()
// },
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.handleBack()
}
},
isLast: function() {
let that = this
that.stopblue = that.isLast
console.log("最后", this.isLast)
}
},
methods: {
//
openBluetoothAdapter() {
let that = this
that.weight = ""
that.kcal = ""
uni.openBluetoothAdapter({
success: e => {
that.isConnection = 0
that.startBluetoothDeviceDiscovery()
},
fail: e => {
that.isConnection = 1
console.log('openBluetoothAdapter', e)
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
//
startBluetoothDeviceDiscovery() {
let that = this
uni.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true,
services: [
// "F0A0",
// "A5FE"
],
success: res => {
that.isConnection = 0
that.onBluetoothDeviceFound();
},
fail: res => {
that.isConnection = 1
console.log('startBluetoothDeviceDiscovery', res)
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
//
onBLEConnectionStateChange() {
let that = this
uni.onBLEConnectionStateChange(function(res) {
console.log("监听蓝牙连接状态", res.connected)
if (!res.connected) {
that.isConnection = 1
that.closeBLEConnection()
that.closeBluetoothAdapter()
}
that.$store.commit("changeConnected", res.connected);
})
},
/**
* 停止搜索蓝牙设备
*/
stopBluetoothDevicesDiscovery() {
uni.stopBluetoothDevicesDiscovery({
success: e => {
console.log("停止搜索蓝牙设备", e)
},
});
},
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
var that = this;
that.isConnection = 0
uni.onBluetoothDeviceFound(res => {
res.devices.forEach(device => {
device.advertisData = device.advertisData ? device.advertisData : ''
device.advertisServiceUUIDs = device.advertisServiceUUIDs ? device.advertisServiceUUIDs : ""
let value = that.$tools.ab2hex(device.advertisData, "")
let id = value.substring(0, 4)
if (!device.name && !device.localName) {
return
}
if (device.name.indexOf("EL") !== -1 && device.advertisServiceUUIDs != '') {
that.isConnection = 3
let value = that.$tools.ab2hex(device.advertisData)
let parseDataRes = plugin.parseBroadcastData(device.advertisData)
let analyzeData = plugin.analyzeBroadcastScaleData(parseDataRes)
let analyzeDataText = analyzeData.text
let data = analyzeData.data
if (parseDataRes.status == 1) {
let data0 = parseDataRes.payload
let data = parseInt(data0[3]).toString(16)
console.log('data' + data)
let data1 = parseInt(data0[4]).toString(16)
let data2 = parseInt((data + data1), 16) //
//
let unit0 = parseInt(data0[5]).toString(16) //
let unit = unit0.length > 1 ? unit0.substring(1, 2) : unit0 //
let num = parseInt(unit0.substring(0, 1), 16).toString(8)
let dot = num.toString().substring(0, 1) //
let zfz = 0 //
if (num.toString().length > 1) {
dot = num.toString().substring(1, 2)
zfz = num.toString().substring(0, 1)
}
if(unit == '0') {
that.dw = 'g'
}
if (unit == "7") {
that.dw = "ml"
}
if (unit == "3") {
that.dw = "oz"
}
if (unit == "2") {
that.dw = "lb'oz"
}
if (dot == "1") {
data2 = data2 / 10
}
if (dot == "2") {
data2 = data2 / 100
}
if (zfz == "0") {
data2 = data2
}
if (zfz == "1") {
data2 = "-" + data2
}
that.weight = data2
that.kcal = (Number(that.weightKcal) / 100 * data2).toFixed(2)
that.$emit('realTimeWeight',data2,that.dw)
}
}else if(device.name.indexOf('Chipsea-BLE') != -1 || device.localName.indexOf('Chipsea-BLE') != -1 || id == 'a5fe') {
that.stopBluetoothDevicesDiscovery()
that.connectDevice(device.deviceId)
}
})
});
},
//
async connectDevice(device_id) {
let that = this;
uni.createBLEConnection({
deviceId: device_id,
success: res => {
setTimeout(function() {
that.getBLEDeviceServices(device_id)
}, 200)
},
fail: res => {
console.log("设备连接失败,请重新连接", res);
}
});
},
/**
* 获取设备的UUID
*/
getBLEDeviceServices(device_id) {
let serviceList = [];
let that = this;
uni.getBLEDeviceServices({
deviceId: device_id,
success: res => {
console.log("获取设备的UUID成功", res)
serviceList = res.services;
for (let i = 0; i < serviceList.length; i++) {
let service = serviceList[i];
if (service.uuid.indexOf("FFF0") != -1) {
that.getBLEDeviceCharacteristics(device_id, service.uuid);
break;
}
}
},
fail: res => {
console.log('获取设备的UUID失败:', res)
}
});
},
/**
* 获取指定服务的特征值
*/
getBLEDeviceCharacteristics(deviceId, serviceId) {
let characteristicsList = [];
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: deviceId,
serviceId: serviceId,
success: res => {
console.log("服务的特征值成功", res)
let write, notify
for (let i = 0; i < res.characteristics.length; i++) {
let item = res.characteristics[i];
if (item.uuid.indexOf('0000FFF2') != -1) {
write = item.uuid
} else if (item.uuid.indexOf('0000FFF1') != -1) {
notify = item.uuid
}
}
uni.notifyBLECharacteristicValueChange({
deviceId: deviceId,
serviceId: serviceId,
characteristicId: notify,
state: true,
success: () => {
that.isConnection = 3
that.$emit('connect_success')
uni.onBLECharacteristicValueChange(function(res) {
const value = res.value
const dataView = new DataView(value)
const header = dataView.getUint8(0)
// MCU
if (header === 0xC7) {
const cmd = dataView.getUint8(2)
switch (cmd) {
case 0x02:
that.parseWeightData(dataView)
break
case 0x03:
break
}
}
})
},
fail: res => {
console.log('获取特征值失败:', JSON.stringify(res))
}
})
},
fail: res => {
console.log('获取特征值失败:', JSON.stringify(res))
}
})
},
parseWeightData(dataView) {
const statusByte = dataView.getUint8(4)
const isNegative = !!(statusByte & 0x80) //
const statusType = statusByte & 0x0F //
// 24 ()
const weightValue =
(dataView.getUint8(5) << 16) |
(dataView.getUint8(6) << 8) |
dataView.getUint8(7)
//
const unitByte = dataView.getUint8(8)
const precision = (unitByte & 0xF0) >> 4 // 4
const unitIndex = unitByte & 0x0F // 4
//
let finalWeight = weightValue / Math.pow(10, precision)
if (isNegative) finalWeight = -finalWeight
//
this.weight = finalWeight
this.dw = this.units[unitIndex] || 'g'
this.kcal = (Number(this.weightKcal) / 100 * finalWeight).toFixed(2)
// console.log('' + finalWeight)
// console.log('' + this.unit)
this.$emit('realTimeWeight',finalWeight,this.dw)
//
// if (statusType === 0x02) {
// this.$emit('handleBle', finalWeight,this.unit,0)
// }
},
//
handlesub() {
let that = this
console.log("weight", that.weight)
if (Number(that.weight) > 0) {
that.$emit("handleBle", that.weight, that.dw, that.kcal)
// that.stopBluetoothDevicesDiscovery() //
// that.closeBLEConnection()
// that.closeBluetoothAdapter()
} else {
that.$tools.msg("数据异常,请清零后重新测量!")
}
},
//
handleDetailSub() {
let that = this
if (that.weightType == 1) { //
// that.weight0 = Number(that.weight) - Number(that.weightALL)
that.weight0 = Number((Number(that.weight) - Number(that.weightALL)).toFixed(2))
if(that.weight0 > 0) {
that.weightALL = that.weight
}else {
that.$tools.msg("数据异常,请清零后重新测量!")
}
} else {
that.weight0 = that.weight
}
if (Number(that.weight0) > 0) {
that.$emit("handleDetailSub", that.weight0, that.dw, that.kcal)
// that.stopBluetoothDevicesDiscovery() //
// that.closeBLEConnection()
// that.closeBluetoothAdapter()
that.weight = 0
that.weight0 = 0
} else {
that.$tools.msg("数据异常,请重新测量!")
}
},
//
handleDetailNext() {
let that = this
if (that.weightType == 1) {
console.log('weight' + that.weight)
console.log('weight0' + that.weight0)
console.log('weightALL' + that.weightALL)
// that.weight0 = Number(that.weight) - Number(that.weightALL)
that.weight0 = Number((Number(that.weight) - Number(that.weightALL)).toFixed(2))
if(that.weight0 > 0) {
that.weightALL = that.weight
}else {
that.$tools.msg("数据异常,请清零后重新测量!")
}
} else {
that.weight0 = that.weight
}
if (Number(that.weight0) > 0) {
that.$emit("handleDetailNext", that.weight0, that.dw, that.kcal)
that.weight = 0
that.weight0 = 0
} else {
that.$tools.msg("数据异常,请清零后重新测量!")
}
},
handlechongzhi(weight) {
let that = this
console.log('当前总重:' + that.weightALL)
console.log('重置重量:' + weight)
if (that.weightType == 1) {
that.weightALL = Number((Number(that.weightALL) - Number(weight)).toFixed(2))
console.log('剩余重量:' + that.weightALL)
}
},
handleBack() {
let that = this
that.isConnection = 1
that.stopBluetoothDevicesDiscovery() //
that.closeBLEConnection()
that.closeBluetoothAdapter()
},
/**
* 断开蓝牙模块
*/
closeBluetoothAdapter() {
let that = this;
uni.closeBluetoothAdapter({
success: res => {
console.log('蓝牙模块关闭成功');
}
})
},
/**
* 断开蓝牙连接
*/
closeBLEConnection() {
var that = this;
uni.closeBLEConnection({
deviceId: that.deviceId,
success: res => {
console.log('断开蓝牙连接成功');
}
});
},
unitConversion(unit) {
if(unit == 'kcal') {
return '千卡'
}else if(unit == 'g') {
return '克'
}else if(unit == 'lb') {
return '磅'
}else if(unit =='oz') {
return '盎司'
}
return unit
}
// isNutritionScale(advertisData) {
// const buffer = this.base64ToArrayBuffer(advertisData)
// const dataView = new DataView(buffer)
// //
// if (dataView.getUint16(0) !== 0xA5FE) return false
// // (:0x0001)
// const typeId = dataView.getUint16(2)
// if (typeId !== 0x0001) return false
// // ID (:0x0001)
// const vendorId = dataView.getUint16(4)
// return vendorId === 0x0001
// },
// base64ToArrayBuffer(base64) {
// const str = atob(base64)
// const buffer = new ArrayBuffer(str.length)
// const view = new Uint8Array(buffer)
// for (let i = 0; i < str.length; i++) {
// view[i] = str.charCodeAt(i)
// }
// return buffer
// }
},
}
</script>
<style scoped lang="scss">
.weightPages {
display: flex;
flex-wrap: wrap;
flex-direction: column;
position: relative;
justify-content: space-around;
.weight-wrap {
display: flex;
flex-direction: column;
align-items: center;
background: #fff;
color: #666;
font-size: 16px;
flex-wrap: wrap;
text-align: center;
.weight, .kcal {
display: flex;
justify-content: center;
align-items: center;
width: 70%;
padding: 40rpx 0;
border-radius: 20rpx;
background-color: #F8F8F8;
}
.weight {
margin-bottom: 30rpx;
.val {
font-size: 40rpx;
color: #F0AE43;
margin: 0 !important;
}
.unit {
padding: 10rpx;
margin-left: 30rpx;
font-size: 28rpx;
color: #fff;
border-radius: 8rpx;
background-color: #F0AE43;
}
}
.kcal {
font-size: 32rpx;
.val {
font-size: 40rpx;
color: #F0AE43;
margin: 0 !important;
}
.unit {
margin-left: 20rpx;
}
}
}
.tips {
font-size: 12px;
text-align: center;
}
.btn {
color: #fff;
width: 80%;
margin-left: 10%
}
.groupbtn {
.btn {
color: #000 !important;
}
}
.table {
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: center;
margin: 15px 0;
}
.image {
width: 160px;
height: 160px;
margin: auto;
image {
width: 100%;
height: 100%;
}
}
.tips {
margin-top: 40rpx;
margin-left: 15px;
display: flex;
color: #999;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<template>
<view>
<view class="footbox">
<view class="footlist">
<view class="list" v-for="(it,id) in list" :key="it" @click="handleDetail(it.id)">
<view class="list" v-for="(it,ind) in list" :key="ind" @click="handleDetail(it.id)">
<view class="topimg">
<image :src="it.cover" class="img" mode="aspectFill"></image>
</view>
@ -61,5 +61,71 @@
</script>
<style scoped lang="scss">
.footlist {
margin: 15px 0;
width: 100%;
height: auto;
overflow: hidden;
column-gap: 20rpx;
column-count: 2;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
.list {
margin-bottom: 10px;
// height: auto;
overflow: auto;
break-inside: avoid;
border-radius: 15rpx;
overflow: hidden;
-webkit-column-break-inside: avoid;
.item {
color: #666;
width: calc(100% - 10px);
position: initial;
background: #fff;
border-radius: 0 0 5px 5px;
font-size: 14px;
height: auto;
overflow: hidden;
}
.topimg {
width: 335rpx;
height: 370rpx;
overflow: hidden;
position: relative;
}
.img {
width: 100%;
height: 100%;
display: block;
border-radius: 5px 5px 0 0;
}
.zan {
.iconfont {
font-size: 16px;
position: inherit !important;
}
}
}
.list:nth-of-type(2n) {
.topimg {
height: 300rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
}
</style>

View File

@ -5,10 +5,10 @@
<view class="searchInput">
<input placeholder="请输入..." class="city-serach-input" v-model="name" />
<icon v-if="name" class="iconfont icon-error" @click="handlecolse"></icon>
<view class="voice" v-if="voice && !name">
<uni-icons class="mic" type="mic-filled" size="26" @click="onMic"></uni-icons>
<uni-icons class="camera" type="camera-filled" size="26" @click="onCamera"></uni-icons>
</view>
<view class="voice" v-if="voice && !name">
<uni-icons class="mic" type="mic-filled" size="26" @click="onMic"></uni-icons>
<uni-icons class="camera" type="camera-filled" size="26" @click="onCamera"></uni-icons>
</view>
</view>
<view class="searchBtn">
<view @click="handleSerach">搜索</view>
@ -20,22 +20,18 @@
<script>
export default {
name: "search",
props: {
voice: {
type: Boolean,
default: false
}
},
props: {
voice: {
type: Boolean,
default: false
}
},
data() {
return {
name: ""
};
},
methods: {
searchByName(name) {
this.name = name
this.$emit("handleSearch", this.name)
},
//
handleSerach() {
this.$emit("handleSearch", this.name)
@ -45,18 +41,12 @@
this.name = ""
this.$emit("handleSearch", "")
},
//
onFocus() {
uni.navigateTo({
url: '/pages/search/search'
})
},
onMic() {
this.$emit("mic")
},
onCamera() {
this.$emit("camera")
}
onMic() {
this.$emit("mic")
},
onCamera() {
this.$emit("camera")
}
}
}
</script>
@ -92,21 +82,23 @@
display: flex;
z-index: 99999;
}
.voice {
display: flex;
justify-content: flex-end;
align-items: center;
position: absolute;
right: 10px;
top: 0;
bottom: 0;
width: 150rpx;
display: flex;
z-index: 99999;
.mic {
margin-right: 10rpx;
}
}
.voice {
display: flex;
justify-content: flex-end;
align-items: center;
position: absolute;
right: 10px;
top: 0;
bottom: 0;
width: 150rpx;
display: flex;
z-index: 99999;
.mic {
margin-right: 10rpx;
}
}
}
.searchBtn {
@ -143,4 +135,4 @@
}
}
</style>
</style>

View File

@ -1,16 +1,8 @@
<template>
<!-- 搜索 -->
<view class="serachBox">
<view class="serach-box">
<view class="searchInput">
<div class="search-wrap" @click="handleSearch">
<text>搜索食材...</text>
</div>
</view>
<view class="searchBtn">
<view @click="handleSearch">搜索</view>
</view>
</view>
<view class="search" @click="handleSearch">
<input type="text" :placeholder="name" />
<image src="/static/28.png"></image>
</view>
</template>
@ -18,14 +10,19 @@
export default {
name: "search",
data() {
return {
};
return {};
},
props: {
name: {
type: String,
default: ''
}
},
methods: {
//
handleSearch() {
uni.navigateTo({
url: '/pages/search/search'
uni.switchTab({
url: '/pages/search/search'
})
},
}
@ -33,71 +30,37 @@
</script>
<style scoped lang="scss">
.serachBox {
height: 40px;
position: fixed;
top: 0;
left: 0;
right: 0;
padding: 0 15px 10px;
z-index: 99;
background-color: #efefef;
.serach-box {
height: 40px;
border-radius: 10px;
position: relative;
background-color: #fff;
.search-wrap {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
text {
font-size: 30rpx;
color: #aaa;
}
}
}
.searchInput {
position: absolute;
left: 0;
right: 60px;
height: 40px;
icon {
position: absolute;
right: 10px;
top: 10px;
display: flex;
z-index: 99999;
}
}
.searchBtn {
position: absolute;
width: 60px;
right: 0px;
height: 40px;
line-height: 40px;
background: $maincolor;
border-radius: 0 10px 10px 0;
text-align: center;
color: #fff;
}
.icon {
width: 50px;
height: 40px;
position: absolute;
right: 15px;
display: flex;
align-items: center;
justify-content: center;
}
.search {
width: 100%;
position: fixed;
left: 0;
top: 0;
padding-bottom: 35px;
padding-top: 10px;
background-color: $maincolor;
input {
width: calc(100% - 40px);
background: #fff;
height: 39px;
line-height: 38px;
border-radius: 10px;
padding: 0 10px;
margin: 0 10px;
}
.input:hover {
box-shadow: 0 1rpx 20rpx #ccc;
}
image {
width: 25px;
height: 25px;
position: absolute;
right: 20px;
top: 18px;
z-index: 99;
}
}
</style>
</style>

View File

@ -1,6 +1,3 @@
const accountInfo = wx.getAccountInfoSync();
const appid = accountInfo.miniProgram.appId
uni.setStorageSync('appid', appid)
let configPro = {}
if (process.env.NODE_ENV === 'development') {
console.log("测试环境")
@ -16,6 +13,5 @@ if (process.env.NODE_ENV === 'development') {
}
}
module.exports = {
appid,
configPro,
};

15
content.json Normal file
View File

@ -0,0 +1,15 @@
{
"addfoodList": [{
"name": "早加餐",
"id": 3
},
{
"name": "午加餐",
"id": 4
}, {
"name": "晚加餐",
"id": 5
}
]
}

293
data.json
View File

@ -1,293 +0,0 @@
{
"fimages": [{
"image": "../../static/img.jpg",
"title": "减脂一定要吃的生菜鸡丝卷01",
"head": "../../static/dan.png",
"name": "季总蛋先生01",
"iszan": false
}, {
"image": "../../static/img2.jpg",
"title": "减脂一定要吃的生菜鸡丝卷02",
"head": "../../static/dan.png",
"name": "季总蛋先生02",
"iszan": false
}],
"footlist": [{
"height": 370,
"image": "../static/img.jpg",
"title": "鸡蛋芝士烤吐司",
"head": "../static/dan.png",
"name": "ayamama",
"zan": 2255,
"iszan": false
},
{
"height": 370,
"image": "../static/img2.jpg",
"title": "鸡蛋芝士烤吐司",
"head": "../static/dan.png",
"name": "ayamama",
"zan": 2255,
"iszan": false
},
{
"height": 370,
"image": "../static/img.jpg",
"title": "减脂一定要吃的生菜鸡丝卷03",
"head": "../static/dan.png",
"name": "季总蛋先生03",
"iszan": true,
"zan": 1699
},
{
"height": 370,
"image": "../static/img.jpg",
"title": "减脂一定要吃的生菜鸡丝卷03",
"head": "../static/dan.png",
"name": "季总蛋先生03",
"iszan": true,
"zan": 1699
},
{
"height": 370,
"image": "../static/img2.jpg",
"title": "减脂一定要吃的生菜鸡丝卷03",
"head": "../static/dan.png",
"name": "季总蛋先生03",
"iszan": true,
"zan": 1699
},
{
"height": 370,
"image": "../static/img2.jpg",
"title": "减脂一定要吃的生菜鸡丝卷03",
"head": "../static/dan.png",
"name": "季总蛋先生03",
"iszan": true,
"zan": 1699
}
],
"menu": [{
"name": "酒水饮料"
},
{
"name": "健康饮食"
},
{
"name": "家常菜谱"
},
{
"name": "轻食沙拉"
},
{
"name": "烘焙"
}
],
"menulist": [{
"name": "酒水",
"list": [{
"image": "../../static/img2.jpg",
"name": "莫吉托"
},
{
"image": "../../static/jiu.jpg",
"name": "威士忌"
},
{
"image": "../../static/img2.jpg",
"name": "白兰地"
},
{
"image": "../../static/jiu.jpg",
"name": "朗姆酒"
}
]
},
{
"name": "饮品",
"list": [{
"image": "../../static/jiu.jpg",
"name": "咖啡"
},
{
"image": "../../static/img2.jpg",
"name": "豆浆"
},
{
"image": "../../static/jiu.jpg",
"name": "果汁"
},
{
"image": "../../static/jiu.jpg",
"name": "奶茶"
}
]
}
],
"food": [{
"name": "蔬菜豆品"
},
{
"name": "水果鲜花"
},
{
"name": "酒水饮料"
},
{
"name": "乳品烘焙"
},
{
"name": "肉蛋水产"
},{
"name": "蔬菜豆品"
},
{
"name": "水果鲜花"
},
{
"name": "酒水饮料"
},
{
"name": "乳品烘焙"
},
{
"name": "肉蛋水产"
},{
"name": "蔬菜豆品"
},
{
"name": "水果鲜花"
},
{
"name": "酒水饮料"
},
{
"name": "乳品烘焙"
},
{
"name": "肉蛋水产"
}
],
"foodlist": [{
"name": "土豆/根茎类",
"list": [{
"id": 1,
"name": "土豆",
"unit": "g",
"weight": null
},
{
"id": 2,
"name": "紫薯",
"unit": "g",
"weight": null
},
{
"id": 3,
"name": "铁棍山药",
"unit": "g",
"weight": null
},
{
"id": 4,
"name": "胡萝卜",
"unit": "g",
"weight": null
}
]
},
{
"name": "叶菜类",
"list": [{
"id": 5,
"name": "上海青",
"unit": "g",
"weight": null
},
{
"id": 6,
"name": "本地生菜",
"unit": "g",
"weight": null
},
{
"id": 7,
"name": "球生菜",
"unit": "g",
"weight": null
},
{
"id": 8,
"name": "菠菜",
"unit": "g",
"weight": null
}
]
}
],
"recordList": [{
"time": "2323/03/25",
"kcal": "1235",
"status": 1
}, {
"time": "2323/03/25",
"kcal": "1236",
"status": 2
}, {
"time": "2323/03/25",
"kcal": "1237",
"status": 1
}, {
"time": "2323/03/25",
"kcal": "1238",
"status": 1
}, {
"time": "2323/03/25",
"kcal": "1239",
"status": -1
}, {
"time": "2323/03/25",
"kcal": "1240",
"status": -1
}, {
"time": "2323/03/25",
"kcal": "1241",
"status": 2
}],
"menudetail": {
"id": 1,
"FMimg": "../../static/1-2.jpg",
"content": "简单易操作,方便又美味",
"list": [{
"id": 1,
"name": "牛肉",
"unit": "g",
"weight": "10"
}, {
"id": 2,
"name": "芝麻",
"unit": "g",
"weight": "20"
}, {
"id": 3,
"name": "面粉",
"unit": "g",
"weight": "30"
}],
"user": {
"headimg": "../../static/dan.png",
"name": "季总蛋先生03",
"iszan": false,
"zan": 1699
},
"stepList": [{
"content": "去面粉500g,加水100ml搅拌均匀取葱1根切葱花热锅放油放面饼翻面放葱花芝麻",
"image": "../../static/img2.jpg"
}, {
"content": "去面粉500g,加水100ml搅拌均匀取葱1根切葱花热锅放油放面饼翻面放葱花芝麻",
"image": "../../static/img.jpg"
}],
"title": "葱油饼"
}
}

10
main.js
View File

@ -1,8 +1,8 @@
import App from './App'
import './uni.scss';
import './assets/common.scss'
import './assets/iconfont.css'
import './assets/iconfont-weapp-icon.css'
// import './uni.scss';
// import './assets/common.scss'
// import './assets/iconfont.css'
// import './assets/iconfont-weapp-icon.css'
import store from './store'
Vue.prototype.$store = store;
// js
@ -15,7 +15,7 @@ Vue.prototype.$http = http;
import model from '@/tools/model.js'
Vue.prototype.$model = model;
//模拟数据
import json from '@/data.json'
import json from '@/content.json'
Vue.prototype.$json = json;

View File

@ -1,6 +1,6 @@
{
"name" : "kitchendDevice",
"appid" : "__UNI__9A0614A",
"appid" : "__UNI__20604F1",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -44,7 +44,9 @@
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"speech" : {}
}
}
},
/* */
@ -64,11 +66,6 @@
"Package8s" : true
},
"plugins" : {
"sdkPlugin" : {
// 线
"version" : "2.4.0", //
"provider" : "wx17e93aad47cdae1a" //appid
},
"WechatSI" : {
"version" : "0.3.6",
"provider" : "wx069ba97219f66d99"

View File

@ -106,7 +106,7 @@
</view>
</scroll-view>
</uni-drawer>
<!-- 称重-->
<!-- 测量-->
<view class="wrapper" v-if="IsWeight && !IsFoodDetail">
<view class="bg" @click='IsWeight=false'>
<view class="box" @click.stop>
@ -244,7 +244,6 @@
mapState
} from "vuex";
let myTime
// const plugin = requirePlugin("sdkPlugin").AiLink;
import search from "../../components/search.vue"
import blueTooth from "../../components/bluetooth_food.vue"
import FoodItem from "../../components/food_item.vue"
@ -570,20 +569,20 @@
rulerChange(val) {
this.activeType = Object.assign({}, this.activeType, { weight: val })
},
//
//
handleWeight() {
let that = this
that.weightKcal = that.activeType.kcal
that.isBle = true
that.IsWeight = false
},
//
//
handleMannulWeight() {
let that = this
that.isBle = false
that.IsWeight = true
},
//
//
handleBle(weight, unit, kcal) {
let that = this
that.isBle = false

1194
pageTwo/count/search.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -115,7 +115,7 @@
padding: 10px;
display: flex;
align-items: center;
margin-bottom: 15px;
margin: 15px 0;
justify-content: space-between;
.left {

View File

@ -35,7 +35,7 @@
</view>
<view class="close" @click="handleWeight">
<image src="../../static/lianjie.png"></image>
连接称重
连接测量
</view>
</view>
<view class="foodlist">
@ -115,13 +115,13 @@
<icon class="iconfont icon-reset"></icon>
</view>
<view class="kcal" v-if="activeType.id&&activeType.id ==ite.id&&!ite.newweight">
正在称重...
正在测量...
</view>
</view>
</view>
<!-- <view class="groupbtn" :style="{display: (isWeightType&&iSWeightSub) ? '' : 'none'}">
<view @click="handleWeightType(1)">累计称重</view>
<view @click="handleWeightType(0)">分类称重</view>
<view @click="handleWeightType(1)">累计测量</view>
<view @click="handleWeightType(0)">分类测量</view>
</view> -->
<view class="title" :style="{display: (!isWeightType&&iSWeightSub) ? '' : 'none'}">
<view class="name">{{activeType.name}}</view>
@ -215,7 +215,7 @@
that.cookIndex = that.menu.findIndex(ite => ite.id == res.data.cook_label)
})
},
//
//
handleWeight() {
let that = this
if(that.isBle) {
@ -227,7 +227,7 @@
that.activeType = {}
that.iSWeightSub = true
that.isWeightType = true
that.handleWeightType(0) //
that.handleWeightType(0) //
},
//
handleDetailNext(weight, dw, kcal) {
@ -244,10 +244,10 @@
that.info.tags[0].list[that.listInd].newkcal = ""
if (that.listInd == that.info.tags[0].list.length - 1 || that.listInd == that.info.tags[0].list.length) {
that.isLast = true
console.log('已经称重完成')
console.log('已经测量完成')
}
},
//
//
handleDetailSub(weight, dw, kcal) {
let that = this
let ind = that.info.tags[0].list.findIndex(ite => ite.id == that.activeType.id)
@ -255,7 +255,7 @@
that.info.tags[0].list[ind].newunit = dw
that.info.tags[0].list[ind].newkcal = kcal
that.showSaveFood = true
console.log("称重完成", weight, dw, kcal)
console.log("测量完成", weight, dw, kcal)
},
//
handlechongzhi(ite, ind) {
@ -276,7 +276,7 @@
this.$refs.blueTooth.handlechongzhi(weight)
console.log("重置", ind, that.info.tags[0].list.length)
},
//
//
handleWeightType(ind) {
this.weightType = ind
this.isLast = false
@ -288,7 +288,7 @@
this.isLast = true
}
},
//
//
confirmSaveFood() {
let that = this
let newFoodList = []

View File

@ -1,30 +1,26 @@
<template>
<view class="content">
<!-- 搜索 -->
<search @handleSearch="handleSearch"></search>
<view class="search">
<input type="text" placeholder="请输入关键字快速搜索" v-model="name" />
<image src="/static/28.png" @click="handleSearch"></image>
</view>
<!-- 食谱 -->
<!-- <view class="tab_list">
<view class="tabbar" v-for="(ite,ind) in list" :key="ind" @click="handleToggle(ind)">
<view :class="[index ==ind?'active':'']">{{ite.name}}</view>
<view class="footlist footbox" v-if="menuList.length">
<view class="list" v-for="(it,id) in menuList" :key="it" @click="handleDetail(it.id)">
<view class="topimg">
<image :src="it.cover_url" class="img" mode="aspectFill"></image>
</view>
</view> -->
<view class="footbox" v-if="menuList.length">
<view class="footlist">
<view class="list" v-for="(it,id) in menuList" :key="it" @click="handleDetail(it.id)">
<view class="topimg">
<image :src="it.cover_url" class="img" mode="aspectFill"></image>
<view class="item">
<view class="title">{{it.title}}</view>
<view class="name">
<image :src="it.create_user_head_pic"></image>
<text class="overflow">{{it.create_user_nickname}}</text>
</view>
<view class="item">
<view class="title">{{it.title}}</view>
<view class="name">
<image :src="it.create_user_head_pic"></image>
<text class="overflow">{{it.create_user_nickname}}</text>
</view>
<view class="zan" @click="handleZan(it)">
<icon class="iconfont" :class="[it.is_me_like_it=='yes'?'icon-icon3':'icon-icon_collect']">
</icon>
<text>{{it.likes_num}}</text>
</view>
<view class="zan" @click="handleZan(it)">
<icon class="iconfont" :class="[it.is_me_like_it=='yes'?'icon-icon3':'icon-icon_collect']">
</icon>
<text>{{it.likes_num}}</text>
</view>
</view>
</view>
@ -102,9 +98,8 @@
})
},
//
handleSearch(ite) {
handleSearch() {
let that = this
that.name = ite
that.page = 1
that.menuList = []
that.lastPage = ""
@ -115,4 +110,55 @@
</script>
<style lang="scss" scoped>
.content {
background: #fff;
}
.search {
width: 100%;
position: fixed;
left: 0;
top: 0;
padding-bottom: 35px;
padding-top: 10px;
background-color: $maincolor;
input {
width: calc(100% - 40px);
background: #fff;
height: 39px;
line-height: 38px;
border-radius: 10px;
padding: 0 10px;
margin: 0 10px;
}
.input:hover {
box-shadow: 0 1rpx 20rpx #ccc;
}
image {
width: 25px;
height: 25px;
position: absolute;
right: 20px;
top: 18px;
z-index: 99;
}
}
.footlist {
position: relative;
margin-top: 68px;
padding: 15px;
width: calc(100% - 30px);
background: #fff;
border-radius: 15px 15px 0 0;
.item {
background: #f7f7f7 !important;
border-top: 1px solid #f7f7f7;
}
}
</style>

View File

@ -1,11 +1,5 @@
<template>
<view class="content">
<!-- 日期搜索 -->
<view class="calendar">
<ren-calendar ref='ren' :markDays='markDays' @maskClick="maskClick" @onMonthClickPre='onMonthClickPre'
@onMonthClickNext="onMonthClickNext">
</ren-calendar>
</view>
<!-- 列表 -->
<view class="box">
<view class="list" v-for="(item,ind) in infoList" :key="ind" @click="handleDetail(item)">
@ -13,12 +7,13 @@
<view class="kcal">
<view>摄入卡路里<text>{{item.val}}</text>{{item.unit}}</view>
<view class="status">
<text class="quan" :style="'background:'+item.color"></text>
<text class="quan0" :style="'background:'+item.color"></text>
{{item.describe}}
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
</view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
<view v-if="!infoList.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
<text>还没有记录哦</text>
@ -32,7 +27,6 @@
import {
mapState
} from "vuex";
import RenCalendar from '@/uni_modules/ren-calendar/ren-calendar.vue';
export default {
data() {
return {
@ -47,9 +41,6 @@
infoList: []
}
},
components: {
RenCalendar,
},
computed: {
...mapState(["user"]),
end() {
@ -63,8 +54,6 @@
let that = this
that.page = 1
that.list = []
that.startM = that.$tools.getMonth(that.$tools.getTime(), 0).substring(0, 10)
that.endM = that.$tools.getMonth(that.$tools.getTime(), 0).substring(11, 21)
that.handleList()
},
onReachBottom() {
@ -85,8 +74,6 @@
that.$model.getMyLogList({
aud_id: that.user.aud_id,
page: that.page,
s_time: that.startM,
e_time: that.endM
}).then(res => {
if (res) {
console.log("11111", res)
@ -167,7 +154,7 @@
}
.box {
margin-top: 55px;
margin-top: 15px;
width: 100%;
}
@ -202,7 +189,7 @@
width: 85px;
}
.quan {
.quan0 {
width: 12px;
height: 12px;
background: $uni-color-warning;
@ -210,14 +197,6 @@
border-radius: 50%;
margin-right: 5px;
}
.quan1 {
background: $uni-color-success;
}
.quan2 {
background: $maincolor;
}
}
}
</style>

View File

@ -2,14 +2,17 @@
<view class="content">
<view class="lanBox">
<view class="headbox">
<view class="touxiang">
<view class="touxiang" v-if="user.head_pic">
<image :src="user.head_pic" class="headimage" />
</view>
<view class="touxiang" v-else>
<image src="/static/tou.png" class="headimage" />
</view>
</view>
<view class="lan border-bottom">
<view class="left">昵称</view>
<view class="right">
<input name="name" type="text" v-model="memInfo.nickname" placeholder="请输入昵称" class="name" />
<input name="name" type="text" v-model="memInfo.nickname" placeholder="请输入" class="name" />
<icon class="iconfont icon-bianji" v-if="!memInfo.nickname"></icon>
<icon class="iconfont icon-error" v-else @click="memInfo.nickname=''"></icon>
</view>
@ -18,12 +21,22 @@
<view class="left">性别</view>
<view class="right">
<picker mode="selector" :range="sexItem" @change="onsexArr">
<view class="uni-input">{{!memInfo.gender?'请选择性别':memInfo.gender==1?'男':'女'}}</view>
<view class="uni-input">{{memInfo.gender==0?'请选择':memInfo.gender==1?'男':'女'}}</view>
<icon class="iconfont icon-arrow-down"></icon>
</picker>
</view>
</view>
<view class="lan border-bottom">
<view class="left">出生日期</view>
<view class="right">
<picker mode="date" :end="endDate" @change="maskClick"
:value="memInfo.birthday?memInfo.birthday:endDate">
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:"请选择"}}</view>
<icon class="iconfont icon-arrow-down"></icon>
</picker>
</view>
</view>
<!-- <view class="lan border-bottom">
<view class="left">年龄</view>
<view class="right">
<picker mode="selector" :range="ageArr" @change="onageArr">
@ -31,18 +44,18 @@
<icon class="iconfont icon-arrow-down"></icon>
</picker>
</view>
</view>
</view> -->
<view class="lan border-bottom">
<view class="left">身高</view>
<view class="right">
<input type="digit" v-model="memInfo.height" placeholder="请输入身高" />
<input type="digit" v-model="memInfo.height" placeholder="请输入" />
<text>cm</text>
</view>
</view>
<view class="lan border-bottom">
<view class="left">体重</view>
<view class="right">
<input type="digit" v-model="memInfo.weight" placeholder="请输入体重" />
<input type="digit" v-model="memInfo.weight" placeholder="请输入" />
<text>kg</text>
</view>
</view>
@ -59,37 +72,34 @@
export default {
data() {
return {
ageArr: [],
sexItem: [
"男",
"女"
],
isEdit: false,
memInfo: {
age: "",
birthday: "",
height: "",
weight: "",
gender: "",
gender: 0,
nickname: "",
},
};
},
computed: {
...mapState(["user", "appTheme"]),
...mapState(["user"]),
endDate() {
return this.$tools.getDate("start")
},
},
onLoad(options) {
var agedata = []
for (var i = 5; i <= 80; i++) {
agedata.push(i);
}
this.ageArr = agedata
//
if (options.familayData) {
let info = options.familayData
this.memInfo = JSON.parse(info)
this.isEdit = true
console.log("编辑", this.memInfo)
} else {
} else if (this.user.aud_id) {
this.memInfo = this.user
}
},
@ -105,8 +115,8 @@
this.$tools.msg("请选择性别")
return;
}
if (!this.memInfo.age) {
this.$tools.msg("请选择年龄")
if (!this.memInfo.birthday) {
this.$tools.msg("请选择出生日期")
return;
}
if (!this.memInfo.height) {
@ -141,14 +151,15 @@
that.$store.commit('changeUserInfo', res.data)
})
},
//
maskClick(e) {
console.log("出生日期", e.detail.value)
this.memInfo.birthday = e.detail.value
},
//
onsexArr(e) {
this.memInfo.gender = this.sexItem[e.target.value] == "男" ? 1 : 2
},
//
onageArr(e) {
this.memInfo.age = this.ageArr[e.target.value]
},
},
};
</script>

View File

@ -3,20 +3,20 @@
<view class="caritem" @click="navTo('/pageTwo/setting/phone')">
<view class="text">手机号</view>
<view class="text_r">
<text>{{user.my_tel}}</text>
<uni-icons type="right"></uni-icons>
<text>{{userinfo.tel?userinfo.tel:''}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
</view>
<view class="caritem" @click="navTo('/pageTwo/setting/email')">
<view class="text">邮箱</view>
<view class="text_r">
<text>{{user.my_email}}</text>
<uni-icons type="right"></uni-icons>
<text>{{userinfo.email}}</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
</view>
<view class="caritem" @click="navTo('/pageTwo/setting/password')">
<view class="text">设置密码</view>
<uni-icons type="right"></uni-icons>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<!-- <view class="btn mb-15" @click="handleOutLogin">删除账号</view> -->
</view>
@ -35,9 +35,9 @@
};
},
computed: {
...mapState(["accountNumber"]),
user() {
return this.accountNumber
...mapState(["user"]),
userinfo() {
return this.user
}
},
methods: {
@ -111,6 +111,7 @@
justify-content: flex-end;
text {
text-align: right;
width: calc(100% - 30px);
display: inline-block;
}
@ -138,11 +139,11 @@
align-items: center;
justify-content: space-between;
width: calc(100% - 20px);
.uni-icons {
width: 30px;
text-align: right;
}
}
</style>

View File

@ -24,7 +24,7 @@
}, {
"path": "pages/count/count",
"style": {
"navigationBarTitleText": "计食器",
"navigationBarTitleText": "测量",
"enablePullDownRefresh": false
}
@ -46,8 +46,15 @@
"path" : "pages/search/search",
"style" :
{
"navigationBarTitleText" : "搜索"
"navigationBarTitleText" : "搜索菜谱"
}
},
{
"path" : "pages/search/list",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
"subPackages": [{
@ -70,15 +77,13 @@
}, {
"path": "me/feedBack",
"style": {
"navigationBarTitleText": "意见反馈",
"navigationBarBackgroundColor": "#F9FAFC"
"navigationBarTitleText": "意见反馈"
}
}, {
"path": "me/userEdit",
"style": {
"navigationBarTitleText": "个人资料",
"navigationBarBackgroundColor": "#F9FAFC"
"navigationBarTitleText": "个人资料"
}
}, {
@ -129,6 +134,14 @@
"enablePullDownRefresh": false
}
},
{
"path": "count/search",
"style": {
"navigationBarTitleText": "食材搜索",
"enablePullDownRefresh": false
}
},
{
"path": "webview/webview",
@ -181,12 +194,12 @@
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#efefef",
"navigationBarBackgroundColor": "#3CB383",
"backgroundColor": "#efefef"
}, //
"tabBar": {
"color": "#333",
"selectedColor": "#ff4c4f",
"selectedColor": "#3CB383",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
@ -195,10 +208,10 @@
"text": "首页"
},
{
"pagePath": "pages/menu/menu",
"pagePath": "pages/search/search",
"iconPath": "static/cai.png",
"selectedIconPath": "static/cai01.png",
"text": "菜谱"
"text": "教你做"
},
{
"pagePath": "pages/add/add",
@ -210,7 +223,7 @@
"pagePath": "pages/count/count",
"iconPath": "static/ji.png",
"selectedIconPath": "static/ji01.png",
"text": "计食器"
"text": "测量"
},
{
"pagePath": "pages/me/me",

View File

@ -377,6 +377,7 @@
margin-bottom: 10px;
overflow: hidden;
position: relative;
margin-top: 15px;
.iconfont {
font-size: 30px;

View File

@ -8,120 +8,117 @@
<view class="btn">登录</view>
</view>
<view v-else class="content_box">
<view class="box" v-if="userinfo&&userinfo.weight!=''">
<!-- 日期搜索 -->
<view class="calendar">
<ren-calendar ref='ren' :startDay="startDay" :markDays='markDays' @maskClick="maskClick"
@onMonthClickPre='onMonthClickPre' @onMonthClickNext="onMonthClickNext">
</ren-calendar>
<view class="set" @click="handleSet">
<view class="date">{{foodInfo.date}}</view>
<view class="icon">
<icon class="iconfont icon-shezhi1"></icon>
</view>
</view>
<view class="box" v-if="userinfo">
<view class="kcal">
<view class="set" @click="handleSet">
<icon class="iconfont icon-shezhi1"></icon>
</view>
<view class="top">
<!-- 进度 -->
<view class="left ">
<qiun-data-charts type="arcbar" :chartData="chartData" :canvas2d="true" :cHeight="300"
:cWidth="300" canvasId="arcbar008" />
<view class="center">
还能
<text>{{remaining_kcal}}</text>
可以吃
<text>{{foodInfo.remaining_kcal}}</text>
<view class="unit">Kcal</view>
</view>
</view>
<view class="right">
<text>建议摄入</text>
<text class="num">{{suggestion.kcal}}</text>
<view class="unit">Kcal</view>
</view>
</view>
<view class="weight">
<view class="item">
<text class="name">碳水化合物()</text>
<view class="bold">
<view class="val"
:style="{ width: (carbohydratepercent>100?100:carbohydratepercent) + '%'}"></view>
<text>{{today_intake.carbohydrate}}/{{suggestion.carbohydrate}}</text>
<view class="item border-bottom">
<text class="name">已摄入</text>
<text class="bold">
{{foodInfo.today_intake.kcal}}千卡
</text>
</view>
</view>
<view class="item">
<text class="name">蛋白质()</text>
<view class="bold">
<view class="val" :style="{ width: (proteinpercent>100?100:proteinpercent) + '%'}">
</view>
<text>{{today_intake.protein}}/{{suggestion.protein}}</text>
<view class="item">
<text class="name">碳水</text>
<text class="bold">
{{foodInfo.today_intake.carbohydrate}}/{{foodInfo.suggestion.carbohydrate}}
</text>
</view>
</view>
<view class="item">
<text class="name">脂肪()</text>
<view class="bold">
<view class="val" :style="{ width: (fatpercent>100?100:fatpercent) + '%'}"></view>
<text>{{today_intake.fat}}/{{suggestion.fat}}</text>
<view class="item">
<text class="name">脂肪</text>
<text class="bold">
{{foodInfo.today_intake.fat}}/{{foodInfo.suggestion.fat}}
</text>
</view>
<view class="item">
<text class="name">蛋白</text>
<text class="bold">
{{foodInfo.today_intake.protein}}/{{foodInfo.suggestion.protein}}
</text>
</view>
</view>
</view>
</view>
<!-- -->
<view class="tabbar">
<view class="tools">
<view class="type" @click="handleAddFood(0,'早餐')">
<icon class="t-icon t-icon-yingyangzaocan"></icon>
<image src="/static/zao.png"></image>
<view class="text">
<icon class="iconfont icon-add"></icon>早餐
</view>
</view>
<view class="type" @click="handleAddFood(1,'午餐')">
<icon class="t-icon t-icon-jiucan"></icon>
<image src="/static/wu.png"></image>
<view class="text">
<icon class="iconfont icon-add"></icon>午餐
</view>
</view>
<view class="type" @click="handleAddFood(2,'晚餐')">
<icon class="t-icon t-icon-wancan1"></icon>
<image src="/static/wan.png"></image>
<view class="text">
<icon class="iconfont icon-add"></icon>晚餐
</view>
</view>
<view class="type" @click="isShow = true">
<icon class="t-icon t-icon-jiacan"></icon>
<image src="/static/jia.png"></image>
<view class="text">
<icon class="iconfont icon-add"></icon>加餐
</view>
</view>
</view>
<!-- -->
<view class="list" v-if="list.length">
<view class="listbox" v-for="(ite,ind) in list" :key="ind">
<view class="left">
<view class="title">{{ite.name}}</view>
<view class="kcalval">
<text>{{ite.val}}</text>{{ite.unit}}
<view class="tabbar-box">
<view class="tabbar">
<view @click="index=0" :class="[index==0?'active':'']">饮食记录</view>
<view @click="index=1" :class="[index==1?'active':'']">历史记录</view>
</view>
<view class="list" v-if="foodInfo.list.length">
<view class="listbox" v-for="(ite,ind) in foodInfo.list" :key="ind">
<view class="left">
<view class="title">{{ite.name}}</view>
<view class="kcalval">
<text>{{ite.val}}</text>{{ite.unit}}
</view>
</view>
<view class="right">
<uni-swipe-action>
<uni-swipe-action-item v-for="(it,id) in ite.list" :key="id"
:right-options="actionOptions" @click="delAcitionItem(it)">
<view class="item" @click="showFoodDetail(it)">
<image :src="it.pic_url" mode="aspectFill"></image>
<text>{{it.name}}</text>
<text>{{it.weight}}</text>
<text>{{it.val}}千卡</text>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
<view class="right">
<uni-swipe-action>
<uni-swipe-action-item v-for="(it,id) in ite.list" :key="id"
:right-options="actionOptions" @click="delAcitionItem(it)">
<view class="item" @click="showFoodDetail(it)">
<image :src="it.pic_url" mode="aspectFill"></image>
<text>{{it.name}}</text>
<text>{{it.weight}}</text>
<text>{{it.val}}千卡</text>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
<view v-else class="nolist list">
<icon class="iconfont icon-zanwushuju"></icon>
<text>还没有记录点击上方按钮添加</text>
<view v-else class="nolist list">
<image src="/static/none.png"></image>
<text>暂无打卡记录</text>
<text>点击上方按钮打卡吧</text>
</view>
</view>
</view>
<view v-else class="list2" @click="handleEditUser()">
<view class="nolist">
<icon class="iconfont icon-zanwushuju"></icon>
<image src="/static/none.png"></image>
<text>完善资料后记录更准确哦</text>
</view>
<view class="btn">完善资料</view>
@ -192,25 +189,12 @@
mapState
} from "vuex";
let next = 0
import RenCalendar from '@/uni_modules/ren-calendar/ren-calendar.vue';
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
export default {
data() {
return {
token: "",
remaining_kcal: 0, //
suggestion: { //
fat: "",
kcal: "",
protein: "",
carbohydrate: "",
},
today_intake: { //
fat: "",
kcal: "",
protein: "",
carbohydrate: "",
},
index: 0,
opts: {
dataLabel: false,
color: ["#5180D8", "#ED7886", "#FFB169"],
@ -242,17 +226,7 @@
}
}
},
fatpercent: 0,
carbohydratepercent: 0,
proteinpercent: 0,
list: [],
isShow: false,
chartData: {
series: [{
data: 1,
color: "#ff4c4f"
}]
},
chartData2: {},
addfoodList: [{
name: "早加餐",
@ -271,10 +245,7 @@
success: [],
error: [],
},
handTrue: true,
startDay: "",
startM: "",
endM: "",
activeFoodDetail: {},
actionOptions: [{
text: '删除',
@ -286,70 +257,39 @@
}
},
components: {
RenCalendar,
qiunDataCharts
},
computed: {
...mapState(["user"]),
...mapState(["user", "countFoodInfo"]),
userinfo() {
return this.user.weight
return this.user.aud_id
},
foodInfo() {
return this.countFoodInfo
}
},
onLoad(options) {
let that = this
that.startM = that.$tools.getMonth(that.$tools.getTime(), 0).substring(0, 10)
that.endM = that.$tools.getMonth(that.$tools.getTime(), 0).substring(11, 21)
that.handleList()
},
onShow() {
onLoad() {
let that = this
that.token = uni.getStorageSync('token')
//
if (uni.getStorageSync("startDay")) {
that.startDay = uni.getStorageSync("startDay");
uni.removeStorageSync('startDay');
let star1 = that.$tools.getMonth(that.$tools.getTime(), 0).substring(0, 10)
let star2 = that.$tools.getMonth(that.startDay, 0).substring(0, 10)
if (star2 != star1) {
that.startM = that.$tools.getMonth(that.startDay, 0).substring(0, 10)
that.endM = that.$tools.getMonth(that.startDay, 0).substring(11, 21)
that.handleList()
}
} else {
that.startDay = this.$tools.getDate("start")
}
that.handleCountFoodInfo()
that.$store.dispatch("getCountFoodInfo", {
aud_id: that.user.aud_id,
time: that.$tools.getDate("start")
})
},
methods: {
//
handleCountFoodInfo() {
let that = this
that.$model.getCountFoodInfo({
aud_id: that.user.aud_id,
time: that.startDay
}).then(res => {
if (res.code != 0) return
that.list = res.data.list
that.remaining_kcal = res.data.remaining_kcal
that.suggestion = res.data.suggestion
that.today_intake = res.data.today_intake
that.fatpercent = Number(res.data.today_intake.fat) / Number(res.data.suggestion.fat) * 100
that.carbohydratepercent = Number(res.data.today_intake.carbohydrate) / Number(res.data
.suggestion.carbohydrate) * 100
that.proteinpercent = Number(res.data.today_intake.protein) / Number(res.data.suggestion
.protein) * 100
that.chartData.series[0].data = Number(res.data.today_intake.kcal) == 0 ? 1 :
(Number(res.data.today_intake.kcal) > Number(res.data.suggestion.kcal) ? Number(res.data
.suggestion.kcal) : Number(res.data.today_intake.kcal)) / Number(res.data.suggestion
.kcal)
})
},
//
showFoodDetail(item) {
console.log("item", item)
let chart_data = []
this.activeFoodDetail = item
this.$refs.showRight.open();
let chart_data = []
this.opts.color = []
for (let i = 1; i < item.nutrients_four.length; ++i) {
this.opts.color.push(item.nutrients_four[i].color)
@ -358,69 +298,19 @@
value: Number(item.nutrients_four[i].proportion),
})
}
this.chartData2 = JSON.parse(JSON.stringify({
series: [{
data: chart_data
}]
}));
},
//
handleList() {
let that = this
that.$model.getMyLogList({
aud_id: that.user.aud_id,
s_time: that.startM,
e_time: that.endM
}).then(res => {
console.log("11111111", res)
if (res) {
for (var i = 0; i < res.pkList.list.length; i++) {
if (Date.parse(that.endDate) == Date.parse(res.pkList.list[i].time)) {
that.infoList.push(res.pkList.list[i]);
}
if (res.pkList.list[i].describe == "超标") {
that.markDays.error.push(res.pkList.list[i].time);
}
if (res.pkList.list[i].describe == "达标") {
that.markDays.success.push(res.pkList.list[i].time);
}
if (res.pkList.list[i].describe == "不达标") {
that.markDays.warning.push(res.pkList.list[i].time);
}
}
}
})
},
//
getAddFood(list) {
let that = this
that.list.push(list)
console.log("list", that.list, that.list.sort())
},
//
maskClick(data) {
let that = this
that.list = []
that.startDay = data.date
that.handleCountFoodInfo()
console.log('maskClick事件:', data);
},
//
onMonthClickPre(data) {
let that = this
that.markDays = {
warning: [],
success: [],
error: [],
}
that.startM = data.substring(0, 10)
that.endM = data.substring(11, 21)
that.handleList()
},
onMonthClickNext(data) {
console.log("下月", data)
},
//
handleSet() {
uni.navigateTo({
@ -437,7 +327,7 @@
handleAddFood(ind, name) {
this.isShow = false
uni.navigateTo({
url: "/pageTwo/count/food?name=" + name + '&ind=' + ind
url: "/pageTwo/count/search?name=" + name + '&ind=' + ind
})
},
//
@ -467,7 +357,8 @@
<style scoped lang="scss">
.content {
padding: 0 15px;
padding: 0 10px;
background-color: #fff;
}
.content_box {
@ -478,158 +369,97 @@
width: 100%;
}
.calendar {
text-align: center;
background: #fff;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 20;
height: 40px;
line-height: 40px;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.set {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10px;
font-size: 16px;
font-weight: bold;
.icon {
background: #d1f2ed;
border-radius: 50%;
font-size: 28px;
color: #66cccc;
text-align: center;
padding: 5px;
}
}
.kcal {
width: calc(100% - 20px);
margin-bottom: 15px;
background: #fff;
border-radius: 5px;
border-radius: 10px;
padding: 10px;
position: relative;
margin-top: 60px;
margin-top: 15px;
background: #f3fffd;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.set {
position: absolute;
right: 15px;
width: 50px;
height: 50px;
display: flex;
align-items: flex-start;
justify-content: flex-end;
font-weight: bold;
z-index: 18;
icon {
font-size: 22px;
}
}
.top {
margin-left: 5px;
.left {
width: 300rpx;
height: 300rpx;
position: relative;
border-radius: 50%;
background: #d1f2ed;
border: 5px solid #66cccc;
display: flex;
justify-content: center;
align-items: center;
.left {
width: 300rpx;
height: 300rpx;
position: relative;
.center {
position: absolute;
top: 0;
text-align: center;
width: 300rpx;
height: 300rpx;
display: flex;
flex-wrap: wrap;
flex-direction: column;
align-items: center;
justify-content: center;
text {
display: inline-block;
font-size: 22px;
font-weight: bold;
}
.unit {
position: absolute;
font-size: 22px;
font-weight: bold;
bottom: 20rpx;
text-align: center;
}
}
}
.right {
.center {
position: absolute;
left: 65%;
height: 300rpx;
top: 0;
text-align: center;
width: 260rpx;
height: 260rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
flex-direction: column;
align-items: center;
justify-content: center;
background: #fff;
border-radius: 50%;
.num {
font-size: 24px;
font-weight: bold;
width: 100%;
text {
display: inline-block;
margin-top: 5px;
}
.unit {
position: absolute;
font-size: 22px;
font-weight: bold;
bottom: 20rpx;
text-align: center;
margin: 10px 0;
}
}
}
.weight {
width: 100%;
.right {
position: absolute;
left: 50%;
bottom: 0;
top: 0px;
right: 0;
display: flex;
margin-top: 25px;
margin-bottom: 5px;
justify-content: space-between;
flex-wrap: wrap;
padding: 0 10px;
border-radius: 0 10px 10px 0;
justify-content: center;
flex-direction: column;
background: #d1f2ed;
.item {
display: flex;
flex-direction: column;
align-items: center;
width: 30%;
justify-content: space-between;
height: 35px;
line-height: 35px;
}
.name {
white-space: nowrap;
}
.bold {
width: 100%;
background: #eaeaea;
border-radius: 6px;
margin-top: 5px;
text-align: right;
font-weight: 500;
font-size: 12px;
height: 15px;
line-height: 15px;
position: relative;
text {
position: absolute;
z-index: 6;
right: 8px;
}
}
.val {
position: absolute;
left: 0;
background: #f9ce27;
height: 15px;
border-radius: 10px;
z-index: 2;
}
.border-bottom {
border-bottom: 1px solid #dfdfdf;
}
}
}
.tabbar {
.tools {
width: 100%;
background: #fff;
border-radius: 10px;
@ -637,6 +467,7 @@
display: flex;
margin-bottom: 15px;
justify-content: space-between;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.type {
width: 20%;
@ -645,18 +476,17 @@
align-items: center;
justify-content: center;
.t-icon {
width: 35px;
height: 35px;
font-size: 28px;
image {
width: 45px;
height: 45px;
}
.text {
width: 100%;
text-align: center;
margin-top: 5px;
display: flex;
justify-content: center;
font-weight: bold;
icon {
font-size: 14px;
@ -665,6 +495,31 @@
}
}
.tabbar-box {
background: #f3fffd;
border-radius: 10px;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.tabbar {
height: 45px;
width: 100%;
display: flex;
justify-content: space-between;
view {
width: 50%;
line-height: 45px;
text-align: center;
}
.active {
border-radius: 10px;
color: $maincolor;
background: #fff;
}
}
}
.list {
width: 100%;
padding-bottom: 50px;
@ -742,8 +597,9 @@
text-align: center;
width: auto;
icon {
font-size: 50px;
image {
width: 50px;
height: 50px;
color: #999;
display: flex;
justify-content: center;
@ -751,6 +607,7 @@
}
}
.list2 {
margin-top: 45%;

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,50 @@
<template>
<view class="content">
<view class="head" v-if="token" @tap="navTo('/pageTwo/setting/setting')">
<view class="left">
<!-- <icon class="t-icon t-icon-nvtouxiang"></icon> -->
<image :src="info.head_pic"></image>
<text>{{info.nickname}}</text>
<view v-if="token" style="width: 100%;">
<view class="head" v-if="info.aud_id" @tap="navTo('/pageTwo/setting/setting')">
<view class="left">
<image :src="info.head_pic"></image>
<text>{{info.nickname}}</text>
</view>
<view class="right">
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
</view>
<view class="right">
<uni-icons type="forward" size="20" color="#666"></uni-icons>
<view class="head " v-else @click="handleUserEdit">
<text class="size22">完善资料后记录更准确哦</text>
</view>
</view>
<view class="list">
<view class="item" @tap="navTo('/pageTwo/me/userEdit')">
<view>
<image src="/static/11.png" mode=""></image>个人资料
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="item" @tap="navTo('/pageTwo/me/mymenu?pageName=我的菜谱')">
<text>我的菜谱</text>
<view>
<image src="/static/12.png" mode=""></image>我的菜谱
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="item" @tap="navTo('/pageTwo/me/mymenu?pageName=我的收藏')">
<text>我的收藏</text>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="item" @tap="navTo('/pageTwo/me/userEdit')">
<text>个人资料</text>
<view>
<image src="/static/27.png" mode=""></image>我的收藏
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="item" @tap="navTo('/pageTwo/me/record')">
<text>饮食记录</text>
<view>
<image src="/static/13.png" mode=""></image>饮食记录
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<view class="item" @click="navTo('/pageTwo/webview/webview?url=' + configInfo.business_cooperation)">
<view>
<image src="/static/14.png" mode=""></image>商务合作
</view>
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view>
<!-- <view class="item" @tap="navTo('/pageTwo/me/feedBack')">
@ -32,9 +52,8 @@
<uni-icons type="forward" size="20" color="#666"></uni-icons>
</view> -->
</view>
<view class="btn" v-if="!token" @click="handleLogin">登录后查看更多</view>
<view class="btn " v-if="token" @click="handleOutLogin">退出登录</view>
<view class=" btn" v-if="!token" @click="handleLogin">登录后查看更多</view>
</view>
</template>
@ -49,7 +68,7 @@
}
},
computed: {
...mapState(["user"]),
...mapState(["user",'configInfo']),
info() {
return this.user
},
@ -82,9 +101,15 @@
},
})
},
handleLogin(){
handleLogin() {
uni.reLaunch({
url:"/pageTwo/login/login"
url: "/pageTwo/login/login"
})
},
//
handleUserEdit() {
uni.navigateTo({
url: '/pageTwo/me/userEdit'
})
},
navTo(url) {
@ -102,19 +127,27 @@
<style scoped lang="scss">
.content {
padding: 0 15px;
min-height: 100vh;
min-height: calc(100vh - 20px);
background-color: #fff;
padding-top: 20px;
}
.size22 {
width: 100%;
text-align: center;
color: #fff;
}
.head {
width: 100%;
height: 5rem;
background: #fff;
background: $maincolor;
display: flex;
align-items: center;
border-radius: 10px;
font-size: 16px;
font-weight: bold;
padding-bottom: 20px;
margin-top: -20px;
.left {
width: calc(100% - 30px);
@ -144,17 +177,51 @@
margin: 15px;
border-radius: 10px;
line-height: 50px;
margin-top: -20px;
.item {
display: flex;
justify-content: space-between;
margin: 0 15px;
border-bottom: 1px solid #f7f7f7;
border-radius: 20px;
background: #FEF9F4;
margin-top: 15px;
padding: 0 10px;
view {
width: 80%;
display: flex;
align-items: center;
}
image {
width: 25px;
height: 25px;
margin-right: 10px;
}
}
:nth-child(2).item {
background-color: #F2FDEE;
}
:nth-child(3).item {
background-color: #FFEEFF;
}
:nth-child(4).item {
background-color: #DBF2F9;
}
:nth-child(5).item {
background-color: #FFEEFF;
}
}
.btn {
width: 100%;
width: calc(100% - 60rpx);
margin-left: 30rpx;
color: #fff;
margin-bottom: 20px;
}
</style>

View File

@ -16,12 +16,12 @@
<view class="right">
<scroll-view class="right_list" scroll-y="true" @scrolltolower="onPullDown">
<div class="right_inner_list">
<view class="list" v-for="(ite,ind) in menulist" :key="ind" @click="handleDetail(ite.id)"
v-if="menulist.length">
<image :src="ite.cover" mode="aspectFill"></image>
<text class="overflow">{{ite.title}}</text>
</view>
</div>
<view class="list" v-for="(ite,ind) in menulist" :key="ind" @click="handleDetail(ite.id)"
v-if="menulist.length">
<image :src="ite.cover" mode="aspectFill"></image>
<text class="overflow">{{ite.title}}</text>
</view>
</div>
</scroll-view>
<view v-if="!menulist.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
@ -43,9 +43,12 @@
search
},
computed: {
...mapState(["menuList","menu_search_value"]),
...mapState(["menuList", "menu_search_value"]),
menu() {
return [...this.menuList,{id:999,name:'搜索'}]
return [...this.menuList, {
id: 999,
name: '搜索'
}]
},
},
data() {
@ -54,7 +57,7 @@
text: "",
index: 0,
lastPage: "",
loading: false,
loading: false,
menulist: []
};
},
@ -63,42 +66,42 @@
that.page = 1
that.handleCookListLabel()
},
onShow() {
let that = this
if(that.$store.state.menu_search_value != '') {
that.handleSearch(that.$store.state.menu_search_value)
that.$store.state.menu_search_value = ""
}
},
onShow() {
let that = this
if (that.$store.state.menu_search_value != '') {
that.handleSearch(that.$store.state.menu_search_value)
that.$store.state.menu_search_value = ""
}
},
methods: {
onPullDown() {
let that = this
if(that.loading) {
return
}
if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
icon: 'none'
})
return
}
this.page++
this.handleCookListLabel()
},
onPullDown() {
let that = this
if (that.loading) {
return
}
if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
icon: 'none'
})
return
}
this.page++
this.handleCookListLabel()
},
//
handleCookListLabel() {
let that = this
that.loading = true
that.loading = true
that.$model.getCookListLabel({
cook_label: that.menu[that.index].id,
page: that.page,
}).then(res => {
that.loading = false
that.loading = false
if (res.code != 0) return
that.menulist = that.menulist.concat(res.data.content_list)
that.lastPage = res.data.page_total
that.page = res.data.page_now
that.lastPage = res.data.page_total
that.page = res.data.page_now
})
},
//
@ -129,13 +132,13 @@
that.index = 0
that.handleCookListLabel()
} else {
uni.showLoading({
title: '搜索中...'
})
uni.showLoading({
title: '搜索中...'
})
that.$model.getMenuSearch({
food_name: ite
}).then(res => {
uni.hideLoading()
uni.hideLoading()
if (res.code != 0) return
that.index = that.menu.length - 1
that.menulist = res.data.content_list
@ -147,10 +150,11 @@
</script>
<style lang="scss" scoped>
.right_list {
padding: 0 !important;
height: 100%;
}
.right_list {
padding: 0 !important;
height: 100%;
}
.right_inner_list {
display: flex;
flex-wrap: wrap;

120
pages/search/list.vue Normal file
View File

@ -0,0 +1,120 @@
<template>
<view class="content">
<search :name="search_value"></search>
<view class="footbox footlist">
<view class="list" v-for="(it,ind) in food_search_list" :key="ind" @click="handleDetail(it.id)">
<view class="topimg">
<image :src="it.cover" class="img" mode="aspectFill"></image>
</view>
<view class="item">
<view class="title">{{it.title}}</view>
<view class="name">
<image :src="it.create_user_head_pic"></image>
<text class="overflow">{{it.create_user_nickname}}</text>
</view>
<view class="zan">
<icon class="iconfont" :class="[it.is_me_like_it=='yes'?'icon-icon3':'icon-icon_collect']">
</icon>
<text>{{it.likes_num}}</text>
</view>
</view>
</view>
</view>
<view class="endtext" v-if="!lastPage || Page >= lastPage"> 到底了看看别的吧 </view>
<view v-if="!food_search_list.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
<text>还没有记录哦</text>
</view>
</view>
</template>
<script>
import search from '@/components/search2.vue';
export default {
name: "list",
data() {
return {
Page: 1,
lastPage: 1,
search_value: "",
food_search_list: [],
};
},
props: {
title: {
type: String,
default: ''
},
},
components: {
search
},
onLoad(options) {
let that = this
that.search_value = options.name
that.handleSearchColumn()
},
onReachBottom() {
let that = this
console.log("onReachBottom", this.lastPage)
if (!this.lastPage || this.Page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
icon: 'none'
})
return
}
this.Page++
this.handleSearchColumn()
},
methods: {
handleSearchColumn() {
let that = this
that.$model.getMenuSearchColumn({
page: that.Page,
search_data: that.search_value
}).then(res => {
if (res.code != 0) return
that.food_search_list = that.food_search_list.concat(res.data.content_list)
that.lastPage = res.data.page_total
})
},
//
handleDetail(id) {
uni.navigateTo({
url: "/pageTwo/me/menudetail?id=" + id
})
},
}
}
</script>
<style scoped lang="scss">
.content {
background: #fff;
min-height: calc(100vh - 20px);
}
.footlist {
position: relative;
margin-top: 68px;
padding: 15px;
width: calc(100% - 30px);
background: #fff;
border-radius: 15px 15px 0 0;
}
.list {
border: 1px solid #f7f7f7;
.item {
background: #f7f7f7;
border-top: 1px solid #f7f7f7;
}
}
.topimg {
width: 100%;
}
</style>

View File

@ -0,0 +1,334 @@
<template>
<view class="content" :class="{'noscroll':show_food_search}">
<input type="text" class="search" v-model="search_value" :placeholder="placeholder" @focus="placeholder='输入自定义食材'"
@blur="placeholder='点击添加自定义食材'" />
<view class="picked-container">
<view class="empty" v-if="picked_food.length <= 0">
<view>看起来你还没添加任何食材!</view>
<view>你可以通过上方的<span style="color: red;">输入框</span>自定义输入食材或者通过下方的<span style="color: red;">流行食材</span>点击添加</view>
</view>
<view v-else>
<view class="top">
<view class="title">已选食材</view>
<view @click="picked_food=[]">清空</view>
</view>
<view class="picked-food">
<view class="picked-food-item" v-for="(item,index) in picked_food" :key="index">
<view class="inner">{{item.name}}</view>
<view class="close" @click="removePicked(item.id)">x</view>
</view>
</view>
<view class="tips">* 点击移除食材</view>
<view class="food-match" @click="onSearchFood">匹配菜谱</view>
</view>
</view>
<view class="popular-container">
<view class="title">{{popular_food.title}}</view>
<view class="popular-food-item" v-for="(item,index) in popular_food.list" :key="index">
<view class="food-title">{{item.title}}</view>
<view class="popular-food-inner">
<view class="popular-food-subitem" v-for="(sub_item,sub_index) in item.list"
@click="addIngredients(sub_item,item.list)" :key="sub_index">{{sub_item.name}}
</view>
</view>
</view>
</view>
<view class="food-search-wrap" v-if="show_food_search">
<view class="food-search-item" v-for="(item,index) in food_search_list" :key="index">
<view>{{item.name}}</view>
<view @click="addIngredients(item)">+</view>
</view>
</view>
</view>
</template>
<script>
var timerHandle = null
import {
mapState
} from "vuex";
export default {
data() {
return {
placeholder: '点击添加自定义食材',
search_value: '',
show_food_search: false,
food_search_list: [],
picked_food: [],
popular_food: {}
};
},
computed: {
...mapState(["menu_search_value"]),
},
watch: {
search_value(new_val, old, val) {
clearTimeout(timerHandle)
if (new_val != '') {
timerHandle = setTimeout(() => {
this.$model.getFoodSearch({
food_name: new_val
}).then(res => {
if (res.code != 0) return
this.food_search_list = res.data
this.show_food_search = true
})
}, 500)
} else {
this.show_food_search = false
}
}
},
onLoad() {
this.$model.getSearchPopularFood({}).then(res => {
if (res.code != 0) return
this.popular_food = res.data.food
})
},
methods: {
preventTouchMove() {},
removePicked(id) {
let index = this.picked_food.findIndex(item => item.id == id)
if (index != -1) {
if (this.picked_food[index].parent) {
this.picked_food[index].parent.push(this.picked_food[index])
this.picked_food[index].parent = null
}
this.picked_food.splice(index, 1)
}
},
//
addIngredients(food,parent) {
this.picked_food.push(food)
this.show_food_search = false
if(parent) {
food.parent = parent
let index = parent.findIndex(item => item.id == food.id)
if (index != -1) {
parent.splice(index, 1)
}
}
},
//
onSearchFood() {
let that = this
if (that.picked_food.length <= 0) return
let search = that.picked_food.map(item => item.id)
that.$store.state.menu_search_value = search.join(',')
uni.switchTab({
url: '/pages/menu/menu'
})
// that.$model.getMenuSearch({
// search_data:
// }).then(res => {
// if (res.code != 0) return
// that.index = null
// that.footlist = res.data
// })
}
}
}
</script>
<style lang="scss" scoped>
.content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 25rpx;
overflow-y: auto;
box-sizing: border-box;
background: #fff;
-webkit-overflow-scrolling: touch;
.search {
width: 94%;
padding: 20rpx;
border: 1rpx solid #e1e1e1;
border-radius: 18rpx;
background-color: #fff;
}
.search:hover {
box-shadow: 0 1rpx 20rpx #ccc;
}
.title {
font-size: 40rpx;
color: #000;
}
.picked-container {
margin-top: 80rpx;
width: 100%;
.empty {
display: flex;
flex-direction: column;
align-items: center;
padding: 0 40rpx;
box-sizing: border-box;
view:first-child {
font-size: 32rpx;
font-weight: 700;
color: #909090;
}
view:last-child {
margin-top: 30rpx;
font-size: 26rpx;
color: #909090;
}
}
.top {
display: flex;
justify-content: space-between;
align-items: center;
view:last-child {
color: #999;
font-size: 32rpx;
}
}
.picked-food {
display: flex;
flex-wrap: wrap;
margin-top: 30rpx;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
background-color: #F6F6F6;
.picked-food-item {
display: flex;
align-items: center;
padding: 15rpx 20rpx;
background-color: #fff;
margin-right: 20rpx;
border-radius: 20rpx;
.close {
margin-left: 10rpx;
font-size: 30rpx;
font-weight: 700;
}
}
}
.tips {
margin-top: 30rpx;
font-size: 30rpx;
color: #999;
}
.food-match {
width: 100%;
height: 86rpx;
margin-top: 30rpx;
line-height: 86rpx;
text-align: center;
font-size: 36rpx;
font-weight: 700;
color: #F96679;
border-radius: 25rpx;
background-color: #FEF0EE;
}
}
.popular-container {
width: 100%;
margin-top: 60rpx;
.popular-food-item {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 30rpx;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
background-color: #F6F6F6;
.food-title {
font-size: 34rpx;
font-weight: 700;
}
.popular-food-inner {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
margin-top: 30rpx;
.popular-food-subitem {
display: flex;
align-items: center;
margin-bottom: 20rpx;
padding: 15rpx 20rpx;
background-color: #fff;
margin-right: 20rpx;
border-radius: 20rpx;
}
}
}
}
.food-search-wrap {
position: fixed;
left: 0;
top: 130rpx;
bottom: 0;
width: 100%;
padding: 0 30rpx 50rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
background-color: #fff;
.food-search-inner {
position: absolute;
left: 0;
top: 120rpx;
bottom: 0;
padding: 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.food-search-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
margin-bottom: 15rpx;
border-radius: 16rpx;
box-sizing: border-box;
background-color: #F6F6F6;
view:first-child {
font-size: 32rpx;
font-weight: 700;
color: #000;
}
view:last-child {
font-size: 38rpx;
font-weight: 700;
}
}
}
}
.noscroll {
overflow: hidden;
}
</style>

View File

@ -1,334 +1,399 @@
<template>
<view class="content" :class="{'noscroll':show_food_search}">
<input type="text" class="search" v-model="search_value" :placeholder="placeholder" @focus="placeholder='输入自定义食材'"
@blur="placeholder='点击添加自定义食材'" />
<view class="picked-container">
<view class="empty" v-if="picked_food.length <= 0">
<view>看起来你还没添加任何食材!</view>
<view>你可以通过上方的<span style="color: red;">输入框</span>自定义输入食材或者通过下方的<span style="color: red;">流行食材</span>点击添加</view>
</view>
<view v-else>
<view class="top">
<view class="title">已选食材</view>
<view @click="picked_food=[]">清空</view>
</view>
<view class="picked-food">
<view class="picked-food-item" v-for="(item,index) in picked_food" :key="index">
<view class="inner">{{item.name}}</view>
<view class="close" @click="removePicked(item.id)">x</view>
</view>
</view>
<view class="tips">* 点击移除食材</view>
<view class="food-match" @click="onSearchFood">匹配菜谱</view>
</view>
</view>
<view class="popular-container">
<view class="title">{{popular_food.title}}</view>
<view class="popular-food-item" v-for="(item,index) in popular_food.list" :key="index">
<view class="food-title">{{item.title}}</view>
<view class="popular-food-inner">
<view class="popular-food-subitem" v-for="(sub_item,sub_index) in item.list"
@click="addIngredients(sub_item,item.list)" :key="sub_index">{{sub_item.name}}
</view>
</view>
</view>
</view>
<view class="food-search-wrap" v-if="show_food_search">
<view class="food-search-item" v-for="(item,index) in food_search_list" :key="index">
<view>{{item.name}}</view>
<view @click="addIngredients(item)">+</view>
</view>
</view>
</view>
<view class="content">
<view class="search">
<input type="text" v-model="search_value" placeholder="输入关键字匹配食谱" />
<image src="/static/28.png" @click="handleSearchHistory(search_value)"></image>
</view>
<view class="content-box">
<!-- 历史搜索 -->
<view v-if="history_food.length" class="search-history">
<view class="title">
<view class="quan"></view>历史搜索
</view>
<view class="button-container" @click="showAll =! showAll" v-if="history_food.length>8">
<image :src="showAll?'/static/arrow-up.png':'/static/arrow-down.png'"></image>
</view>
<view class="history-list">
<view class="history-list-item"
v-for="(item,index) in showAll?history_food:history_food.slice(0, 8)"
@click="handleSearchHistory(item.keyword)">
{{item.keyword}}
</view>
</view>
</view>
<!-- 猜你想搜 -->
<view class="popular-container">
<view class="title">
<view class="quan"></view>猜你想搜
</view>
<view class="popular-food-item" v-for="(ite,index) in popular_food" :key="index">
<view class="food-title">{{ite.title}}</view>
<view class="popular-food-inner">
<text class="popular-food-subitem" v-for="(sub_item,sub_index) in ite.list"
@click="handleSearchHistory(sub_item.name)" :key="sub_index">{{sub_item.name}}
</text>
</view>
</view>
</view>
</view>
<!-- 语音描述 -->
<view class="auto-search-dialog" v-if="showAutoSearchDlg">
<view class="auto-search-inner">
<text>{{autoSearchContent != '' ? `识别到你描述的菜谱为“${autoSearchContent}”,是否查找菜谱“${autoSearchContent}` : "长安麦克风图标开始说话,松开后结束"}}</text>
<view class="mic-icon" :style="{'border-color':mic_touch ? '#18bc37' : '#777777'}"
@touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd" v-if="autoSearchContent == ''">
<uni-icons type="mic-filled" size="80" :color="mic_touch ? '#18bc37' : '#777777'"></uni-icons>
</view>
<view class="btn-wrap" v-else>
<view class="retry" @click="retrySearch">重试</view>
<view class="confirm" @click="handleSearchHistory(autoSearchContent)">确定</view>
</view>
<uni-icons class="close" type="close" color="#ffffff" size="45"
@click="showAutoSearchDlg=false"></uni-icons>
</view>
</view>
<!-- 语音 -->
<view class="footBtn">
<view @click="showAutoSearchDlg = true">
<uni-icons type="mic-filled" size="22" color="#fff"></uni-icons>
</view>
</view>
</view>
</template>
<script>
var timerHandle = null
import {
mapState
} from "vuex";
export default {
data() {
return {
placeholder: '点击添加自定义食材',
search_value: '',
show_food_search: false,
food_search_list: [],
picked_food: [],
popular_food: {}
};
},
computed: {
...mapState(["menu_search_value"]),
},
watch: {
search_value(new_val, old, val) {
clearTimeout(timerHandle)
if (new_val != '') {
timerHandle = setTimeout(() => {
this.$model.getFoodSearch({
food_name: new_val
}).then(res => {
if (res.code != 0) return
this.food_search_list = res.data
this.show_food_search = true
})
}, 500)
} else {
this.show_food_search = false
}
}
},
onLoad() {
this.$model.getSearchPopularFood({}).then(res => {
if (res.code != 0) return
this.popular_food = res.data.food
})
},
methods: {
preventTouchMove() {},
removePicked(id) {
let index = this.picked_food.findIndex(item => item.id == id)
if (index != -1) {
if (this.picked_food[index].parent) {
this.picked_food[index].parent.push(this.picked_food[index])
this.picked_food[index].parent = null
}
this.picked_food.splice(index, 1)
}
},
//
addIngredients(food,parent) {
this.picked_food.push(food)
this.show_food_search = false
if(parent) {
food.parent = parent
let index = parent.findIndex(item => item.id == food.id)
if (index != -1) {
parent.splice(index, 1)
}
}
},
//
onSearchFood() {
let that = this
if (that.picked_food.length <= 0) return
let search = that.picked_food.map(item => item.id)
that.$store.state.menu_search_value = search.join(',')
uni.switchTab({
url: '/pages/menu/menu'
})
import {
mapState
} from "vuex";
const plugin = requirePlugin("WechatSI")
export default {
data() {
return {
index: 0,
Page: 1,
showAll: false,
search_value: '',
mic_touch: false,
voiceManager: null,
autoSearchContent: "",
showAutoSearchDlg: false
};
},
computed: {
...mapState(["configInfo"]),
popular_food() {
return this.configInfo.search_guess.cookbook
},
history_food() {
return this.configInfo.search_history.cookbook
}
},
onLoad() {
// that.$model.getMenuSearch({
// search_data:
// }).then(res => {
// if (res.code != 0) return
// that.index = null
// that.footlist = res.data
// })
}
}
}
},
mounted() {
let that = this
that.voiceManager = plugin.getRecordRecognitionManager()
that.voiceManager.onStop = function(res) {
that.autoSearchContent = res.result.replace('。', '')
}
that.voiceManager.onError = function(res) {
console.error("error msg", res.retcode)
}
that.voiceManager.stop()
},
methods: {
// /
toggleShowAll() {
this.showAll = !this.showAll
},
//
retrySearch() {
let that = this
that.autoSearchContent = ''
},
onVoiceTouchStart() {
let that = this
that.mic_touch = true
that.voiceManager.start({
duration: 60000,
lang: "zh_CN"
})
},
onVoiceTouchEnd() {
let that = this
that.mic_touch = false
that.voiceManager.stop()
},
//
handleSearchHistory(text) {
let that = this
that.showAutoSearchDlg = false
that.autoSearchContent = ''
uni.navigateTo({
url: "/pages/search/list?name=" + text
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding: 25rpx;
overflow-y: auto;
box-sizing: border-box;
background: #fff;
-webkit-overflow-scrolling: touch;
.content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
background: #fff;
-webkit-overflow-scrolling: touch;
.search {
width: 94%;
padding: 20rpx;
border: 1rpx solid #e1e1e1;
border-radius: 18rpx;
background-color: #fff;
}
.search {
width: 100%;
position: relative;
padding-bottom: 35px;
padding-top: 10px;
background-color: $maincolor;
.search:hover {
box-shadow: 0 1rpx 20rpx #ccc;
}
.title {
font-size: 40rpx;
color: #000;
}
input {
width: calc(100% - 40px);
background: #fff;
height: 39px;
line-height: 38px;
border-radius: 10px;
padding: 0 10px;
margin: 0 10px;
}
.picked-container {
margin-top: 80rpx;
width: 100%;
.input:hover {
box-shadow: 0 1rpx 20rpx #ccc;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
padding: 0 40rpx;
box-sizing: border-box;
image {
width: 25px;
height: 25px;
position: absolute;
right: 20px;
top: 18px;
z-index: 99;
}
}
view:first-child {
font-size: 32rpx;
font-weight: 700;
color: #909090;
}
.content-box {
background: #fff;
border-radius: 10px 10px 0 0;
position: relative;
z-index: 99;
width: 100%;
padding-top: -13px;
margin: -20px 0 70px;
}
view:last-child {
margin-top: 30rpx;
font-size: 26rpx;
color: #909090;
}
}
.search-history {
width: 100%;
height: auto;
overflow: hidden;
.top {
display: flex;
justify-content: space-between;
align-items: center;
uni-icons {
color: #333333;
font-size: 30px;
position: absolute;
top: 13px;
right: 15px;
}
}
view:last-child {
color: #999;
font-size: 32rpx;
}
}
.history-list {
width: calc(100% - 20px);
margin: 10px 10px 0;
height: auto;
display: flex;
flex-wrap: wrap;
.picked-food {
display: flex;
flex-wrap: wrap;
margin-top: 30rpx;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
background-color: #F6F6F6;
.history-list-item {
border: 1px solid #dfdfdf;
padding: 3px 12px;
border-radius: 10px;
margin-bottom: 10px;
margin-right: 10px;
}
}
.picked-food-item {
display: flex;
align-items: center;
padding: 15rpx 20rpx;
background-color: #fff;
margin-right: 20rpx;
border-radius: 20rpx;
.title {
width: 90%;
font-size: 30rpx;
font-weight: bold;
color: #000;
margin-top: 15px;
margin-left: 15px;
display: flex;
align-items: center;
}
.close {
margin-left: 10rpx;
font-size: 30rpx;
font-weight: 700;
}
}
}
.popular-container {
width: 100%;
.tips {
margin-top: 30rpx;
font-size: 30rpx;
color: #999;
}
.popular-food-item {
display: flex;
flex-direction: column;
align-items: center;
margin: 20rpx;
padding: 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
background: linear-gradient(#EDFFF4, #ffffff 80%);
.food-match {
width: 100%;
height: 86rpx;
margin-top: 30rpx;
line-height: 86rpx;
text-align: center;
font-size: 36rpx;
font-weight: 700;
color: #F96679;
border-radius: 25rpx;
background-color: #FEF0EE;
}
}
.food-title {
font-size: 34rpx;
font-weight: 700;
}
.popular-container {
width: 100%;
margin-top: 60rpx;
.popular-food-inner {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
margin-top: 20rpx;
.popular-food-item {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 30rpx;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
background-color: #F6F6F6;
.popular-food-subitem {
display: flex;
align-items: center;
margin-bottom: 20rpx;
padding: 10rpx 20rpx;
background-color: #fff;
margin-right: 20rpx;
border-radius: 20rpx;
border: 1px solid #f7f7f7;
}
}
}
}
.food-title {
font-size: 34rpx;
font-weight: 700;
}
.search_list {
display: flex;
padding: 10px;
flex-wrap: wrap;
margin-bottom: 90px;
margin-top: 15px;
justify-content: space-between;
.popular-food-inner {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
margin-top: 30rpx;
.search_list_item {
width: 30%;
margin-top: 15px;
text-align: center;
.popular-food-subitem {
display: flex;
align-items: center;
margin-bottom: 20rpx;
padding: 15rpx 20rpx;
background-color: #fff;
margin-right: 20rpx;
border-radius: 20rpx;
}
}
}
}
image {
width: 220rpx;
height: 220rpx;
}
}
}
.food-search-wrap {
position: fixed;
left: 0;
top: 130rpx;
bottom: 0;
width: 100%;
padding: 0 30rpx 50rpx 30rpx;
box-sizing: border-box;
overflow-y: auto;
background-color: #fff;
.auto-search-dialog {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
.food-search-inner {
position: absolute;
left: 0;
top: 120rpx;
bottom: 0;
padding: 30rpx;
box-sizing: border-box;
overflow-y: auto;
}
.auto-search-inner {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
position: relative;
width: 70%;
height: 350rpx;
padding: 80rpx 0;
background-color: #fff;
border-radius: 20rpx;
box-shadow: 0 0 20rpx #ccc;
.food-search-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
margin-bottom: 15rpx;
border-radius: 16rpx;
box-sizing: border-box;
background-color: #F6F6F6;
.close {
position: absolute;
left: 0;
right: 0;
bottom: -140rpx;
width: 90rpx;
margin: 0 auto;
}
}
view:first-child {
font-size: 32rpx;
font-weight: 700;
color: #000;
}
text {
font-size: 32rpx;
width: 80%;
}
view:last-child {
font-size: 38rpx;
font-weight: 700;
}
}
}
}
.mic-icon {
display: flex;
justify-content: center;
align-items: center;
width: 150rpx;
height: 150rpx;
border-radius: 50%;
border: 8rpx solid #777777;
}
.noscroll {
overflow: hidden;
}
.btn-wrap {
display: flex;
justify-content: space-around;
width: 90%;
.retry,
.confirm {
width: 190rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
border: 2rpx solid #777;
border-radius: 15rpx;
}
}
}
.footBtn {
position: fixed;
width: 100%;
bottom: 0;
padding-top: 15px;
background: #fff;
display: flex;
z-index: 999;
justify-content: space-around;
view {
color: #fff;
width: auto;
padding: 5px 20px;
background: $maincolor;
margin-bottom: 15px;
display: flex;
align-items: center;
border-radius: 10px;
}
}
}
.button-container {
position: absolute;
top: 10px;
right: 15px;
font-size: 20px;
image {
width: 25px;
height: 25px;
}
}
</style>

View File

@ -1,2 +1,2 @@
## 厨房秤小程序
已对接广播秤称重
已对接广播秤测量

BIN
static/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
static/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
static/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
static/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
static/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
static/14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
static/19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
static/20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
static/21.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/22.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
static/23.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
static/24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/25.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/26.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/27.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/28.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
static/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
static/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
static/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
static/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
static/arrow-down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/arrow-up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
static/jia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 542 KiB

BIN
static/tou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/wan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
static/wu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
static/zao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -3,117 +3,44 @@ import tools from '@/tools/tools.js'
import config from '@/config.js'
// Action 包含异步操作请求API方法、回调函数提交mutaions更改state数据状态使之可以异步
export default {
//sessionId
getsessionId({
commit
//配置接口
getHomeConfig({
commit,
dispatch
}) {
return uni.login({
success(res) {
if (res.code) {
if (res.errMsg = "login:ok") {
model.onlogin({
code: res.code
}).then(ress => {
uni.setStorageSync('sessionid', ress.data.sessionid)
return ress
})
}
}
}
return model.getHomeConfig({}).then(res => {
commit('changeConfig', res.data)
dispatch("getUserInfo")
return res.data
})
},
// 用户信息
getPetInfo({
commit
},
account) {
return model.getPetInfo(account).then(res => {
if (res.code != 0) false
uni.setStorageSync('petid', res.data.id);
commit('changePetInfo', res.data)
commit('changeInfoConf', res.data.conf)
getUserInfo({
commit,
dispatch
}) {
return model.getHomeUserInfo({}).then(res => {
if (res.code != 0) {
commit('changeUserInfo', {})
return
}
commit('changeUserInfo', res.data)
dispatch("getCountFoodInfo", {
aud_id: res.data.aud_id,
time: tools.getDate("start")
})
return res.data
});
},
// 获取历史记录
gethistoryList({
// 计食器信息
getCountFoodInfo({
commit
}, account) {
return model.getList(account).then((res) => {
if (res.data && res.data.items) {
commit('changehistoryList', res.data.items)
} else {
commit('changehistoryList', null)
}
return res
})
},
// 宠物列表
getPetList({
commit
}) {
return model.getPetList({
pagenum: 20,
pagesize: 1
}).then((res) => {
if (res.data) {
commit("changePetList", res.data)
} else {
commit("changePetList", null)
}
return res
})
},
//养护提醒
getAlertList({
commit
}, account) {
return model.getAlertList(account).then(res => {
if (res.data && res.data.rows) {
commit('changeAlertList', res.data.rows)
} else {
commit('changeAlertList', null)
}
return res
})
},
//通知提醒
getNoticelist({
commit
}) {
return model.getnoticelist({}).then(res => {
if (res.data) {
commit('changeNoticelist', res.data)
} else {
commit('changeNoticelist', null)
}
return res
})
},
// 配置详情
getConfig({
commit
}) {
return model.getConfig({
appid: config.appid
}).then((res) => {
return model.getCountFoodInfo(account).then(res => {
if (res.code == 0) {
commit("changeConfig", res.data)
commit('changeCountFoodInfo', res.data)
}
})
return res.data
});
},
// 枚举
getnumdata({
commit
}) {
return model.getnumdata({
appid: config.appid
}).then((res) => {
if (res.code == 0) {
commit("changenumdata", res.data)
}
})
},
}
}

View File

@ -6,22 +6,47 @@ export default new Vuex.Store({
// state: 存储基本数据
state: {
user: {
age: "",
age: "1",
aud_id: "",
email: "",
gender: "",
head_pic: "",
height: "",
height: 0,
is_use_set_kcal: "",
nickname: "",
set_kcal: "",
tel: "",
token: "",
weight: ""
weight: 0,
birthday: ""
},
// 配置
configInfo: {
banner_data: [],
search_guess: {
cookbook: [],
food_data: []
},
search_history: {
cookbook: [],
food: []
},
business_cooperation: {}
},
// 计食器
countFoodInfo: {
date: "",
home_food_count: {},
list: [],
remaining_kcal: "",
suggestion: {
kcal: "",
carbohydrate: "",
protein: "",
fat: ""
},
today_intake: {}
},
menu_search_value: '',
foodList: [],
menuList: [],
isConnected: false,
isBluetoothTyle: false,
},
@ -39,12 +64,12 @@ export default new Vuex.Store({
changeConnected(state, newData) {
state.isConnected = newData
},
// 菜谱
changeMenuList(state, newData) {
state.menuList = newData
changeConfig(state, newData) {
state.configInfo = newData
},
changeFoodList(state, newData) {
state.foodList = newData
// 计食器
changeCountFoodInfo(state, newData) {
state.countFoodInfo = newData
},
},
// 模块化vuex

View File

@ -1,7 +1,7 @@
import tools from '@/tools/tools.js'
import store from '../store'
import config from '@/config.js'
let baseUrl = "https://tc.pcxbc.com"
let baseUrl = "https://tc.pcxbc.com/"
const httpRequest = (url, method = "get", data) => {
let httpDefaultOpts = {
url: baseUrl + url,
@ -67,12 +67,12 @@ function uploadFile(url, filePath) {
return promise
};
const get = (url, data) => {
data.token = uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
data.token = uni.getStorageSync('token') || ''
return httpRequest(url, 'get', data)
}
const post = (url, data) => {
data.token = uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
data.token = uni.getStorageSync('token')|| ''
return httpRequest(url, 'post', data)
}
const upload = (url, filePath) => {

View File

@ -19,186 +19,191 @@ export default {
})
},
getRegisterPhone(param) { // 手机号快捷登录
return http.post("/kitchenscale/wechat_quick_login", param).then(res => {
return http.post("/kitchenscale2/wechat_quick_login", param).then(res => {
return res
})
},
getloginOut(param) { // 退出登录
return http.post("/user_quit_account", param).then(res => {
return http.post("/kitchenscale2/user_quit_account", param).then(res => {
return res
})
},
getResetPassword(param) { // 重置密码
return http.post("/reset_password", param).then(res => {
return http.post("/kitchenscale2/reset_password", param).then(res => {
return res
})
},
getAccountPassword(param) { // 修改密码
return http.post("/update_my_password", param).then(res => {
return http.post("/kitchenscale2/update_my_password", param).then(res => {
return res
})
},
getAccountMsg(param) { // 邮箱/手机号绑定
return http.post("/update_my_account_msg", param).then(res => {
return http.post("/kitchenscale2/update_my_account_msg", param).then(res => {
return res
})
},
// 首页
getHomeInfo(param) { // 默认数据
return http.post("/kitchenscale/get_homepage_information", param).then(res => {
return http.post("/kitchenscale2/get_homepage_information", param).then(res => {
return res
})
},
getHomeUserInfo(param) { // 用户信息
return http.post("/kitchenscale/get_user_msg", param).then(res => {
return http.post("/kitchenscale2/get_user_msg", param).then(res => {
return res
})
},
getHomeConfig(param) { // 配置
return http.post("/kitchenscale/get_default_config", param).then(res => {
return http.post("/kitchenscale2/get_default_config", param).then(res => {
return res
})
},
getHomeSearch(param) { // 首页搜索
return http.post("/kitchenscale/search_column", param).then(res => {
return http.post("/kitchenscale2/search_column", param).then(res => {
return res
})
},
getUserInfoEdit(param) { // 修改用户信息
return http.post("/kitchenscale/update_user_msg", param).then(res => {
return http.post("/kitchenscale2/update_user_msg", param).then(res => {
return res
})
},
getSearchPopularFood(param) { //获取搜索页面常用食材
return http.post("/kitchenscale/get_search_food_page_list", param).then(res => {
return http.post("/kitchenscale2/get_search_food_page_list", param).then(res => {
return res
})
},
getFoodSearch(param) { //搜索食材
return http.post("/kitchenscale/find_food", param).then(res => {
return http.post("/kitchenscale2/get_food_list", param).then(res => {
return res
})
},
getMenuSearch(param) { //搜索菜谱
return http.post("/kitchenscale/find_by_food", param).then(res => {
return http.post("/find_by_food", param).then(res => {
return res
})
},
getMenuSearchColumn(param) { //搜索菜谱2
return http.post("/kitchenscale2/search_column", param).then(res => {
return res
})
},
getPhotoSearch(param) { //图像识别
return http.post("/kitchenscale/baidu_identify_food", param).then(res => {
return http.post("/kitchenscale2/baidu_identify_food", param).then(res => {
return res
})
},
// 通用
getUploadImg(param) { // 上传素材
return http.upload("/kitchenscale/pic_upload_one_action", param).then(res => {
return http.upload("/kitchenscale2/pic_upload_one_action", param).then(res => {
return res
})
},
// 菜谱
getAddCookbook(param) { // 添加菜谱
return http.post("/kitchenscale/add_cookbook", param).then(res => {
return http.post("/kitchenscale2/add_cookbook", param).then(res => {
return res
})
},
getEditCookbook(param) { // 修改菜谱
return http.post("/kitchenscale/update_cookbook", param).then(res => {
return http.post("/kitchenscale2/update_cookbook", param).then(res => {
return res
})
},
getCookListLabel(param) { // 菜谱查询(根据菜谱标签拉取)
return http.post("/kitchenscale/find_by_cook_label", param).then(res => {
return http.post("/kitchenscale2/find_by_cook_label", param).then(res => {
return res
})
},
getCookListFood(param) { // 菜谱列表(根据食材名称拉取)
return http.post("/kitchenscale/find_by_food", param).then(res => {
return http.post("/kitchenscale2/find_by_food", param).then(res => {
return res
})
},
getCookListDetails(param) { // 查询菜谱详情
return http.post("/kitchenscale/cookbook_details", param).then(res => {
return http.post("/kitchenscale2/cookbook_details", param).then(res => {
return res
})
},
getCookFollow(param) { // 关注行为
return http.post("/kitchenscale/cookbook_follow", param).then(res => {
return http.post("/kitchenscale2/cookbook_follow", param).then(res => {
return res
})
},
getCookLike(param) { // 点赞收藏菜谱
return http.post("/kitchenscale/cookbook_like", param).then(res => {
return http.post("/kitchenscale2/cookbook_like", param).then(res => {
return res
})
},
getCookKcal(param) { // 食材卡路里计算
return http.post("/kitchenscale/food_count_kcal", param).then(res => {
return http.post("/kitchenscale2/food_count_kcal", param).then(res => {
return res
})
},
// 食材
getCookFoodList(param) { // 食材列表
return http.post("/kitchenscale/get_food_list", param).then(res => {
return http.post("/kitchenscale2/get_food_list", param).then(res => {
return res
})
},
getCookListSave(param) { // 食材列表查询
return http.post("/kitchenscale/save_food_list", param).then(res => {
return http.post("/kitchenscale2/save_food_list", param).then(res => {
return res
})
},
// 计食器
getAddIntakeFood(param) { // 添加每日摄入记录
return http.post("/kitchenscale/add_intake_food", param).then(res => {
return http.post("/kitchenscale2/add_intake_food", param).then(res => {
return res
})
},
getCountfootCon(param) { // 每日记食器板块详细内容
return http.post("/kitchenscale/get_countfoot_content", param).then(res => {
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => {
return res
})
},
delCEatAction(param) { // 删除餐饮食物
return http.post("/kitchenscale/del_user_eat_log", param).then(res => {
return http.post("/kitchenscale2/del_user_eat_log", param).then(res => {
return res
})
},
getLogList(param) { // 记食器角色饮食记录列表
return http.post("/kitchenscale/get_log_list", param).then(res => {
return http.post("/kitchenscale2/get_log_list", param).then(res => {
return res
})
},
getSetUpContent(param) { // 计食器板块-设置里的内容
return http.post("/kitchenscale/set_up_content", param).then(res => {
return http.post("/kitchenscale2/set_up_content", param).then(res => {
return res
})
},
getSetUserKcal(param) { // 设置用户的卡路里
return http.post("/kitchenscale/set_user_kcal", param).then(res => {
return http.post("/kitchenscale2/set_user_kcal", param).then(res => {
return res
})
},
// 个人中心
getUserCollectList(param) { // 用户收藏点赞列表
return http.post("/kitchenscale/get_user_collect_list", param).then(res => {
return http.post("/kitchenscale2/get_user_collect_list", param).then(res => {
return res
})
},
getMyCookbook(param) { // 我的菜谱
return http.post("/kitchenscale/get_my_cookbook", param).then(res => {
return http.post("/kitchenscale2/get_my_cookbook", param).then(res => {
return res
})
},
getMyCookbookDel(param) { // 删除我的菜谱
return http.post("/kitchenscale/del_my_cookbook", param).then(res => {
return http.post("/kitchenscale2/del_my_cookbook", param).then(res => {
return res
})
},
getMyLogList(param) { // 饮食列表
return http.post("/kitchenscale/get_log_list", param).then(res => {
return http.post("/kitchenscale2/get_log_list", param).then(res => {
let pkList = {
list: [],
Dlist: []
@ -217,22 +222,22 @@ export default {
},
// 计食器
getAddIntakeFood(param) { // 添加每日摄入记录
return http.post("/kitchenscale/add_intake_food", param).then(res => {
return http.post("/kitchenscale2/add_intake_food", param).then(res => {
return res
})
},
getCountFoodInfo(param) { // 获取记食器板块详细内容
return http.post("/kitchenscale/get_countfoot_content", param).then(res => {
return http.post("/kitchenscale2/get_countfoot_content", param).then(res => {
return res
})
},
getCountSetKcal(param) { // 获取记食器设置里的内容
return http.post("/kitchenscale/set_up_content", param).then(res => {
return http.post("/kitchenscale2/set_up_content", param).then(res => {
return res
})
},
getCountSetUserKcal(param) { // 获取记食器设置里的内容
return http.post("/kitchenscale/set_user_kcal", param).then(res => {
return http.post("/kitchenscale2/set_user_kcal", param).then(res => {
return res
})
},

View File

@ -7,8 +7,31 @@ export default {
getDate,
getMonth,
GetDateStr,
NewsPtype,
mergeAndDeduplicate
}
function NewsPtype(con) {
if (con.type == "wechat") { //跳小程序
// #ifdef APP
uni.navigateTo({
url: "/pageTwo/webview/webview?id=" + con.id + '&url=' + con.jump_url
})
// #endif
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({ //小程序跳小程序
appId: con.appid,
path: con.path,
extraData: {},
})
// #endif
} else if (con.type != 'wechat') { //跳h5或文本
uni.navigateTo({
url: "/pageTwo/webview/webview?id=" + con.id + '&url=' + con.jump_url
})
}
}
// 合并数组并去重
function mergeAndDeduplicate(arr1, arr2, uniqueKey) {
let map = new Map();
@ -106,16 +129,4 @@ function getMonth(dates, months) {
} else {
return year + "-" + month + "-01" + "~" + year + "-" + month + "-30";
};
// if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
// month == "12") {
// return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
// } else if (month == "02") {
// if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
// return year + '/' + month + "/01" + "~" + year + "/" + year + "/" + month + "/29";
// } else {
// return year + '/' + month + "/01" + "~" + year + "/" + month + "/28";
// };
// } else {
// return year + '/' + month + "/01" + "~" + year + "/" + month + "/30";
// };
};

View File

@ -76,7 +76,7 @@ $uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
//
$maincolor:#ff4c4f;
$maincolor:#3CB383;
$bgcolor:#efefef;
$btncolor:#f0ae43;
$btncolor:#3CB383;
$textcolor:#333

View File

@ -18,20 +18,20 @@
<template>
<view class="chartsview" :id="'ChartBoxId'+cid">
<block v-if="type2d">
<view v-if="ontouch" @tap="_tap">
<view v-if="ontouch" @click="tap">
<canvas :id="cid" :canvasId="cid"
:style="{ width: cWidth + 'rpx', height: cHeight + 'rpx', background: background }" type="2d"
:disable-scroll="disScroll" @touchstart="_touchStart" @touchmove="_touchMove" @touchend="_touchEnd"
@error="_error" v-show="showchart" />
</view>
<view v-if="!ontouch" @tap="_tap">
<view v-if="!ontouch" @click="tap">
<canvas :id="cid" :canvasId="cid"
:style="{ width: cWidth + 'rpx', height: cHeight + 'rpx', background: background }" type="2d"
:disable-scroll="disScroll" @error="_error" v-show="showchart" />
</view>
</block>
<block v-if="!type2d">
<view v-if="ontouch" @tap="_tap">
<view v-if="ontouch" @click="tap">
<canvas :id="cid" :canvasId="cid"
:style="{ width: cWidth + 'rpx', height: cHeight + 'rpx', background: background }"
@touchstart="_touchStart" @touchmove="_touchMove" @touchend="_touchEnd" :disable-scroll="disScroll"
@ -40,7 +40,7 @@
<view v-if="!ontouch">
<canvas :id="cid" :canvasId="cid"
:style="{ width: cWidth + 'rpx', height: cHeight + 'rpx', background: background }"
:disable-scroll="disScroll" @tap="_tap" @error="_error" v-show="showchart" />
:disable-scroll="disScroll" @click="tap" @error="_error" v-show="showchart" />
</view>
</block>
</view>
@ -749,6 +749,7 @@
}
},
init() {
let that = this
let cid = this.cid
let chartdom = uni
.createSelectorQuery()
@ -807,15 +808,15 @@
if (cfu.instance[cid]) {
cfu.option[cid].context.restore();
cfu.option[cid].context.save();
this._updataUChart(cid)
that._updataUChart(cid)
} else {
setTimeout(() => {
this._newChart(cid)
that._newChart(cid)
}, 100)
}
} else {
this.showchart = false;
this.mixinDatacomErrorMessage =
that.showchart = false;
that.mixinDatacomErrorMessage =
'参数错误开启2d模式后未获取到dom节点canvas-id:' + cid;
}
});
@ -828,7 +829,7 @@
this._updataUChart(cid)
} else {
setTimeout(() => {
this._newChart(cid)
that._newChart(cid)
}, 100)
}
}
@ -965,7 +966,7 @@
});
}
},
_tap(e, move) {
tap(e, move) {
let cid = this.cid
let currentIndex = null;
let legendIndex = null;
@ -1085,7 +1086,7 @@
}
});
if (this.ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true) {
this._tap(e, true)
this.tap(e, true)
}
},
_touchEnd(e) {
@ -1102,7 +1103,7 @@
}
});
if (this.ontap === true && cfu.option[cid].enableScroll === false && this.onmovetip === true) {
this._tap(e, true)
this.tap(e, true)
}
},
// #endif

View File

@ -1,549 +0,0 @@
<template>
<view class="calendar_all">
<view class="date" @click="handleisCalen">
{{startDay?startDay:startdate}}
</view>
<view class="wrapper Calen" v-if="isCalen">
<view class="bg" @click='isCalen=false'>
<view class="addfood" @click.stop>
<!-- -->
<view class="calendar-wrapper">
<view class="header">
<view class="pre" @click="changeMonth('pre')">
<uni-icons type="back" size="20"></uni-icons>
</view>
<view>{{y+'年'+formatNum(m)+'月'}}</view>
<view class="next" @click="changeMonth('next')">
<uni-icons type="forward" size="20"></uni-icons>
</view>
</view>
<view class="week">
<view class="week-day" v-for="(item, index) in weekDay" :key="index">{{ item }}</view>
</view>
<view :class="{ hide: !monthOpen }" class="content0" :style="{ height: height }">
<view :style="{ top: positionTop + 'rpx' }" class="days">
<view class="item" v-for="(item, index) in dates" :key="index">
<view class="day" @click="selectOne(item, $event)" :class="{
choose: choose == `${item.year}-${item.month}-${item.date}`&&item.isCurM,
nolm: !item.isCurM,
today: isToday(item.year, item.month, item.date),
isWorkDay: isWorkDay(item.year, item.month, item.date)
}">
{{ Number(item.date) }}
</view>
<view class="markDay error"
v-if="isMarkDay(item.year, item.month, item.date,'error')&&item.isCurM">
</view>
<view class="markDay success"
v-if="isMarkDay(item.year, item.month, item.date,'success')&&item.isCurM">
</view>
<view class="markDay warning"
v-if="isMarkDay(item.year, item.month, item.date,'warning')&&item.isCurM">
</view>
</view>
</view>
</view>
<view class="level">
<view><text></text>超标</view>
<view><text></text>达标</view>
<view><text></text>未达标</view>
</view>
</view>
<!-- -->
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'ren-calendar',
props: {
// (0)
weekstart: {
type: Number,
default: 0
},
//
// markDays: {
// type: Array,
// default: () => {
// return [];
// }
// },
markDays: {
type: Object,
default: () => {
return {};
}
},
//
headerBar: {
type: Boolean,
default: true
},
//
open: {
type: Boolean,
default: true
},
//
collapsible: {
type: Boolean,
default: true
},
//
disabledAfter: {
type: Boolean,
default: true
},
//
startDay: {
type: String,
default: ""
}
},
data() {
return {
weektext: ['日', '一', '二', '三', '四', '五', '六'],
y: new Date().getFullYear(), //
m: new Date().getMonth() + 1, //
dates: [], //
positionTop: 0,
monthOpen: true,
choose: '',
month: null,
isCalen: false,
startdate: ""
};
},
created() {
this.startdate = this.$tools.getDate("start")
this.dates = this.monthDay(this.y, this.m);
!this.open && this.toggle();
},
mounted() {
this.y = new Date().getFullYear()
this.m = new Date().getMonth() + 1
this.month = this.$tools.getMonth(this.$tools.getTime(), 0)
this.choose = this.getToday().date;
},
computed: {
//
weekDay() {
return this.weektext.slice(this.weekstart).concat(this.weektext.slice(0, this.weekstart));
},
height() {
return (this.dates.length / 7) * 80 + 'rpx';
},
},
methods: {
handleisCalen() {
console.log("店家")
this.isCalen = !this.isCalen
},
formatNum(num) {
let res = Number(num);
return res < 10 ? '0' + res : res;
},
getToday() {
let date = new Date();
let y = date.getFullYear();
let m = date.getMonth();
let d = date.getDate();
let week = new Date().getDay();
let weekText = ['日', '一', '二', '三', '四', '五', '六'];
let formatWeek = '星期' + weekText[week];
let today = {
date: y + '-' + this.formatNum(m + 1) + '-' + this.formatNum(d),
week: formatWeek
};
return today;
},
//
monthDay(y, month) {
let dates = [];
let m = Number(month);
let firstDayOfMonth = new Date(y, m - 1, 1).getDay(); //
let lastDateOfMonth = new Date(y, m, 0).getDate(); //
let lastDayOfLastMonth = new Date(y, m - 1, 0).getDate(); //
let weekstart = this.weekstart == 7 ? 0 : this.weekstart;
let startDay = (() => {
//
if (firstDayOfMonth == weekstart) {
return 0;
} else if (firstDayOfMonth > weekstart) {
return firstDayOfMonth - weekstart;
} else {
return 7 - weekstart + firstDayOfMonth;
}
})();
let endDay = 7 - ((startDay + lastDateOfMonth) % 7); //
if (endDay == 7) {
endDay = 0;
}
for (let i = 1; i <= startDay; i++) {
dates.push({
date: this.formatNum(lastDayOfLastMonth - startDay + i),
day: weekstart + i - 1 || 7,
month: m - 1 >= 0 ? this.formatNum(m - 1) : 12,
year: m - 1 >= 0 ? y : y - 1
});
}
for (let j = 1; j <= lastDateOfMonth; j++) {
dates.push({
date: this.formatNum(j),
day: (j % 7) + firstDayOfMonth - 1 || 7,
month: this.formatNum(m),
year: y,
isCurM: true //
});
}
for (let k = 1; k <= endDay; k++) {
dates.push({
date: this.formatNum(k),
day: (lastDateOfMonth + startDay + weekstart + k - 1) % 7 || 7,
month: m + 1 <= 11 ? this.formatNum(m + 1) : 0,
year: m + 1 <= 11 ? y : y + 1
});
}
return dates;
},
isWorkDay(y, m, d) {
//
let ymd = `${y}-${m}-${d}`;
let formatDY = new Date(ymd.replace(/-/g, '/'));
let week = formatDY.getDay();
if (week == 0 || week == 6) {
return false;
} else {
return true;
}
},
isFutureDay(y, m, d) {
//
let ymd = `${y}-${m}-${d}`;
let formatDY = new Date(ymd.replace(/-/g, '/'));
let showTime = formatDY.getTime();
let curTime = new Date().getTime();
if (showTime > curTime) {
return true;
} else {
return false;
}
},
//
isMarkDay(y, m, d, type) {
let that = this
let flag = false;
let markDays = that.markDays[type]
for (let i = 0; i < markDays.length; i++) {
let dy = `${y}-${m}-${d}`;
if (markDays[i] == dy) {
flag = true;
break;
}
}
// console.log("isMarkDay", this.markDays, type, markDays)
return flag;
},
isToday(y, m, d) {
let checkD = y + '-' + m + '-' + d;
let today = this.getToday().date;
if (checkD == today) {
return true;
} else {
return false;
}
},
//
toggle() {
this.monthOpen = !this.monthOpen;
if (this.monthOpen) {
this.positionTop = 0;
} else {
let index = -1;
this.dates.forEach((i, x) => {
this.isToday(i.year, i.month, i.date) && (index = x);
});
this.positionTop = -((Math.ceil((index + 1) / 7) || 1) - 1) * 80;
}
},
//
selectOne(i, event) {
let date = `${i.year}-${i.month}-${i.date}`;
let selectD = new Date(date).getTime();
let curTime = new Date().getTime();
let week = new Date(date).getDay();
let weekText = ['日', '一', '二', '三', '四', '五', '六'];
let formatWeek = '星期' + weekText[week];
let response = {
date: date,
week: formatWeek
};
if (!i.isCurM) {
// console.log('');
return false;
}
if (selectD > curTime) {
if (this.disabledAfter) {
console.log('未来日期不可选');
return false;
} else {
this.choose = date;
this.$emit('maskClick', response);
}
} else {
this.choose = date;
this.$emit('maskClick', response);
}
this.startdate = response.date
this.isCalen = false
},
//
changYearMonth(y, m) {
this.dates = this.monthDay(y, m);
this.y = y;
this.m = m;
},
changeMonth(type) {
let that = this
// if (!uni.getStorageSync('token')) {
// this.$store.commit("changeUserLogin", true);
// return
// }
console.log("type", type)
if (type == 'pre') {
if (that.m + 1 == 2) {
that.m = 12;
that.y = that.y - 1;
} else {
that.m = that.m - 1;
}
that.month = this.$tools.getMonth(that.month, -1)
that.$emit('onMonthClickPre', that.month)
} else {
if (this.m + 1 == 13) {
this.m = 1;
this.y = this.y + 1;
} else {
this.m = this.m + 1;
}
that.month = this.$tools.getMonth(that.month, +1)
that.$emit('onMonthClickPre', that.month)
}
this.dates = this.monthDay(this.y, this.m);
}
}
};
</script>
<style lang="scss" scoped>
.date {
font-size: 16px;
font-weight: bold;
}
.Calen {
top: 50px;
.bg {
top: 50px;
}
.addfood {
top: 0;
bottom: auto;
border-radius: 0;
}
}
.calendar-wrapper {
color: #bbb7b7;
// border-radius: 10px;
font-size: 28rpx;
text-align: center;
background-color: #fff;
padding-bottom: 10rpx;
.header {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
color: #42464A;
font-size: 32rpx;
font-weight: bold;
justify-content: space-around;
.pre,
.next {
color: $maincolor;
font-size: 28rpx;
}
}
.week {
display: flex;
align-items: center;
height: 70rpx;
line-height: 70rpx;
border-bottom: 1rpx solid rgba(255, 255, 255, 0.2);
view {
flex: 1;
}
}
.content0 {
position: relative;
overflow: hidden;
transition: height 0.4s ease;
.days {
transition: top 0.3s;
display: flex;
align-items: center;
flex-wrap: wrap;
position: relative;
.item {
position: relative;
display: block;
height: 70rpx;
line-height: 70rpx;
width: calc(100% / 7);
.day {
font-style: normal;
display: inline-block;
vertical-align: middle;
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
overflow: hidden;
border-radius: 60rpx;
&.choose {
background-color: $maincolor;
color: #fff;
}
&.nolm {
color: #fff;
opacity: 0.3;
}
}
.isWorkDay {
color: #42464a;
}
.notSigned {
font-style: normal;
width: 8rpx;
height: 8rpx;
background: #fa7268;
border-radius: 10rpx;
position: absolute;
left: 50%;
bottom: 0;
pointer-events: none;
}
.today {
color: #fff;
background-color: #a8c0ff;
}
.workDay {
font-style: normal;
width: 8rpx;
height: 8rpx;
background: #4d7df9;
border-radius: 10rpx;
position: absolute;
left: 50%;
bottom: 0;
pointer-events: none;
}
.markDay {
font-style: normal;
width: 10px;
height: 10px;
background: #fa7268;
border-radius: 10rpx;
position: absolute;
left: 42%;
bottom: -8px;
pointer-events: none;
}
.error {
background-color: $uni-color-error;
}
.warning {
background-color: $uni-color-warning;
}
.success {
background-color: $uni-color-success;
}
}
}
}
.hide {
height: 70rpx !important;
}
.weektoggle {
width: 85rpx;
height: 32rpx;
position: relative;
bottom: -42rpx;
&.down {
transform: rotate(180deg);
bottom: 0;
}
}
}
//
.level {
display: flex;
font-size: 12px;
margin-left: 10px;
margin-top: -20px;
view {
width: 25%;
text-align: left;
height: 28px;
line-height: 28px;
text {
width: 10px;
height: 10px;
background: red;
display: inline-block;
border-radius: 50%;
margin-right: 5px;
}
}
:nth-child(2) text {
background: $uni-color-success
}
:nth-child(3) text {
background: $uni-color-warning
}
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<view :style="{'display':visibleSync?'block':'none'}" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @click="close('mask')" />
<view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer}" :style="{width:drawerWidth+'px'}">
<slot />
</view>

View File

@ -6,7 +6,8 @@
"pages/count/count",
"pages/me/me",
"pages/add/Preview",
"pages/search/search"
"pages/search/search",
"pages/search/list"
],
"subPackages": [
{
@ -23,6 +24,7 @@
"count/setting",
"count/KcalEdit",
"count/food",
"count/search",
"webview/webview",
"setting/setting",
"setting/password",
@ -35,12 +37,12 @@
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#efefef",
"navigationBarBackgroundColor": "#45C570",
"backgroundColor": "#efefef"
},
"tabBar": {
"color": "#333",
"selectedColor": "#ff4c4f",
"selectedColor": "#45C570",
"backgroundColor": "#fff",
"list": [
{
@ -50,10 +52,10 @@
"text": "首页"
},
{
"pagePath": "pages/menu/menu",
"pagePath": "pages/search/search",
"iconPath": "static/cai.png",
"selectedIconPath": "static/cai01.png",
"text": "菜谱"
"text": "教你做"
},
{
"pagePath": "pages/add/add",
@ -65,7 +67,7 @@
"pagePath": "pages/count/count",
"iconPath": "static/ji.png",
"selectedIconPath": "static/ji01.png",
"text": "计食器"
"text": "测量"
},
{
"pagePath": "pages/me/me",
@ -76,10 +78,6 @@
]
},
"plugins": {
"sdkPlugin": {
"version": "2.4.0",
"provider": "wx17e93aad47cdae1a"
},
"WechatSI": {
"version": "0.3.6",
"provider": "wx069ba97219f66d99"

View File

@ -1 +1 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{4149:function(t,e,o){},"63b1":function(t,e,o){"use strict";var n=o("4149"),r=o.n(n);r.a},"6b1b":function(t,e,o){"use strict";o.r(e);var n=o("be13"),r=o.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=r.a},"834a":function(t,e,o){"use strict";(function(t,e){var n=o("47a9"),r=n(o("7ca3"));o("6caf");var a=n(o("9998"));o("60a4"),o("17f2"),o("38a5"),o("a5bf");var c=n(o("b3c9")),u=n(o("069d")),f=n(o("749e")),i=n(o("d3d2")),l=n(o("229b")),d=n(o("3240"));function p(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}t.__webpack_require_UNI_MP_PLUGIN__=o,d.default.prototype.$store=c.default,d.default.prototype.$tools=u.default,d.default.prototype.$http=f.default,d.default.prototype.$model=i.default,d.default.prototype.$json=l.default,d.default.config.productionTip=!1,a.default.mpType="app";var s=new d.default(function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?p(Object(o),!0).forEach((function(e){(0,r.default)(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},a.default));e(s).$mount()}).call(this,o("3223")["default"],o("df3c")["createApp"])},9998:function(t,e,o){"use strict";o.r(e);var n=o("6b1b");for(var r in n)["default"].indexOf(r)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(r);o("63b1");var a=o("828b"),c=Object(a["a"])(n["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);e["default"]=c.exports},be13:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={onTabItemClick:function(t){console.log("itemPath",t)},onLaunch:function(){console.log("App Launch")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")},methods:{handleHomeConfig:function(){var t=this;t.$model.getHomeConfig({}).then((function(e){0==e.code&&(t.$store.commit("changeMenuList",e.data.cook_label),t.$store.commit("changeFoodList",e.data.food_list))}))}}};e.default=n}},[["834a","common/runtime","common/vendor"]]]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"107a":function(e,t,o){"use strict";(function(e,t){var n=o("47a9"),r=n(o("7ca3"));o("6c4c");var c=n(o("5b00")),a=n(o("860e")),u=n(o("c238")),i=n(o("6f56")),f=n(o("bbe1")),l=n(o("836b")),d=n(o("3240"));function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}e.__webpack_require_UNI_MP_PLUGIN__=o,d.default.prototype.$store=a.default,d.default.prototype.$tools=u.default,d.default.prototype.$http=i.default,d.default.prototype.$model=f.default,d.default.prototype.$json=l.default,d.default.config.productionTip=!1,c.default.mpType="app";var s=new d.default(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){(0,r.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},c.default));t(s).$mount()}).call(this,o("3223")["default"],o("df3c")["createApp"])},"45ee":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={onTabItemClick:function(e){console.log("itemPath",e)},onLaunch:function(){console.log("App Launch")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")},methods:{handleHomeConfig:function(){var e=this;e.$model.getHomeConfig({}).then((function(t){0==t.code&&(e.$store.commit("changeMenuList",t.data.cook_label),e.$store.commit("changeFoodList",t.data.food_list))}))}}};t.default=n},4646:function(e,t,o){"use strict";var n=o("8ed7"),r=o.n(n);r.a},"5b00":function(e,t,o){"use strict";o.r(t);var n=o("ab62");for(var r in n)["default"].indexOf(r)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(r);o("4646");var c=o("828b"),a=Object(c["a"])(n["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=a.exports},"8ed7":function(e,t,o){},ab62:function(e,t,o){"use strict";o.r(t);var n=o("45ee"),r=o.n(n);for(var c in n)["default"].indexOf(c)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(c);t["default"]=r.a}},[["107a","common/runtime","common/vendor"]]]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<view class="weightPages data-v-1a50718f"><block wx:if="{{isConnection==0}}"><view class="table data-v-1a50718f">称重中,请将食物放到秤上</view></block><block wx:if="{{isConnection==1}}"><view data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" class="table data-v-1a50718f" bindtap="__e">连接失败,点击重新连接</view></block><block wx:if="{{isConnection!=3}}"><view class="image data-v-1a50718f"><image src="../static/cheng.png" class="data-v-1a50718f"></image></view></block><block wx:if="{{isConnection==3}}"><view class="data-v-1a50718f"><view class="weight data-v-1a50718f"><view class="data-v-1a50718f">重量<text class="data-v-1a50718f">{{weight}}</text>{{dw}}</view><view class="data-v-1a50718f">热量<text class="data-v-1a50718f">{{kcal}}</text>千卡</view></view><view class="tips data-v-1a50718f">注:重新称重可更新当前数据</view><block wx:if="{{weightType!=2}}"><view class="groupbtn data-v-1a50718f"><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-1a50718f" bindtap="__e">完成</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-1a50718f" bindtap="__e">下一位</view></block></view></block><block wx:if="{{weightType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn data-v-1a50718f" bindtap="__e">确认添加</view></block></view></block><block wx:if="{{isConnection==1}}"><view class="tips data-v-1a50718f"><uni-icons vue-id="2b524063-1" type="info-filled" color="#dd524d" size="20" class="data-v-1a50718f" bind:__l="__l"></uni-icons>请确定设备是开机状态、手机蓝牙权限已打开!</view></block></view>
<view class="weightPages data-v-7aeb0836"><block wx:if="{{isConnection==0}}"><view class="table data-v-7aeb0836">称重中,请将食物放到秤上</view></block><block wx:if="{{isConnection==1}}"><view data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" class="table data-v-7aeb0836" bindtap="__e">连接失败,点击重新连接</view></block><block wx:if="{{isConnection!=3}}"><view class="image data-v-7aeb0836"><image src="../static/cheng.png" class="data-v-7aeb0836"></image></view></block><block wx:if="{{isConnection==3}}"><view class="data-v-7aeb0836"><view class="weight data-v-7aeb0836"><view class="data-v-7aeb0836">重量<text class="data-v-7aeb0836">{{weight}}</text>{{dw}}</view><view class="data-v-7aeb0836">热量<text class="data-v-7aeb0836">{{kcal}}</text>千卡</view></view><view class="tips data-v-7aeb0836">注:重新称重可更新当前数据</view><block wx:if="{{weightType!=2}}"><view class="groupbtn data-v-7aeb0836"><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-7aeb0836" bindtap="__e">完成</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-7aeb0836" bindtap="__e">下一位</view></block></view></block><block wx:if="{{weightType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn data-v-7aeb0836" bindtap="__e">确认添加</view></block></view></block><block wx:if="{{isConnection==1}}"><view class="tips data-v-7aeb0836"><uni-icons vue-id="2b524063-1" type="info-filled" color="#dd524d" size="20" class="data-v-7aeb0836" bind:__l="__l"></uni-icons>请确定设备是开机状态、手机蓝牙权限已打开!</view></block></view>

View File

@ -1 +1 @@
.weightPages.data-v-1a50718f{display:flex;flex-wrap:wrap;flex-direction:column;position:absolute;justify-content:space-around;left:0;right:0;bottom:20px;top:60px;margin-top:20px}.weightPages .weight.data-v-1a50718f{background:#fff;color:#666;font-size:16px;flex-wrap:wrap;text-align:center}.weightPages .weight view.data-v-1a50718f{width:60%;height:50px;display:flex;margin-left:25%;align-items:flex-end;margin-bottom:15px}.weightPages .weight view text.data-v-1a50718f{width:80px;display:inline-block;border-bottom:1px solid #dfdfdf;margin:0 10px;font-size:18px;font-weight:700;color:#f0ae43}.weightPages .tips.data-v-1a50718f{font-size:12px;text-align:center}.weightPages .btn.data-v-1a50718f{color:#fff;width:80%;margin-left:10%}.weightPages .groupbtn .btn.data-v-1a50718f{color:#000!important}.weightPages .table.data-v-1a50718f{width:100%;font-size:16px;font-weight:700;text-align:center;margin:15px 0}.weightPages .image.data-v-1a50718f{width:160px;height:160px;margin:auto}.weightPages .image image.data-v-1a50718f{width:100%;height:100%}.weightPages .tips.data-v-1a50718f{margin-bottom:15px;margin-left:15px;display:flex;color:#999}
.weightPages.data-v-7aeb0836{display:flex;flex-wrap:wrap;flex-direction:column;position:absolute;justify-content:space-around;left:0;right:0;bottom:20px;top:60px;margin-top:20px}.weightPages .weight.data-v-7aeb0836{background:#fff;color:#666;font-size:16px;flex-wrap:wrap;text-align:center}.weightPages .weight view.data-v-7aeb0836{width:60%;height:50px;display:flex;margin-left:25%;align-items:flex-end;margin-bottom:15px}.weightPages .weight view text.data-v-7aeb0836{width:80px;display:inline-block;border-bottom:1px solid #dfdfdf;margin:0 10px;font-size:18px;font-weight:700;color:#f0ae43}.weightPages .tips.data-v-7aeb0836{font-size:12px;text-align:center}.weightPages .btn.data-v-7aeb0836{color:#fff;width:80%;margin-left:10%}.weightPages .groupbtn .btn.data-v-7aeb0836{color:#000!important}.weightPages .table.data-v-7aeb0836{width:100%;font-size:16px;font-weight:700;text-align:center;margin:15px 0}.weightPages .image.data-v-7aeb0836{width:160px;height:160px;margin:auto}.weightPages .image image.data-v-7aeb0836{width:100%;height:100%}.weightPages .tips.data-v-7aeb0836{margin-bottom:15px;margin-left:15px;display:flex;color:#999}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<view class="weightPages data-v-134d4a82"><block wx:if="{{isConnection==0}}"><view class="table data-v-134d4a82">称重中,请将食物放到秤上</view></block><block wx:if="{{isConnection==1}}"><view data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" class="table data-v-134d4a82" bindtap="__e">连接失败,点击重新连接</view></block><block wx:if="{{isConnection!=3}}"><view class="image data-v-134d4a82"><image src="../static/cheng.png" class="data-v-134d4a82"></image></view></block><block wx:if="{{isConnection==3}}"><view class="data-v-134d4a82"><view class="weight-wrap data-v-134d4a82"><view class="weight data-v-134d4a82"><text class="val data-v-134d4a82">{{weight==''?'--':weight}}</text><text class="unit data-v-134d4a82">{{$root.m0}}</text></view><view class="kcal data-v-134d4a82"><text class="val data-v-134d4a82">{{kcal==''?0:kcal}}</text><text class="unit data-v-134d4a82">千卡</text></view></view><view class="tips data-v-134d4a82">注:重新称重可更新当前数据</view><block wx:if="{{weightType!=2}}"><view class="groupbtn data-v-134d4a82"><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-134d4a82" bindtap="__e">完成</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-134d4a82" bindtap="__e">下一位</view></block></view></block><block wx:if="{{weightType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn data-v-134d4a82" bindtap="__e">确认添加</view></block></view></block><block wx:if="{{isConnection==1}}"><view class="tips data-v-134d4a82"><uni-icons vue-id="cef7e708-1" type="info-filled" color="#dd524d" size="20" class="data-v-134d4a82" bind:__l="__l"></uni-icons>请确定设备是开机状态、手机蓝牙权限已打开!</view></block></view>
<view class="weightPages data-v-e3c5d128"><block wx:if="{{isConnection==0}}"><view class="table data-v-e3c5d128">称重中,请将食物放到秤上</view></block><block wx:if="{{isConnection==1}}"><view data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" class="table data-v-e3c5d128" bindtap="__e">连接失败,点击重新连接</view></block><block wx:if="{{isConnection!=3}}"><view class="image data-v-e3c5d128"><image src="../static/cheng.png" class="data-v-e3c5d128"></image></view></block><block wx:if="{{isConnection==3}}"><view class="data-v-e3c5d128"><view class="weight-wrap data-v-e3c5d128"><view class="weight data-v-e3c5d128"><text class="val data-v-e3c5d128">{{weight==''?'--':weight}}</text><text class="unit data-v-e3c5d128">{{$root.m0}}</text></view><view class="kcal data-v-e3c5d128"><text class="val data-v-e3c5d128">{{kcal==''?0:kcal}}</text><text class="unit data-v-e3c5d128">千卡</text></view></view><view class="tips data-v-e3c5d128">注:重新称重可更新当前数据</view><block wx:if="{{weightType!=2}}"><view class="groupbtn data-v-e3c5d128"><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-e3c5d128" bindtap="__e">完成</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-e3c5d128" bindtap="__e">下一位</view></block></view></block><block wx:if="{{weightType==2}}"><view data-event-opts="{{[['tap',[['handlesub',['$event']]]]]}}" class="btn data-v-e3c5d128" bindtap="__e">确认添加</view></block></view></block><block wx:if="{{isConnection==1}}"><view class="tips data-v-e3c5d128"><uni-icons vue-id="cef7e708-1" type="info-filled" color="#dd524d" size="20" class="data-v-e3c5d128" bind:__l="__l"></uni-icons>请确定设备是开机状态、手机蓝牙权限已打开!</view></block></view>

View File

@ -1 +1 @@
.weightPages.data-v-134d4a82{display:flex;flex-wrap:wrap;flex-direction:column;position:relative;justify-content:space-around}.weightPages .weight-wrap.data-v-134d4a82{display:flex;flex-direction:column;align-items:center;background:#fff;color:#666;font-size:16px;flex-wrap:wrap;text-align:center}.weightPages .weight-wrap .weight.data-v-134d4a82, .weightPages .weight-wrap .kcal.data-v-134d4a82{display:flex;justify-content:center;align-items:center;width:70%;padding:40rpx 0;border-radius:20rpx;background-color:#f8f8f8}.weightPages .weight-wrap .weight.data-v-134d4a82{margin-bottom:30rpx}.weightPages .weight-wrap .weight .val.data-v-134d4a82{font-size:40rpx;color:#f0ae43;margin:0!important}.weightPages .weight-wrap .weight .unit.data-v-134d4a82{padding:10rpx;margin-left:30rpx;font-size:28rpx;color:#fff;border-radius:8rpx;background-color:#f0ae43}.weightPages .weight-wrap .kcal.data-v-134d4a82{font-size:32rpx}.weightPages .weight-wrap .kcal .val.data-v-134d4a82{font-size:40rpx;color:#f0ae43;margin:0!important}.weightPages .weight-wrap .kcal .unit.data-v-134d4a82{margin-left:20rpx}.weightPages .tips.data-v-134d4a82{font-size:12px;text-align:center}.weightPages .btn.data-v-134d4a82{color:#fff;width:80%;margin-left:10%}.weightPages .groupbtn .btn.data-v-134d4a82{color:#000!important}.weightPages .table.data-v-134d4a82{width:100%;font-size:16px;font-weight:700;text-align:center;margin:15px 0}.weightPages .image.data-v-134d4a82{width:160px;height:160px;margin:auto}.weightPages .image image.data-v-134d4a82{width:100%;height:100%}.weightPages .tips.data-v-134d4a82{margin-top:40rpx;margin-left:15px;display:flex;color:#999}
.weightPages.data-v-e3c5d128{display:flex;flex-wrap:wrap;flex-direction:column;position:relative;justify-content:space-around}.weightPages .weight-wrap.data-v-e3c5d128{display:flex;flex-direction:column;align-items:center;background:#fff;color:#666;font-size:16px;flex-wrap:wrap;text-align:center}.weightPages .weight-wrap .weight.data-v-e3c5d128, .weightPages .weight-wrap .kcal.data-v-e3c5d128{display:flex;justify-content:center;align-items:center;width:70%;padding:40rpx 0;border-radius:20rpx;background-color:#f8f8f8}.weightPages .weight-wrap .weight.data-v-e3c5d128{margin-bottom:30rpx}.weightPages .weight-wrap .weight .val.data-v-e3c5d128{font-size:40rpx;color:#f0ae43;margin:0!important}.weightPages .weight-wrap .weight .unit.data-v-e3c5d128{padding:10rpx;margin-left:30rpx;font-size:28rpx;color:#fff;border-radius:8rpx;background-color:#f0ae43}.weightPages .weight-wrap .kcal.data-v-e3c5d128{font-size:32rpx}.weightPages .weight-wrap .kcal .val.data-v-e3c5d128{font-size:40rpx;color:#f0ae43;margin:0!important}.weightPages .weight-wrap .kcal .unit.data-v-e3c5d128{margin-left:20rpx}.weightPages .tips.data-v-e3c5d128{font-size:12px;text-align:center}.weightPages .btn.data-v-e3c5d128{color:#fff;width:80%;margin-left:10%}.weightPages .groupbtn .btn.data-v-e3c5d128{color:#000!important}.weightPages .table.data-v-e3c5d128{width:100%;font-size:16px;font-weight:700;text-align:center;margin:15px 0}.weightPages .image.data-v-e3c5d128{width:160px;height:160px;margin:auto}.weightPages .image image.data-v-e3c5d128{width:100%;height:100%}.weightPages .tips.data-v-e3c5d128{margin-top:40rpx;margin-left:15px;display:flex;color:#999}

View File

@ -1,9 +1,9 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/food_item"],{2653:function(t,n,e){},"4d1f":function(t,n,e){"use strict";e.r(n);var o=e("b7ca"),c=e.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(u);n["default"]=c.a},"5e5a":function(t,n,e){"use strict";e.r(n);var o=e("ff7c"),c=e("4d1f");for(var u in c)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return c[t]}))}(u);e("e523");var f=e("828b"),i=Object(f["a"])(c["default"],o["b"],o["c"],!1,null,"33e6d913",null,!1,o["a"],void 0);n["default"]=i.exports},b7ca:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={name:"FoodItem",props:["foodList"],data:function(){return{}},methods:{onScrollToLower:function(){this.$emit("scroll")},onSelect:function(t){this.$emit("select",t)}}}},e523:function(t,n,e){"use strict";var o=e("2653"),c=e.n(o);c.a},ff7c:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},c=[]}}]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/food_item"],{"0c0c":function(t,n,e){"use strict";e.r(n);var o=e("d905"),c=e("4f23");for(var u in c)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return c[t]}))}(u);e("cf75");var f=e("828b"),i=Object(f["a"])(c["default"],o["b"],o["c"],!1,null,"33e6d913",null,!1,o["a"],void 0);n["default"]=i.exports},3843:function(t,n,e){},"4f23":function(t,n,e){"use strict";e.r(n);var o=e("fc8d"),c=e.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(u);n["default"]=c.a},cf75:function(t,n,e){"use strict";var o=e("3843"),c=e.n(o);c.a},d905:function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return c})),e.d(n,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},c=[]},fc8d:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={name:"FoodItem",props:["foodList"],data:function(){return{}},methods:{onScrollToLower:function(){this.$emit("scroll")},onSelect:function(t){this.$emit("select",t)}}}}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/food_item-create-component',
{
'components/food_item-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("5e5a"))
__webpack_require__('df3c')['createComponent'](__webpack_require__("0c0c"))
})
},
[['components/food_item-create-component']]

View File

@ -1,10 +0,0 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/list"],{"0a40":function(t,n,e){"use strict";e.r(n);var a=e("80a2"),i=e.n(a);for(var u in a)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(u);n["default"]=i.a},5818:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this.$createElement,n=(this._self._c,this.list.length);this.$mp.data=Object.assign({},{$root:{g0:n}})},i=[]},"80a2":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e={name:"list",data:function(){return{}},props:{title:{type:String,default:""},list:{type:Array,default:[]}},mounted:function(){},methods:{handleDetail:function(n){t.getStorageSync("token")?t.navigateTo({url:"/pageTwo/me/menudetail?id="+n}):this.$tools.msg("登录后查看等多!")}}};n.default=e}).call(this,e("df3c")["default"])},cebd:function(t,n,e){"use strict";e.r(n);var a=e("5818"),i=e("0a40");for(var u in i)["default"].indexOf(u)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(u);var o=e("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"67887168",null,!1,a["a"],void 0);n["default"]=r.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/list-create-component',
{
'components/list-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("cebd"))
})
},
[['components/list-create-component']]
]);

View File

@ -1,4 +0,0 @@
{
"usingComponents": {},
"component": true
}

View File

@ -1 +0,0 @@
<view class="data-v-67887168"><view class="footlist data-v-67887168"><block wx:for="{{list}}" wx:for-item="it" wx:for-index="id" wx:key="*this"><view data-event-opts="{{[['tap',[['handleDetail',['$0'],[[['list','',id,'id']]]]]]]}}" class="list data-v-67887168" bindtap="__e"><view class="topimg data-v-67887168"><image class="img data-v-67887168" src="{{it.cover}}" mode="aspectFill"></image></view><view class="item data-v-67887168"><view class="title data-v-67887168">{{it.title}}</view><view class="name data-v-67887168"><image src="{{it.create_user_head_pic}}" class="data-v-67887168"></image><text class="overflow data-v-67887168">{{it.create_user_nickname}}</text></view><view class="zan data-v-67887168"><icon class="{{['iconfont','data-v-67887168',it.is_me_like_it=='yes'?'icon-icon3':'icon-icon_collect']}}"></icon><text class="data-v-67887168">{{it.likes_num}}</text></view></view></view></block></view><block wx:if="{{!$root.g0}}"><view class="nolist data-v-67887168"><icon class="iconfont icon-wancan data-v-67887168"></icon><text class="data-v-67887168">还没有记录哦</text></view></block></view>

View File

@ -1,9 +1,9 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/search"],{1916:function(n,e,t){},5378:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={name:"search",props:{voice:{type:Boolean,default:!1}},data:function(){return{name:""}},methods:{searchByName:function(n){this.name=n,this.$emit("handleSearch",this.name)},handleSerach:function(){this.$emit("handleSearch",this.name)},handlecolse:function(){this.name="",this.$emit("handleSearch","")},onFocus:function(){n.navigateTo({url:"/pages/search/search"})},onMic:function(){this.$emit("mic")},onCamera:function(){this.$emit("camera")}}};e.default=t}).call(this,t("df3c")["default"])},"6b07":function(n,e,t){"use strict";var a=t("1916"),i=t.n(a);i.a},e39e:function(n,e,t){"use strict";t.r(e);var a=t("5378"),i=t.n(a);for(var c in a)["default"].indexOf(c)<0&&function(n){t.d(e,n,(function(){return a[n]}))}(c);e["default"]=i.a},eea8:function(n,e,t){"use strict";t.d(e,"b",(function(){return i})),t.d(e,"c",(function(){return c})),t.d(e,"a",(function(){return a}));var a={uniIcons:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(t.bind(null,"6c3a"))}},i=function(){var n=this.$createElement;this._self._c},c=[]},f7da:function(n,e,t){"use strict";t.r(e);var a=t("eea8"),i=t("e39e");for(var c in i)["default"].indexOf(c)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(c);t("6b07");var o=t("828b"),u=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"817943f2",null,!1,a["a"],void 0);e["default"]=u.exports}}]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/search"],{"5dc4":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"search",props:{voice:{type:Boolean,default:!1}},data:function(){return{name:""}},methods:{handleSerach:function(){this.$emit("handleSearch",this.name)},handlecolse:function(){this.name="",this.$emit("handleSearch","")},onMic:function(){this.$emit("mic")},onCamera:function(){this.$emit("camera")}}};e.default=i},"9b69":function(n,e,t){"use strict";var i=t("c386"),c=t.n(i);c.a},"9ca1":function(n,e,t){"use strict";t.r(e);var i=t("5dc4"),c=t.n(i);for(var a in i)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(a);e["default"]=c.a},c386:function(n,e,t){},e1ba:function(n,e,t){"use strict";t.d(e,"b",(function(){return c})),t.d(e,"c",(function(){return a})),t.d(e,"a",(function(){return i}));var i={uniIcons:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(t.bind(null,"5de9"))}},c=function(){var n=this.$createElement;this._self._c},a=[]},f1d3:function(n,e,t){"use strict";t.r(e);var i=t("e1ba"),c=t("9ca1");for(var a in c)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return c[n]}))}(a);t("9b69");var o=t("828b"),u=Object(o["a"])(c["default"],i["b"],i["c"],!1,null,"03eb5676",null,!1,i["a"],void 0);e["default"]=u.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/search-create-component',
{
'components/search-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("f7da"))
__webpack_require__('df3c')['createComponent'](__webpack_require__("f1d3"))
})
},
[['components/search-create-component']]

View File

@ -1 +1 @@
<view class="serachBox data-v-817943f2"><view class="serach-box data-v-817943f2"><view class="searchInput data-v-817943f2"><input class="city-serach-input data-v-817943f2" placeholder="请输入..." data-event-opts="{{[['input',[['__set_model',['','name','$event',[]]]]]]}}" value="{{name}}" bindinput="__e"/><block wx:if="{{name}}"><icon data-event-opts="{{[['tap',[['handlecolse',['$event']]]]]}}" class="iconfont icon-error data-v-817943f2" bindtap="__e"></icon></block><block wx:if="{{voice&&!name}}"><view class="voice data-v-817943f2"><uni-icons class="mic data-v-817943f2" vue-id="6eb882c3-1" type="mic-filled" size="26" data-event-opts="{{[['^click',[['onMic']]]]}}" bind:click="__e" bind:__l="__l"></uni-icons><uni-icons class="camera data-v-817943f2" vue-id="6eb882c3-2" type="camera-filled" size="26" data-event-opts="{{[['^click',[['onCamera']]]]}}" bind:click="__e" bind:__l="__l"></uni-icons></view></block></view><view class="searchBtn data-v-817943f2"><view data-event-opts="{{[['tap',[['handleSerach',['$event']]]]]}}" bindtap="__e" class="data-v-817943f2">搜索</view></view></view></view>
<view class="serachBox data-v-03eb5676"><view class="serach-box data-v-03eb5676"><view class="searchInput data-v-03eb5676"><input class="city-serach-input data-v-03eb5676" placeholder="请输入..." data-event-opts="{{[['input',[['__set_model',['','name','$event',[]]]]]]}}" value="{{name}}" bindinput="__e"/><block wx:if="{{name}}"><icon data-event-opts="{{[['tap',[['handlecolse',['$event']]]]]}}" class="iconfont icon-error data-v-03eb5676" bindtap="__e"></icon></block><block wx:if="{{voice&&!name}}"><view class="voice data-v-03eb5676"><uni-icons class="mic data-v-03eb5676" vue-id="6eb882c3-1" type="mic-filled" size="26" data-event-opts="{{[['^click',[['onMic']]]]}}" bind:click="__e" bind:__l="__l"></uni-icons><uni-icons class="camera data-v-03eb5676" vue-id="6eb882c3-2" type="camera-filled" size="26" data-event-opts="{{[['^click',[['onCamera']]]]}}" bind:click="__e" bind:__l="__l"></uni-icons></view></block></view><view class="searchBtn data-v-03eb5676"><view data-event-opts="{{[['tap',[['handleSerach',['$event']]]]]}}" bindtap="__e" class="data-v-03eb5676">搜索</view></view></view></view>

View File

@ -1 +1 @@
.serachBox.data-v-817943f2{height:40px;position:fixed;top:0;left:0;right:0;padding:0 15px 10px;z-index:99;background-color:#efefef}.serachBox .serach-box.data-v-817943f2{height:40px;border-radius:10px;position:relative;background-color:#fff}.serachBox .searchInput.data-v-817943f2{position:absolute;left:0;right:60px;height:40px}.serachBox .searchInput icon.data-v-817943f2{position:absolute;right:10px;top:10px;display:flex;z-index:99999}.serachBox .searchInput .voice.data-v-817943f2{display:flex;justify-content:flex-end;align-items:center;position:absolute;right:10px;top:0;bottom:0;width:150rpx;display:flex;z-index:99999}.serachBox .searchInput .voice .mic.data-v-817943f2{margin-right:10rpx}.serachBox .searchBtn.data-v-817943f2{position:absolute;width:60px;right:0;height:40px;line-height:40px;background:#ff4c4f;border-radius:0 10px 10px 0;text-align:center;color:#fff}.serachBox input.data-v-817943f2{height:40px;padding:0 5px;text-align:center;position:absolute;left:0;right:0;border-radius:10px}.serachBox .icon.data-v-817943f2{width:50px;height:40px;position:absolute;right:15px;display:flex;align-items:center;justify-content:center}
.serachBox.data-v-03eb5676{height:40px;position:fixed;top:0;left:0;right:0;padding:0 15px 10px;z-index:99;background-color:#efefef}.serachBox .serach-box.data-v-03eb5676{height:40px;border-radius:10px;position:relative;background-color:#fff}.serachBox .searchInput.data-v-03eb5676{position:absolute;left:0;right:60px;height:40px}.serachBox .searchInput icon.data-v-03eb5676{position:absolute;right:10px;top:10px;display:flex;z-index:99999}.serachBox .searchInput .voice.data-v-03eb5676{display:flex;justify-content:flex-end;align-items:center;position:absolute;right:10px;top:0;bottom:0;width:150rpx;display:flex;z-index:99999}.serachBox .searchInput .voice .mic.data-v-03eb5676{margin-right:10rpx}.serachBox .searchBtn.data-v-03eb5676{position:absolute;width:60px;right:0;height:40px;line-height:40px;background:#45c570;border-radius:0 10px 10px 0;text-align:center;color:#fff}.serachBox input.data-v-03eb5676{height:40px;padding:0 5px;text-align:center;position:absolute;left:0;right:0;border-radius:10px}.serachBox .icon.data-v-03eb5676{width:50px;height:40px;position:absolute;right:15px;display:flex;align-items:center;justify-content:center}

View File

@ -1,9 +1,9 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/search2"],{"10bb":function(n,t,e){"use strict";var a=e("9f69"),u=e.n(a);u.a},"2d23":function(n,t,e){"use strict";e.d(t,"b",(function(){return a})),e.d(t,"c",(function(){return u})),e.d(t,"a",(function(){}));var a=function(){var n=this.$createElement;this._self._c},u=[]},"4d80":function(n,t,e){"use strict";e.r(t);var a=e("2d23"),u=e("93b4");for(var c in u)["default"].indexOf(c)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(c);e("10bb");var r=e("828b"),f=Object(r["a"])(u["default"],a["b"],a["c"],!1,null,"5e260652",null,!1,a["a"],void 0);t["default"]=f.exports},"93b4":function(n,t,e){"use strict";e.r(t);var a=e("ad65"),u=e.n(a);for(var c in a)["default"].indexOf(c)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(c);t["default"]=u.a},"9f69":function(n,t,e){},ad65:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={name:"search",data:function(){return{}},methods:{handleSearch:function(){n.navigateTo({url:"/pages/search/search"})}}};t.default=e}).call(this,e("df3c")["default"])}}]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/search2"],{"0cb2":function(n,t,e){"use strict";var a=e("79a3"),c=e.n(a);c.a},"5ec3":function(n,t,e){"use strict";e.r(t);var a=e("fc7e"),c=e.n(a);for(var u in a)["default"].indexOf(u)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(u);t["default"]=c.a},"79a3":function(n,t,e){},9356:function(n,t,e){"use strict";e.d(t,"b",(function(){return a})),e.d(t,"c",(function(){return c})),e.d(t,"a",(function(){}));var a=function(){var n=this.$createElement;this._self._c},c=[]},aaa3:function(n,t,e){"use strict";e.r(t);var a=e("9356"),c=e("5ec3");for(var u in c)["default"].indexOf(u)<0&&function(n){e.d(t,n,(function(){return c[n]}))}(u);e("0cb2");var r=e("828b"),f=Object(r["a"])(c["default"],a["b"],a["c"],!1,null,"35910c3e",null,!1,a["a"],void 0);t["default"]=f.exports},fc7e:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={name:"search",data:function(){return{}},props:{name:{type:String,default:""}},methods:{handleSearch:function(){n.switchTab({url:"/pages/search/search"})}}};t.default=e}).call(this,e("df3c")["default"])}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/search2-create-component',
{
'components/search2-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("4d80"))
__webpack_require__('df3c')['createComponent'](__webpack_require__("aaa3"))
})
},
[['components/search2-create-component']]

View File

@ -1 +1 @@
<view class="serachBox data-v-5e260652"><view class="serach-box data-v-5e260652"><view class="searchInput data-v-5e260652"><view data-event-opts="{{[['tap',[['handleSearch',['$event']]]]]}}" class="search-wrap _div data-v-5e260652" bindtap="__e"><text class="data-v-5e260652">搜索食材...</text></view></view><view class="searchBtn data-v-5e260652"><view data-event-opts="{{[['tap',[['handleSearch',['$event']]]]]}}" bindtap="__e" class="data-v-5e260652">搜索</view></view></view></view>
<view data-event-opts="{{[['tap',[['handleSearch',['$event']]]]]}}" class="search data-v-35910c3e" bindtap="__e"><input type="text" placeholder="{{name}}" class="data-v-35910c3e"/><image src="/static/28.png" class="data-v-35910c3e"></image></view>

Some files were not shown because too many files have changed in this diff Show More