Merge branch 'master' of https://git.yuzhankeji.cn/TmOct5/ZhHealth into master

This commit is contained in:
zhangmanman
2022-01-14 10:22:09 +08:00
12 changed files with 501 additions and 227 deletions

57
App.vue
View File

@@ -1,8 +1,63 @@
<script> <script>
import { getVersions } from './apis/interfaces/versions'
import im from '@/public/im' import im from '@/public/im'
export default { export default {
onLaunch: function() { onLaunch: function() {
// im.imInit() //#ifdef APP-PLUS
// 获取系统版本号
getVersions({
platform: plus.os.name,
version : plus.runtime.versionCode
}).then(res => {
if(res.update){
uni.showModal({
title: "更新提示",
content: res.note || '版本更新信息',
confirmText: "更新",
success: modalRes => {
if (modalRes.confirm) {
if (plus.os.name == "Android") {
uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon : 'none'
})
uni.downloadFile({
url : res.info.download,
success : apkPick=> {
plus.runtime.install(apkPick.tempFilePath, '', installRES => {
// 安装完成用于提示新版本引导,暂时无用
}, installERR => {
// 安装失败
})
},
fail(err){
uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试',
icon : 'none'
})
}
})
// plus.runtime.openURL(res.info.download, err => {
// console.log(err)
// }, 'com.android.browser');
} else{
uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon : 'none'
})
}
}
}
})
}
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon : 'none'
})
})
//#endif
} }
} }
</script> </script>

View File

@@ -33,7 +33,6 @@ const meals = (id, categoryId) => {
// 商品列表 // 商品列表
const lists = data => { const lists = data => {
console.log(data)
return request({ return request({
url: 'mall/goods', url: 'mall/goods',
data data

View File

@@ -131,7 +131,20 @@
"style": { "style": {
"navigationBarTitleText": "商品", "navigationBarTitleText": "商品",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": true "enablePullDownRefresh": true,
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleSize": "16",
"buttons": [{
"float": "right",
"text": "\ue603",
"fontSrc": "/static/iconfont.ttf",
"color": "#000",
"fontSize": "20px"
}]
}
}
} }
}, { }, {
"path": "pages/store/meals", "path": "pages/store/meals",
@@ -237,7 +250,7 @@
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
},{ }, {
"path": "pages/im/index", "path": "pages/im/index",
"name": "IM", "name": "IM",
"style": { "style": {
@@ -261,51 +274,51 @@
} }
} }
} }
},{ }, {
"path": "pages/im/chum", "path": "pages/im/chum",
"name": "ImChum", "name": "ImChum",
"style": { "style": {
"navigationBarTitleText": "好友", "navigationBarTitleText": "好友",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/add", "path": "pages/wallet/add",
"name": "WalletAdd", "name": "WalletAdd",
"style": { "style": {
"navigationBarTitleText": "创建钱包", "navigationBarTitleText": "创建钱包",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/create", "path": "pages/wallet/create",
"name": "WalletCreate", "name": "WalletCreate",
"style": { "style": {
"navigationBarTitleText": "设置密码", "navigationBarTitleText": "设置密码",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/mnemonic", "path": "pages/wallet/mnemonic",
"name": "WalletMnemonic", "name": "WalletMnemonic",
"style": { "style": {
"navigationBarTitleText": "导出助记词", "navigationBarTitleText": "导出助记词",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/validation", "path": "pages/wallet/validation",
"name": "WalletValidation", "name": "WalletValidation",
"style": { "style": {
"navigationBarTitleText": "验证助记词", "navigationBarTitleText": "验证助记词",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/property", "path": "pages/wallet/property",
"name": "WalletProperty", "name": "WalletProperty",
"style": { "style": {
"navigationBarTitleText": "ZH钱包", "navigationBarTitleText": "ZH钱包",
"navigationBarTextStyle":"white", "navigationBarTextStyle": "white",
"app-plus": { "app-plus": {
"titleNView": { "titleNView": {
"backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)", "backgroundImage": "linear-gradient(to right, #34ce98, #22aa98)",
@@ -318,13 +331,13 @@
"fontSize": "20px", "fontSize": "20px",
"background": "rgba(0,0,0,0)" "background": "rgba(0,0,0,0)"
}], }],
"backButton":{ "backButton": {
"background": "rgba(0,0,0,0)" "background": "rgba(0,0,0,0)"
} }
} }
} }
} }
},{ }, {
"path": "pages/service/index", "path": "pages/service/index",
"name": "serviceIndex", "name": "serviceIndex",
"style": { "style": {
@@ -332,7 +345,7 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/service/index", "path": "pages/service/index",
"name": "serviceIndex", "name": "serviceIndex",
"style": { "style": {
@@ -340,28 +353,35 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/service/details", "path": "pages/service/details",
"name": "serviceDetails", "name": "serviceDetails",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},{ }, {
"path": "pages/wallet/privatekey", "path": "pages/wallet/privatekey",
"name": "WalletPrivatekey", "name": "WalletPrivatekey",
"style": { "style": {
"navigationBarTitleText": "钱包私钥", "navigationBarTitleText": "钱包私钥",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/wallet/resetPassword", "path": "pages/wallet/resetPassword",
"name": "ResetPassword", "name": "ResetPassword",
"style": { "style": {
"navigationBarTitleText": "修改钱包密码", "navigationBarTitleText": "修改钱包密码",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/store/search",
"name": "StoreSearch",
"style": {
"navigationBarTitleText": "搜索",
"navigationBarBackgroundColor": "#FFFFFF"
}
}], }],
"tabBar": { "tabBar": {
"borderStyle": "white", "borderStyle": "white",

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="content"> <view class="content">
<block v-if="messageArr.length >= 1"> <block v-if="messageArr.length < 1">
<view class="vertical null-list"> <view class="vertical null-list">
<u-empty <u-empty
icon="http://cdn.uviewui.com/uview/empty/message.png" icon="http://cdn.uviewui.com/uview/empty/message.png"
@@ -17,22 +17,30 @@
<!-- <button type="default">连接</button> --> <!-- <button type="default">连接</button> -->
<!-- <button type="default">发送</button> --> <!-- <button type="default">发送</button> -->
<view v-for="item in 2" :key="item" class="mssage-box"> <view v-for="(item, index) in messageArr" :key="index" class="mssage-box">
<view class="mssage-action" @click="$Router.push({name: 'ImChat'})"> <view class="mssage-action" @click="openChum">
<block v-if="item.cover === ''">
<u-avatar <u-avatar
clsss="mssage-action-cover" clsss="mssage-action-cover"
src="https://cdn.uviewui.com/uview/album/1.jpg"
size="44" size="44"
text="" :text="item.text"
font-size="14" font-size="14"
randomBgColor randomBgColor
></u-avatar> ></u-avatar>
</block>
<block v-else>
<u-avatar
clsss="mssage-action-cover"
:src="item.cover"
size="44"
></u-avatar>
</block>
<view class="mssage-action-content"> <view class="mssage-action-content">
<view class="mssage-header"> <view class="mssage-header">
<view class="header-name">唐明明</view> <view class="header-name">{{item.name}}</view>
<view class="header-time">2021/12/31</view> <view class="header-time">{{item.time}}</view>
</view> </view>
<view class="mssage-msg">消息</view> <view class="mssage-msg">{{item.message}}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -45,7 +53,33 @@
export default { export default {
data() { data() {
return { return {
messageArr : [], messageArr : [
{
cover: 'https://cdn.uviewui.com/uview/album/1.jpg',
name: '班班五月',
message: '咱们进直播间了吗?上课啦~今天教大家【拆解项目背后的逻辑】',
time: '昨天'
},
{
cover: 'https://cdn.uviewui.com/uview/album/4.jpg',
name: '周磊',
message: '[语音]',
time: '周一'
},
{
cover: '',
text: 'S',
name: 'SKY',
message: '谢谢',
time: '2022/1/5'
},
{
cover: 'https://cdn.uviewui.com/uview/album/5.jpg',
name: '俊少',
message: '[语音]',
time: '2022/1/4'
},
],
optionsAction: [ optionsAction: [
{ {
text: '删除', text: '删除',
@@ -58,17 +92,26 @@
}, },
methods:{ methods:{
openChum(){ openChum(){
this.$Router.push({name: 'ImChum'}) uni.showToast({
console.log("好友列表") title: '聊聊系统正在开发中,敬请期待',
icon : 'none'
})
} }
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
switch (e.index){ switch (e.index){
case 1: case 1:
this.openChum() uni.showToast({
title: '聊聊好友系统正在开发中,敬请期待',
icon : 'none'
})
break; break;
case 0: case 0:
console.log("扫码添加好友") uni.showToast({
title: '聊聊扫一扫系统正在开发中,敬请期待',
icon : 'none'
})
break; break;
} }
} }

View File

@@ -1,6 +1,8 @@
<template> <template>
<view class="content"> <view>
<!-- 搜索 --> <!-- 搜索 -->
<u-sticky>
<view class="header ios-top">
<view class="search"> <view class="search">
<view class="search-nav"> <view class="search-nav">
<u-search <u-search
@@ -17,10 +19,10 @@
searchIconColor="#34CE98" searchIconColor="#34CE98"
/> />
</view> </view>
<view class="search-cancel" @click="$router.back(-1)"> <view class="search-cancel" @click="$Router.back()">取消</view>
取消
</view> </view>
</view> </view>
</u-sticky>
<view class="recommend" v-if="listArr == ''"> <view class="recommend" v-if="listArr == ''">
<view class="recommend-title"> <view class="recommend-title">
@@ -123,22 +125,12 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content {
padding-top: calc(var(--status-bar-height) + 120rpx);
overflow: hidden;
}
// 搜索 // 搜索
.search { .header{
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
height: 120rpx;
background-color: white; background-color: white;
@extend .ios-top; .search {
padding: $padding; position: relative;
padding: $padding/2 $padding;
box-sizing: border-box; box-sizing: border-box;
.search-nav { .search-nav {
width: calc(100% - 100rpx); width: calc(100% - 100rpx);
@@ -154,13 +146,13 @@
color: $main-color; color: $main-color;
position: absolute; position: absolute;
right: $padding; right: $padding;
top: $padding; top: $padding/2;
line-height: 80rpx; line-height: 80rpx;
width: 100rpx; width: 100rpx;
text-align: right; text-align: right;
} }
} }
}
.recommend { .recommend {
padding: $padding; padding: $padding;
box-sizing: border-box; box-sizing: border-box;

View File

@@ -5,6 +5,7 @@
<u-tabs <u-tabs
class="tabs" class="tabs"
:list="tabs" :list="tabs"
:current="index"
lineColor="#34CE98" lineColor="#34CE98"
@click="onTabs" @click="onTabs"
sticky sticky
@@ -63,6 +64,7 @@
} }
}, },
mounted() { mounted() {
this.index = this.$Route.query.index
this.getOrder() this.getOrder()
}, },
methods:{ methods:{

View File

@@ -1,5 +1,6 @@
<template> <template>
<view class="content"> <view class="content">
<u-sticky>
<view class="status"> <view class="status">
<view class="top"> <view class="top">
<view class="top-name"> <view class="top-name">
@@ -19,8 +20,9 @@
</view> </view>
</view> </view>
</view> </view>
</u-sticky>
<view class="list"> <view class="list">
<view class="label" v-for="(item, index) in lists" @click="$Router.push({name: 'serviceDetails', params: {id: item.hall_id, title: item.title + ' ' + item.subtitle}})"> <view class="label" v-for="(item, index) in lists" :key="index" @click="$Router.push({name: 'serviceDetails', params: {id: item.hall_id, title: item.title + ' ' + item.subtitle}})">
<view class="labelImg"> <view class="labelImg">
<image :src="item.cover" mode="aspectFill"></image> <image :src="item.cover" mode="aspectFill"></image>
</view> </view>
@@ -94,21 +96,17 @@
} }
.status { .status {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
height: 180rpx;
background-color: white; background-color: white;
padding: $padding; padding: 0 $padding $padding;
box-sizing: border-box; box-sizing: border-box;
border-bottom: $border-color 2rpx solid; border-bottom: $border-color 2rpx solid;
.top { .top {
display: flex; display: flex;
margin-bottom: $margin; margin-bottom: $margin;
@extend .ios-top;
.top-name { .top-name {
font-size: $title-size + 6; font-size: $title-size + 6;
font-weight: bold;
} }
.top-card { .top-card {
font-size: $title-size-m; font-size: $title-size-m;

View File

@@ -41,6 +41,7 @@
<script> <script>
import { goods } from '@/apis/interfaces/store' import { goods } from '@/apis/interfaces/store'
import userAuth from '@/public/userAuth'
export default { export default {
data() { data() {
return { return {
@@ -66,6 +67,11 @@
}) })
}, },
buy(){ buy(){
if(this.$store.state.token === ''){
const Auth = new userAuth()
Auth.Login()
return
}
this.$Router.push({ this.$Router.push({
name: 'StoreBuy', name: 'StoreBuy',
params: { params: {

View File

@@ -89,6 +89,9 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getMall() this.getMall()
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'StoreSearch'})
} }
} }
</script> </script>

View File

@@ -11,6 +11,10 @@
color="#e6576b" color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})" @onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/> />
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</block> </block>
<block v-else> <block v-else>
<view class="vertical pages-empty"> <view class="vertical pages-empty">
@@ -34,7 +38,8 @@
classify: [ classify: [
{ name: "全部", category_id: "" } { name: "全部", category_id: "" }
], ],
cid : "" cid : "",
page : 1
}; };
}, },
mounted(){ mounted(){
@@ -46,12 +51,17 @@
}, },
methods:{ methods:{
// 商品列表 // 商品列表
getLists(cid) { getLists() {
lists({ lists({
category_id : this.$Route.query.id, category_id : this.$Route.query.id,
category_cid: this.cid category_cid: this.cid,
page : this.page
}).then(res => { }).then(res => {
this.goodsArr = res.data if(res.page.current === 1){
this.goodsArr = []
}
this.goodsArr = this.goodsArr.concat(res.data)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}) })
}, },
@@ -66,10 +76,22 @@
this.goodsArr = [] this.goodsArr = []
this.cid = e.category_id this.cid = e.category_id
this.getLists() this.getLists()
} },
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.page = 1
this.getLists() this.getLists()
},
onReachBottom() {
if(this.status === 'loadmore'){
this.page += 1
this.status = 'loading'
this.getLists()
}
},
onNavigationBarButtonTap() {
this.$Router.push({name: 'StoreSearch'})
} }
} }
</script> </script>
@@ -83,4 +105,9 @@
.pages-empty{ .pages-empty{
height: 70vh; height: 70vh;
} }
// 加载分页
.pages-load{
padding-bottom: $padding;
}
</style> </style>

116
pages/store/search.vue Normal file
View File

@@ -0,0 +1,116 @@
<template>
<view class="content">
<!-- 搜索 -->
<view class="header">
<input type="text" v-model="searchVlaue" focus placeholder="输入产品关键搜索" />
<view class="btn" @click="getLists()">搜索</view>
</view>
<!-- 搜索列表 -->
<block v-if="goodsArr.length >= 1">
<oct-goods
:lists="goodsArr"
color="#e6576b"
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})"
/>
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/search.png"
textColor="#999"
text="暂无搜索结果"
></u-empty>
</view>
</block>
</view>
</template>
<script>
import { lists } from "@/apis/interfaces/store"
export default {
data() {
return {
searchVlaue : '',
goodsArr : [],
status : "loading",
page : 1
};
},
methods:{
getLists() {
lists({
name: this.searchVlaue,
page: this.page
}).then(res => {
console.log(res.page)
if(res.page.current === 1){
this.goodsArr = []
}
this.goodsArr = this.goodsArr.concat(res.data)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
})
}
},
onReachBottom() {
if(this.status === 'loadmore'){
this.page += 1
this.status = 'loading'
this.getLists()
}
}
}
</script>
<style lang="scss" scoped>
.content{
min-height: 100vh;
padding-top: 110rpx;
background: $window-color;
box-sizing: border-box;
}
// 搜索
.header{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 120rpx;
padding: 20rpx ($padding + 150) 20rpx $padding;
box-sizing: border-box;
background: white;
input{
background: $window-color;
height: 70rpx;
line-height: 70rpx;
padding: 0 $padding;
border-radius: 35rpx;
font-size: $title-size-lg;
}
.btn{
position: absolute;
top: 20rpx;
right: $padding;
width: 130rpx;
background: $window-color;
line-height: 70rpx;
text-align: center;
font-size: $title-size-lg;
color: $main-color;
font-weight: bold;
border-radius: 35rpx;
}
}
// 结果空
.pages-empty{
height: 80vh;
}
// 加载分页
.pages-load{
padding-bottom: $padding;
}
</style>

View File

@@ -13,7 +13,7 @@
</view> </view>
</block> </block>
<block v-else> <block v-else>
<view class="name" @click="Login">未登录</view> <view class="name" @click="isLogin()">未登录</view>
</block> </block>
</view> </view>
</view> </view>
@@ -61,39 +61,29 @@
</view> </view>
<!-- 订单 --> <!-- 订单 -->
<view class="order-box"> <view class="order-box">
<view class="order-box-item" @click="$Router.push({name: 'Order'})"> <view class="order-box-item" @click="onBtn('Order', {index: 0})">
<image class="icon" src="@/static/user/order_icon_00.png" mode="widthFix"></image> <image class="icon" src="@/static/user/order_icon_00.png" mode="widthFix"></image>
<view class="title">全部订单</view> <view class="title">全部订单</view>
</view> </view>
<view class="order-box-item" @click="$Router.push({name: 'Order'})"> <view class="order-box-item" @click="onBtn('Order', {index: 1})">
<image class="icon" src="@/static/user/order_icon_01.png" mode="widthFix"></image> <image class="icon" src="@/static/user/order_icon_01.png" mode="widthFix"></image>
<view class="title">待付款</view> <view class="title">待付款</view>
</view> </view>
<view class="order-box-item" @click="$Router.push({name: 'Order'})"> <view class="order-box-item" @click="onBtn('Order', {index: 2})">
<image class="icon" src="@/static/user/order_icon_02.png" mode="widthFix"></image> <image class="icon" src="@/static/user/order_icon_02.png" mode="widthFix"></image>
<view class="title">待发货</view> <view class="title">待发货</view>
</view> </view>
<view class="order-box-item" @click="$Router.push({name: 'Order'})"> <view class="order-box-item" @click="onBtn('Order', {index: 3})">
<image class="icon" src="@/static/user/order_icon_03.png" mode="widthFix"></image> <image class="icon" src="@/static/user/order_icon_03.png" mode="widthFix"></image>
<view class="title">待收货</view> <view class="title">待收货</view>
</view> </view>
<view class="order-box-item" @click="$Router.push({name: 'Order'})"> <view class="order-box-item" @click="onBtn('Order', {index: 4})">
<image class="icon" src="@/static/user/order_icon_04.png" mode="widthFix"></image> <image class="icon" src="@/static/user/order_icon_04.png" mode="widthFix"></image>
<view class="title">已完成</view> <view class="title">已完成</view>
</view> </view>
</view> </view>
<!-- 功能块 --> <!-- 功能块 -->
<view class="btns-box"> <view class="btns-box">
<!-- <view class="btns-box-item" @click="$Router.push({name: 'WalletAdd'})">
<image class="icon" src="@/static/user/icon_00.png" mode="widthFix"></image>
ZH钱包(首次)
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view>
<view class="btns-box-item" @click="$Router.push({name: 'WalletProperty'})">
<image class="icon" src="@/static/user/userIcon_01.png" mode="widthFix"></image>
ZH钱包钱包
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view> -->
<view class="btns-box-item" @click="onWallet"> <view class="btns-box-item" @click="onWallet">
<image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix"></image> <image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix"></image>
ZH钱包 ZH钱包
@@ -104,18 +94,13 @@
健康档案 健康档案
<uni-icons class="forward" type="forward" color="#999"></uni-icons> <uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view> </view>
<view class="btns-box-item" @click="$Router.push({name: 'Address', params: {type: 'edit'}})"> <view class="btns-box-item" @click="onBtn('Address', {type: 'edit'})">
<image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix"></image> <image class="icon" src="@/static/user/userIcon_03.png" mode="widthFix"></image>
地址管理 地址管理
<uni-icons class="forward" type="forward" color="#999"></uni-icons> <uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view> </view>
</view> </view>
<view class="btns-box"> <view class="btns-box">
<view class="btns-box-item">
<image class="icon" src="@/static/user/userIcon_04.png" mode="widthFix"></image>
设置
<uni-icons class="forward" type="forward" color="#999"></uni-icons>
</view>
<view class="btns-box-item" @click="logOut"> <view class="btns-box-item" @click="logOut">
<image class="icon" src="@/static/user/userIcon_05.png" mode="widthFix"></image> <image class="icon" src="@/static/user/userIcon_05.png" mode="widthFix"></image>
退出登录 退出登录
@@ -135,7 +120,7 @@
export default { export default {
data() { data() {
return { return {
cardText: ['用户专属特权', '老用户专属健康会员'], cardText: ['用户首单即赠会员', '老用户专属验证开通会员'],
userInfo: { userInfo: {
nickname: "", nickname: "",
avatar : "" avatar : ""
@@ -150,11 +135,9 @@
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
}) })
this.userInfo = res this.userInfo = res
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
@@ -165,25 +148,55 @@
}, },
// 开通会员 // 开通会员
openVip(){ openVip(){
if(this.$store.state.token === ''){ if(this.isLogin()){
this.Login() uni.showActionSheet({
return itemList: ["我是新用户", "我是老用户"],
success: res=> {
switch (res.tapIndex){
case 0:
uni.showModal({
title: '开通提示',
content: '平台新用户完成手笔订单即可获赠ZH健康会员',
showCancel:false,
cancelText: '去完成',
success: res => {
console.log(res)
this.$Router.pushTab({name: 'Store'})
}
})
break;
case 1:
uni.showToast({
title: '老用户渠道暂未开放',
icon : 'none'
})
break;
}
}
})
} }
console.log("开通会员")
}, },
// 开通钱包 // 开通钱包
onWallet(){ onWallet(){
if(this.$store.state.token === ''){ if(this.isLogin()){
this.Login()
return
}
if(this.userInfo.is_wallet) this.$Router.push({name: 'WalletProperty'}) if(this.userInfo.is_wallet) this.$Router.push({name: 'WalletProperty'})
else this.$Router.push({name: 'WalletAdd'}) else this.$Router.push({name: 'WalletAdd'})
}
}, },
// 登录 // 按钮导航
Login(){ onBtn(name, params){
if(this.isLogin()){
this.$Router.push({name, params})
}
},
// 检查登录
isLogin(){
if(this.$store.state.token === ''){
const Auth = new userAuth() const Auth = new userAuth()
Auth.Login() Auth.Login()
return false
}
return true
}, },
// 退出登录 // 退出登录
logOut(){ logOut(){