LGX 3 months ago
parent ed5f67935a
commit 139342e4b8
  1. 4
      .hbuilderx/launch.json
  2. 7
      api/request.js
  3. 37
      pages.json
  4. 49
      pages/face/face.vue
  5. 71
      pages/index/index.vue
  6. 24
      pages/login/login.vue
  7. 15
      pages/mendainlist/mendainlist.vue
  8. 19
      pages/order/order.vue
  9. 20
      pages/user/index.vue
  10. 8
      pages/user/portrait/portrait.vue

@ -2,6 +2,10 @@
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"

@ -3,6 +3,8 @@ let baseUrl = 'https://bodybuilding.bsdong.cn/';
//https://console-docs.apipost.cn/preview/077df998e6b8e954/a3d90a650bdbe292
Vue.prototype.$baseUrl = baseUrl;
// 当前是否显示modal
let loginModal = false
export function request(prams) {
return new Promise((resolve, reject) => {
let url;
@ -19,6 +21,8 @@ export function request(prams) {
if (res.data.code == 200){
resolve(res.data);
}else if(res.data.code == 402){
if(!loginModal){
loginModal = true
uni.showModal({
title: "温馨提示",
content: "当前账号已过期,是否重新登录",
@ -29,8 +33,11 @@ export function request(prams) {
uni.navigateTo({
url: "/pages/login/login"
})
loginModal = false
}
})
}
} else {
reject(res.data);
uni.showToast({

@ -1,19 +1,18 @@
{
"pages": [
{
"path": "pages/login/login",
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/index/index",
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "首页",
"navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#fff",
"navigationStyle": "custom"
}
},
{
@ -25,48 +24,41 @@
},
{
"path": "pages/user/userxy/userxy",
"style" :
{
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/user/portrait/portrait",
"style" :
{
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/mendainlist/mendainlist",
"style" :
{
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": true
"navigationStyle": "custom"
}
},
{
"path": "pages/order/order",
"style" :
{
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/face/face",
"style" :
{
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/auth/auth",
"style" :
{
"style": {
"navigationBarTitleText": ""
}
}
@ -94,7 +86,6 @@
"navigationBarTextStyle": "#222222",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8A617",
"backgroundColor": "#55ff00",
"app-plus": {
"background": "#efeff4"
}

@ -1,7 +1,7 @@
<template>
<view>
<image src="@/static/bg.png" mode="" style="width: 100%;height: 928rpx;"></image>
<view class="top" @click="previous">
<view class="top" @click="fanhui">
<view class="xuzou">
<uni-icons type="left" size="18"></uni-icons>
<text class="title">人脸录入</text>
@ -40,10 +40,28 @@
url: "",
path: "",
yrenlianlist:[],
jqrllist:[]
jqrllist:[],
userxixin:{}
}
},
onShow() {
this.memberInfo()
},
methods: {
fanhui(){
uni.navigateBack()
},
memberInfo() {
this.$api.memberInfo().then(res => {
this.userxixin = res.data
console.log('this.userxixin',this.userxixin);
if(this.userxixin.face_id!=0){
uni.switchTab({
url:'/pages/index/index'
})
}
})
},
pais(){
this.$refs.popup.open('center')
this.chooseImage()
@ -61,16 +79,35 @@
success: (res) => {
console.log('tjlist',JSON.parse(res.data));
var data=JSON.parse(res.data)
if(data.code==200){
uni.showToast({
icon: "none",
title: '上传成功',
duration: 5000,
});
this.$api.memberFace({face_id:data.data.file_id}).then(res=>{
if(res.code=='200'){
uni.showToast({
icon: "none",
title: '上传成功',
duration: 3000
duration: 5000,
});
this.$refs.popup.close('center')
setTimeout(function(){
uni.switchTab({
url:'/pages/user/index'
})
},1000)
}
})
}else{
uni.showToast({
icon: "none",
title: data.msg,
duration: 5000,
});
}
}
});
@ -104,7 +141,9 @@
this.url = "";
},
previous() {
uni.navigateBack()
uni.switchTab({
url:'/pages/index/index'
})
},
}
}

@ -42,10 +42,11 @@
<view class="btbox" v-for="(item,index) in viplist" :key="index" @click="taochan(item)">
<image :src="item.img.url" mode="" class="btimg"></image>
<view class="bttitle">{{item.name}}</view>
<view class="btwz">期限{{item.validity_day}}</view>
<view class="btwz" v-if="item.validity_day>0">期限{{item.validity_day}}</view>
<view class="btwz" v-if='item.validity_num>0'>次数{{item.validity_num}}</view>
<view class="btwzjg">
<text class="btwzjg1">{{item.price}}</text>
<text class="btwzjg2">{{item.original_price}}</text>
<text class="btwzjg2">{{item.original_price}}</text>
</view>
</view>
</view>
@ -81,15 +82,28 @@
latitude:'',
longitude:'',
tuijianlist:[],
iswanjie:false,
shoujidingwei:true
}
},
onShareAppMessage() {
return {
title: '运动湾24小时健身',
path: '/pages/index/index'
}
},
onShow() {
this.viplist=[]
this.cardList(1)
// this.storeList(1)
this.getLocation()
},
onReachBottom(){
if(!this.iswanjie){
this.cardList(this.page+1)
}
},
methods: {
handleNavigation(i) {
uni.openLocation({
@ -98,7 +112,6 @@
name:i.name,
address: i.address,
success: function(res) {
console.log('打开系统位置地图成功')
},
fail: function(error) {
console.log(error)
@ -107,7 +120,7 @@
},
numberCheck(){
this.$api.numberCheck({number:this.number}).then(res=>{
if(res.data.code==200){
if(res.code==200){
uni.showToast({
icon: "none",
title: res.data.msg,
@ -123,6 +136,7 @@
uni.getLocation({
type: 'wgs84',
success: function (res) {
that.shoujidingwei=true
that.latitude= res.latitude;
that.longitude= res.longitude;
that.$api.nearStore({latitude:that.latitude,longitude:that.longitude,limit:1}).then(res=>{
@ -134,15 +148,45 @@
})
},
fail: function (error) {
console.error('获取位置失败:', error);
that.shoujidingwei=false
uni.getSystemInfo({
success: function (res) {
console.log(998,);
if(!res.locationEnabled){
uni.showModal({
icon: "none",
title: '手机定位未开启',
duration: 3000
})
}else{
uni.showModal({
title: '获取位置',
content: '小程序定位未开启是否开启',
success: function (res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(9998,res.authSetting)
}
});
} else if (res.cancel) {
}
}
});
}
}
})
}
});
},
cardList(page){
this.$api.cardList({page:page}).then(res=>{
console.log(123,res);
this.viplist=res.data.list
let arr = res.data.list
this.viplist = [...this.viplist, ...arr]
if(this.viplist.length>=res.data.total){
this.iswanjie=true
}
})
},
storeList(page){
@ -152,7 +196,7 @@
},
makePhoneCall(e){
uni.makePhoneCall({
phoneNumber: e //
phoneNumber: e
});
},
mendianlist() {
@ -161,6 +205,7 @@
})
},
tuanquan() {
this.number=''
this.$refs.popup.open('center')
},
close() {
@ -171,9 +216,16 @@
var that=this
var tuijianlist=JSON.stringify(that.tuijianlist[0])
var item=JSON.stringify(i)
if(that.shoujidingwei){
uni.navigateTo({
url: `/pages/order/order?tuijianlist=${tuijianlist}&item=${item}`
})
}else{
uni.reLaunch({
url: '/pages/index/index'
});
}
},
}
}
@ -252,6 +304,7 @@
.btboxs {
display: flex;
flex-wrap: wrap;
}
.btwz {

@ -81,11 +81,12 @@
avatar:''
},
success: (res) => {
console.log(7871, res)
if( res.data.code==200){
// token
uni.setStorageSync('token', res.data.data.userToken)
uni.reLaunch({
url: "/pages/index/index"
uni.navigateTo({
url: "/pages/face/face"
})
}else{
uni.showToast({
@ -93,9 +94,22 @@
title: res.data.msg,
duration: 3000
});
const that = this;
uni.login({
success(res) {
console.log(787, res)
that.wxcode = res.code
}
})
}
},
})
}else{
const that = this;
uni.login({
success(res) {
console.log(787, res)
that.wxcode = res.code
}
})
}
@ -157,7 +171,7 @@
.btn {
width: 630rpx;
height: 98rpx;
background: #0D5DC9;
background: #F8A617;
box-shadow: 0rpx 4rpx 13rpx 0rpx rgba(14, 94, 157, 0.4);
border-radius: 49rpx;
font-family: Alibaba PuHuiTi;

@ -14,7 +14,7 @@
<view class="mddz1wz">{{item.name}}</view>
</view>
<view class="mddz2">
<view class="" @click="handleNavigation(item)">
<view class="mdleft" @click="handleNavigation(item)">
<image class="mddz1img1" src="@/static/定位1.png" mode=""></image>
<text class="dz">地址{{item.address}}</text>
</view>
@ -41,10 +41,11 @@
this.isshouye=e.item
},
onShow() {
this.mendainlist=[]
this.storeList(this.page)
},
onReachBottom(){
if(!iswanjie){
if(!this.iswanjie){
this.storeList(this.page+1)
}
},
@ -80,15 +81,14 @@
uni.navigateBack()
},
storeList(page) {
this.mendainlist=[]
this.$api.storeList({
page: page
}).then(res => {
let arr = res.data.list
if(arr.length<res.data.total){
this.mendainlist = [...this.mendainlist, ...arr]
if(this.mendainlist.length>=res.data.total){
this.iswanjie=true
}
this.mendainlist = [...this.mendainlist, ...arr]
})
},
}
@ -96,6 +96,9 @@
</script>
<style scoped>
.mdleft{
width: 550rpx;
}
.top {
display: flex;
position: absolute;
@ -151,7 +154,7 @@
.mddz {
width: 680rpx;
height: 152rpx;
/* height: 152rpx; */
background: #FFFFFF;
box-shadow: 0rpx 3rpx 9rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 20rpx;

@ -34,7 +34,11 @@
<view class="taoctitle1wz">{{vipxinxi.name}}</view>
<view class="taoctitle1q">{{vipxinxi.price}}</view>
</view>
<view class="smwz">期限{{vipxinxi.validity_day}}</view>
<view class="taoctitle2">
<view class="smwz" v-if='vipxinxi.validity_num>0'>次数{{vipxinxi.validity_num}}</view>
<view class="smwz" v-if='vipxinxi.validity_day>0'>期限{{vipxinxi.validity_day}}</view>
<view class="smwz hengxian">原价{{vipxinxi.original_price}}</view>
</view>
<view class="smwz">说明{{vipxinxi.introduce}}</view>
<view class="smwz">限购{{vipxinxi.buy_limit}}</view>
</view>
@ -134,7 +138,7 @@
paySign:res.data.paySign,
success: function (res) {
console.log('success:' + JSON.stringify(res));
uni.navigateTo({
uni.switchTab({
url: '/pages/user/index'
})
},
@ -152,6 +156,9 @@
</script>
<style scoped>
.hengxian{
text-decoration-line: line-through;
}
.xy {
color: #F8A617;
}
@ -203,6 +210,7 @@
background: #FFFFFF;
display: flex;
justify-content: space-between;
border-radius: 20rpx;
}
.zfwi {
@ -255,7 +263,10 @@
justify-content: space-between;
margin-top: 36rpx;
}
.taoctitle2{
display: flex;
justify-content: space-between;
}
.taoctitle {
font-family: PingFang SC;
font-weight: bold;
@ -265,7 +276,7 @@
.taoc {
width: 650rpx;
height: 322rpx;
/* height: 322rpx; */
background: #FFFFFF;
box-shadow: 0rpx 3rpx 9rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 20rpx;

@ -15,7 +15,7 @@
</view>
<view class="renlbtn" @click="face(userxixin.face_id)">{{userxixin.face_id!=0?'已认证':'人脸录入'}}</view>
</view>
<view class="huiy">
<view class="huiy" v-if="viplist.length>0">
<view class="" v-for="(item,index) in viplist" :key="index" style="height: 223rpx;">
<image class="huiyimg" src="@/static/hbg.png" mode=""></image>
<view class="huiybox">
@ -37,7 +37,13 @@
</view>
</view>
</view>
</view>
<view class="huiy" v-else>
<image class="huiyimg" src="@/static/hbg.png" mode=""></image>
<view class="huiybox">
<image class="huiyboximg" src="@/static/huangguan.png" mode=""></image>
<view class="huiywz">会员套餐</view>
</view>
</view>
<!-- <button open-type="chooseAvatar" @chooseavatar='chooseAvatar'>获取头像</button> -->
@ -55,7 +61,12 @@
},
onShow() {
this.memberInfo()
this.memberCardList()
},
onShareAppMessage() {
return {
title: '运动湾24小时健身',
path: '/pages/uesr/index'
}
},
methods: {
chooseAvatar(e) {
@ -71,6 +82,7 @@
this.$api.memberInfo().then(res => {
this.userxixin = res.data
})
this.memberCardList()
},
memberCardList(page) {
this.$api.memberCardList(page).then(res => {
@ -112,7 +124,7 @@
.huiywz {
margin-left: 22rpx;
margin-top: 20rpx;
margin-top: 10rpx;
}
.huiyxx {

@ -28,9 +28,7 @@
</uni-col>
</uni-row>
</view>
<view class="subbtn" @click="subbtn">
确认
</view>
<button class="subbtn" @click="subbtn">确认</button>
<view class="fottuichu" @click="outLogin">退出登录</view>
</view>
</template>
@ -157,7 +155,7 @@
.fottuichu {
width: 702rpx;
height: 80rpx;
background: #999999;
// background: #999999;
font-family: PingFang SC;
font-weight: 500;
font-size: 30rpx;
@ -185,7 +183,7 @@
color: #fff;
width: 660rpx;
height: 98rpx;
background: #0D5DC9;
background: #F8A617;
border-radius: 49rpx;
}

Loading…
Cancel
Save