ck110 2 minggu lalu
induk
melakukan
147f8a6f27

+ 1 - 1
common/public.js

@@ -7,7 +7,7 @@ export default {
 		let encrypted = CryptoJS.AES.encrypt(srcs, key, {
 			iv: iv,
 			mode: CryptoJS.mode.CBC,
-			padding: CryptoJS.pad.Pkcs7
+			padding: CryptoJS.pad.Pkcs7 //ZeroPadding
 		});
 		return encrypted.toString();
 	},

+ 179 - 174
manifest.json

@@ -1,175 +1,180 @@
 {
-	"name": "遇见玛特",
-	"appid": "__UNI__A59181F",
-	"description": "",
-	"versionName": "1.0.9",
-	"versionCode": 109,
-	"transformPx": false,
-	/* 5+App特有相关 hfhz-mrro-iqmv-igdl storygarden2024@outlook.com*/
-	"app-plus": {
-		"compatible": {
-			"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
-		},
-		"usingComponents": true,
-		"nvueStyleCompiler": "uni-app",
-		"compilerVersion": 3,
-		"splashscreen": {
-			"alwaysShowBeforeRender": true,
-			"waiting": true,
-			"autoclose": true,
-			"delay": 0
-		},
-		"safearea": {
-			"background": "#00000000",
-			"bottom": {
-				"offset": "none"
-			}
-		},
-		/* 模块配置 */
-		"modules": {
-			"Push": {},
-			"Geolocation": {},
-			"Camera": {}
-		},
-		/* 应用发布信息 */
-		"distribute": {
-			/* android打包配置 */
-			"android": {
-				"permissions": [
-					"<uses-feature android:name=\"android.hardware.camera\"/>",
-					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
-					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-					"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-				],
-				"abiFilters": ["armeabi-v7a", "arm64-v8a"],
-				"enableOAID": false
-			},
-			/* ios打包配置 */
-			"ios": {
-				"UIBackgroundModes": "audio",
-				"dSYMs": false,
-				"idfa": false
-			},
-			/* SDK配置 */
-			"sdkConfigs": {
-				"ad": {},
-				"payment": {
-					"appleiap": {}
-				},
-				"speech": {},
-				"oauth": {},
-				"push": {
-					"unipush": {
-						"version": "2",
-						"offline": true,
-						"hms": {},
-						"oppo": {},
-						"vivo": {},
-						"mi": {},
-						"meizu": {},
-						"honor": {}
-					}
-				},
-				"geolocation": {
-					"system": {
-						"__platform__": ["android"]
-					}
-				}
-			},
-			"splashscreen": {
-				"androidStyle": "default",
-				"useOriginalMsgbox": false,
-				"iosStyle": "common",
-				"ios": {},
-				"android": {
-					"xxhdpi": "static/loading_1080.png",
-					"xhdpi": "static/loading_720.png",
-					"hdpi": "static/loading_480.png"
-				}
-			},
-			"icons": {
-				"android": {
-					"hdpi": "unpackage/res/icons/72x72.png",
-					"xhdpi": "unpackage/res/icons/96x96.png",
-					"xxhdpi": "unpackage/res/icons/144x144.png",
-					"xxxhdpi": "unpackage/res/icons/192x192.png"
-				},
-				"ios": {
-					"appstore": "unpackage/res/icons/1024x1024.png",
-					"ipad": {
-						"app": "unpackage/res/icons/76x76.png",
-						"app@2x": "unpackage/res/icons/152x152.png",
-						"notification": "unpackage/res/icons/20x20.png",
-						"notification@2x": "unpackage/res/icons/40x40.png",
-						"proapp@2x": "unpackage/res/icons/167x167.png",
-						"settings": "unpackage/res/icons/29x29.png",
-						"settings@2x": "unpackage/res/icons/58x58.png",
-						"spotlight": "unpackage/res/icons/40x40.png",
-						"spotlight@2x": "unpackage/res/icons/80x80.png"
-					},
-					"iphone": {
-						"app@2x": "unpackage/res/icons/120x120.png",
-						"app@3x": "unpackage/res/icons/180x180.png",
-						"notification@2x": "unpackage/res/icons/40x40.png",
-						"notification@3x": "unpackage/res/icons/60x60.png",
-						"settings@2x": "unpackage/res/icons/58x58.png",
-						"settings@3x": "unpackage/res/icons/87x87.png",
-						"spotlight@2x": "unpackage/res/icons/80x80.png",
-						"spotlight@3x": "unpackage/res/icons/120x120.png"
-					}
-				}
-			}
-		}
-	},
-	"networkTimeout": {
-		"request": 6000
-	},
-	/* 快应用特有相关 */
-	"quickapp": {},
-	/* 小程序特有相关 */
-	"mp-weixin": {
-		"appid": "",
-		"setting": {
-			"urlCheck": false
-		},
-		"usingComponents": true
-	},
-	"mp-alipay": {
-		"usingComponents": true
-	},
-	"mp-baidu": {
-		"usingComponents": true
-	},
-	"mp-toutiao": {
-		"usingComponents": true
-	},
-	"uniStatistics": {
-		"enable": false
-	},
-	"vueVersion": "2",
-	"h5": {
-		"router": {
-			"base": "./",
-			"mode": "hash"
-		},
-		"template": "h5.template.html",
-		"optimization": {
-			"treeShaking": {
-				"enable": true
-			}
-		}
-	},
-	"fallbackLocale": "zh-Hans"
-}
+    "name" : "遇见玛特",
+    "appid" : "__UNI__A59181F",
+    "description" : "",
+    "versionName" : "1.0.9",
+    "versionCode" : 109,
+    "transformPx" : false,
+    /* 5+App特有相关 hfhz-mrro-iqmv-igdl storygarden2024@outlook.com*/
+    "app-plus" : {
+        "compatible" : {
+            "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
+        },
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        "safearea" : {
+            "background" : "#00000000",
+            "bottom" : {
+                "offset" : "none"
+            }
+        },
+        /* 模块配置 */
+        "modules" : {
+            "Push" : {},
+            "Geolocation" : {},
+            "Camera" : {},
+            "Record" : {}
+        },
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
+                "enableOAID" : false
+            },
+            /* ios打包配置 */
+            "ios" : {
+                "UIBackgroundModes" : "audio",
+                "dSYMs" : false,
+                "idfa" : false
+            },
+            /* SDK配置 */
+            "sdkConfigs" : {
+                "ad" : {},
+                "payment" : {},
+                "speech" : {},
+                "oauth" : {},
+                "push" : {
+                    "unipush" : {
+                        "version" : "2",
+                        "offline" : false,
+                        "hms" : {},
+                        "oppo" : {},
+                        "vivo" : {},
+                        "mi" : {},
+                        "meizu" : {},
+                        "honor" : {}
+                    }
+                },
+                "geolocation" : {
+                    "system" : {
+                        "__platform__" : [ "android" ]
+                    }
+                },
+                "share" : {
+                    "weixin" : {
+                        "appid" : "",
+                        "UniversalLinks" : ""
+                    }
+                }
+            },
+            "splashscreen" : {
+                "androidStyle" : "default",
+                "useOriginalMsgbox" : false,
+                "iosStyle" : "common",
+                "ios" : {},
+                "android" : {
+                    "xxhdpi" : "static/loading_1080.png",
+                    "xhdpi" : "static/loading_720.png",
+                    "hdpi" : "static/loading_480.png"
+                }
+            },
+            "icons" : {
+                "android" : {
+                    "hdpi" : "unpackage/res/icons/72x72.png",
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
+                    "xxhdpi" : "unpackage/res/icons/144x144.png",
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
+                },
+                "ios" : {
+                    "appstore" : "unpackage/res/icons/1024x1024.png",
+                    "ipad" : {
+                        "app" : "unpackage/res/icons/76x76.png",
+                        "app@2x" : "unpackage/res/icons/152x152.png",
+                        "notification" : "unpackage/res/icons/20x20.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
+                        "settings" : "unpackage/res/icons/29x29.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "spotlight" : "unpackage/res/icons/40x40.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
+                    },
+                    "iphone" : {
+                        "app@2x" : "unpackage/res/icons/120x120.png",
+                        "app@3x" : "unpackage/res/icons/180x180.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
+                    }
+                }
+            }
+        }
+    },
+    "networkTimeout" : {
+        "request" : 6000
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "vueVersion" : "2",
+    "h5" : {
+        "router" : {
+            "base" : "./",
+            "mode" : "hash"
+        },
+        "template" : "h5.template.html",
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
+            }
+        }
+    },
+    "fallbackLocale" : "zh-Hans"
+}

+ 41 - 28
pages/article/addArticle.vue

@@ -68,6 +68,13 @@
 			},
 			submitData() {
 				let str = "";
+				if (this.list.length > 6) {
+					uni.showToast({
+						title: "最多上传6张图片",
+						icon: 'none'
+					});
+					return;
+				}
 				if (this.list != null) {
 					for (var i = 0; i < this.list.length; i++) {
 						str += this.list[i] + "|";
@@ -102,6 +109,9 @@
 						if (res.data.success == "yes") {
 							this.list = [];
 							this.content = "";
+							setTimeout(function() {
+								uni.navigateBack()
+							}, 800);
 						}
 					}
 				});
@@ -129,39 +139,42 @@
 					return;
 				}
 				uni.chooseImage({
-					count: 1,
+					count: 6,
 					sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['album', 'camera'], //从相册、相机选择
 					success: function(res) {
 						console.log('res:', res)
-						that.imglocal = res.tempFilePaths[0]
-						const tempFilePaths = res.tempFilePaths[0];
-						console.log('tempFilePaths:', tempFilePaths);
-						uni.showLoading({
-
-						})
-						// 图片上传
-						const uploadTask = uni.uploadFile({
-							url: that.$apiHost + '/Xweb/upload_img?skey=' + that.skey, // post请求地址
-							filePath: res.tempFilePaths[0],
-							name: 'file', // 待确认
-							success: function(uploadFileRes) {
-								let resdata = JSON.parse(uploadFileRes.data)
-								console.log('Success11:', uploadFileRes);
-								console.log('Success21:', resdata);
-								if (resdata.success == 'yes') {
-									that.list.push(resdata.url);
-									// _self.avator = resdata.url;
-								}
-							},
-							fail: function(uploadFileFail) {
-								console.log('Error:', uploadFileFail.data);
-							},
-							complete: () => {
-								console.log('Complete:');
-								uni.hideLoading()
+						uni.showLoading({})
+						if (res.tempFilePaths.length > 0) {
+							for (var i = 0; i < res.tempFilePaths.length; i++) {
+								const tempFilePaths = res.tempFilePaths[i];
+								console.log('tempFilePaths:', tempFilePaths);
+								// 图片上传
+								const uploadTask = uni.uploadFile({
+									url: that.$apiHost + '/Xweb/upload_img?skey=' + that.skey,
+									filePath: tempFilePaths,
+									name: 'file',
+									success: function(uploadFileRes) {
+										let resdata = JSON.parse(uploadFileRes.data)
+										// console.log('Success11:', uploadFileRes);
+										// console.log('Success21:', resdata);
+										if (resdata.success == 'yes') {
+											that.list.push(resdata.url);
+											// _self.avator = resdata.url;
+										}
+									},
+									fail: function(uploadFileFail) {
+										console.log('Error:', uploadFileFail.data);
+									},
+									complete: () => {
+										console.log('Complete:');
+									}
+								});
 							}
-						});
+							setTimeout(function() {
+								uni.hideLoading()
+							}, 2000);
+						}
 					},
 					error: function(e) {
 						console.log(e);

+ 33 - 9
pages/article/article.vue

@@ -89,16 +89,18 @@
 		},
 		data() {
 			return {
-				title: '',
+				page: 1,
 				list: [],
 				imgs: [],
 				descs: []
 			}
 		},
 		onLoad() {
+
+		},
+		onShow() {
 			this.loadData();
 		},
-		onShow() {},
 		methods: {
 			onBack() {},
 			goFabu() {
@@ -129,14 +131,12 @@
 				return; //如需测试和uni原生预览差别可注释这两行
 			},
 			loadData() {
-				// console.log({
-				// 	uuid: getApp().globalData.uuid,
-				// 	skey: getApp().globalData.skey
-				// });
+				var offset = (this.page - 1) * 20;
 				uni.request({
 					url: this.$apiHost + '/Article/getlist',
 					data: {
 						uuid: getApp().globalData.uuid,
+						offset: offset,
 						ismy: 0
 					},
 					header: {
@@ -144,8 +144,12 @@
 						'sign': getApp().globalData.headerSign
 					},
 					success: (res) => {
-						console.log("----:", res.data);
-						if (res.data.list != null) {
+						if (res.data.list == undefined || res.data.list == null) {
+							res.data.list = []
+						}
+						if (this.page > 1) {
+							this.list = this.list.concat(res.data.list)
+						} else {
 							this.list = res.data.list;
 						}
 					},
@@ -187,7 +191,27 @@
 					}
 				});
 			}
-		}
+		},
+		//滚动到底部
+		onReachBottom() {
+			console.log("onReachBottom");
+			if (this.list.length > 0) {
+				this.page++;
+				this.loadData()
+			}
+
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			console.log("onPullDownRefresh")
+			this.list = []
+			this.page = 1
+			// console.log(this.lx)
+			this.loadData()
+			// setTimeout(() => {
+			//     uni.stopPullDownRefresh()
+			// },1000)
+		},
 	}
 </script>
 

+ 9 - 0
pages/index/index.vue

@@ -91,6 +91,7 @@
 </template>
 
 <script>
+	import pubc from '@/common/public.js'
 	export default {
 		components: {},
 		data() {
@@ -121,6 +122,8 @@
 		onShow() {
 			uni.$emit('check_update');
 			this.loadData();
+			// let hsign = pubc.Encrypt("aboa-wifl-kwfl-zjfk-wlaa" + getApp().globalData.uuid);
+			// console.log("hsign", hsign)
 		},
 		methods: {
 			goArticle() {
@@ -160,6 +163,12 @@
 							});
 							return;
 						}
+						if (res.data.need_edit == "yes") {
+							uni.navigateTo({
+								url: '/pages/my/step'
+							});
+							return;
+						}
 						this.myinfo = res.data;
 						this.article = res.data.article;
 						this.list = res.data.list;

+ 4 - 1
pages/login/login.vue

@@ -129,6 +129,10 @@
 			});
 		},
 		onShow() {
+			// let hsign = pubc.Encrypt("aboa-wifl-kwfl-zjfk-wlaa_FA0412932BAE9D98506580ADB348BEF9");
+			// console.log("hsign", hsign)
+
+
 			let skey = uni.getStorageSync("wapptoken");
 			if (skey != null && skey != "" && skey != undefined) {
 				uni.switchTab({
@@ -180,7 +184,6 @@
 			toLogin() {
 				console.log('aaa');
 				let that = this;
-				that.pos = 'a1';
 				if (this.mobile.length != 11) {
 					uni.showToast({
 						title: "请输入手机号",

+ 54 - 9
pages/login/reg.vue

@@ -50,6 +50,7 @@
 </template>
 
 <script>
+	import pubc from '@/common/public.js'
 	export default {
 		components: {},
 		data() {
@@ -65,6 +66,9 @@
 				nickname: '',
 				captchaTime: 0,
 				is_web3: 0,
+				push_token: '',
+				lat: '',
+				lng: '',
 			}
 		},
 		onLoad(params) {
@@ -80,8 +84,35 @@
 					}
 				})
 			}, 200);
+			let that = this;
+			// #ifdef APP-PLUS
+			uni.getPushClientId({
+				success: (res) => {
+					console.log("su:", res.cid);
+					that.push_token = res.cid;
+				},
+				fail(err) {
+					that.push_token = '';
+					console.log(err)
+				}
+			});
+			// #endif
+		},
+		onShow() {
+			let that = this;
+			// #ifdef APP-PLUS
+			uni.getLocation({
+				type: 'wgs84',
+				success: function(res) {
+					that.lat = res.latitude;
+					that.lng = res.longitude;
+				},
+				fail: function(error) {
+					console.error('获取位置失败:', error);
+				}
+			});
+			// #endif
 		},
-		onShow() {},
 		methods: {
 			onBack() {},
 			agreeChk() {
@@ -202,7 +233,10 @@
 						password: this.password,
 						ycode: this.ycode,
 						code: this.code,
-						is_web3: this.is_web3
+						is_web3: this.is_web3,
+						push_token: this.push_token,
+						lat: this.lat,
+						lng: this.lng,
 					},
 					header: {
 						"content-type": "application/json"
@@ -210,21 +244,32 @@
 					success: (res) => {
 						console.log("----", res.data);
 						if (res.data.success == "yes") {
-							uni.showToast({
-								title: res.data.str,
-								icon: "none",
-							});
 
 							// #ifdef APP-PLUS
 
-							uni.navigateTo({
-								url: '/pages/login/login'
-							})
+							uni.setStorageSync("wapptoken", res.data.skey);
+							getApp().globalData.skey = res.data.skey;
+							if (res.data.header_c != "") {
+								getApp().globalData.headerSign = pubc.Encrypt(res.data.header_c + "_" +
+									getApp().globalData.uuid);
+								uni.setStorageSync("headerSign", getApp().globalData.headerSign);
+							}
+							getApp().globalData.headerC = res.data.header_c;
+							uni.redirectTo({
+								url: '/pages/my/step'
+							});
+							// uni.switchTab({
+							// 	url: "/pages/index/index",
+							// });
 
 							// #endif
 
 							// #ifdef H5
 
+							uni.showToast({
+								title: res.data.str,
+								icon: "none",
+							});
 							uni.navigateTo({
 								url: '/pages/login/down'
 							})

+ 6 - 0
pages/my/my.vue

@@ -166,6 +166,12 @@
 							});
 							return;
 						}
+						if (res.data.need_edit == "yes") {
+							uni.navigateTo({
+								url: '/pages/my/step'
+							});
+							return;
+						}
 						this.myinfo = res.data;
 					},
 					complete: (com) => {

+ 1 - 1
pages/my/step.vue

@@ -24,7 +24,7 @@
 				<view class="name">选一张你的真实照片作为封面:</view>
 				<view class="bcenter">
 					<view class="avator" @click="upload">
-						<image :src="avator" mode="widthFix" class="img" />
+						<image :src="avator" mode="aspectFill" class="img" />
 						<image class="photo" src="../../static/me/photo.png" mode="widthFix" />
 					</view>
 				</view>

+ 1 - 0
pages/my/wishList.vue

@@ -70,6 +70,7 @@
 				// this.loadData();
 			},
 			onLinqu() {
+				return;
 				this.$refs['DialogBox'].confirm({
 					title: '',
 					content: '你还没有维护收货地址,请先维护收货地址!',

+ 2 - 2
pages/w3/box.scss

@@ -80,7 +80,7 @@ page {
 	}
 .list_item {
 	width:690rpx;height:268rpx;display: flex;flex-direction: column;justify-content: flex-start;align-items: center;
-	background: url('http://c.yujianmate.com/images/v1/w3bg_box2.png');
+	background: url('http://c.yujianmate.com/images/v1/w3/bg_box2.png');
 	background-size: 690rpx 268rpx;margin:0 auto;
 	margin-top: 24rpx;
 	.item2 {
@@ -166,7 +166,7 @@ page {
 
 .state12 {
 	width:690rpx;height:388rpx;display: flex;flex-direction: column;justify-content: flex-start;align-items: center;
-	background: url('http://c.yujianmate.com/images/v1/w3bg_box2.png');
+	background: url('http://c.yujianmate.com/images/v1/w3/bg_box2.png');
 	background-size: 690rpx 388rpx;margin:0rpx auto;margin-bottom: 20rpx;
 	.item1 {
 		.right {