jmash-core-mp 0.1.46 → 0.1.48

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.
@@ -18,7 +18,7 @@ class StorageApiImpl {
18
18
  method: "GET",
19
19
  });
20
20
  }
21
- // 查询列表信息店铺用户浏览信息
21
+ // 查询列表信息店铺
22
22
  findStorageOrganInfoList(data) {
23
23
  const config = getApp().globalData.config;
24
24
  return mpx.xfetch.fetch({
@@ -6,11 +6,18 @@ export interface StorageOrganInfoList {
6
6
  results: StorageOrganInfoModel[];
7
7
  }
8
8
  export interface StorageOrganInfoModel {
9
+ storageId?: string;
10
+ organId?: string;
9
11
  organName?: string;
10
- logoUrl?: string;
12
+ organCode?: string;
13
+ serviceType?: string;
14
+ storage?: string;
15
+ status?: boolean;
16
+ createBy?: string;
11
17
  createTime?: string;
12
- remark?: string;
13
18
  organTenant?: string;
19
+ remark?: string;
20
+ logoUrl?: string;
14
21
  }
15
22
  export interface ShopBrowserUserList {
16
23
  results: ShopBrowserUserModel[];
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmash-core-mp",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "private": false,
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -32,7 +32,7 @@ class StorageApiImpl {
32
32
  });
33
33
  }
34
34
 
35
- // 查询列表信息店铺用户浏览信息
35
+ // 查询列表信息店铺
36
36
  findStorageOrganInfoList(
37
37
  data: StorageOrganInfoReq
38
38
  ): Promise<ResponseData<StorageOrganInfoList>> {
@@ -5,25 +5,37 @@ export interface StorageOrganInfoReq {
5
5
  // 组织名称模糊检索
6
6
  likeOrganName?: string;
7
7
  }
8
-
9
8
  // 组织列表
10
9
  export interface StorageOrganInfoList {
11
10
  // 当前内容
12
11
  results: StorageOrganInfoModel[];
13
12
  }
14
-
15
13
  // 组织实体
16
14
  export interface StorageOrganInfoModel {
15
+ // 存储ID
16
+ storageId?: string;
17
+ // 组织ID
18
+ organId?: string;
17
19
  // 组织名称
18
20
  organName?: string;
19
- // 店铺图片
20
- logoUrl?: string;
21
+ // 组织编码
22
+ organCode?: string;
23
+ // 服务类型
24
+ serviceType?: string;
25
+ // 组织信息存储区
26
+ storage?: string;
27
+ // 状态
28
+ status?: boolean;
29
+ // 创建人
30
+ createBy?: string;
21
31
  // 创建时间
22
32
  createTime?: string;
23
- // 备注
24
- remark?: string;
25
33
  // 组织租户
26
34
  organTenant?: string;
35
+ // 备注
36
+ remark?: string;
37
+ // 组织LOGO
38
+ logoUrl?: string;
27
39
  }
28
40
 
29
41
  // 店铺用户浏览信息列表
@@ -31,7 +43,6 @@ export interface ShopBrowserUserList {
31
43
  // 当前内容
32
44
  results: ShopBrowserUserModel[];
33
45
  }
34
-
35
46
  // 店铺用户浏览信息实体
36
47
  export interface ShopBrowserUserModel {
37
48
  // 店铺名称
@@ -0,0 +1,201 @@
1
+ <template>
2
+ <view class="cell-main">
3
+ <!-- 主菜单列表 -->
4
+ <view class="cell-group">
5
+ <block wx:for="{{ arr }}" wx:key="index">
6
+ <button class="cell contact-cell" wx:if="{{ item.show }}"
7
+ open-type="{{ item.type === 'contact' ? 'contact' : '' }}" bind:tap="handleNavigate"
8
+ data-item="{{ item }}">
9
+ <view class="my-cell-item-l">
10
+ <image wx:if="{{ resourceUrl && item.icon }}" class="cell-icon"
11
+ src="{{ resourceUrl + item.icon }}" mode="widthFix" />
12
+ <view class="cell-text">{{ item.text }}</view>
13
+ </view>
14
+ <cube-icon class="cell-arrow" type="arrow" size="28rpx" />
15
+ </button>
16
+ </block>
17
+ </view>
18
+ </view>
19
+
20
+ <!-- 公众号弹窗 -->
21
+ <jmash-code-interest-popup show="{{ gzShow }}" bind:close="onGzClose" />
22
+ </template>
23
+
24
+ <script lang="ts">
25
+ import mpx, { createComponent, ref, computed } from "@mpxjs/core";
26
+ import { config } from "../../utils/config";
27
+ import { EventBase } from "../../api/types";
28
+ import { useUserStore } from "../../store/user";
29
+
30
+ createComponent({
31
+ options: {
32
+ styleIsolation: "apply-shared",
33
+ },
34
+ properties: {
35
+ // 主菜单列表
36
+ menuList: {
37
+ type: Array,
38
+ value: [],
39
+ },
40
+ },
41
+ setup(props) {
42
+ // 用户状态管理
43
+ const userStore = useUserStore();
44
+ // 资源路径
45
+ const resourceUrl = config.resourceUrl + "/images/";
46
+ // 默认主菜单列表
47
+ const defaultMenuList = computed(() => [
48
+ {
49
+ type: "setting",
50
+ url: "/jmash/pages/auth/setting-page",
51
+ tabbar: false,
52
+ icon: "mall/icon-my-setting.png",
53
+ text: "系统设置",
54
+ show: true,
55
+ },
56
+ {
57
+ type: "gz",
58
+ url: "",
59
+ tabbar: false,
60
+ icon: "mall/icon_12.png",
61
+ text: "公众号",
62
+ show: true,
63
+ },
64
+ {
65
+ type: "contact",
66
+ url: "",
67
+ tabbar: false,
68
+ icon: "serve/icon-my-contact.png",
69
+ text: "联系客服",
70
+ show: true,
71
+ },
72
+ ]);
73
+ // 使用父组件传入的列表或默认列表
74
+ const arr = computed(() => props.menuList.length > 0 ? props.menuList : defaultMenuList.value);
75
+ // 公众号弹窗显示状态
76
+ let gzShow = ref(false);
77
+
78
+
79
+ // 公众号弹窗关闭
80
+ function onGzClose() {
81
+ gzShow.value = false;
82
+ }
83
+
84
+ // 跳转
85
+ function handleNavigate(e: EventBase) {
86
+ const { type, url, tabbar } = e.currentTarget.dataset.item;
87
+ if (type === "gz") {
88
+ // 公众号特殊处理
89
+ gzShow.value = true;
90
+ return;
91
+ }
92
+ if (type === "contact") {
93
+ // 联系客服由 open-type="contact" 处理,无需导航
94
+ return;
95
+ }
96
+ if (!userStore.checkLogin()) {
97
+ mpx.showModal({
98
+ title: "提示",
99
+ content: "请先登录!",
100
+ success(res) {
101
+ if (res.confirm) {
102
+ mpx.navigateTo({
103
+ url: config.loginUrl + "?tabbar=true&backurl=" + encodeURIComponent("/pages/tabbar/my"),
104
+ });
105
+ }
106
+ },
107
+ });
108
+ return;
109
+ }
110
+ if (url && !tabbar) {
111
+ mpx.navigateTo({ url });
112
+ } else if (url && tabbar) {
113
+ mpx.switchTab({ url });
114
+ }
115
+ }
116
+
117
+ return {
118
+ resourceUrl,
119
+ gzShow,
120
+ arr,
121
+ userStore,
122
+ handleNavigate,
123
+ onGzClose,
124
+ };
125
+ },
126
+ });
127
+ </script>
128
+
129
+ <style lang="scss">
130
+ @use "../../styles/index.scss" as *;
131
+
132
+ .cell-main {
133
+ display: flex;
134
+ flex-direction: column;
135
+ gap: 20rpx;
136
+ }
137
+
138
+ .cell-group {
139
+ margin: 0 30rpx;
140
+ border-radius: $border-radius;
141
+ background-color: $background-white-color;
142
+ overflow: hidden;
143
+ }
144
+
145
+ .cell {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: space-between;
149
+ padding: 26rpx 30rpx;
150
+ border-bottom: 2rpx solid $border-line;
151
+ box-sizing: border-box;
152
+ height: 90rpx;
153
+
154
+ .my-cell-item-l {
155
+ display: flex;
156
+ align-items: center;
157
+ gap: 20rpx;
158
+
159
+ .cell-icon {
160
+ width: 34rpx;
161
+ height: 34rpx;
162
+ }
163
+ }
164
+
165
+ .cell-text {
166
+ font-size: $font-size;
167
+ color: #1f2937;
168
+ }
169
+
170
+ .cell-arrow {
171
+ color: $font-color-grey-opacity;
172
+ }
173
+ }
174
+
175
+ .cell:last-child {
176
+ border-bottom: 0;
177
+ }
178
+
179
+ .contact-cell {
180
+ border: none;
181
+ margin: 0;
182
+ background: transparent;
183
+ text-align: left;
184
+ width: 100%;
185
+ line-height: inherit;
186
+ }
187
+
188
+ .contact-cell::after {
189
+ border: none;
190
+ }
191
+ </style>
192
+
193
+ <script type="application/json">
194
+ {
195
+ "component": true,
196
+ "usingComponents": {
197
+ "cube-icon": "@mpxjs/mpx-cube-ui/lib/components/icon/index",
198
+ "jmash-code-interest-popup": "../../components/common/jmash-code-interest-popup"
199
+ }
200
+ }
201
+ </script>
@@ -0,0 +1,223 @@
1
+ <template>
2
+ <!-- 关注公众号弹窗 -->
3
+ <jmash-popup show="{{ show }}" titleShow="{{ false }}" borderRadius="0" padding="0" bind:close="handleClose">
4
+ <view class="organ-code-interest-popup">
5
+ <view class="position-box">
6
+ <image wx:if="{{ resourceUrl }}" class="main-bgc-image" src="{{ resourceUrl + 'replaced/push_bgc.png' }}"
7
+ mode="widthFix" />
8
+ <view class="main">
9
+ <!-- 关闭文字 -->
10
+ <view class="main-close-text" bind:tap="handleClose">稍后关注</view>
11
+ <view class="main-title-image-box">
12
+ <view class="main-title">关注公众号</view>
13
+ </view>
14
+ <!-- 手的图片的定位盒子 -->
15
+ <view class="main-push-position-box">
16
+ <image wx:if="{{ resourceUrl }}" class="main-push-bgc-image"
17
+ src="{{ resourceUrl + 'replaced/push_hand_none.png' }}" mode="widthFix" />
18
+ <!-- 公司公众号二维码 -->
19
+ <view class="main-push-code-image">
20
+ <image wx:if="{{ resourceUrl && appQrcodeUrl }}" class="code-image" show-menu-by-longpress="{{ true }}"
21
+ src="{{ appQrcodeUrl }}" mode="aspectFit" />
22
+ </view>
23
+ <!-- 提示文字 -->
24
+ <view class="main-push-text">
25
+ 关注后即可获得以下权益
26
+ <view class="main-push-text_item">
27
+ <image wx:if="{{ resourceUrl }}" class="main-push-text_item_left"
28
+ src="{{ resourceUrl + 'icon_image/interest_lisk.png' }}" mode="aspectFit" />
29
+ <view class="main-push-text_item_right">
30
+ <view class="main-push-text_item_right_title">消息实时提醒</view>
31
+ <view>及时接收订单、收发货、交易、收益等动态信息</view>
32
+ </view>
33
+ </view>
34
+ <view class="main-push-text_item">
35
+ <image wx:if="{{ resourceUrl }}" class="main-push-text_item_left"
36
+ src="{{ resourceUrl + 'icon_image/interest_lisk.png' }}" mode="aspectFit" />
37
+ <view class="main-push-text_item_right">
38
+ <view class="main-push-text_item_right_title">享受更多服务</view>
39
+ <view>关注公众号,解锁客服、活动、会员等超值服务!</view>
40
+ </view>
41
+ </view>
42
+ </view>
43
+ </view>
44
+ </view>
45
+ </view>
46
+ </view>
47
+ </jmash-popup>
48
+ </template>
49
+
50
+ <script lang="ts">
51
+ import { createComponent, ref } from "@mpxjs/core";
52
+ import { config } from "../../utils/config";
53
+
54
+ createComponent({
55
+ options: {
56
+ styleIsolation: "apply-shared"
57
+ },
58
+ /**
59
+ * 组件的属性列表
60
+ */
61
+ properties: {
62
+ // 是否显示
63
+ show: {
64
+ type: Boolean,
65
+ value: false,
66
+ }
67
+ },
68
+ /**
69
+ * 组件的初始数据
70
+ */
71
+ setup() {
72
+ // 资源路径
73
+ let resourceUrl = config.resourceUrl + "/images/";
74
+ // 公司公众号二维码图片
75
+ let appQrcodeUrl = ref(config.resourceUrl + "/images/replaced/official_account2x.png");
76
+
77
+ return {
78
+ resourceUrl,
79
+ appQrcodeUrl,
80
+ };
81
+ },
82
+ /**
83
+ * 组件的方法列表
84
+ */
85
+ methods: {
86
+ // 关闭弹框
87
+ handleClose() {
88
+ this.triggerEvent("close");
89
+ },
90
+ }
91
+ });
92
+ </script>
93
+
94
+ <style lang="scss">
95
+ @use "../../styles/index.scss" as *;
96
+
97
+ .organ-code-interest-popup {
98
+ .position-box {
99
+ position: relative;
100
+ top: -10rpx;
101
+ left: 0;
102
+ height: 85vh;
103
+
104
+ .main-bgc-image {
105
+ position: absolute;
106
+ top: -10rpx;
107
+ left: 0;
108
+ width: $width;
109
+ }
110
+
111
+ .main {
112
+ position: absolute;
113
+ top: 0rpx;
114
+ left: 0;
115
+ padding-top: 37rpx;
116
+ width: $width;
117
+
118
+ .main-close-text {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: flex-end;
122
+ font-weight: 400;
123
+ font-size: 30rpx;
124
+ color: #ffffff;
125
+ margin-bottom: 40rpx;
126
+ padding-right: 30rpx;
127
+ }
128
+
129
+ .main-title-image-box {
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+
134
+ .main-title {
135
+ font-size: 57rpx;
136
+ font-weight: 500;
137
+ color: #0551ff;
138
+ }
139
+
140
+ .main-title-image {
141
+ width: 60%;
142
+ height: 69rpx;
143
+ }
144
+ }
145
+
146
+ .main-push-position-box {
147
+ position: relative;
148
+ display: flex;
149
+ justify-content: center;
150
+ align-items: center;
151
+ width: $width;
152
+ height: 1000rpx;
153
+
154
+ .main-push-bgc-image {
155
+ width: $width;
156
+ }
157
+
158
+ .main-push-code-image {
159
+ position: absolute;
160
+ top: 227rpx;
161
+ width: 187rpx;
162
+ height: 187rpx;
163
+
164
+ .code-image {
165
+ position: relative;
166
+ left: 14rpx;
167
+ width: $width;
168
+ height: 100%;
169
+ }
170
+ }
171
+
172
+ .main-push-text {
173
+ position: absolute;
174
+ top: 737rpx;
175
+ left: 80rpx;
176
+ color: $font-color;
177
+ font-size: $font-size;
178
+ font-weight: 600;
179
+ display: flex;
180
+ flex-direction: column;
181
+ gap: 35rpx;
182
+ letter-spacing: 1px;
183
+
184
+ .main-push-text_item {
185
+ display: flex;
186
+ align-items: self-start;
187
+ gap: 20rpx;
188
+ letter-spacing: 0.8px;
189
+
190
+ .main-push-text_item_left {
191
+ width: 25rpx;
192
+ height: 25rpx;
193
+ margin-top: 8rpx;
194
+ }
195
+
196
+ .main-push-text_item_right {
197
+ display: flex;
198
+ flex-direction: column;
199
+ gap: 10rpx;
200
+ color: $font-color-grey-opacity;
201
+ font-size: $font-size-mini;
202
+
203
+ &_title {
204
+ color: #296efe;
205
+ font-size: 26rpx;
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ </style>
215
+
216
+ <script type="application/json">
217
+ {
218
+ "component": true,
219
+ "usingComponents": {
220
+ "jmash-popup": "./jmash-popup"
221
+ }
222
+ }
223
+ </script>
@@ -4,6 +4,7 @@
4
4
  "./pages/auth/login",
5
5
  "./pages/auth/update-user",
6
6
  "./pages/auth/cms-protocol",
7
+ "./pages/auth/setting-page",
7
8
  "./pages/cms/cms-article-list",
8
9
  "./pages/cms/cms-article",
9
10
  "./pages/cms/cms-location-list",
@@ -0,0 +1,135 @@
1
+ <template>
2
+ <!-- 我的协议 -->
3
+ <view class="cell-group" wx:for="{{ arr }}" wx:key="index">
4
+ <navigator class="cell" url="{{ item.url }}" open-type="{{ item.openType }}" hover-class="none">
5
+ <view class="cell-text">{{ item.title }}</view>
6
+ <cube-icon class="cell-arrow" type="arrow" size="28rpx" />
7
+ </navigator>
8
+ </view>
9
+
10
+ <!-- 退出登录-仅清理用户相关数据 -->
11
+ <view class="logout-section">
12
+ <view class="logout-btn" bindtap="handleLogout">
13
+ <text class="logout-text">退出登录</text>
14
+ </view>
15
+ </view>
16
+ </template>
17
+
18
+ <script lang="ts">
19
+ import mpx, { createPage } from "@mpxjs/core";
20
+ import { useUserStore } from "../../../store/user";
21
+
22
+ createPage({
23
+ setup() {
24
+ const userStore = useUserStore();
25
+ const config = getApp().globalData.config;
26
+ // 我的协议
27
+ let arr = [
28
+ {
29
+ title: "用户协议",
30
+ openType: "navigateTo",
31
+ url: `/jmash/pages/auth/cms-protocol?tenant=${config.siteTenant}&siteId=${config.siteId}&channelAlias=${config.aliasAgreement}`,
32
+ },
33
+ {
34
+ title: "隐私政策",
35
+ openType: "navigateTo",
36
+ url: `/jmash/pages/auth/cms-protocol?tenant=${config.siteTenant}&siteId=${config.siteId}&channelAlias=${config.aliasPrivacy}`,
37
+ },
38
+ ];
39
+
40
+ return { arr, userStore }
41
+ },
42
+ methods: {
43
+ handleLogout() {
44
+ mpx.showModal({
45
+ title: "提示",
46
+ content: "确定要退出登录吗?",
47
+ success: (res) => {
48
+ if (!res.confirm) return
49
+
50
+ // 1. 只清除登录相关数据,保留角色权限等其他数据
51
+ mpx.removeStorageSync('token')
52
+ mpx.removeStorageSync('refreshToken')
53
+ mpx.removeStorageSync('expiresDate')
54
+ mpx.removeStorageSync('expiresIn')
55
+ mpx.removeStorageSync('userInfo')
56
+
57
+ // 2. 重置 store 状态
58
+ this.userStore.accessToken = ''
59
+ this.userStore.expiresDate = 0
60
+ this.userStore.userInfo = {} as any
61
+
62
+ mpx.showToast({ title: "已退出登录", icon: "none" })
63
+
64
+ // 3. 跳转到启动页,重新走登录流程
65
+ mpx.navigateBack({ delta: 1 })
66
+ },
67
+ })
68
+ },
69
+ },
70
+ });
71
+ </script>
72
+
73
+ <style lang="scss">
74
+ @use "../../../styles/index.scss" as *;
75
+
76
+ page {
77
+ background-color: $background-color;
78
+ }
79
+
80
+ .cell-group {
81
+ background: $background-white-color;
82
+ }
83
+
84
+ .cell {
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: space-between;
88
+ padding: 28rpx 30rpx;
89
+ color: $font-color;
90
+ border-bottom: 2rpx solid $border-line;
91
+ }
92
+
93
+ .cell:last-child {
94
+ border-bottom: 0;
95
+ }
96
+
97
+ .cell-text {
98
+ font-size: $font-size;
99
+ }
100
+
101
+ .cell-arrow {
102
+ color: $font-color-grey-opacity;
103
+ }
104
+
105
+ .logout-section {
106
+ position: fixed;
107
+ left: 0;
108
+ right: 0;
109
+ bottom: 0;
110
+ padding: 0 0 calc(env(safe-area-inset-bottom) + 300rpx);
111
+ background-color: $background-color;
112
+ }
113
+
114
+ .logout-btn {
115
+ background-color: $background-white-color;
116
+ padding: 32rpx 0;
117
+ text-align: center;
118
+ border-radius: 12rpx;
119
+ }
120
+
121
+ .logout-text {
122
+ font-size: $font-size;
123
+ color: #dc2626;
124
+ font-weight: 500;
125
+ }
126
+ </style>
127
+
128
+ <script type="application/json">
129
+ {
130
+ "usingComponents": {
131
+ "cube-icon": "@mpxjs/mpx-cube-ui/lib/components/icon/index"
132
+ },
133
+ "navigationBarTitleText": "系统设置"
134
+ }
135
+ </script>