Browse Source

对接部分接口

pull/7/head
longjieli 3 months ago
parent
commit
e675264284
31 changed files with 733 additions and 393 deletions
  1. +1
    -0
      App.vue
  2. +3
    -3
      api/amount/index.js
  3. +0
    -9
      api/home.js
  4. +15
    -0
      api/myFlow/index.js
  5. +12
    -0
      api/pet/index.js
  6. +14
    -0
      api/receivingHall/index.js
  7. +70
    -67
      manifest.json
  8. +3
    -0
      otherPages/authentication/connectAddress/detail.vue
  9. +26
    -4
      otherPages/myOrdersManage/bond/index.vue
  10. +25
    -6
      otherPages/myOrdersManage/withdrawal/index.vue
  11. +22
    -5
      otherPages/orderTakingManage/evaluate/index.vue
  12. +232
    -0
      otherPages/userManage/pet/index.vue
  13. +8
    -2
      otherPages/workbenchManage/bindUser/index.scss
  14. +39
    -9
      otherPages/workbenchManage/bindUser/index.vue
  15. +1
    -1
      otherPages/workbenchManage/myLevel/index.vue
  16. +1
    -1
      otherPages/workbenchManage/myUser/index.vue
  17. +1
    -1
      otherPages/workbenchManage/myWallet/index.vue
  18. +6
    -0
      pages.json
  19. +1
    -1
      pages/login/index.vue
  20. +24
    -19
      pages/login/wxUserInfo.vue
  21. +57
    -0
      pages/orderTakingManage/components/list.vue
  22. +0
    -71
      pages/orderTakingManage/components/lossOrder.vue
  23. +0
    -71
      pages/orderTakingManage/components/personOrder.vue
  24. +0
    -71
      pages/orderTakingManage/components/systemOrder.vue
  25. +38
    -11
      pages/orderTakingManage/index.vue
  26. +101
    -16
      pages/userManage/index.vue
  27. +0
    -11
      pages/workbenchManage/components/modal.vue
  28. +1
    -4
      pages/workbenchManage/index.vue
  29. +4
    -0
      static/styles/common.scss
  30. +25
    -3
      store/modules/user.js
  31. +3
    -7
      utils/getUrl.js

+ 1
- 0
App.vue View File

@ -8,6 +8,7 @@
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!') console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
console.log('App Launch') console.log('App Launch')
store.dispatch('fetchConfigList') store.dispatch('fetchConfigList')
store.dispatch('getUserInfo')
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')


+ 3
- 3
api/amount/index.js View File

@ -14,14 +14,14 @@ export const amountLogList = (params) => {
} }
// 小程序-充值 // 小程序-充值
export const cashIn = (params) => {
export const cashIn = (data) => {
return request({ return request({
url: '/applet/amount/cashIn', url: '/applet/amount/cashIn',
headers: { headers: {
isToken: true isToken: true
}, },
method: "get",
params
method: "post",
data
}) })
} }


+ 0
- 9
api/home.js View File

@ -49,15 +49,6 @@ export const indexConfigIco = () => {
method: "get" method: "get"
}) })
} }
export const successList = () => {
return request({
url: "/applet/workIn/list",
headers: {
isToken: false
},
method: "get"
})
}
export const getbaseInfo = (appUserId) => { export const getbaseInfo = (appUserId) => {
return request({ return request({
url: `/applet/login/getAppletUserInfo/${appUserId}`, url: `/applet/login/getAppletUserInfo/${appUserId}`,


+ 15
- 0
api/myFlow/index.js View File

@ -0,0 +1,15 @@
// 伴宠师-我的流程
import request from '@/utils/request'
// 获取我的评价列表数据带分页
export function appletCommentList(params) {
return request({
headers: {
"isToken": true
},
url: "/applet/info/appletCommentList",
method: 'get',
params
})
}

+ 12
- 0
api/pet/index.js View File

@ -0,0 +1,12 @@
import request from '@/utils/request'
// 查询我的宠物列表
export function petList() {
return request({
headers: {
"isToken": true
},
url: "/applet/pet/list",
method: 'get'
})
}

+ 14
- 0
api/receivingHall/index.js View File

@ -0,0 +1,14 @@
// 订单模块 - 接单大厅流程
import request from '@/utils/request'
// 小程序-接单大厅流程
export function orderList(params) {
return request({
headers: {
"isToken": true
},
url: "/applet/order/list",
method: 'get',
params
})
}

+ 70
- 67
manifest.json View File

@ -1,68 +1,71 @@
{ {
"name" : "uni-vuu3",
"appid" : "__UNI__BCA90DD",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
/* 5+App */
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {},
/* */
"distribute" : {
/* */
"android" : {
/* android */
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios" : {},
/* ios */
"sdkConfigs" : {}
}
},
/* SDK */
"quickapp" : {},
/* */
"mp-weixin" : {
/* */
"appid" : "wx01f0f43759922fda",
"setting" : {
"urlCheck" : false,
"postcss" : true,
"minified" : true
},
"usingComponents" : true,
"mergeVirtualHostAttributes" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "获取用户地址"
}
}
},
"vueVersion" : "3"
}
"name": "uni-vuu3",
"appid": "__UNI__BCA90DD",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
/* 5+App */
"usingComponents": true,
"nvueCompiler": "uni-app",
"nvueStyleCompiler": "uni-app",
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {},
/* */
"distribute": {
/* */
"android": {
/* android */
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios": {},
/* ios */
"sdkConfigs": {}
}
},
/* SDK */
"quickapp": {},
/* */
"mp-weixin": {
/* */
"appid": "wx01f0f43759922fda",
"setting": {
"urlCheck": false,
"postcss": true,
"minified": true
},
"usingComponents": true,
"mergeVirtualHostAttributes": true,
"permission": {
"scope.userLocation": {
"desc": "获取用户地址"
}
},
"requiredPrivateInfos": [
"chooseLocation"
]
},
"vueVersion": "3"
}

+ 3
- 0
otherPages/authentication/connectAddress/detail.vue View File

@ -121,6 +121,9 @@
uni.chooseLocation({ uni.chooseLocation({
success: function(res) { success: function(res) {
setAddress(res) setAddress(res)
},
fail(e) {
console.log("获取位置信息失败!",e)
} }
}) })
} }


+ 26
- 4
otherPages/myOrdersManage/bond/index.vue View File

@ -42,9 +42,22 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'
import {
ref,
computed
} from 'vue'
import {
cashIn
} from '@/api/amount/index.js'
import {
useStore
} from "vuex"
const money = ref() const money = ref()
const store = useStore();
const userInfo = computed(() => {
return store.getters.userInfo
})
const jumpToDetail = () => { const jumpToDetail = () => {
uni.navigateTo({ uni.navigateTo({
@ -58,10 +71,19 @@
}) })
} }
const onPay = () => {
// todo: wx pay
const onPay = async () => {
if (!money.value) {
return uni.showToast({
title: '请填写充值金额',
icon: "none"
})
}
let response = await cashIn({
money: money.value,
type: 1,
userId: userInfo.value.userId
})
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">


+ 25
- 6
otherPages/myOrdersManage/withdrawal/index.vue View File

@ -8,7 +8,7 @@
<view class="level"> <view class="level">
<view class="money level"> <view class="money level">
<text>¥</text> <text>¥</text>
<input type="text" />
<input v-model="form.amount" type="text" />
</view> </view>
<!-- <DForm :list="state. " @submit="handleSubmit" /> --> <!-- <DForm :list="state. " @submit="handleSubmit" /> -->
</view> </view>
@ -24,7 +24,7 @@
<view> <view>
2直接提现至微信账户无法提现至支付宝; 2直接提现至微信账户无法提现至支付宝;
</view> </view>
<view class="buttom level" :style="{ borderRadius: '41rpx' }">
<view @click="handleSubmit" class="buttom level" :style="{ borderRadius: '41rpx' }">
提现 提现
</view> </view>
</view> </view>
@ -33,11 +33,13 @@
</view> </view>
</template> </template>
<script>
<script setup>
import { import {
reactive
reactive, ref , computed
} from "vue"; } from "vue";
import DForm from "@/components/dForm/index.vue" import DForm from "@/components/dForm/index.vue"
import { cashOut } from "@/api/amount/index.js"
import { useStore } from "vuex"
const state = reactive({ const state = reactive({
list: [{ list: [{
@ -46,9 +48,26 @@
placeholder: "请输入提现金额", placeholder: "请输入提现金额",
}, ] }, ]
}) })
const store = useStore();
const userInfo = computed(() => {
return store.getters.userInfo
})
const form = ref({
amount : ''
})
const handleSubmit = (val) => {
console.log("获取参数", val)
const handleSubmit = async (val) => {
if(!form.value.amount) {
return uni.showToast({
title: '请填写提现金额',
icon: "none"
})
}
let response = await cashOut({
...form.value,
type : 0,
userId : userInfo.value.userId
})
} }
</script> </script>


+ 22
- 5
otherPages/orderTakingManage/evaluate/index.vue View File

@ -6,10 +6,11 @@
我的评价 我的评价
</view> </view>
<view class="text1"> <view class="text1">
3
{{ list.length }}
</view> </view>
</view> </view>
<view class="item box-size level">
<view v-for="item in list" :key="item.id" class="item box-size level">
<view class="img" :style="{borderRadius:'75rpx'}"> <view class="img" :style="{borderRadius:'75rpx'}">
<image src="" mode="" style="width: 132rpx;height: 132rpx;" :style="{borderRadius:'75rpx'}"></image> <image src="" mode="" style="width: 132rpx;height: 132rpx;" :style="{borderRadius:'75rpx'}"></image>
</view> </view>
@ -23,10 +24,10 @@
</view> </view>
</view> </view>
<view class="time"> <view class="time">
2023-12-10 12:41:12
{{ item.createTime }}
</view> </view>
<view class=""> <view class="">
服务贴心态度热情,非常满意
{{ item.comment }}
</view> </view>
</view> </view>
</view> </view>
@ -39,9 +40,25 @@
ref, ref,
reactive reactive
} from 'vue'; } from 'vue';
import { appletCommentList } from "@/api/myFlow/index.js"
import {
onShow
} from "@dcloudio/uni-app"
onShow(() => {
getAppletCommentList()
})
const count = ref(5); const count = ref(5);
const value = ref(2); const value = ref(2);
const list = ref([]);
const getAppletCommentList = async() => {
let response = await appletCommentList();
if(response.code == 200 && response.data) {
list.value = response.data;
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
@ -81,7 +98,7 @@
.img { .img {
width: 132rpx; width: 132rpx;
height: 132rpx; height: 132rpx;
background-color: red;
background: red;
margin-right: 15rpx; margin-right: 15rpx;
} }


+ 232
- 0
otherPages/userManage/pet/index.vue View File

@ -0,0 +1,232 @@
<template>
<view class="personal-pet">
<view v-if="petLists.length > 0" class="personal-pet-list">
<view v-for="(item, index) in petLists" :key="index">
<view
:class="['personal-pet-list-item', item.gender === '男生' ? '.personal-pet-list-item_backgroud_m' : '.personal-pet-list-item_backgroud_f']">
<view class="personal-pet-info">
<view>
<u-avatar :src="item.headImage? item.headImage : defaultPhoto" size="60" shape="circle"></u-avatar>
</view>
<view class="personal-pet-info-1">
<view class="personal-pet-info-2">
<view class="personal-pet-name">
{{ item.nickName }}
</view>
<view class="personal-pet-sex">
<img :src="item.sex === 0 ? '../../static/images/details/boy.svg' : '../../static/images/details/girl.svg'"
alt="sex" style="width: 16px;height: 16px;" />
</view>
</view>
<view class="personal-pet-info-3" style="width: 100%;">
<view class="ellipsis" style="max-width: 25%;">
{{ item.type || '未知' }}
</view>
<view class="personal-pet-info-age" style="max-width: 90px;">
{{ item.type || '未知' }}
</view>
<view class="ellipsis" style="max-width: 25%;">
{{ item.weight + 'kg' }}
</view>
</view>
</view>
</view>
<view class="personal-pet-info-disposition ellipsis">
性格 {{ item.personality }}
</view>
</view>
</view>
</view>
<view v-else class="personal-pet-none">
<img src="https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/catdog.png" alt="pet"
style="width: 149px;height: 124px;" mode="widthFix" />
<view class="personal-pet-none-text">这里还没有您的宠物,请点击添加吧~</view>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue';
import {
petList
} from "@/api/pet/index.js";
import {
onShow,
onPullDownRefresh
} from "@dcloudio/uni-app"
//
const defaultPhoto = ref('https://catmdogf.oss-cn-shanghai.aliyuncs.com/CMDF/front/personal/pet/catdog.png');
const petLists = ref([]);
const deleteId = ref('');
const petType = ref('');
//
const getPetListData = async () => {
petLists.value = [];
try {
const res = await petList();
if (res && res.data) {
petLists.value = res.data;
}
} catch (error) {
console.error('获取宠物列表失败', error);
}
};
//
const addPet = () => {
show.value = true;
};
//
const editPet = (item) => {
if (item.petType === '猫猫' || item.petType === 'cat') {
uni.navigateTo({
url: `/pages/personalCenter/petInfo?petType=cat&optionType=edit&petId=${item.id}`
});
}
if (item.petType === '狗狗' || item.petType === 'dog') {
uni.navigateTo({
url: `/pages/personalCenter/petInfo?petType=dog&optionType=edit&petId=${item.id}`
});
}
};
//
const deletePet = (item) => {
showDel.value = true;
deleteId.value = item.id;
};
//
onMounted(() => {
getPetListData();
});
onShow(() => {
getPetListData();
});
onPullDownRefresh(() => {
getPetListData();
});
</script>
<style lang="scss">
.personal-pet {
position: relative;
height: 100%;
padding-bottom: 90px;
.personal-pet-list {
.personal-pet-list-add {
width: 100%;
height: 44px;
background-color: #FFFFFF;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
.personal-pet-list-add-btn {
font-size: 14px;
color: #AAA;
display: flex;
align-items: center;
}
}
.personal-pet-list-item_backgroud_m {
background: linear-gradient(179deg, #EDF5FE 0.75%, #FFF 34.11%);
}
.personal-pet-list-item_backgroud_f {
background: linear-gradient(179deg, #FFF4F6 0.75%, #FFF 34.11%);
}
.personal-pet-list-item {
margin: 10px 10px 0 10px;
border-radius: 5px;
padding: 20px 10px 10px;
.personal-pet-info {
display: flex;
align-items: center;
justify-content: flex-start;
.personal-pet-info-1 {
margin-left: 10px;
.personal-pet-info-2 {
display: flex;
flex-wrap: wrap;
.personal-pet-name {
color: #333;
font-size: 16px;
margin-right: 10px;
}
}
.personal-pet-info-3 {
display: flex;
align-items: baseline;
font-size: 14px;
margin-top: 5px;
color: #7D8196;
.personal-pet-info-age {
padding: 0 10px;
margin: 0 10px;
border-left: solid 2px #7D8196;
border-right: solid 2px #7D8196;
}
}
}
}
.personal-pet-info-disposition {
padding: 10px;
color: #7D8196;
font-size: 14px;
background: #f9f9f9;
border-radius: 5px;
margin-top: 10px;
}
.personal-pet-info-btns {
display: flex;
justify-content: flex-end;
margin-top: 10px;
.personal-pet-info-btn {
display: flex;
font-size: 14px;
color: #7D8196;
margin-left: 20px;
}
}
}
}
.personal-pet-none {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
margin-top: 40%;
.personal-pet-none-text {
color: #666;
text-align: center;
font-size: 14px;
width: 100%;
margin-top: 10px;
}
}
}
</style>

+ 8
- 2
otherPages/workbenchManage/bindUser/index.scss View File

@ -38,13 +38,19 @@
} }
.bind-main-one{ .bind-main-one{
text-align: center; text-align: center;
background: #b3f1dd;
background: #FAE7E3;
border-radius: 20rpx; border-radius: 20rpx;
padding: 40rpx 60rpx; padding: 40rpx 60rpx;
} }
.bind-main-two{ .bind-main-two{
text-align: center; text-align: center;
background: #c6bcef;
background: #D0E5F9;
border-radius: 20rpx;
padding: 40rpx 50rpx;
}
.bind-main-three{
text-align: center;
background: #FDE7C5;
border-radius: 20rpx; border-radius: 20rpx;
padding: 40rpx 50rpx; padding: 40rpx 50rpx;
} }


+ 39
- 9
otherPages/workbenchManage/bindUser/index.vue View File

@ -2,10 +2,9 @@
<view class="bind-user"> <view class="bind-user">
<view class="bind-user-header"> <view class="bind-user-header">
<view class="flex mb28"> <view class="flex mb28">
<up-image width="139rpx" height="139rpx" src="https://cdn.uviewui.com/uview/album/1.jpg"
shape="circle"></up-image>
<up-image width="139rpx" height="139rpx" :src="userInfo?.userImage" shape="circle"></up-image>
<view class="header-name"> <view class="header-name">
<view class="font32 mb20" :style="{color:'#000'}">猫小姐</view>
<view class="font32 mb20" :style="{color:'#000'}">{{ userInfo?.userName}}</view>
<view class="label1"> <view class="label1">
初级合伙人 初级合伙人
</view> </view>
@ -46,20 +45,25 @@
</view> </view>
<view class="bind-main"> <view class="bind-main">
<view class="bind-main-one mb10"> <view class="bind-main-one mb10">
<view class="mb20 font32">邀请码</view>
<view class="mb20 font32">邀请码邀请</view>
<view class="mb20">用户输入邀请码直接完成绑定</view> <view class="mb20">用户输入邀请码直接完成绑定</view>
<up-input disabled v-model="code">
<up-input disabled v-model="userInfo.invitationCode">
<template #suffix> <template #suffix>
<up-button text="复制" type="success" size="small" shape="circle"></up-button>
<up-button @click="copyMessage(code)" text="复制" type="success" size="small" shape="circle"></up-button>
</template> </template>
</up-input> </up-input>
</view> </view>
<view class="bind-main-two">
<view class="bind-main-two mb10">
<view class="mb20 font32">分享海报邀请</view>
<view class="mb20">扫码进入猫妈狗爸完成绑定</view>
<up-button text="保存海报" type="primary" shape="circle" plain style="background: transparent;"></up-button>
</view>
<view class="bind-main-three">
<view class="mb20 font32">分享链接邀请</view> <view class="mb20 font32">分享链接邀请</view>
<view class="mb20">复制链接给好友进入直接绑定</view> <view class="mb20">复制链接给好友进入直接绑定</view>
<up-input disabled v-model="url"> <up-input disabled v-model="url">
<template #suffix> <template #suffix>
<up-button text="复制" type="success" size="small" shape="circle"></up-button>
<up-button @click="copyMessage(url)" text="复制" type="success" size="small" shape="circle"></up-button>
</template> </template>
</up-input> </up-input>
</view> </view>
@ -69,11 +73,37 @@
<script setup> <script setup>
import { import {
computed,
ref ref
} from "vue"; } from "vue";
import {
useStore
} from "vuex"
const store = useStore();
const userInfo = computed(() => {
return store.getters.userInfo
})
const code = ref('asdasaadsdsa') const code = ref('asdasaadsdsa')
const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
const url = ref('https://uview-plus.jiangruyi.com/components/button.html');
//
const copyMessage = (value) => {
uni.setClipboardData({
data: value,
success: function(res) {
uni.getClipboardData({
success: function(res) {
uni.showToast({
icon: 'none',
title: "复制成功",
});
},
});
},
});
}
</script> </script>


+ 1
- 1
otherPages/workbenchManage/myLevel/index.vue View File

@ -2,7 +2,7 @@
<view class="bind-user"> <view class="bind-user">
<view class="bind-user-header"> <view class="bind-user-header">
<view class="flex mb28"> <view class="flex mb28">
<up-image width="120rpx" height="120rpx" :src="state.baseInfo.upgrade_image" shape="circle"></up-image>
<up-image width="120rpx" height="120rpx" :src="state.baseInfo.info.userImage" shape="circle"></up-image>
<view class="header-name"> <view class="header-name">
<view class="font32 mb20" :style="{ color: '#000', fontSize: '32rpx' }"> <view class="font32 mb20" :style="{ color: '#000', fontSize: '32rpx' }">
{{state.baseInfo.info.userName}} {{state.baseInfo.info.userName}}


+ 1
- 1
otherPages/workbenchManage/myUser/index.vue View File

@ -2,7 +2,7 @@
<view class="bind-user"> <view class="bind-user">
<view class="bind-user-header"> <view class="bind-user-header">
<view class="flex mb28"> <view class="flex mb28">
<up-image width="120rpx" height="120rpx" :src="state.baseInfo.upgrade_image" shape="circle"></up-image>
<up-image width="120rpx" height="120rpx" :src="state.baseInfo.info.userImage" shape="circle"></up-image>
<view class="header-name"> <view class="header-name">
<view class="font32 mb20 color-040">{{ state.baseInfo.info.userName }}</view> <view class="font32 mb20 color-040">{{ state.baseInfo.info.userName }}</view>
<view class="label1"> <view class="label1">


+ 1
- 1
otherPages/workbenchManage/myWallet/index.vue View File

@ -2,7 +2,7 @@
<view class="bind-user"> <view class="bind-user">
<view class="bind-user-header"> <view class="bind-user-header">
<view class="flex mb28 ml20 "> <view class="flex mb28 ml20 ">
<up-image width="140rpx" height="140rpx" :src="state.baseInfo.upgrade_image" shape="circle"></up-image>
<up-image width="140rpx" height="140rpx" :src="state.baseInfo.info.userImage" shape="circle"></up-image>
<view class="header-name"> <view class="header-name">
<view class="font32 mb20 color-040">{{ state.baseInfo.info.userName }}</view> <view class="font32 mb20 color-040">{{ state.baseInfo.info.userName }}</view>
<view class="label1"> <view class="label1">


+ 6
- 0
pages.json View File

@ -356,6 +356,12 @@
"style": { "style": {
"navigationBarTitleText": "服务记录" "navigationBarTitleText": "服务记录"
} }
},
{
"path": "pet/index",
"style": {
"navigationBarTitleText": "我的宠物"
}
} }
] ]
} }


+ 1
- 1
pages/login/index.vue View File

@ -34,7 +34,7 @@
</view> </view>
<up-popup :show="show" @close="close" :round="10"> <up-popup :show="show" @close="close" :round="10">
<view style="padding: 10rpx 20rpx;min-height: 50vh;" v-html="content"></view>
<view style="padding: 10rpx 20rpx;height: 50vh;overflow-y: scroll;" v-html="content"></view>
</up-popup> </up-popup>
</template> </template>


+ 24
- 19
pages/login/wxUserInfo.vue View File

@ -1,11 +1,9 @@
<template> <template>
<view class="login"> <view class="login">
<!-- <view class="logo">
<image :src="configList.logo_image" mode=""></image>
</view> -->
<view class="title">
猫妈狗爸
</view>
<view class="logo">
<image class="logo-img" :src="configList?.applet_info?.paramValueImage" mode="aspectFill"></image>
<image class="d" :src="configList?.logo_icon?.paramValueImage" mode="aspectFill"></image>
</view>
<view class="title"> <view class="title">
申请获取你的头像昵称 申请获取你的头像昵称
</view> </view>
@ -57,7 +55,8 @@
<script setup> <script setup>
import { import {
ref, ref,
getCurrentInstance
getCurrentInstance,
computed
} from 'vue' } from 'vue'
import { import {
ossUpload ossUpload
@ -90,6 +89,10 @@
nickName: '', nickName: '',
phone: '', phone: '',
}) })
const configList = computed(() => {
return store.getters.configList
})
onShow(() => { onShow(() => {
// onShow // onShow
@ -167,23 +170,25 @@
height: 80vh; height: 80vh;
.logo { .logo {
height: 140rpx;
width: 140rpx;
image {
height: 140rpx;
width: 140rpx;
border-radius: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.logo-img {
width: 180rpx;
height: 180rpx;
}
.d {
width: 200rpx;
height: 80rpx;
margin-top: 20rpx;
} }
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.title {
line-height: 45rpx;
font-weight: 900;
}
.line { .line {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;


+ 57
- 0
pages/orderTakingManage/components/list.vue View File

@ -0,0 +1,57 @@
<template>
<up-list @scrolltolower="scrolltolower">
<up-list-item v-for="item in orderList">
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">{{ item.price }}</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px"
src="https://cdn.catmdogd.com/Work/image/work/tx.png" shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">{{ item.address }}</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button @click="toOrderDetail" type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
</up-list-item>
</up-list>
</template>
<script setup>
const scrolltolower = () => {
}
const props = defineProps({
orderList : {
type : Array,
default : () => []
}
})
console.log("props",props)
//
const toOrderDetail = () => {
uni.navigateTo({
url: "/otherPages/orderTakingManage/detail/index"
});
}
</script>
<style scoped lang="scss">
@import "../index";
</style>

+ 0
- 71
pages/orderTakingManage/components/lossOrder.vue View File

@ -1,71 +0,0 @@
<template>
<up-list
@scrolltolower="scrolltolower"
>
<up-list-item>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px"
src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px"
src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
</up-list-item>
</up-list>
</template>
<script setup>
const scrolltolower = () => {
}
</script>
<style scoped lang="scss">
@import "../index";
</style>

+ 0
- 71
pages/orderTakingManage/components/personOrder.vue View File

@ -1,71 +0,0 @@
<template>
<up-list
@scrolltolower="scrolltolower"
>
<up-list-item>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px"
src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px"
src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
</up-list-item>
</up-list>
</template>
<script setup>
const scrolltolower = () => {
}
</script>
<style scoped lang="scss">
@import "../index";
</style>

+ 0
- 71
pages/orderTakingManage/components/systemOrder.vue View File

@ -1,71 +0,0 @@
<template>
<up-list
@scrolltolower="scrolltolower"
>
<up-list-item>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px" src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
<view class="mb28 container-list-item">
<view class="flex-between flex" style="background: #FFF4E5;padding: 22rpx 42rpx">
<view>待接单</view>
<view>本单酬劳
<text style="color: #FF530A">260</text>
</view>
</view>
<view class="container-list">
<view class="flex-between flex mb28">
<up-image style="flex-shrink:0" class="mr20" width="70px" height="70px" src="https://cdn.catmdogd.com/Work/image/work/tx.png"
shape="circle"></up-image>
<view>
<view class="font28 col3">服务天数: 共2天 I 12-07,12-08</view>
<view style="margin: 18rpx 0">期望上门时间</view>
<view>中华田园犬(小型犬) | 专业喂养+提前熟悉+陪玩</view>
</view>
</view>
<view class="mb28 address">重庆市南岸区长嘉汇</view>
<view class="mb28">订单为系统派发请确认订单信息后再抢单</view>
<view class="flex flex-between">
<up-button text="无法接单" shape="circle" plain class="mr20"></up-button>
<up-button type="primary" text="查看详情后接单" shape="circle" color="#FFAA48"></up-button>
</view>
</view>
</view>
</up-list-item>
</up-list>
</template>
<script setup>
const scrolltolower = () => {
}
</script>
<style scoped lang="scss">
@import "../index";
</style>

+ 38
- 11
pages/orderTakingManage/index.vue View File

@ -9,31 +9,36 @@
}" :inactiveStyle="{ }" :inactiveStyle="{
color: '#FFFFFF', color: '#FFFFFF',
transform: 'scale(1)' transform: 'scale(1)'
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF"></up-tabs>
}" :itemStyle="{height:'88rpx',padding:'0 52rpx'}" lineColor="#FFFFFF" @click="clickEvent"></up-tabs>
</view> </view>
</up-sticky> </up-sticky>
<view class="container"> <view class="container">
<systemOrder v-if="current===0" />
<personOrder v-if="current===1" />
<lossOrder v-if="current===2" />
<list :orderList="orderlist" v-if="current===0" />
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import {
computed,
reactive, reactive,
ref ref
} from "vue"; } from "vue";
import systemOrder from "./components/systemOrder.vue";
import personOrder from "./components/personOrder.vue";
import lossOrder from "./components/lossOrder.vue";
import List from "./components/list.vue";
import { import {
onShow onShow
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import { getIsLogin } from "@/utils/auth.js"
import {
getIsLogin
} from "@/utils/auth.js"
import {
orderList
} from "@/api/receivingHall/index.js"
import {
useStore
} from "vuex"
const current = ref(0) const current = ref(0)
const list = reactive([{ const list = reactive([{
name: '系统派单', name: '系统派单',
@ -54,14 +59,36 @@
} }
}, },
]) ])
const store = useStore();
const userInfo = computed(() => {
return store.getters.userInfo
})
const orderlist = ref([]);
onShow(() => { onShow(() => {
if(!getIsLogin()) {
if (!getIsLogin()) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/login/index" url: "/pages/login/index"
}) })
} }
getOrderList();
}) })
//
const getOrderList = async () => {
let response = await orderList({
status: current.value,
userId: userInfo.value.userId
});
if (response.code == 200 && response.data) {
orderlist.value = response.data;
}
}
const clickEvent = (item) => {
current.value = item.index;
getOrderList();
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">


+ 101
- 16
pages/userManage/index.vue View File

@ -7,8 +7,10 @@
shape="circle"></up-image> shape="circle"></up-image>
<view>{{getIsLogin()?userInfo.userName:"欢迎来到版宠师"}}</view> <view>{{getIsLogin()?userInfo.userName:"欢迎来到版宠师"}}</view>
</view> </view>
<view style="width: 140rpx" v-if="!getIsLogin()">
<up-button @click="handleLogin" :customStyle="{borderColor:'#fff'}" type="primary" text="请登录"
<view style="width: 140rpx">
<up-button v-if="!getIsLogin()" @click="handleLogin" :customStyle="{borderColor:'#fff'}"
type="primary" text="请登录" shape="circle" color="#FFBF60"></up-button>
<up-button v-else @click="logout" :customStyle="{borderColor:'#fff'}" type="primary" text="退出登录"
shape="circle" color="#FFBF60"></up-button> shape="circle" color="#FFBF60"></up-button>
</view> </view>
</view> </view>
@ -21,9 +23,9 @@
width="68rpx" height="68rpx"></up-image> width="68rpx" height="68rpx"></up-image>
服务酬劳 服务酬劳
</view> </view>
<view class="mb20">--</view>
<view class="mb20">{{ userInfo.price }}</view>
<view class="flex flex-between but"> <view class="flex flex-between but">
<view>提现</view>
<view @click="toWithdrawDeposit">提现</view>
<view>|</view> <view>|</view>
<view @click="toRunningWater">明细</view> <view @click="toRunningWater">明细</view>
</view> </view>
@ -34,8 +36,8 @@
width="68rpx" height="68rpx"></up-image> width="68rpx" height="68rpx"></up-image>
保证金 保证金
</view> </view>
<view class="mb20">--</view>
<view class="but">保证金中心</view>
<view class="mb20">{{ userInfo.baoPrice }}</view>
<view @click="toBail" class="but">保证金中心</view>
</view> </view>
</view> </view>
</view> </view>
@ -43,22 +45,22 @@
</view> </view>
<view class="user-container"> <view class="user-container">
<view class="bgf pd4 radius20 mb28"> <view class="bgf pd4 radius20 mb28">
<view class=" mb28 flex flex-between">
<view class="mb28 flex flex-between">
<view class="font36">我的宠物</view> <view class="font36">我的宠物</view>
<view style="color: #707070">更多 ></view>
<view @click="toMyPet" style="color: #707070">更多 ></view>
</view> </view>
<view> <view>
<up-button v-if="!getIsLogin()" @click="handleLogin" class="mb20" size="large" <up-button v-if="!getIsLogin()" @click="handleLogin" class="mb20" size="large"
style="width: 600rpx;height: 135rpx;" type="primary" text="登录后管理宠物" shape="" style="width: 600rpx;height: 135rpx;" type="primary" text="登录后管理宠物" shape=""
color="#FFF4E5"></up-button> color="#FFF4E5"></up-button>
<up-button v-if="getIsLogin()" class="mb20" size="large" style="width: 500rpx" type="primary"
<!-- <up-button v-if="getIsLogin()" class="mb20" size="large" style="width: 500rpx" type="primary"
text="请添加您的爱宠" shape="circle" text="请添加您的爱宠" shape="circle"
color="linear-gradient(to right, rgb(255 ,191 ,96 ,1), rgb(255, 51, 186))"></up-button>
color="linear-gradient(to right, rgb(255 ,191 ,96 ,1), rgb(255, 51, 186))"></up-button> -->
<view v-if="isLogin" class="cw-box radius20 pd20 flex"> <view v-if="isLogin" class="cw-box radius20 pd20 flex">
<up-image class="mr20" width="140rpx" style="flex-shrink: 0" height="140rpx" <up-image class="mr20" width="140rpx" style="flex-shrink: 0" height="140rpx"
src="https://cdn.uviewui.com/uview/album/1.jpg" shape="circle"></up-image>
:src="pet?.headImage" shape="circle"></up-image>
<view style="width: 418rpx"> <view style="width: 418rpx">
<view class="font32 mb20">阿拉斯加</view>
<view class="font32 mb20">{{ pet.type }}</view>
<view class="font24 ellipsis">澳大利亚雾猫澳洲斑点雾猫| 1 个月</view> <view class="font24 ellipsis">澳大利亚雾猫澳洲斑点雾猫| 1 个月</view>
</view> </view>
</view> </view>
@ -72,13 +74,13 @@
height="68rpx"></up-image> height="68rpx"></up-image>
<view>我的评价</view> <view>我的评价</view>
</view> </view>
<view class="icon-list">
<view @click="platformProtocol" class="icon-list">
<up-image class="mb20" :show-loading="true" <up-image class="mb20" :show-loading="true"
src="https://cdn.catmdogd.com/Work/image/work/icon2.png" width="68rpx" src="https://cdn.catmdogd.com/Work/image/work/icon2.png" width="68rpx"
height="68rpx"></up-image> height="68rpx"></up-image>
<view>平台协议</view> <view>平台协议</view>
</view> </view>
<view class="icon-list">
<view @click="openCustomerServiceChat" class="icon-list">
<up-image class="mb20" :show-loading="true" <up-image class="mb20" :show-loading="true"
src="https://cdn.catmdogd.com/Work/image/work/icon3.png" width="68rpx" src="https://cdn.catmdogd.com/Work/image/work/icon3.png" width="68rpx"
height="68rpx"></up-image> height="68rpx"></up-image>
@ -94,17 +96,23 @@
</view> </view>
</view> </view>
</view> </view>
<up-popup :show="show" @close="close" :round="10">
<view style="padding: 10rpx 20rpx;height: 50vh;overflow-y: scroll;" v-html="content"></view>
</up-popup>
</template> </template>
<script setup> <script setup>
import { import {
computed, computed,
onMounted,
ref ref
} from "vue" } from "vue"
import { import {
getIsLogin, getIsLogin,
getStorage, getStorage,
getToken
getToken,
removeIsLogin
} from "../../utils/auth"; } from "../../utils/auth";
import tab from "../../plugins/tab"; import tab from "../../plugins/tab";
import { import {
@ -113,6 +121,9 @@
import { import {
onShow onShow
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import {
petList
} from "@/api/pet/index.js"
onShow(() => { onShow(() => {
if (!getIsLogin()) { if (!getIsLogin()) {
@ -120,6 +131,11 @@
url: "/pages/login/index" url: "/pages/login/index"
}) })
} }
getPetList();
})
onMounted(() => {
content.value = configList.value?.['home-agreement']?.paramValueArea || ""
}) })
const store = useStore(); const store = useStore();
@ -127,6 +143,13 @@
const userInfo = computed(() => { const userInfo = computed(() => {
return store.getters.userInfo return store.getters.userInfo
}) })
const configList = computed(() => {
return store.getters.configList;;
})
const pet = ref({})
const show = ref(false)
const content = ref("")
if (getIsLogin() && getToken()) { if (getIsLogin() && getToken()) {
userInfo.value = getStorage("userInfo") userInfo.value = getStorage("userInfo")
isLogin.value = true isLogin.value = true
@ -140,12 +163,74 @@
url: "/otherPages/orderTakingManage/evaluate/index" url: "/otherPages/orderTakingManage/evaluate/index"
}) })
} }
const toRunningWater = () => { const toRunningWater = () => {
uni.navigateTo({ uni.navigateTo({
url: "/otherPages/myOrdersManage/transaction/index" url: "/otherPages/myOrdersManage/transaction/index"
}) })
} }
const getPetList = async () => {
let response = await petList();
pet.value = response?.data[0] || {};
}
const logout = () => {
store.commit("setUserInfo", {});
uni.removeStorageSync("token")
uni.removeStorageSync("baseInfo")
removeIsLogin();
uni.navigateTo({
url: "/pages/login/index"
})
}
//
const toWithdrawDeposit = () => {
uni.navigateTo({
url: "/otherPages/myOrdersManage/withdrawal/index"
})
}
//
const toBail = () => {
uni.navigateTo({
url: "/otherPages/myOrdersManage/bond/index"
})
}
//
const toMyPet = () => {
uni.navigateTo({
url: '/otherPages/userManage/pet/index'
});
}
const close = () => {
show.value = false;
}
const platformProtocol = () => {
show.value = true;
}
// openCustomerServiceChat
const openCustomerServiceChat = () => {
uni.openCustomerServiceChat({
extInfo: {
url: "https://work.weixin.qq.com/kfid/kfc135d138d063817e1"
},
sessionFrom: '1000',
//
success: function(res) {
console.log('成功打开客服会话', res);
},
//
fail: function(err) {
console.error('打开客服会话失败', err);
}
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "index"; @import "index";

+ 0
- 11
pages/workbenchManage/components/modal.vue View File

@ -15,9 +15,6 @@
</template> </template>
<script setup> <script setup>
import {
successList
} from "@/api/home.js"
import { import {
watch, watch,
ref, ref,
@ -43,17 +40,9 @@
watch(() => props.open, (val) => { watch(() => props.open, (val) => {
show.value = val show.value = val
}) })
onMounted(() => {
init()
})
const state = reactive({ const state = reactive({
info: {} info: {}
}) })
const init = () => {
successList().then(res => {
// state.info = res.rows[0]
})
}
const close = () => { const close = () => {
emit("close", false) emit("close", false)
} }


+ 1
- 4
pages/workbenchManage/index.vue View File

@ -94,9 +94,6 @@
onMounted(() => { onMounted(() => {
getBanner() getBanner()
getpz() getpz()
// uni.navigateTo({
// url: '/otherPages/authentication/connectAddress/index'
// });
}) })
const userInfo = computed(() => { const userInfo = computed(() => {
return store.getters.userInfo return store.getters.userInfo
@ -131,7 +128,7 @@
appUserId: baseInfo.userId appUserId: baseInfo.userId
}).then(res => { }).then(res => {
isoOpen.value = true isoOpen.value = true
changeBaseInfo(baseInfo.userId)
store.dispatch("getUserInfo");
}).catch(() => {}) }).catch(() => {})
} else { } else {
// //


+ 4
- 0
static/styles/common.scss View File

@ -51,6 +51,10 @@
margin-right: 20rpx; margin-right: 20rpx;
} }
.pd10 {
padding: 10rpx;
}
.pd20 { .pd20 {
padding: 20rpx; padding: 20rpx;
} }


+ 25
- 3
store/modules/user.js View File

@ -18,6 +18,9 @@ import {
import { import {
wxLogin wxLogin
} from "../../api/system/user"; } from "../../api/system/user";
import {
getbaseInfo
} from "@/api/home.js"
const baseUrl = currentUrl const baseUrl = currentUrl
const user = { const user = {
@ -43,6 +46,9 @@ const user = {
uni.login({ uni.login({
success: (res) => { success: (res) => {
const code = res.code const code = res.code
uni.showLoading({
mask : true
});
wxLogin({ wxLogin({
code code
}).then(res => { }).then(res => {
@ -51,19 +57,35 @@ const user = {
uni.setStorageSync("baseInfo", JSON.stringify(res.data.userInfo)) uni.setStorageSync("baseInfo", JSON.stringify(res.data.userInfo))
context.commit('setAccessToken', res.data.token); context.commit('setAccessToken', res.data.token);
context.commit('setUserInfo', res.data.userInfo); context.commit('setUserInfo', res.data.userInfo);
setIsLogin("isLogin", true);
setIsLogin(true);
uni.hideLoading();
if (!res.data.userInfo.userName || !res.data.userInfo.userImage || !res.data.userInfo.userTelephone) {
if (!res.data.userInfo.userName || !res.data.userInfo.userImage || !
res.data.userInfo.userTelephone) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/login/wxUserInfo" url: "/pages/login/wxUserInfo"
}) })
}else {
} else {
uni.navigateBack(-1) uni.navigateBack(-1)
} }
} }
}) })
} }
}) })
},
// 已登录的情况下调用接口获取用户信息,保证用户信息的实时更新
async getUserInfo({
commit,
state
}) {
if (getIsLogin()) {
const response = await getbaseInfo(state.userInfo.userId);
if (response.code == 200) {
commit("setUserInfo", response.data);
uni.setStorageSync("baseInfo", JSON.stringify(response.data))
}
}
} }
} }
} }


+ 3
- 7
utils/getUrl.js View File

@ -1,18 +1,14 @@
let current = "develop";
let current = "trial";
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
current = accountInfo.miniProgram.envVersion;
// current = accountInfo.miniProgram.envVersion;
const api = { const api = {
develop: "http://h5.xzaiyp.top/prod-api", // 开发
develop: "http://youyi-test.natapp1.cc/prod-api", // 开发
trial: "http://h5.xzaiyp.top/prod-api", //测试 trial: "http://h5.xzaiyp.top/prod-api", //测试
release: "http://h5.xzaiyp.top/prod-api", // 线上 release: "http://h5.xzaiyp.top/prod-api", // 线上
} }
console.log('--current', current)
const currentUrl = api[current]; const currentUrl = api[current];
console.log('--currentUrl', currentUrl)
export { export {
currentUrl currentUrl
}; };

Loading…
Cancel
Save