cr лет назад: 4
Родитель
Сommit
eb4606504b

BIN
nativeplugins/Test/android/SerialPortPicingScale-release.aar


BIN
nativeplugins/Test/android/uniplugin_module-release.aar


+ 32 - 0
nativeplugins/Test/package.json

@@ -0,0 +1,32 @@
1
+{
2
+	"name": "Test",
3
+	"id": "Test",
4
+	"version": "0.0.1",
5
+	"description": "电子秤测试",
6
+	"_dp_type":"nativeplugin",
7
+	"_dp_nativeplugin":{
8
+
9
+		"android": {
10
+			"plugins": [
11
+				{
12
+					"type": "module",
13
+					"name": "TestModule",
14
+					"class": "io.dcloud.uniplugin.TestModule"
15
+				}
16
+			],
17
+			"integrateType": "aar",
18
+			"minSdkVersion": "19",
19
+			"permissions": [
20
+			
21
+			],
22
+			"abis": [  
23
+				"armeabi-v7a",  
24
+				"arm64-v8a",
25
+				"x86"  
26
+			],
27
+			"parameters": {  
28
+               
29
+            }
30
+		}
31
+	}
32
+}

+ 16 - 0
src/manifest.json

@@ -93,6 +93,22 @@
93 93
                     }
94 94
                 }
95 95
             }
96
+        },
97
+        "nativePlugins" : {
98
+            "Test" : {
99
+                "__plugin_info__" : {
100
+                    "name" : "Test",
101
+                    "description" : "电子秤测试",
102
+                    "platforms" : "Android",
103
+                    "url" : "",
104
+                    "android_package_name" : "",
105
+                    "ios_bundle_id" : "",
106
+                    "isCloud" : false,
107
+                    "bought" : -1,
108
+                    "pid" : "",
109
+                    "parameters" : {}
110
+                }
111
+            }
96 112
         }
97 113
     },
98 114
     /* SDK配置 */

+ 6 - 0
src/pages.json

@@ -267,6 +267,12 @@
267 267
             "style": {
268 268
                 "navigationBarTitleText": "修改手机号"
269 269
             }
270
+        },
271
+        {
272
+            "path": "pages/test/index",
273
+            "style": {
274
+                "navigationBarTitleText": "测试页"
275
+            }
270 276
         }
271 277
     ]
272 278
 }

+ 305 - 283
src/pages/manage/index.vue

@@ -1,308 +1,330 @@
1 1
 <template>
2
-    <div class="page">
3
-        <div class="tips" v-if="shopErr">
4
-            当前店铺没有门店,请后台添加门店后重试
5
-        </div>
6
-        <div v-if="!shopErr">
7
-            <div class="page__top" v-if="isAdmin">
8
-                <div class="name">当前门店:</div>
9
-                <div class="shop" @click="goShopSelect">
10
-                    <div class="shop__name">
11
-                        <!-- 最多6字 -->
12
-                        {{ curShop.name ? curShop.name : "加载中..." }}
13
-                        <i class="iconfont iconyoujiantou shop__arrow"></i>
14
-                    </div>
15
-                </div>
16
-            </div>
17
-            <div class="page__top" v-else>
18
-                <div class="name">当前门店:</div>
19
-                <div class="shop">
20
-                    <div class="shop__name">
21
-                        <!-- 最多6字 -->
2
+	<div class="page">
3
+		<div class="tips" v-if="shopErr">
4
+			当前店铺没有门店,请后台添加门店后重试
5
+		</div>
6
+		<div v-if="!shopErr">
7
+			<div class="page__top" v-if="isAdmin">
8
+				<div class="name">当前门店:</div>
9
+				<div class="shop" @click="goShopSelect">
10
+					<div class="shop__name">
11
+						<!-- 最多6字 -->
12
+						{{ curShop.name ? curShop.name : "加载中..." }}
13
+						<i class="iconfont iconyoujiantou shop__arrow"></i>
14
+					</div>
15
+				</div>
16
+			</div>
17
+			<div class="page__top" v-else>
18
+				<div class="name">当前门店:</div>
19
+				<div class="shop">
20
+					<div class="shop__name">
21
+						<!-- 最多6字 -->
22 22
 
23
-                        {{ curShop.name ? curShop.name : "加载中..." }}
24
-                        <!-- <i class="iconfont iconyoujiantou shop__arrow"></i> -->
25
-                    </div>
26
-                </div>
27
-            </div>
28
-            <ul class="menu" v-if="!menuLoading">
29
-                <li
30
-                    class="item"
31
-                    v-for="item of menuList"
32
-                    :key="item.id"
33
-                    @click="jump(item.url)"
34
-                >
35
-                    <my-image class="img" :src="item.icon"></my-image>
36
-                    <span class="text">{{ item.name }}</span>
37
-                </li>
38
-                <!-- <li class="item" @click="jump('/pages/manage/user/index')">
23
+						{{ curShop.name ? curShop.name : "加载中..." }}
24
+						<!-- <i class="iconfont iconyoujiantou shop__arrow"></i> -->
25
+					</div>
26
+				</div>
27
+			</div>
28
+			<ul class="menu" v-if="!menuLoading">
29
+				<li class="item" v-for="item of menuList" :key="item.id" @click="jump(item.url)">
30
+					<my-image class="img" :src="item.icon"></my-image>
31
+					<span class="text">{{ item.name }}</span>
32
+				</li>
33
+				<!-- <li class="item" @click="jump('/pages/manage/user/index')">
39 34
                     <my-image
40 35
                         class="img"
41 36
                         src="/static/icon/user.png"
42 37
                     ></my-image>
43 38
                     <span class="text">账号设置</span>
44 39
                 </li> -->
45
-            </ul>
46
-        </div>
40
+				<li class="item" @click="jump('/pages/test/index')">
41
+                    <my-image
42
+                        class="img"
43
+                        src="/static/icon/user.png"
44
+                    ></my-image>
45
+                    <span class="text">app接口测试</span>
46
+                </li>
47
+			</ul>
48
+		</div>
47 49
 
48
-        <button class="btn" @click="layout">退出登录</button>
50
+		<button class="btn" @click="layout">退出登录</button>
49 51
 
50
-        <div class="ver">0.3.9</div>
51
-    </div>
52
+		<div class="ver">0.3.9</div>
53
+	</div>
52 54
 </template>
53 55
 
54 56
 <script>
55
-import MyImage from "../../components/image/index";
57
+	import MyImage from "../../components/image/index";
58
+
59
+	export default {
60
+		name: "",
61
+		components: {
62
+			MyImage
63
+		},
56 64
 
57
-export default {
58
-    name: "",
59
-    components: { MyImage },
65
+		// 数据
66
+		data() {
67
+			return {
68
+				curShop: {},
69
+				shopErr: false,
70
+				menuList: [],
71
+				menuLoading: true,
72
+			};
73
+		},
60 74
 
61
-    // 数据
62
-    data() {
63
-        return {
64
-            curShop: {},
65
-            shopErr: false,
66
-            menuList: [],
67
-            menuLoading: true,
68
-        };
69
-    },
75
+		onLoad() {
76
+			this.getUserMenu();
77
+			// this.appTest();
78
+		},
79
+		async onShow() {
80
+			if (this.isAdmin) {
81
+				this.curShop = {
82
+					name: this.user.storeName,
83
+					id: this.user.storeId,
84
+				};
85
+				this.getShopList();
86
+			} else {
87
+				if (this.user.storeId) {
88
+					this.curShop = {
89
+						name: this.user.storeName,
90
+						id: this.user.storeId,
91
+					};
92
+				} else {
93
+					this.fn.showModal({
94
+						content: "当前用户无门店设置,请前往后台设置所属店铺",
95
+					});
96
+					// this.getShopList();
97
+				}
98
+			}
99
+		},
100
+		// 函数
101
+		methods: {
70 102
 
71
-    onLoad() {
72
-        this.getUserMenu();
73
-    },
74
-    async onShow() {
75
-        if (this.isAdmin) {
76
-            this.curShop = {
77
-                name: this.user.storeName,
78
-                id: this.user.storeId,
79
-            };
80
-            this.getShopList();
81
-        } else {
82
-            if (this.user.storeId) {
83
-                this.curShop = {
84
-                    name: this.user.storeName,
85
-                    id: this.user.storeId,
86
-                };
87
-            } else {
88
-                this.fn.showModal({
89
-                    content: "当前用户无门店设置,请前往后台设置所属店铺",
90
-                });
91
-                // this.getShopList();
92
-            }
93
-        }
94
-    },
95
-    // 函数
96
-    methods: {
97
-        getUserMenu() {
98
-            uni.showLoading({
99
-                title: "加载中...",
100
-            });
101
-            this.menuLoading = true;
102
-            this.api
103
-                .get("/User/GetUserMenu", { userId: this.user.id })
104
-                .then((res) => {
105
-                    if (res.data.userMenu) {
106
-                        let userMenu = res.data.userMenu.mobile;
107
-                        let mobileMenu = res.data.menu.mobile;
108
-                        if (userMenu && userMenu.length) {
109
-                            this.initMenu(mobileMenu, userMenu);
110
-                        }
111
-                    }
112
-                    this.menuLoading = false;
113
-                    uni.hideLoading();
114
-                });
115
-        },
103
+			getUserMenu() {
104
+				uni.showLoading({
105
+					title: "加载中...",
106
+				});
107
+				this.menuLoading = true;
108
+				this.api
109
+					.get("/User/GetUserMenu", {
110
+						userId: this.user.id
111
+					})
112
+					.then((res) => {
113
+						if (res.data.userMenu) {
114
+							let userMenu = res.data.userMenu.mobile;
115
+							let mobileMenu = res.data.menu.mobile;
116
+							if (userMenu && userMenu.length) {
117
+								this.initMenu(mobileMenu, userMenu);
118
+							}
119
+						}
120
+						this.menuLoading = false;
121
+						uni.hideLoading();
122
+					});
123
+			},
116 124
 
117
-        initMenu(menu, userMenu) {
118
-            let arr = [];
119
-            for (let item of menu) {
120
-                for (let userItem of userMenu) {
121
-                    if (userItem.id === item.id && userItem.status === 1) {
122
-                        let obj = item;
123
-                        let childArr = [];
124
-                        if (userItem.children && userItem.children.length) {
125
-                            for (let userChild of userItem.children) {
126
-                                for (let child of item.children) {
127
-                                    if (
128
-                                        userChild.id === child.id &&
129
-                                        userChild.status === 1
130
-                                    ) {
131
-                                        childArr.push(child);
132
-                                    }
133
-                                }
134
-                            }
135
-                        }
136
-                        obj.children = childArr;
137
-                        arr.push(obj);
138
-                    }
139
-                }
140
-            }
141
-            this.$store.commit("user/update", {
142
-                menuList: arr,
143
-            });
144
-            this.menuList = arr;
145
-        },
125
+			initMenu(menu, userMenu) {
126
+				let arr = [];
127
+				for (let item of menu) {
128
+					for (let userItem of userMenu) {
129
+						if (userItem.id === item.id && userItem.status === 1) {
130
+							let obj = item;
131
+							let childArr = [];
132
+							if (userItem.children && userItem.children.length) {
133
+								for (let userChild of userItem.children) {
134
+									for (let child of item.children) {
135
+										if (
136
+											userChild.id === child.id &&
137
+											userChild.status === 1
138
+										) {
139
+											childArr.push(child);
140
+										}
141
+									}
142
+								}
143
+							}
144
+							obj.children = childArr;
145
+							arr.push(obj);
146
+						}
147
+					}
148
+				}
149
+				this.$store.commit("user/update", {
150
+					menuList: arr,
151
+				});
152
+				this.menuList = arr;
153
+			},
146 154
 
147
-        getShopList() {
148
-            uni.showLoading({
149
-                title: "加载中...",
150
-            });
151
-            this.api.get("/Store/GetShopList").then((res) => {
152
-                if (res.data.length === 0) {
153
-                    this.shopErr = true;
154
-                }
155
-                this.shopList = res.data;
156
-                uni.hideLoading();
157
-                uni.stopPullDownRefresh();
158
-                if (!this.curShop.id) {
159
-                    this.curShop = res.data[0];
160
-                    let user = { ...this.$store.state.user.user };
161
-                    user.storeId = this.curShop.id;
162
-                    user.storeName = this.curShop.name;
163
-                    this.$store.commit("user/update", {
164
-                        user,
165
-                    });
166
-                }
167
-            });
168
-        },
155
+			getShopList() {
156
+				uni.showLoading({
157
+					title: "加载中...",
158
+				});
159
+				this.api.get("/Store/GetShopList").then((res) => {
160
+					if (res.data.length === 0) {
161
+						this.shopErr = true;
162
+					}
163
+					this.shopList = res.data;
164
+					uni.hideLoading();
165
+					uni.stopPullDownRefresh();
166
+					if (!this.curShop.id) {
167
+						this.curShop = res.data[0];
168
+						let user = { ...this.$store.state.user.user
169
+						};
170
+						user.storeId = this.curShop.id;
171
+						user.storeName = this.curShop.name;
172
+						this.$store.commit("user/update", {
173
+							user,
174
+						});
175
+					}
176
+				});
177
+			},
169 178
 
170
-        goShopSelect() {
171
-            this.router.push({
172
-                path: "/pages/index/select",
173
-                query: {
174
-                    entry: "manage",
175
-                },
176
-            });
177
-        },
179
+			goShopSelect() {
180
+				this.router.push({
181
+					path: "/pages/index/select",
182
+					query: {
183
+						entry: "manage",
184
+					},
185
+				});
186
+			},
178 187
 
179
-        layout() {
180
-            this.$store.commit("user/logout", null);
181
-            this.router.replace({
182
-                path: "/pages/index/login",
183
-                isReLaunch: true,
184
-            });
185
-        },
186
-    },
188
+			layout() {
189
+				this.$store.commit("user/logout", null);
190
+				this.router.replace({
191
+					path: "/pages/index/login",
192
+					isReLaunch: true,
193
+				});
194
+			},
195
+		},
187 196
 
188
-    // 数据计算
189
-    computed: {
190
-        user() {
191
-            return this.$store.state.user.user;
192
-        },
193
-        isAdmin() {
194
-            //店铺管理员  系统管理员
195
-            if (
196
-                this.user.roleId === "50c41c5d-b54c-43ed-b587-10dcb60e72e5" ||
197
-                this.user.roleId === "75b71b24-25de-40ac-a866-c8f5555b8b92"
198
-            ) {
199
-                return true;
200
-            } else {
201
-                return false;
202
-            }
203
-        },
204
-    },
197
+		// 数据计算
198
+		computed: {
199
+			user() {
200
+				return this.$store.state.user.user;
201
+			},
202
+			isAdmin() {
203
+				//店铺管理员  系统管理员
204
+				if (
205
+					this.user.roleId === "50c41c5d-b54c-43ed-b587-10dcb60e72e5" ||
206
+					this.user.roleId === "75b71b24-25de-40ac-a866-c8f5555b8b92"
207
+				) {
208
+					return true;
209
+				} else {
210
+					return false;
211
+				}
212
+			},
213
+		},
205 214
 
206
-    // 数据监听
207
-    watch: {},
208
-};
215
+		// 数据监听
216
+		watch: {},
217
+	};
209 218
 </script>
210 219
 
211 220
 <style lang="scss" scoped>
212
-.page {
213
-    &__top {
214
-        display: flex;
215
-        align-items: center;
216
-        justify-content: space-between;
217
-        height: px(145);
218
-        padding: 0 px(50);
219
-        background-color: #fff;
220
-        border-bottom: 1px solid #f1f1f1;
221
-    }
222
-    .name {
223
-        font-size: px(36);
224
-        color: #999;
225
-        flex-shrink: 0;
226
-        margin-right: px(20);
227
-    }
228
-}
229
-.shop {
230
-    display: flex;
231
-    color: #666;
232
-    font-size: px(36);
233
-    flex-shrink: 0;
234
-    margin-right: px(30);
235
-    width: 100%;
236
-    &__logo {
237
-        margin-right: px(20);
238
-        width: px(80);
239
-        height: px(80);
240
-        border-radius: 50%;
241
-        box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
242
-        overflow: hidden;
243
-        /deep/ img {
244
-            width: px(80);
245
-            height: px(80);
246
-        }
247
-    }
248
-    &__name {
249
-        display: flex;
250
-        white-space: nowrap;
251
-        align-items: center;
252
-    }
253
-    &__arrow {
254
-        margin-left: px(10);
255
-        transform: rotate(90deg);
256
-    }
257
-}
258
-.menu {
259
-    display: flex;
260
-    flex-wrap: wrap;
261
-    border-top: 1px solid #f1f1f1;
262
-    .item {
263
-        width: 33.333333%;
264
-        height: px(330);
265
-        flex-shrink: 0;
266
-        display: flex;
267
-        flex-direction: column;
268
-        justify-content: center;
269
-        align-items: center;
270
-        font-size: px(44);
271
-        background-color: #fff;
272
-        border-bottom: 1px solid #f1f1f1;
273
-        /deep/ img {
274
-            width: px(90);
275
-            height: px(90);
276
-            margin-bottom: px(30);
277
-        }
278
-        &:nth-child(3n-1),
279
-        &:nth-child(3n) {
280
-            border-left: 1px solid #f1f1f1;
281
-        }
282
-    }
283
-}
284
-.ver {
285
-    margin-top: px(30);
286
-    font-size: px(30);
287
-    text-align: center;
288
-    color: #aaa;
289
-}
290
-.btn {
291
-    position: fixed;
292
-    bottom: px(50);
293
-    left: px(30);
294
-    right: px(30);
295
-    z-index: 10;
296
-    color: #fff;
297
-    background-color: #e92e25;
298
-    font-size: px(44);
299
-}
300
-.tips {
301
-    background-color: #fef9f3;
302
-    font-size: px(40);
303
-    padding: 0 px(40);
304
-    height: px(100);
305
-    line-height: px(100);
306
-    color: #ec883d;
307
-}
308
-</style>
221
+	.page {
222
+		&__top {
223
+			display: flex;
224
+			align-items: center;
225
+			justify-content: space-between;
226
+			height: px(145);
227
+			padding: 0 px(50);
228
+			background-color: #fff;
229
+			border-bottom: 1px solid #f1f1f1;
230
+		}
231
+
232
+		.name {
233
+			font-size: px(36);
234
+			color: #999;
235
+			flex-shrink: 0;
236
+			margin-right: px(20);
237
+		}
238
+	}
239
+
240
+	.shop {
241
+		display: flex;
242
+		color: #666;
243
+		font-size: px(36);
244
+		flex-shrink: 0;
245
+		margin-right: px(30);
246
+		width: 100%;
247
+
248
+		&__logo {
249
+			margin-right: px(20);
250
+			width: px(80);
251
+			height: px(80);
252
+			border-radius: 50%;
253
+			box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
254
+			overflow: hidden;
255
+
256
+			/deep/ img {
257
+				width: px(80);
258
+				height: px(80);
259
+			}
260
+		}
261
+
262
+		&__name {
263
+			display: flex;
264
+			white-space: nowrap;
265
+			align-items: center;
266
+		}
267
+
268
+		&__arrow {
269
+			margin-left: px(10);
270
+			transform: rotate(90deg);
271
+		}
272
+	}
273
+
274
+	.menu {
275
+		display: flex;
276
+		flex-wrap: wrap;
277
+		border-top: 1px solid #f1f1f1;
278
+
279
+		.item {
280
+			width: 33.333333%;
281
+			height: px(330);
282
+			flex-shrink: 0;
283
+			display: flex;
284
+			flex-direction: column;
285
+			justify-content: center;
286
+			align-items: center;
287
+			font-size: px(44);
288
+			background-color: #fff;
289
+			border-bottom: 1px solid #f1f1f1;
290
+
291
+			/deep/ img {
292
+				width: px(90);
293
+				height: px(90);
294
+				margin-bottom: px(30);
295
+			}
296
+
297
+			&:nth-child(3n-1),
298
+			&:nth-child(3n) {
299
+				border-left: 1px solid #f1f1f1;
300
+			}
301
+		}
302
+	}
303
+
304
+	.ver {
305
+		margin-top: px(30);
306
+		font-size: px(30);
307
+		text-align: center;
308
+		color: #aaa;
309
+	}
310
+
311
+	.btn {
312
+		position: fixed;
313
+		bottom: px(50);
314
+		left: px(30);
315
+		right: px(30);
316
+		z-index: 10;
317
+		color: #fff;
318
+		background-color: #e92e25;
319
+		font-size: px(44);
320
+	}
321
+
322
+	.tips {
323
+		background-color: #fef9f3;
324
+		font-size: px(40);
325
+		padding: 0 px(40);
326
+		height: px(100);
327
+		line-height: px(100);
328
+		color: #ec883d;
329
+	}
330
+</style>

+ 86 - 0
src/pages/test/index.vue

@@ -0,0 +1,86 @@
1
+<template>
2
+  <div class="page">
3
+    <div>
4
+      <button @click="open">open</button>
5
+      <!-- <button @click="testAsyncFunc">testAsyncFunc</button> -->
6
+      <button @click="getWeight">getWeight</button>
7
+      <button @click="getPrice">getPrice</button>
8
+      <button @click="getAmt">getAmt</button>
9
+    </div>
10
+    <div>
11
+      {{ dataStr }}
12
+    </div>
13
+  </div>
14
+</template>
15
+
16
+<script>
17
+import MyImage from "../../components/image/index";
18
+var testModule = uni.requireNativePlugin("TestModule");
19
+
20
+export default {
21
+  name: "",
22
+  components: { MyImage },
23
+  // 数据
24
+  data() {
25
+    return {
26
+      dataStr: "",
27
+    };
28
+  },
29
+  filters: {},
30
+  onLoad() {},
31
+  async onShow() {},
32
+  // 函数
33
+  methods: {
34
+    open() {
35
+      this.dataStr = "获取中...";
36
+      var ret = testModule.open({
37
+        name: "unimp",
38
+        age: 1,
39
+      });
40
+      this.dataStr = JSON.stringify(ret);
41
+    },
42
+    testAsyncFunc() {
43
+      this.dataStr = "获取中...";
44
+      var ret = testModule.testSyncFunc({
45
+        name: "unimp",
46
+        age: 1,
47
+      });
48
+      this.dataStr = JSON.stringify(ret);
49
+    },
50
+    getWeight() {
51
+      this.dataStr = "获取中...";
52
+      var ret = testModule.getWeight({
53
+        name: "unimp",
54
+        age: 1,
55
+      });
56
+      this.dataStr = JSON.stringify(ret);
57
+    },
58
+    getPrice() {
59
+      this.dataStr = "获取中...";
60
+      var ret = testModule.getPrice({
61
+        name: "unimp",
62
+        age: 1,
63
+      });
64
+      this.dataStr = JSON.stringify(ret);
65
+    },
66
+    getAmt() {
67
+      this.dataStr = "获取中...";
68
+      var ret = testModule.getAmt({
69
+        name: "unimp",
70
+        age: 1,
71
+      });
72
+      this.dataStr = JSON.stringify(ret);
73
+    },
74
+  },
75
+
76
+  // 数据计算
77
+  computed: {},
78
+
79
+  // 数据监听
80
+  watch: {},
81
+};
82
+</script>
83
+
84
+
85
+<style lang="scss" scoped>
86
+</style>