af-mobile-client-vue3 1.0.89 → 1.0.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,169 @@
1
+ <script setup lang="ts">
2
+ import banner1 from '@af-mobile-client-vue3/assets/img/banner/appraise-banner-1.png';
3
+ import banner2 from '@af-mobile-client-vue3/assets/img/banner/appraise-banner-2.png';
4
+
5
+ import {
6
+ NavBar as VanNavBar,
7
+ Space as VanSpace,
8
+ Row as VanRow,
9
+ Loading as VanLoading,
10
+ CellGroup as VanCellGroup,
11
+ Cell as VanCell,
12
+ Swipe as VanSwipe,
13
+ SwipeItem as VanSwipeItem
14
+ } from 'vant'
15
+ import { useRoute } from "vue-router";
16
+ import {onMounted,ref,getCurrentInstance} from 'vue'
17
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
18
+ import {openApiLogic} from "@af-mobile-client-vue3/services/api/common"
19
+ import {showDialog} from "vant/lib";
20
+ import {formatDate} from '@af-mobile-client-vue3/hooks/useCommon'
21
+ let xForm = ref()
22
+ const xFormInit = ref(false)
23
+ const mode = ref('')
24
+ let loading = ref(true)
25
+ const groupFormItems = ref({})
26
+ const formData = ref({})
27
+ let id = ref(-1)
28
+ let openid = ref('')
29
+ const instance = getCurrentInstance();
30
+ let route = useRoute()
31
+ let serviceName = ref('af-revenue')
32
+ let images = ref([banner1, banner2])
33
+ let currentEvaluate = {
34
+ id: null,
35
+ f_business_name: '',
36
+ f_evaluate_state: ''
37
+ }
38
+ onMounted(()=>{
39
+ if (instance) {
40
+ id.value = route.params.id as unknown as number
41
+ openid.value = <string>route.params.openid
42
+ formInit()
43
+ }})
44
+
45
+ async function formInit() {
46
+ if (id.value > 0) {
47
+ queryData()
48
+ } else {
49
+ // 没有id 直接提示用户不存在,返回上一级
50
+ await showDialog({message: '评价信息缺少参数,找不到对应评价信息'})
51
+ closeWindows()
52
+ }
53
+ }
54
+ function queryData () {
55
+ openApiLogic({
56
+ id: id.value
57
+ }, 'getEvalConfigById',serviceName.value).then(async (res: any) => {
58
+ console.log('打印res', res)
59
+ if (res.row && res.config) {
60
+ Object.assign(currentEvaluate, res.row)
61
+ if (currentEvaluate.f_evaluate_state === '已评价') {
62
+ // await showDialog({message: '该纪录已经被评价过了'})
63
+ // closeWindows()
64
+ mode.value = '预览'
65
+ formData.value = res.row.f_json ? JSON.parse(res.row.f_json) : {}
66
+ }
67
+ groupFormItems.value = res.config
68
+ xFormInit.value = true
69
+ loading.value = false
70
+ } else {
71
+ await showDialog({message: res.msg})
72
+ closeWindows()
73
+ }
74
+ }).catch(() => {
75
+ showDialog({message: '查询评价信息失败了'})
76
+ })
77
+ }
78
+ function onSubmit(params) {
79
+ let data = {
80
+ id: currentEvaluate.id,
81
+ f_json: params,
82
+ f_evaluate_date: formatDate(new Date),
83
+ f_evaluate_state: '已评价',
84
+ f_evaluate_type: '用户评价',
85
+ f_evaluate_userid: openid.value
86
+ }
87
+ openApiLogic(data, 'saveEvaluate', serviceName.value).then(async (res: any) => {
88
+ if (res.id) {
89
+ await showDialog({message: '评价成功了'})
90
+ closeWindows()
91
+ } else {
92
+ await showDialog({message: '评价失败了'})
93
+ }
94
+ }).catch(() => {
95
+ showDialog({ message: '评价失败了' })
96
+ })
97
+ }
98
+ function closeWindows() {
99
+ let ua = window.navigator.userAgent.toLowerCase();
100
+ if (ua.indexOf('micromessenger') !== -1) {
101
+ WeixinJSBridge.call('closeWindow')
102
+ } else {
103
+ //关闭页面
104
+ if (navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('Chrome')!= -1) {
105
+ window.open('about:blank', '_self')
106
+ window.close()
107
+ } else {
108
+ window.opener = null
109
+ window.open('', '_self')
110
+ window.close()
111
+ }
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <template>
117
+ <van-nav-bar
118
+ :title="mode === '预览' ? '服务评价纪录' : '服务评价'"
119
+ />
120
+ <van-swipe class="my-swipe" height="150" :autoplay="3000" lazy-render indicator-color="#7b7c7c">
121
+ <van-swipe-item v-for="image in images" :key="image">
122
+ <img :src="image" />
123
+ </van-swipe-item>
124
+ </van-swipe>
125
+ <van-row justify="center" v-show="loading">
126
+ <van-loading type="spinner" color="#1989fa" />
127
+ </van-row>
128
+ <van-space direction="vertical" fill v-show="!loading">
129
+ <van-cell-group inset>
130
+ <van-cell title="业务办理人" :value="currentEvaluate.f_business_agent" />
131
+ <van-cell title="业务类型" :value="currentEvaluate.f_business_type" />
132
+ <van-cell title="业务名称" :value="currentEvaluate.f_business_name" />
133
+ </van-cell-group>
134
+ <x-form
135
+ v-if="xFormInit"
136
+ ref="xForm"
137
+ style="margin-bottom: 14px;"
138
+ :group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
139
+ :service-name="serviceName"
140
+ :form-data="formData"
141
+ :mode="mode"
142
+ @onSubmit="onSubmit">
143
+ </x-form>
144
+ </van-space>
145
+ </template>
146
+
147
+ <style scoped>
148
+ .van-cell-group--inset .van-cell::after {
149
+ border-bottom: 1px dashed #c0c2c2 !important; /* 虚线 + 颜色 */
150
+ left: 16px; /* 保持 inset 分组缩进 */
151
+ right: 16px;
152
+ }
153
+ .my-swipe .van-swipe-item {
154
+ border-radius: 8px;
155
+ box-sizing: border-box;
156
+ padding: 8px; /* 让图片和边框有间距 */
157
+ }
158
+
159
+ .my-swipe .van-swipe-item img {
160
+ width: 100%;
161
+ height: 100%;
162
+ object-fit: contain; /* 保持图片比例 */
163
+ border-radius: 4px; /* 可选:图片圆角 */
164
+ }
165
+ img {
166
+ overflow-clip-margin: content-box;
167
+ overflow: clip;
168
+ }
169
+ </style>
@@ -63,8 +63,8 @@ function submit(_result) {
63
63
  <!-- v-if="isInit" -->
64
64
  <XFormGroup
65
65
  ref="formGroup"
66
- config-name="lngOrderCarInFormGroup"
67
- service-name="af-gaslink"
66
+ :config-name="configName"
67
+ :service-name="serviceName"
68
68
  :group-form-data="formData"
69
69
  mode="新增"
70
70
  @submit="submit"
@@ -1,123 +1,127 @@
1
- <script setup lang="ts">
2
- import { ref } from 'vue'
3
- import {
4
- Cell as VanCell,
5
- List as VanList,
6
- showToast,
7
- } from 'vant'
8
- import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
9
- import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
10
-
11
- // 列表详情页的路由 '/Component/XCellDetailView/:id'
12
- const list = ref([
13
- {
14
- name: 'XCellList 单元格列表',
15
- to: '/Component/XCellListView',
16
- },
17
- {
18
- name: 'XReportForm 报表表单',
19
- to: '/Component/XReportFormView',
20
- },
21
- {
22
- name: 'XCellDetail 列表详情页',
23
- to: '/Component/XCellDetailView/0',
24
- },
25
- {
26
- name: 'XForm 表单',
27
- to: '/Component/XFormView/1/debug',
28
- },
29
- {
30
- name: '操作卡手机端',
31
- to: '/Component/XReportFormView',
32
- },
33
- {
34
- name: '评论记录列表',
35
- to: '/Component/EvaluateRecordView',
36
- },
37
- {
38
- name: 'XSignature 签名组件',
39
- to: '/Component/XSignatureView',
40
- },
41
- {
42
- name: 'XReportGridView 栅格组件',
43
- to: '/Component/XReportGridView',
44
- },
45
- ])
46
-
47
- function cleanConfigCache() {
48
- // 清除indexedDB缓存
49
- indexedDB.clear()
50
- showToast({
51
- message: '操作成功',
52
- })
53
- }
54
-
55
- async function logout() {
56
- await useUserStore().logout()
57
- }
58
- </script>
59
-
60
- <template>
61
- <main class="home_main">
62
- <h1 class="home_title">
63
- <img src="@af-mobile-client-vue3/assets/img/component/logo.png" alt="logo">
64
- <span>Vue3-Client</span>
65
- </h1>
66
- <span class="home_desc">基于Vant4的移动端组件库扩展</span>
67
- <div class="home_component_main">
68
- <span class="home_desc">配置化组件</span>
69
- <VanList>
70
- <VanCell v-for="item in list" :key="item.name" :title="item.name" is-link :to="item.to" />
71
- </VanList>
72
- <span class="home_desc">开发者工具</span>
73
- <VanList>
74
- <VanCell key="clean_config_cache" title="清除配置缓存" @click="cleanConfigCache" />
75
- <VanCell key="clean_config_cache" title="退出登录" @click="logout" />
76
- </VanList>
77
- </div>
78
- </main>
79
- </template>
80
-
81
- <style scoped lang="less">
82
- .home_main {
83
- width: 100vw;
84
- height: 100%;
85
- padding: var(--base-interval-2);
86
- background-color: #eff2f5;
87
- .home_title {
88
- margin: 0 0 10px;
89
- font-size: 30px;
90
- font-weight: 400;
91
- color: rgb(50, 50, 51);
92
- img {
93
- vertical-align: middle;
94
- width: 46px;
95
- height: 46px;
96
- }
97
- span {
98
- margin-left: 12px;
99
- }
100
- }
101
- .home_desc {
102
- padding-left: 16px;
103
- font-weight: 400;
104
- line-height: 1.6;
105
- margin: 0 0 40px;
106
- color: #969799;
107
- font-size: 14px;
108
- }
109
- .home_component_main {
110
- margin-top: 30px;
111
- .van-cell {
112
- margin: 10px 0;
113
- font-weight: 600;
114
- border-radius: 99px;
115
- color: #34495e;
116
- :deep(.van-icon) {
117
- display: flex;
118
- align-items: center;
119
- }
120
- }
121
- }
122
- }
123
- </style>
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import {
4
+ Cell as VanCell,
5
+ List as VanList,
6
+ showToast,
7
+ } from 'vant'
8
+ import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
9
+ import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
10
+
11
+ // 列表详情页的路由 '/Component/XCellDetailView/:id'
12
+ const list = ref([
13
+ {
14
+ name: 'XCellList 单元格列表',
15
+ to: '/Component/XCellListView',
16
+ },
17
+ {
18
+ name: 'XReportForm 报表表单',
19
+ to: '/Component/XReportFormView',
20
+ },
21
+ {
22
+ name: 'XCellDetail 列表详情页',
23
+ to: '/Component/XCellDetailView/0',
24
+ },
25
+ {
26
+ name: 'XForm 表单',
27
+ to: '/Component/XFormView/1/debug',
28
+ },
29
+ {
30
+ name: '操作卡手机端',
31
+ to: '/Component/XReportFormView',
32
+ },
33
+ {
34
+ name: '评论记录列表',
35
+ to: '/Component/EvaluateRecordView',
36
+ },
37
+ {
38
+ name: 'XSignature 签名组件',
39
+ to: '/Component/XSignatureView',
40
+ },
41
+ {
42
+ name: 'XReportGridView 栅格组件',
43
+ to: '/Component/XReportGridView',
44
+ },
45
+ {
46
+ name: 'XFormAppraise 表单',
47
+ to: '/Component/XFormAppraiseView/2/debug',
48
+ },
49
+ ])
50
+
51
+ function cleanConfigCache() {
52
+ // 清除indexedDB缓存
53
+ indexedDB.clear()
54
+ showToast({
55
+ message: '操作成功',
56
+ })
57
+ }
58
+
59
+ async function logout() {
60
+ await useUserStore().logout()
61
+ }
62
+ </script>
63
+
64
+ <template>
65
+ <main class="home_main">
66
+ <h1 class="home_title">
67
+ <img src="@af-mobile-client-vue3/assets/img/component/logo.png" alt="logo">
68
+ <span>Vue3-Client</span>
69
+ </h1>
70
+ <span class="home_desc">基于Vant4的移动端组件库扩展</span>
71
+ <div class="home_component_main">
72
+ <span class="home_desc">配置化组件</span>
73
+ <VanList>
74
+ <VanCell v-for="item in list" :key="item.name" :title="item.name" is-link :to="item.to" />
75
+ </VanList>
76
+ <span class="home_desc">开发者工具</span>
77
+ <VanList>
78
+ <VanCell key="clean_config_cache" title="清除配置缓存" @click="cleanConfigCache" />
79
+ <VanCell key="clean_config_cache" title="退出登录" @click="logout" />
80
+ </VanList>
81
+ </div>
82
+ </main>
83
+ </template>
84
+
85
+ <style scoped lang="less">
86
+ .home_main {
87
+ width: 100vw;
88
+ height: 100%;
89
+ padding: var(--base-interval-2);
90
+ background-color: #eff2f5;
91
+ .home_title {
92
+ margin: 0 0 10px;
93
+ font-size: 30px;
94
+ font-weight: 400;
95
+ color: rgb(50, 50, 51);
96
+ img {
97
+ vertical-align: middle;
98
+ width: 46px;
99
+ height: 46px;
100
+ }
101
+ span {
102
+ margin-left: 12px;
103
+ }
104
+ }
105
+ .home_desc {
106
+ padding-left: 16px;
107
+ font-weight: 400;
108
+ line-height: 1.6;
109
+ margin: 0 0 40px;
110
+ color: #969799;
111
+ font-size: 14px;
112
+ }
113
+ .home_component_main {
114
+ margin-top: 30px;
115
+ .van-cell {
116
+ margin: 10px 0;
117
+ font-weight: 600;
118
+ border-radius: 99px;
119
+ color: #34495e;
120
+ :deep(.van-icon) {
121
+ display: flex;
122
+ align-items: center;
123
+ }
124
+ }
125
+ }
126
+ }
127
+ </style>