This commit is contained in:
2022-01-14 13:54:15 +08:00
15 changed files with 834 additions and 800 deletions

View File

@@ -16,7 +16,6 @@ import { request } from '../index'
* @Date: 2022-01-12 11:08:11 * @Date: 2022-01-12 11:08:11
*/ */
const recordsHealth = (data) => { const recordsHealth = (data) => {
console.log(data, 'camsji///////////')
return request({ return request({
url: 'health/records', url: 'health/records',
method: "POST", method: "POST",

View File

@@ -167,7 +167,6 @@ export default {
let scrollLen = ( let scrollLen = (
Number(scrollLeft / (this.maginL + 2)) + this.scrollStart Number(scrollLeft / (this.maginL + 2)) + this.scrollStart
).toFixed(1); ).toFixed(1);
console.log(typeof scrollLen);
this.scrollLeftInit = this.scrollLeftInit =
(scrollLen - this.scrollStart) * (this.maginL + 2); (scrollLen - this.scrollStart) * (this.maginL + 2);
this.$emit("scroll", scrollLen); this.$emit("scroll", scrollLen);

View File

5
package-lock.json generated
View File

@@ -172,6 +172,11 @@
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
}, },
"moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"randombytes": { "randombytes": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",

1563
pages.json

File diff suppressed because it is too large Load Diff

View File

@@ -420,7 +420,6 @@ export default {
this.sexShow = false; this.sexShow = false;
this.birthdayShow = true; this.birthdayShow = true;
this.dateShow = true; this.dateShow = true;
console.log(this.percentplan1, this.sex);
}, },
// 年龄-------------确认选择了出生年月日 // 年龄-------------确认选择了出生年月日
@@ -667,7 +666,7 @@ export default {
margin-top: $margin * 2; margin-top: $margin * 2;
view { view {
background-color: rgba($color: $main-color, $alpha: 0.5); background-color: rgba($color: $main-color, $alpha: 0.5);
color: $text-color; color: white;
font-size: $title-size; font-size: $title-size;
font-weight: bold; font-weight: bold;
padding: $padding * 0.6 $padding * 3; padding: $padding * 0.6 $padding * 3;

View File

@@ -44,6 +44,10 @@
</view> </view>
</view> </view>
</view> </view>
<view @click="$Router.push({name: 'Record'})">
临时记录
</view>
</block> </block>
</view> </view>
</template> </template>

View File

@@ -4,8 +4,8 @@
<view class="status-main"> <view class="status-main">
<view class="helloe">欢迎使用ZH健康</view> <view class="helloe">欢迎使用ZH健康</view>
<view class="btns"> <view class="btns">
<view class="btns-item" @click="$Router.push({name: 'signIndex'})"><image src="@/static/icon/sign-icon.gif" mode="widthFix"></image></view> <view class="btns-item" @click="onBtn('signIndex')"><image src="@/static/icon/sign-icon.gif" mode="widthFix"></image></view>
<view class="btns-item show" @click="$Router.push({name: 'noticeIndex'})"><uni-icons custom-prefix="iconfont" type="icon-pinglun" size="25"></uni-icons></view> <view class="btns-item show" @click="onBtn('noticeIndex')"><uni-icons custom-prefix="iconfont" type="icon-pinglun" size="25"></uni-icons></view>
</view> </view>
</view> </view>
</view> </view>
@@ -29,9 +29,13 @@
</view> </view>
</view> </view>
</u-scroll-list> </u-scroll-list>
<!-- 排行榜 -->
<view class="img-card" @click="onBtn('Record')">
<image src="@/static/dev/img-02.png" mode="widthFix"></image>
</view>
<!-- 话题广场 --> <!-- 话题广场 -->
<view class="new-box"> <view class="new-box">
<view class="title">话题广场</view><view class="more" @click="$Router.push({name: 'topicIndex'})">更多分类</view> <view class="title">话题广场</view><view class="more" @click="$Router.push({name: 'topicIndex'})">更多</view>
<oct-topic <oct-topic
:lists="topicArr" :lists="topicArr"
@onTopic="$Router.push({ name: 'topicDetails', params: {id: $event.topic_id }})" @onTopic="$Router.push({ name: 'topicDetails', params: {id: $event.topic_id }})"
@@ -44,6 +48,7 @@
<script> <script>
import { index } from '@/apis/interfaces/topic' import { index } from '@/apis/interfaces/topic'
import userAuth from '@/public/userAuth'
export default { export default {
data() { data() {
return { return {
@@ -63,6 +68,14 @@
this.topicArr = res.topics this.topicArr = res.topics
}) })
}, },
onBtn(name){
if(this.$store.state.token === ''){
const Auth = new userAuth()
Auth.Login()
return
}
this.$Router.push({name})
}
} }
}; };
</script> </script>

View File

@@ -125,7 +125,7 @@
{{ item.price }} {{ item.price }}
</view> </view>
</view> </view>
<view class="item-btn"> <view class="item-btn" @click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
查看商品 查看商品
</view> </view>
</view> </view>

View File

@@ -141,11 +141,7 @@
<script> <script>
import arprogress from "@/components/ar-circle-progress/index.vue"; import arprogress from "@/components/ar-circle-progress/index.vue";
import goodsList from "@/components/foods"; import goodsList from "@/components/foods";
import { import { plans, editHealthFoods, delHealthFoods } from "@/apis/interfaces/foods.js";
plans,
editHealthFoods,
delHealthFoods,
} from "@/apis/interfaces/foods.js";
import moment from "moment"; import moment from "moment";
import addFoods from "@/components/add-goods-template/add-goods-template"; import addFoods from "@/components/add-goods-template/add-goods-template";
export default { export default {

View File

@@ -52,7 +52,7 @@
{{ item.price }} {{ item.price }}
</view> </view>
</view> </view>
<view class="item-btn"> <view class="item-btn" @click="$Router.push({ name: 'StoreGoods', params: {id: item.goods_id}})">
查看商品 查看商品
</view> </view>
</view> </view>

View File

@@ -37,16 +37,16 @@
<view class="btn" @click="openVip">开通</view> <view class="btn" @click="openVip">开通</view>
</view> </view>
<!-- 健康数据 --> <!-- 健康数据 -->
<view class="health-flex"> <view class="health-flex" v-if="userInfo.has_record">
<view class="health-flex-item"> <view class="health-flex-item">
<view class="title"> <view class="title">
体脂率 体脂率
<image class="icon" src="@/static/user/icon_04.png" mode="widthFix"></image> <image class="icon" src="@/static/user/icon_04.png" mode="widthFix"></image>
</view> </view>
<view class="num"> <view class="num">
22<text>%</text> {{userInfo.record.fat.fat}}<text>%</text>
</view> </view>
<view class="hith">处于正常范围</view> <view class="hith">{{userInfo.record.fat.text}}</view>
</view> </view>
<view class="health-flex-item"> <view class="health-flex-item">
<view class="title"> <view class="title">
@@ -54,9 +54,9 @@
<image class="icon" src="@/static/user/icon_05.png" mode="widthFix"></image> <image class="icon" src="@/static/user/icon_05.png" mode="widthFix"></image>
</view> </view>
<view class="num"> <view class="num">
78.0<text>KG</text> {{userInfo.record.weight.weight}}<text>KG</text>
</view> </view>
<view class="hith">你上周减少1.2kg</view> <view class="hith">{{userInfo.record.weight.text}}</view>
</view> </view>
</view> </view>
<!-- 订单 --> <!-- 订单 -->
@@ -135,6 +135,7 @@
getInfo(){ getInfo(){
if(this.$store.state.token === '') return if(this.$store.state.token === '') return
info().then(res => { info().then(res => {
console.log(res)
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.nickname title: res.nickname
}) })
@@ -186,7 +187,12 @@
// 个人档案 // 个人档案
onFiles(){ onFiles(){
if(this.isLogin()){ if(this.isLogin()){
this.$Router.push({name: 'indexFiles'}) if(!this.userInfo.has_record){
console.log('未完善资料')
this.$Router.push({name: 'EssentialInfo'})
return
}
this.$Router.push({name: 'UserFiles'})
} }
}, },
// 按钮导航 // 按钮导航
@@ -206,6 +212,10 @@
}, },
// 退出登录 // 退出登录
logOut(){ logOut(){
this.userInfo = {
nickname: "",
avatar : ""
}
this.$store.commit('setToken', '') this.$store.commit('setToken', '')
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

BIN
static/dev/img-02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB