Commit 2218e3d8 authored by 小耗子's avatar 小耗子

修改小程序查看步数巨鹿

parent d4981e80
......@@ -3,12 +3,12 @@
*/
// export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wx.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
// export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名
export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss
export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析
export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
export const MALL_ID ="169782111100588";
export const COMPANY_ID ="741";
\ No newline at end of file
export const MALL_ID ="106975910000477";
export const COMPANY_ID ="999999998";
\ No newline at end of file
......@@ -54,7 +54,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wxf462b300a28539ec",
"appid" : "wx60c6530c49c52ff7",
"setting" : {
"urlCheck" : false,
"minified" : false,
......
......@@ -53,8 +53,18 @@
"enablePullDownRefresh": false
}
},
{
"path" : "pages/h5/walkingRecord",
"style" :
{
"navigationBarTitleText": "步数记录",
"enablePullDownRefresh": false
}
}
],
"subPackages":[],
"tabBar": {
......
<template>
<view>
<u-sticky bgColor="#fff">
<u-tabs :activeStyle="{color: '#61b077'}" lineColor="#61b077" @click="clickTime" :list="tabsList"
:scrollable="false">
</u-tabs>
</u-sticky>
<view class="record-ul p-l-30 p-r-30">
<view class="record-li sh-flex sh-flex-sb" v-for="(item,i) in dataList" :key="i">
<text>{{item.DateStr}}</text>
<text> {{item.RunNumTotal}}</text>
</view>
<view class="noMore">
<u-loadmore v-show="noMore" :marginTop="10" :status="loadStatus" />
</view>
</view>
</view>
</template>
<script>
import http from '@/shopro/request/index';
export default {
data() {
return {
tabsList: [{
name: '',
}, {
name: '',
}, {
name: '季度'
}, {
name: '半年'
}, {
name: ''
}],
dataList: [],
params: {
pageNo: 1,
pageSize: 20,
groupType: 1
},
lastPage: 1,
loadStatus: 'loadmore', //加载
isEmpty: false, //是否为空
noMore: false, //没用更多
}
},
methods: {
clickTime(item) {
this.params.groupType = item.index+1;
this.params.pageNo = 1;
this.dataList = [];
this.list()
},
list() {
http("walking.group", this.params).then(res => {
if (res.code == 0) {
this.dataList = [...this.dataList, ...res.data.list];
let totalCount = res.data.total;
this.isEmpty = !this.dataList.length;
this.lastPage = Math.trunc(totalCount / this.params.pageSize) + 1;
if (this.lastPage == this.params.pageNo) {
this.loadStatus = "nomore";
this.noMore = true;
} else {
this.loadStatus = "loadmore";
}
if (!res.data.list.length && !this.dataList.length) {
this.isEmpty = true;
}
} else {
this.dataList = []
this.$u.toast(res.msg);
}
})
}
},
// 触底加载更多
onReachBottom() {
console.log(this.params.pageNo)
console.log(this.lastPage)
if (this.params.pageNo < this.lastPage) {
this.params.pageNo += 1;
this.list();
}
},
mounted() {
this.list()
}
}
</script>
<style lang="scss" scoped>
.record-li {
border-bottom: 1px solid #ddd;
padding: 15px 10px;
text:last-child {
color: #61b077;
}
}
</style>
<template>
<view class="">
<view class="load">
<u-loading-page loading-color="#61b077" color="#61b077" :loading="loading"></u-loading-page>
<u-loading-page loading-color="#61b077" color="#61b077" :loading="loading"></u-loading-page>
</view>
<view class="we-run-page">
<view class="contant">
<image src="../../static/img/run/bg.png" class="bg" mode="widthFix"></image>
<view class="banner">
<image class="img" src="../../static/img/run/banner.png" mode="widthFix"></image>
</view>
<view class="we-run-container">
<image src="../../static/img/run/runBg.png" class="run-logo" mode="widthFix"></image>
<view class="run-step-number">
......@@ -17,31 +20,42 @@
<u-button open-type="getPhoneNumber" @getphonenumber="getInfoPhoneNumber" type="primary"
size="normal" color="#00c791" :plain="true" text="授权查看"></u-button>
</view>
<view v-if="unregistered&&todayNum" class="steps-empower">
<u-button type="primary" size="normal" color="#00c791" :plain="true" text="查看步数记录">
</u-button>
</view>
</view>
<!-- <image src="../../static/img/run/ranking_btn.png" class="ranking_btn" mode="widthFix"></image> -->
<!-- 模块 -->
<view class="runDataExplain">
<view class="explain">使用说明:</view>
<text class="">
您在微信授权登录后如未能正常显示步数,请检查以下微信项目设置无误:
1、微信运动已启用
2、微信运动已设置数据来源。具体见进入微信运动--设置(右上角齿轮图标)-数据来源
</text>
<view class="runData-ul sh-flex">
<view class="runData-li" v-for="(item,index) in iconList" :key="index" @click="lookMode(item.name)">
<image :src="item.img" mode="widthFix" alt=""></image>
<text>{{item.name}}</text>
</view>
</view>
</view>
</view>
<view class="we-run-good" @click="changeTabBar('商城')">
<image class="img" src="../../static/img/run/goodsThing.png" mode="widthFix"></image>
</view>
</view>
<u-tabbar :value="tabBarVal" @change="changeTabBar" :fixed="true" :placeholder="true" activeColor="#00c791"
:safeAreaInsetBottom="true">
<u-tabbar-item text="步数" name="步数">
<image class="u-page__item__slot-icon" slot="active-icon" src="../../static/img/run/tabbar_Index1.png">
<image class="u-page__item__slot-icon" slot="active-icon"
src="../../static/img/run/tabbar_Index1.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/img/run/tabbar_Index.png">
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="../../static/img/run/tabbar_Index.png">
</image>
</u-tabbar-item>
<u-tabbar-item text="商城" name="商城">
<image class="u-page__item__slot-icon" slot="active-icon" src="../../static/img/run/tabbar_shop1.png">
<image class="u-page__item__slot-icon" slot="active-icon"
src="../../static/img/run/tabbar_shop1.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/img/run/tabbar_shop.png">
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="../../static/img/run/tabbar_shop.png">
</image>
</u-tabbar-item>
</u-tabbar>
......@@ -58,7 +72,8 @@
export default {
data() {
return {
loading:true,
loading: true,
unregistered: true,
tabBarVal: '步数',
registerPopup: true,
......@@ -67,7 +82,33 @@
},
tips: '获取',
seconds: 10,
checkSessionStatus: false
checkSessionStatus: false,
iconList:[
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"新闻公告"
},
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"活动投票"
},
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"建议反馈"
},
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"员工调研"
},
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"特卖专区"
},
{
img:require("../../static/img/run/tabbar_shop1.png"),
name:"兑换奖励"
}
]
}
},
computed: {
......@@ -101,16 +142,16 @@
},
async authAndWeRun() {
let auth = await this.authCheck();
console.log("调用authcheck的值"+auth)
console.log("调用authcheck的值" + auth)
this.loading = false;
if (auth == 0) {
let runData = await this.getWeRunDataFn();
console.log("调用this.loading的值"+this.loading)
console.log("调用this.loading的值" + this.loading)
runData && (this.unregistered = true);
} else if (auth == 2001) {
this.unregistered = false;
} else if (auth == 2001) {
this.unregistered = false;
}
console.log("调用this.loading的值"+this.loading)
console.log("调用this.loading的值" + this.loading)
},
async loginSession() {
let token = uni.getStorageSync('token');
......@@ -131,7 +172,7 @@
if (this.checkSessionStatus && token) {
this.loading = true;
let token = uni.getStorageSync('token');
console.log("token的值===================="+token)
console.log("token的值====================" + token)
this.authAndWeRun();
} else {
// session 不存在,调用login。userInfo 。更新session
......@@ -143,26 +184,26 @@
let userInfo = that.getUserInfo(info.code);
userInfo.then(res => {
that.authCheck().then(checkCode => {
console.log("处理lll"+checkCode)
console.log("处理lll" + checkCode)
if (checkCode == 0) {
that.unregistered = true;
that.getWeRunDataFn().then(runData => {
})
}else if(checkCode == 2001){
} else if (checkCode == 2001) {
that.unregistered = false;
}
})
})
},
fail:function(err){
fail: function(err) {
console.log(err)
uni.showToast({
title: err,
duration: 2000,
icon:'none'
icon: 'none'
});
}
})
}
......@@ -184,7 +225,14 @@
that.loginSession()
}
})
},
// 查看模块
lookMode(name) {
if(name =='特卖专区'){
this.changeTabBar('商城');
}else{
this.$u.toast("此功能暂未启用,敬请期待");
}
}
},
onHide() {},
......@@ -195,12 +243,12 @@
this.getAuth();
},
onReady() {
},
onShareAppMessage(res){
return {
// title: '微信步数',
path: 'pages/index/index'
onShareAppMessage(res) {
return {
// title: '微信步数',
path: 'pages/index/index'
}
}
}
......@@ -209,7 +257,7 @@
// .load::v-deep .vue-ref{
// z-index: 1;
// }
.we-run-page {
background-color: #fff;
......@@ -222,9 +270,21 @@
width: 100%;
}
.banner {
position: absolute;
top: 20rpx;
text-align: center;
width: 100%;
height: 200rpx;
.img{
width: 90%;
border-radius: 20rpx;
}
}
.we-run-container {
position: absolute;
top: 250rpx;
top: 310rpx;
text-align: center;
width: 100%;
......@@ -257,16 +317,27 @@
font-size: 20rpx;
}
}
.runDataExplain{
.explain{
font-weight: bold;
.runDataExplain {
width: 75%;
margin: 20px auto;
.runData-ul{
flex: 1;
flex-flow: wrap;
justify-content: center;
align-items: center;
}
.runData-li{
width: 33.33%;
margin-bottom:20rpx ;
image{
width: 80rpx;
display: block;
margin: 0 auto;
margin-bottom:20rpx ;
}
}
color: #D7D7D7;
text-align: left;
width: 75%;
margin:20px auto;
line-height: 42rpx;
}
.ranking_btn {
......@@ -274,6 +345,12 @@
height: 120rpx;
}
}
.we-run-good{
position: absolute;
bottom: 200rpx;
transform: translateX(-50%);
left: 50%;
}
}
.registre-popup {
......
......@@ -45,8 +45,12 @@ export default {
method: "get"
}
},
index:{
walking:{
group:{
url:'mall/miniProgram/group',
auth: true,
method: "get"
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment