diff --git a/LICENSE b/LICENSE deleted file mode 100755 index c396424..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 viarotel - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pages.config.js b/pages.config.js index 126d7c5..1d98663 100755 --- a/pages.config.js +++ b/pages.config.js @@ -146,7 +146,7 @@ export default defineUniPages({ path: 'index', aliasPath: '/statement', style: { - navigationBarTitleText: '产品服务协议', + navigationBarTitleText: '', }, }, ], diff --git a/src/mixins/share/index.js b/src/mixins/share/index.js index 0406194..94846de 100755 --- a/src/mixins/share/index.js +++ b/src/mixins/share/index.js @@ -3,7 +3,9 @@ import { appName } from '@/configs/index' export default { data () { return { - shareAppMessageProps: {}, + shareAppMessageProps: { + imageUrl: 'https://pei-zhen.oss-cn-shanghai.aliyuncs.com/5531711684145_.pic.jpg', + }, shareTimelineProps: {}, } }, diff --git a/src/pages.json b/src/pages.json index bd4e5f8..9952107 100755 --- a/src/pages.json +++ b/src/pages.json @@ -126,7 +126,7 @@ "path": "index", "aliasPath": "/statement", "style": { - "navigationBarTitleText": "产品服务协议" + "navigationBarTitleText": "" } } ] diff --git a/src/pages/index/home/index.vue b/src/pages/index/home/index.vue index 5797b1e..4a2fba2 100755 --- a/src/pages/index/home/index.vue +++ b/src/pages/index/home/index.vue @@ -35,7 +35,7 @@ width="100rpx" height="100rpx" :duration="100" - :src="$assets(listItem.icon)" + :src="item.iconPath || $assets(listItem.icon)" /> {{ listItem.title @@ -93,6 +93,7 @@ import Order from '../order/index.vue' const { $Router, $api, $store } = getCurrentInstance().proxy const userRole = computed(() => $store.user.userInfo.roleName ?? 'simple') +const isLogin = computed(() => !!$store.user.token) const searchVal = ref('') const swiperList = ref([]) // { @@ -169,10 +170,29 @@ const gridList = ref([ title: '在线咨询', icon: '/home-icon/h-icon-8.png', path: '' + }, + { + title: '成为陪诊师', + // icon: '/personal/qiehuan.png', + iconPath: 'https://pei-zhen.oss-cn-shanghai.aliyuncs.com/h-icon-11.png', + path: '' } ]) const handleGridClick = (path, query = {}) => { + if (!isLogin.value) { + $dialog('请先登录', { + showCancelButton: true, + confirmButtonText: '去登录', + cancelButtonText: '取消', + confirmColor: '#FF8CA6' + }) + .then(() => { + $Router.push('/personal') + }) + .catch(() => '') + return + } if (path) { $Router.push({ path, diff --git a/src/pages/index/order/index.vue b/src/pages/index/order/index.vue index 904c9e6..4e24200 100755 --- a/src/pages/index/order/index.vue +++ b/src/pages/index/order/index.vue @@ -302,7 +302,7 @@ onShow(() => { confirmColor: '#FF8CA6' }) .then(() => { - // $Router.push('/personal') + return $Router.push('/personal') $store.user.login().then((user) => { // $store.user.setUserInfo(user) !user.nickName diff --git a/src/pages/index/personal/index.vue b/src/pages/index/personal/index.vue index e69de97..b8928c1 100755 --- a/src/pages/index/personal/index.vue +++ b/src/pages/index/personal/index.vue @@ -75,7 +75,7 @@ @@ -138,6 +138,50 @@ + + + + + + + + + + 我已阅读并同意 + 《用户协议》 + + 《隐私协议》 + + 《风险告知及免责协议》 + + + + + + + + @@ -148,6 +192,8 @@ import { onShow } from '@dcloudio/uni-app' const instance = getCurrentInstance() const { $api, $store, $Router, $loading, $dialog, $toast, $u } = instance.proxy +const show = ref(false) +const checked = ref([false]) const userStore = $store.user const isLogin = computed(() => !!$store.user.token) const userInfo = computed(() => $store.user.userInfo) @@ -193,13 +239,17 @@ const listConst = [ { icon: '/personal/guanyu.png', text: '关于我们', - path: '/pages/contact/index' - }, - { - icon: '/personal/lianxi.png', - text: '帮助中心', - path: '/pages/contact/index' + // path: '/pages/contact/index' + path: '/pages/statement/index', + query: { + type: 100 + } } + // { + // icon: '/personal/lianxi.png', + // text: '帮助中心', + // path: '/pages/contact/index' + // } ] const menuList = ref([]) const cashModel = ref({ @@ -232,6 +282,10 @@ const cashItemList = [ } ] +const checkboxChange = (n) => { + console.log('🚀 ~ file: index.vue:294 ~ n:', n) + checked.value = n +} watchEffect(() => { const { roleName, roleList = [] } = userInfo.value list.simple[1].text = roleList.includes('common') ? '切换身份' : '成为陪诊师' @@ -240,6 +294,27 @@ watchEffect(() => { const handleInfo = async (item) => { const { roleName, roleList = [] } = userInfo.value + if ( + !isLogin.value && + ['/pages/other/switch', '/pages/other/income-details', '/order'].includes( + item.path + ) + ) { + // $dialog('请先登录', { + // showCancelButton: true, + // confirmButtonText: '去登录', + // cancelButtonText: '取消', + // confirmColor: '#FF8CA6' + // }) + // .then(() => {}) + // .catch(() => '') + uni.showToast({ + title: '请先登录', + icon: 'none', + duration: 2000 + }) + return + } if ( !item.path || (item.path === '/pages/other/switch' && roleList.includes('common')) @@ -304,21 +379,26 @@ const handleWithdraw = async () => { const handleLogin = async () => { if (!isLogin.value) { - $loading(true) - userStore.login().then((user) => { - $loading(false) - !user.nickName - ? $Router.push({ - path: '/pages/other/edit-userinfo' - }) - : userStore.setUserInfo(user) - }) + show.value = true } else $Router.push({ path: '/pages/other/edit-userinfo' }) } +const login = () => { + $loading(true) + userStore.login().then((user) => { + $loading(false) + show.value = false + !user.nickName + ? $Router.push({ + path: '/pages/other/edit-userinfo' + }) + : userStore.setUserInfo(user) + }) +} + const loading = ref(true) const getUserInfo = async () => { setTimeout(() => { @@ -335,6 +415,10 @@ const getUserInfo = async () => { } else userStore.logout() } +const goStatement = (type) => { + $Router.push('/pages/statement/index?type=' + type) +} + onShow(() => { getUserInfo() }) diff --git a/src/pages/other/switch.vue b/src/pages/other/switch.vue index 14b112f..e4292b7 100755 --- a/src/pages/other/switch.vue +++ b/src/pages/other/switch.vue @@ -34,7 +34,7 @@ activeColor="#FF8CA6" shape="square" placement="row" - :disabled="model.status === 0" + :disabled="model.status === 0" > @@ -51,7 +51,7 @@ placeholder="" maxlength="300" :autoHeight="false" - :disabled="model.status === 0" + :disabled="model.status === 0" /> {{model.status === 0 ? '申请中' : '提交申请'}}{{ model.status === 0 ? '申请中' : '提交申请' }} @@ -261,13 +261,13 @@ const init = async () => { const images = res.doctor.images.split(',') imageObj.value.ren = images[0] imageObj.value.fan = images[1] - agreed.value = true + agreed.value = true } $loading(false) } const handleChooseImage = async (key) => { - if(model.value.status === 0) return + if (model.value.status === 0) return let filePath = '' try { const ret = await chooseImage({ @@ -345,7 +345,7 @@ onShow(() => { }) .catch(() => '') return - } + } }) init() diff --git a/src/pages/statement/index.vue b/src/pages/statement/index.vue index a7cadbd..e71e388 100755 --- a/src/pages/statement/index.vue +++ b/src/pages/statement/index.vue @@ -1,20 +1,41 @@ - diff --git a/src/pages/statement/protocol-1.js b/src/pages/statement/protocol-1.js new file mode 100644 index 0000000..e69de29