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 // launchtypelocalremote, localremote
"version": "0.0", "version": "0.0",
"configurations": [{ "configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" : "default" :
{ {
"launchtype" : "local" "launchtype" : "local"

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

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

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<image src="@/static/bg.png" mode="" style="width: 100%;height: 928rpx;"></image> <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"> <view class="xuzou">
<uni-icons type="left" size="18"></uni-icons> <uni-icons type="left" size="18"></uni-icons>
<text class="title">人脸录入</text> <text class="title">人脸录入</text>
@ -40,10 +40,28 @@
url: "", url: "",
path: "", path: "",
yrenlianlist:[], yrenlianlist:[],
jqrllist:[] jqrllist:[],
userxixin:{}
} }
}, },
onShow() {
this.memberInfo()
},
methods: { 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(){ pais(){
this.$refs.popup.open('center') this.$refs.popup.open('center')
this.chooseImage() this.chooseImage()
@ -61,16 +79,35 @@
success: (res) => { success: (res) => {
console.log('tjlist',JSON.parse(res.data)); console.log('tjlist',JSON.parse(res.data));
var data=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=>{ this.$api.memberFace({face_id:data.data.file_id}).then(res=>{
if(res.code=='200'){ if(res.code=='200'){
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: '上传成功', 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 = ""; this.url = "";
}, },
previous() { 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)"> <view class="btbox" v-for="(item,index) in viplist" :key="index" @click="taochan(item)">
<image :src="item.img.url" mode="" class="btimg"></image> <image :src="item.img.url" mode="" class="btimg"></image>
<view class="bttitle">{{item.name}}</view> <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"> <view class="btwzjg">
<text class="btwzjg1">{{item.price}}</text> <text class="btwzjg1">{{item.price}}</text>
<text class="btwzjg2">{{item.original_price}}</text> <text class="btwzjg2">{{item.original_price}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -81,15 +82,28 @@
latitude:'', latitude:'',
longitude:'', longitude:'',
tuijianlist:[], tuijianlist:[],
iswanjie:false,
shoujidingwei:true
} }
}, },
onShareAppMessage() {
return {
title: '运动湾24小时健身',
path: '/pages/index/index'
}
},
onShow() { onShow() {
this.viplist=[]
this.cardList(1) this.cardList(1)
// this.storeList(1) // this.storeList(1)
this.getLocation() this.getLocation()
}, },
onReachBottom(){
if(!this.iswanjie){
this.cardList(this.page+1)
}
},
methods: { methods: {
handleNavigation(i) { handleNavigation(i) {
uni.openLocation({ uni.openLocation({
@ -98,7 +112,6 @@
name:i.name, name:i.name,
address: i.address, address: i.address,
success: function(res) { success: function(res) {
console.log('打开系统位置地图成功')
}, },
fail: function(error) { fail: function(error) {
console.log(error) console.log(error)
@ -107,7 +120,7 @@
}, },
numberCheck(){ numberCheck(){
this.$api.numberCheck({number:this.number}).then(res=>{ this.$api.numberCheck({number:this.number}).then(res=>{
if(res.data.code==200){ if(res.code==200){
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: res.data.msg, title: res.data.msg,
@ -123,6 +136,7 @@
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: function (res) { success: function (res) {
that.shoujidingwei=true
that.latitude= res.latitude; that.latitude= res.latitude;
that.longitude= res.longitude; that.longitude= res.longitude;
that.$api.nearStore({latitude:that.latitude,longitude:that.longitude,limit:1}).then(res=>{ that.$api.nearStore({latitude:that.latitude,longitude:that.longitude,limit:1}).then(res=>{
@ -134,15 +148,45 @@
}) })
}, },
fail: function (error) { 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){ cardList(page){
this.$api.cardList({page:page}).then(res=>{ this.$api.cardList({page:page}).then(res=>{
console.log(123,res); let arr = res.data.list
this.viplist=res.data.list this.viplist = [...this.viplist, ...arr]
if(this.viplist.length>=res.data.total){
this.iswanjie=true
}
}) })
}, },
storeList(page){ storeList(page){
@ -152,7 +196,7 @@
}, },
makePhoneCall(e){ makePhoneCall(e){
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: e // phoneNumber: e
}); });
}, },
mendianlist() { mendianlist() {
@ -161,6 +205,7 @@
}) })
}, },
tuanquan() { tuanquan() {
this.number=''
this.$refs.popup.open('center') this.$refs.popup.open('center')
}, },
close() { close() {
@ -171,9 +216,16 @@
var that=this var that=this
var tuijianlist=JSON.stringify(that.tuijianlist[0]) var tuijianlist=JSON.stringify(that.tuijianlist[0])
var item=JSON.stringify(i) var item=JSON.stringify(i)
if(that.shoujidingwei){
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/order?tuijianlist=${tuijianlist}&item=${item}` url: `/pages/order/order?tuijianlist=${tuijianlist}&item=${item}`
}) })
}else{
uni.reLaunch({
url: '/pages/index/index'
});
}
}, },
} }
} }
@ -252,6 +304,7 @@
.btboxs { .btboxs {
display: flex; display: flex;
flex-wrap: wrap;
} }
.btwz { .btwz {

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

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

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

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

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

Loading…
Cancel
Save