zpj 1 сар өмнө
commit
11265fa20b

+ 17 - 0
App.vue

@@ -0,0 +1,17 @@
+<script>
+	export default {
+		onLaunch: function() {
+			console.log('App Launch')
+		},
+		onShow: function() {
+			console.log('App Show')
+		},
+		onHide: function() {
+			console.log('App Hide')
+		}
+	}
+</script>
+
+<style>
+	/*每个页面公共css */
+</style>

+ 46 - 0
http/ajax.js

@@ -0,0 +1,46 @@
+import tools from "@/service/tools.js";
+
+let BASE_URL = ''
+
+export const request = (url, method, data, show = false) => {
+	if (show) {
+		tools.showLoading();
+	}
+	if (data === undefined) {
+		data = {};
+	}
+
+	return new Promise((resolve, reject) => {
+		
+		uni.request({
+			url: BASE_URL + url,
+			data: {
+				...data,
+			},
+			method: method || 'post',
+			header: {
+				'content-type': 'application/json',
+				'hversion': '1.0',
+			},
+			success: (res) => {
+				if (res.statusCode === 200) {
+					tools.hideLoading();
+					if(res.data.code == 1){
+						resolve(res.data)
+					}else{
+						uni.reLaunch({
+							url:`/pages/error?msg=` + res.message
+						})
+					}
+				} else {
+					tools.error(res.message)
+				}
+			},
+			fail: (err) => {
+				tools.error('网络错误!!')
+				reject(err)
+				tools.hideLoading();
+			}
+		})
+	})
+}

+ 13 - 0
http/shop_order.js

@@ -0,0 +1,13 @@
+import { request } from './ajax.js'
+
+const newsUrl = '/api/shopOrder/'
+
+
+// 扫码查询收款码信息
+export const payImgInfo = (data) => request(newsUrl + 'pay_img_info', 'get', { ...data }, true)
+
+// 收款码下单支付
+export const payPay = (data) => request(newsUrl + 'pay', 'post', { ...data }, true)
+
+// bank获取订单详情
+export const shopOrderInfo = (data) => request(newsUrl + 'info', 'get', { ...data }, true)

+ 21 - 0
index.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <script>
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
+        CSS.supports('top: constant(a)'))
+      document.write(
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+    </script>
+    <title></title>
+    <!--preload-links-->
+    <!--app-context-->
+  </head>
+  <body>
+    <div id="app"><!--app-html--></div>
+    <script type="module" src="/main.js"></script>
+	<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js" type="text/javascript"></script>
+  </body>
+</html>

+ 22 - 0
main.js

@@ -0,0 +1,22 @@
+import App from './App'
+
+// #ifndef VUE3
+import Vue from 'vue'
+import './uni.promisify.adaptor'
+Vue.config.productionTip = false
+App.mpType = 'app'
+const app = new Vue({
+  ...App
+})
+app.$mount()
+// #endif
+
+// #ifdef VUE3
+import { createSSRApp } from 'vue'
+export function createApp() {
+  const app = createSSRApp(App)
+  return {
+    app
+  }
+}
+// #endif

+ 87 - 0
manifest.json

@@ -0,0 +1,87 @@
+{
+    "name" : "zh-h5-pay",
+    "appid" : "__UNI__1FF8A99",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "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" : "3",
+	"h5" : {
+	    "devServer" : {
+			"disableHostCheck": true,
+	        "https" : false,
+	        "proxy" : {
+	            "/api" : {
+	                "target": "https://testgo.jhcs888.com",
+	                "changeOrigin" : true,
+	                "secure" : false
+	            }
+	        }
+	    }
+	}
+}
+
+

+ 95 - 0
md/shopOrder.md

@@ -0,0 +1,95 @@
+# api/shopOrder
+
+> 统一响应格式:`{"code": 1, "message": "success", "data": ...}`,下文「响应参数」均指 `data` 字段。
+
+## 接口总览
+
+| # | 方法 | 路径 | 说明 | 认证 |
+|---|---|---|---|---|
+| 1 | GET | `/api/shopOrder/pay_img_info` | 扫码查询收款码信息(公开接口) | 否 |
+| 2 | GET | `/api/shopOrder/info` | 获取订单详情 | 否 |
+| 3 | POST | `/api/shopOrder/pay` | 收款码下单支付 | 是 |
+
+---
+
+## 接口详情
+
+### 1. GET `/api/shopOrder/pay_img_info`
+
+- **说明**: 扫码查询收款码信息(公开接口)
+- **认证**: 否
+- **Handler**: `api.ShopOrderController{}.GetPayImgInfo`
+
+**请求参数**
+
+| 字段 | 类型 | 必填 | 说明 | 约束 |
+|---|---|---|---|---|
+| `code` | string | 是 | 收款码 | - |
+
+**响应参数**
+
+object,类型 `api.payImgInfoResp`:
+
+| 字段 | 类型 | 说明 |
+|---|---|---|
+| `shop_name` | string | 商户名称 |
+| `store_name` | string | 门店名称 |
+| `cashier_name` | string | 收银台名称 |
+| `staff_name` | string | 员工名称 |
+
+---
+
+### 2. GET `/api/shopOrder/info`
+
+- **说明**: 获取订单详情
+- **认证**: 否
+- **Handler**: `api.ShopOrderController{}.GetShopOrderInfo`
+
+**请求参数**
+
+| 字段 | 类型 | 必填 | 说明 | 约束 |
+|---|---|---|---|---|
+| `order_sn` | string | 是 | 订单编号 | - |
+
+**响应参数**
+
+object,类型 `api.orderInfoResp`:
+
+| 字段 | 类型 | 说明 |
+|---|---|---|
+| `rs_sn` | string | 店铺订单支付编号 |
+| `pay_sn` | string | 支付编号 |
+| `status` | int | 1待支付 2已支付 3已退款/已完成 |
+| `pay_money` | decimal.Decimal | 支付金额 |
+| `shop_name` | string | 商户名称 |
+
+---
+
+### 3. POST `/api/shopOrder/pay`
+
+- **说明**: 收款码下单支付
+- **认证**: 是
+- **Handler**: `api.ShopOrderController{}.Pay`
+
+**请求参数**
+
+| 字段 | 类型 | 必填 | 说明 | 约束 |
+|---|---|---|---|---|
+| `code` | string | 是 | 收款码 | - |
+| `pay_money` | string | 是 | 支付金额 | numeric; 金额范围(0.01-2000)在控制器用 decimal 校验,string 字段不能用 gte/lte 小数(validator 按整数长度解析会 panic) |
+| `pay_type` | int | 是 | 支付方式 | oneof=1 2 |
+| `pay_code_source` | int | 是 | 收款码类型 | oneof=1 2 |
+
+**响应参数**
+
+object,类型 `api.payResp`:
+
+| 字段 | 类型 | 说明 |
+|---|---|---|
+| `order_sn` | string | 店铺订单支付编号 |
+| `is_bank` | int | 是否银联 |
+| `is_yee` | int | 是否易宝 |
+| `pay_data` | interface{} | 支付凭据(易宝预支付凭证或银联跳转URL) |
+
+---
+

+ 13 - 0
node_modules/.package-lock.json

@@ -0,0 +1,13 @@
+{
+  "name": "zh-h5-pay",
+  "version": "1.0.0",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "node_modules/jweixin-module": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
+      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
+    }
+  }
+}

+ 30 - 0
node_modules/jweixin-module/README.md

@@ -0,0 +1,30 @@
+# jweixin-module
+
+微信JS-SDK
+
+## 安装
+
+### NPM
+
+```shell
+npm install jweixin-module --save
+```
+
+### UMD
+
+```http
+https://unpkg.com/jweixin-module/out/index.js
+```
+
+## 使用
+
+```js
+var jweixin = require('jweixin-module')
+jweixin.ready(function(){
+    // TODO
+});
+```
+
+## 完整API
+
+>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
node_modules/jweixin-module/lib/index.js


+ 26 - 0
node_modules/jweixin-module/package.json

@@ -0,0 +1,26 @@
+{
+    "name": "jweixin-module",
+    "version": "1.6.0",
+    "description": "微信JS-SDK",
+    "main": "lib/index.js",
+    "scripts": {},
+    "repository": {
+        "type": "git",
+        "url": "git+https://github.com/zhetengbiji/jweixin-module.git"
+    },
+    "keywords": [
+        "wxjssdk",
+        "weixin",
+        "jweixin",
+        "wechat",
+        "jssdk",
+        "wx"
+    ],
+    "author": "Shengqiang Guo",
+    "license": "ISC",
+    "bugs": {
+        "url": "https://github.com/zhetengbiji/jweixin-module/issues"
+    },
+    "homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
+    "devDependencies": {}
+}

+ 28 - 0
package-lock.json

@@ -0,0 +1,28 @@
+{
+  "name": "zh-h5-pay",
+  "version": "1.0.0",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "": {
+      "name": "zh-h5-pay",
+      "version": "1.0.0",
+      "license": "ISC",
+      "dependencies": {
+        "jweixin-module": "^1.6.0"
+      }
+    },
+    "node_modules/jweixin-module": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
+      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
+    }
+  },
+  "dependencies": {
+    "jweixin-module": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
+      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
+    }
+  }
+}

+ 15 - 0
package.json

@@ -0,0 +1,15 @@
+{
+  "name": "zh-h5-pay",
+  "version": "1.0.0",
+  "description": "",
+  "main": "main.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "jweixin-module": "^1.6.0"
+  }
+}

+ 30 - 0
pages.json

@@ -0,0 +1,30 @@
+{
+	"pages": [ 
+		{
+			"path": "pages/index",
+			"style": {
+				"navigationBarTitleText": "支付"
+			}
+		},
+		{
+			"path": "pages/error",
+			"style": {
+				"navigationBarTitleText": "支付错误"
+			}
+		},
+		{
+			"path": "pages/success",
+			"style": {
+				"navigationBarTitleText": "支付成功"
+			}
+		}
+	],
+	"globalStyle": {
+		"navigationBarTextStyle": "black",
+		"navigationBarTitleText": "uni-app",
+		"navigationBarBackgroundColor": "#F8F8F8",
+		"navigationStyle": "custom",
+		"backgroundColor": "#F8F8F8"
+	},
+	"uniIdRouter": {}
+}

+ 178 - 0
pages/bank-success.vue

@@ -0,0 +1,178 @@
+<template>
+	<view class="flex-direction plr-40-24 box-sizing-border box-b">
+		<view @click="jumpOut" class="but-box sys-radius-200 text-align-center sys-color-4D72FA sys-size-28 sys-weight-600">
+			返回首页
+		</view>
+		<view class="align-items-center flex-justify-center cg-box">
+			<uni-icons v-if="orderInfo.status === 2 || orderInfo.status === 6" class="mr-18" type="checkbox-filled"
+				size="24" color="#547BFA"></uni-icons>
+			<uni-icons v-else class="mr-18" type="clear" size="24" color="#FF0000"></uni-icons>
+			<view class="sys-size-28" v-if="orderInfo.status === 2 || orderInfo.status === 6">
+				支付成功
+			</view>
+			<view class="sys-size-28" v-else>
+				支付失败
+			</view>
+		</view>
+		<view class="align-items-center flex-justify-center pb-32 pay_money-box mb-24">
+			<view class="sys-color-3 sys-size-60 sys-weight-bold">
+				¥
+			</view>
+			<view class="sys-color-3 sys-size-60 sys-weight-bold">
+				{{orderInfo.pay_money || '0.00'}}
+			</view>
+		</view>
+		<view class="align-items-center flex-justify-space mb-24">
+			<view class="sys-color-9 flex-shrink0 sys-size-28 mr-20">
+				商户名称
+			</view>
+			<view class="sys-size-28 sys-color-3">
+				{{orderInfo.shop_name || '无'}}
+			</view>
+		</view>
+		<view class="align-items-center flex-justify-space">
+			<view class="sys-color-9 flex-shrink0 sys-size-28 mr-20">
+				支付订单
+			</view>
+			<view class="sys-size-28 sys-color-3">
+				{{orderInfo.rs_sn || '无'}}
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { shopOrderInfo, } from '@/http/shop_order';
+	export default {
+		components: {},
+		data() {
+			return {
+				orderInfo: {}
+			}
+		},
+		onLoad(data) {
+			var mchData = {
+				action: 'onIframeReady',
+				displayStyle: 'SHOW_CUSTOM_PAGE'
+			};
+			var postData = JSON.stringify(mchData);
+			parent.postMessage(postData, "https://payapp.weixin.qq.com");
+			if (data.order_sn) {
+				this.shopOrderInfo(data.order_sn)
+			}
+		},
+		mounted() {},
+		methods: {
+			shopOrderInfo(order) {
+				shopOrderInfo({
+					order_sn: order
+				}).then((res) => {
+					if (res.code === 1) {
+						this.orderInfo = res.data
+					}
+				})
+			},
+			jumpOut() {
+				if (this.orderInfo.status === 2 || this.orderInfo.status === 6) {
+					var mchData = {
+						action: 'jumpOut',
+						jumpOutUrl: "https://wap.jhcs888.com/#/pages/index-my/index"
+					}
+					var postData = JSON.stringify(mchData)
+					parent.postMessage(postData, 'https://payapp.weixin.qq.com')
+				} else {
+					window.location.href = "https://wap.jhcs888.com/#/pages/index-my/index"
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.flex-direction {
+		display: flex;
+		flex-direction: column;
+	}
+	.box-sizing-border {
+		box-sizing: border-box;
+	}
+	.sys-radius-200 {
+		border-radius: 200rpx;
+	}
+	.text-align-center {
+		text-align: center;
+	}
+	.sys-color-4D72FA {
+		color: #4D72FA;
+	}
+	.sys-size-28 {
+		font-size: 28rpx;
+	}
+	.sys-weight-600 {
+		font-weight: 600;
+	}
+	.align-items-center {
+		display: flex;
+		align-items: center;
+	}
+	.flex-justify-center {
+		display: flex;
+		justify-content: center;
+	}
+	.pb-32 {
+		padding-bottom: 32rpx;
+	}
+	.mb-24 {
+		margin-bottom: 24rpx;
+	}
+	.sys-color-3489FF {
+		color: #3489FF;
+	}
+	.sys-size-60 {
+		font-size: 60rpx;
+	}
+	.sys-weight-bold {
+		font-weight: bold;
+	}
+	.flex-justify-space {
+		display: flex;
+		justify-content: space-between;
+	}
+	.flex-shrink0 {
+		flex-shrink: 0;
+	}
+	.sys-color-9 {
+		color: #999;
+	}
+	
+	
+	.box-b{
+		position: relative;
+	}
+	.plr-40-24 {
+		padding: 24rpx 40rpx 0;
+	}
+
+	.pt-50 {
+		padding-top: 50rpx;
+	}
+
+	.cg-box {
+		padding-bottom: 8rpx;
+		padding-top: 32rpx;
+	}
+
+	.pay_money-box {
+		border-bottom: 1rpx solid #F5F5F5;
+	}
+
+	.but-box {
+		width: 148rpx;
+		height: 48rpx;
+		line-height: 48rpx;
+		border: 1rpx solid #4D72FA;
+		position: absolute;
+		right: 40rpx;
+		top: 40rpx;
+	}
+</style>

+ 49 - 0
pages/error.vue

@@ -0,0 +1,49 @@
+<template>
+	<view class="error-box">
+		<view class="error-box-info">
+			<image src="@/static/ts-icon.png" mode="scaleToFill" class="success-icon" />
+			<view class="">{{msg}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return{
+				msg:"",
+			}
+		},
+		onLoad(res) {
+			if (res.msg) {
+				this.msg = res.msg
+			}else{
+				this.msg = '网络错误!请重新扫码!'
+			}
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.error-box {
+		width: 100%;
+		height: 100vh;
+
+		.success-icon {
+		  width: 98rpx;
+		  height: 98rpx;
+		}
+		
+		.error-box-info {
+			box-sizing: border-box;
+			padding-top: 20vh;
+			font-size: 28rpx;
+			font-weight: 600;
+			text-align: center;
+
+			view {
+				margin-top: 30rpx;
+			}
+		}
+	}
+</style>

+ 323 - 0
pages/index.vue

@@ -0,0 +1,323 @@
+<template>
+	<view class="pay-view">
+		<view class="pay-head" :style="{
+			'height':headH*2+'rpx',
+			'padding-top':headPTop*2+'rpx',
+			'line-height':headH*2+'rpx',
+		}">{{shop_name}}</view>
+
+		<view class="pay-info">
+			<view class="pay-info-input">
+				<view class="info-text">消费总额</view>
+				<view class="info-input">¥ {{totalNum}}</view>
+				<view class="info-text">可询问工作人员应缴费用总额</view>
+			</view>
+			<view class="pay-info-sumit" @click="sumbit()">支付</view>
+		</view>
+
+		<view class="pay-num">
+			<view class="pay-num-input" @click="setNum(item)" v-for="(item,i) in numList" :key="i">{{item}}</view>
+			<view class="pay-num-input" @click="delNum()">
+				<view class="pay-num-del">
+					<view class="pay-num-del-wrap">x</view>
+				</view>
+			</view>
+		</view>
+
+		<view v-html="zfbUrl"></view>
+	</view>
+</template>
+
+<script>
+	import {
+		payImgInfo,payPay
+	} from '@/http/shop_order.js'
+
+	import tools from "@/service/tools.js";
+
+	import {
+		getPhoneTopHeight,
+		getNavHeight,
+		isWx,
+	} from "@/service/utils.js";
+
+	export default {
+		data() {
+			return {
+				shop_name: '',
+				shop_id: '',
+				order_id: '',
+
+				headH: 0,
+				headPTop: 0,
+				numList: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0'],
+				totalNum: '',
+				isAJAX: false,
+				zfbUrl: '',
+
+				code_type: 1,
+				code: '',
+			}
+		},
+
+		onLoad(data) {
+			// #ifdef H5
+			let isWeiXin = isWx();
+			if (isWeiXin) {
+				tools.wxInitialize(["chooseWXPay"]);
+			}
+			// #endif
+
+			this.headH = getNavHeight();
+			this.headPTop = getPhoneTopHeight();
+
+
+			if (data.code !== undefined) {
+				this.code = data.code
+				this.code_type = data.img_type
+			} else {
+				uni.reLaunch({
+					url: `/pages/error?msg=` + '店铺信息错误,请重新扫码。'
+				})
+				return
+			}
+			
+			payImgInfo({
+				code: this.code
+			}).then((res) => {
+				if (res.code === 1) {
+					this.shop_id = res.data.id;
+					this.shop_name = res.data.shop_name;
+					uni.setStorageSync("shopName", this.shop_name)
+				}
+			})
+		},
+		onShow() {
+			let isWeiXin = isWx()
+			if (isWeiXin){
+				if (href.indexOf('?code=') > -1 || href.indexOf('&code=') > -1) {
+					const urlArr = href.split('?')
+					const rightUrlArr = urlArr[1].split('#/')
+					const queryObj = {}
+					rightUrlArr[0].split('&').map((item) => {
+						const splitStr = item.split('=')
+						return {
+							key: splitStr[0],
+							value: splitStr[1],
+						}
+					}).forEach((item) => {
+						queryObj[item.key] = item.value
+					})
+					if (urlArr.length >= 3) {
+						rightUrlArr[1] = "?" + urlArr[2]
+					}
+					let from = {
+						code: queryObj.code,
+						wx_type: 1,
+					}
+					// await getUserInfo(from).then(async (res) => {
+					// 	if (res.code === 1) {
+							
+					// 	}
+					// })
+				} else {
+					// 认证失败
+					tools.wxLogin();
+				}
+			}
+		},
+		methods: {
+			setNum(item) {
+				this.totalNum += item
+			},
+			delNum() {
+				if (this.totalNum) {
+					this.totalNum = this.totalNum.slice(0, this.totalNum.length - 1)
+				} else {
+					tools.error('请输入金额')
+				}
+			},
+			sumbit() {
+
+				if (!this.totalNum || this.totalNum * 1 <= 0) {
+					return tools.error('请输入金额')
+				}
+				let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
+				if (!reg.test(this.totalNum)) {
+					return tools.error('金额格式错误')
+				}
+				
+				
+				let pay_type //1:微信,2:支付宝
+				let ua = navigator.userAgent.toLowerCase();
+				if (ua.match(/MicroMessenger/i) == "micromessenger") {
+					pay_type = 1
+				} else {
+					pay_type = 2
+				}
+				
+				if (this.isAJAX) {
+					return
+				}
+				this.isAJAX = true
+				if (!this.code_type) {
+					this.code_type = 1 //烟草码
+				}
+				payPay({
+					code: this.code,
+					pay_money: this.totalNum,
+					pay_code_source: this.code_type,
+					pay_type: pay_type,
+					m_id:0,
+					token:'',
+				}).then((res) => {
+
+					if (res.code === 1) {
+						
+						console.log(res);
+						return
+						
+						this.order_id = res.data.order_id
+						
+						if (res.data.is_bank == 0 && res.data.is_yee == 1) {
+							if (pay_type === 1) {
+								this.isAJAX = false
+								if (res.data.wx_pay) {
+									this.weiXinPayH5(res.data.wx_pay);
+								} else {
+									tools.error("支付生成失败");
+								}
+							} else {
+								window.location.href = res.data.pay_data;
+							}
+						} else {
+							window.location.href = res.data.pay_data;
+						}
+
+					} else {
+						this.isAJAX = false
+						tools.error(res.msg);
+					}
+				})
+			},
+			payOk(rs_sn) {
+				// uni.redirectTo({
+				// 	url: `/pages-order/pay-success/index?order_id=${this.order_id}&money=${this.totalNum}&rs_sn=${rs_sn}`,
+				// });
+			},
+			async weiXinPayH5(wxPayData) {
+				const res = await tools.weiXinPay(wxPayData);
+				if (res) {
+					this.payOk(wxPayData.rs_sn);
+				}
+			},
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.pay-view {
+		width: 100%;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.pay-head {
+			font-size: 40rpx;
+			font-weight: 600;
+			text-align: center;
+			background-color: #fff;
+		}
+
+		.pay-info {
+			flex: 1;
+			overflow: auto;
+			box-sizing: border-box;
+			padding: 20rpx;
+
+			.pay-info-sumit {
+				margin-top: 30rpx;
+				width: 100%;
+				height: 90rpx;
+				line-height: 90rpx;
+				text-align: center;
+				border-radius: 200rpx;
+				background: linear-gradient(to right, #FE9387, #FB604E, #F83820);
+				color: #fff;
+				font-size: 32rpx;
+			}
+
+			.pay-info-input {
+				width: 100%;
+				height: 330rpx;
+				background-color: #fff;
+				box-sizing: border-box;
+				padding: 20rpx;
+
+				.info-text {
+					font-size: 30rpx;
+					color: #aaa;
+				}
+
+				.info-input {
+					width: 100%;
+					height: 100rpx;
+					line-height: 100rpx;
+					margin: 36rpx 0;
+					padding-bottom: 20rpx;
+					border-bottom: 1rpx solid #E4E4E4;
+					font-size: 52rpx;
+					font-weight: 600;
+				}
+			}
+		}
+
+		.pay-num {
+			width: 100%;
+			height: 600rpx;
+			background: rgb(208, 211, 220);
+			display: flex;
+			justify-content: space-between;
+			flex-flow: row wrap;
+			box-sizing: border-box;
+			padding: 30rpx;
+
+			.pay-num-input {
+				width: 215rpx;
+				height: 110rpx;
+				background-color: #fff;
+				border-radius: 16rpx;
+				text-align: center;
+				line-height: 110rpx;
+				font-size: 40rpx;
+				font-weight: bold;
+			}
+
+			$height: 20rpx;
+
+			.pay-num-del {
+				margin-top: 38rpx;
+				box-sizing: border-box;
+				padding-left: 25rpx;
+				line-height: 35rpx !important;
+				font-weight: 400 !important;
+
+				&-wrap {
+					margin: 0 auto;
+					width: 40rpx;
+					height: $height * 2;
+					background-color: #dedede;
+					position: relative;
+
+					&::after {
+						content: '';
+						position: absolute;
+						left: -$height * 2;
+						border: $height solid transparent;
+						border-right: $height solid #dedede;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 90 - 0
pages/success.vue

@@ -0,0 +1,90 @@
+<template>
+  <view class="pay-success-page">
+    <view class="main">
+      <view class="section">
+        <image src="@/static/success.png" mode="scaleToFill" class="success-icon" />
+        <view class="success-text">支付成功</view>
+      </view>
+      <view class="button-box">
+        <view class="button home" @click="goHomePage">返回首页</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "pay-success",
+  data() {
+    return {};
+  },
+  methods: {
+    goHomePage() {
+      window.location.href = 'https://wap.jhcs888.com'
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.main {
+  background-color: #fff;
+  box-sizing: border-box;
+  padding-top: 100rpx;
+
+  .success-icon {
+    width: 98rpx;
+    height: 98rpx;
+  }
+
+  .success-text {
+    font-size: 34rpx;
+    margin-top: 14rpx;
+    font-weight: 500;
+  }
+
+  .money {
+    margin-top: 24rpx;
+    font-size: 28rpx;
+    color: #666666;
+  }
+
+  .section {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding: 18rpx 0 42rpx 0;
+    border-bottom: 2rpx dashed #c6c6c6;
+  }
+}
+
+.button-box {
+  display: flex;
+  justify-content: center;
+  padding: 40rpx 176rpx;
+
+  .button {
+	
+	
+    width: 180rpx;
+    height: 72rpx;
+    font-size: 28rpx;
+    border-radius: 72rpx;
+    text-align: center;
+    line-height: 72rpx;
+
+    &:active {
+      background-color: rgb(242, 242, 242);
+    }
+  }
+
+  .home {
+    border: 2rpx solid #6f6f6f;
+  }
+
+  .order {
+    border: 2rpx solid #ed301d;
+    color: #ed301d;
+  }
+}
+</style>

+ 316 - 0
service/base64.js

@@ -0,0 +1,316 @@
+//
+// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
+//
+;
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined'
+        ? module.exports = factory()
+        : typeof define === 'function' && define.amd
+            ? define(factory) :
+            // cf. https://github.com/dankogai/js-base64/issues/119
+            (function () {
+                // existing version for noConflict()
+                var _Base64 = global.Base64;
+                var gBase64 = factory();
+                gBase64.noConflict = function () {
+                    global.Base64 = _Base64;
+                    return gBase64;
+                };
+                if (global.Meteor) { // Meteor.js
+                    Base64 = gBase64;
+                }
+                global.Base64 = gBase64;
+            })();
+}((typeof self !== 'undefined' ? self
+    : typeof window !== 'undefined' ? window
+        : typeof global !== 'undefined' ? global
+            : this), function () {
+    'use strict';
+    /**
+     *  base64.ts
+     *
+     *  Licensed under the BSD 3-Clause License.
+     *    http://opensource.org/licenses/BSD-3-Clause
+     *
+     *  References:
+     *    http://en.wikipedia.org/wiki/Base64
+     *
+     * @author Dan Kogai (https://github.com/dankogai)
+     */
+    var version = '3.7.5';
+    /**
+     * @deprecated use lowercase `version`.
+     */
+    var VERSION = version;
+    var _hasatob = typeof atob === 'function';
+    var _hasbtoa = typeof btoa === 'function';
+    var _hasBuffer = typeof Buffer === 'function';
+    var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
+    var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
+    var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+    var b64chs = Array.prototype.slice.call(b64ch);
+    var b64tab = (function (a) {
+        var tab = {};
+        a.forEach(function (c, i) { return tab[c] = i; });
+        return tab;
+    })(b64chs);
+    var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
+    var _fromCC = String.fromCharCode.bind(String);
+    var _U8Afrom = typeof Uint8Array.from === 'function'
+        ? Uint8Array.from.bind(Uint8Array)
+        : function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };
+    var _mkUriSafe = function (src) { return src
+        .replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
+    var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
+    /**
+     * polyfill version of `btoa`
+     */
+    var btoaPolyfill = function (bin) {
+        // console.log('polyfilled');
+        var u32, c0, c1, c2, asc = '';
+        var pad = bin.length % 3;
+        for (var i = 0; i < bin.length;) {
+            if ((c0 = bin.charCodeAt(i++)) > 255 ||
+                (c1 = bin.charCodeAt(i++)) > 255 ||
+                (c2 = bin.charCodeAt(i++)) > 255)
+                throw new TypeError('invalid character found');
+            u32 = (c0 << 16) | (c1 << 8) | c2;
+            asc += b64chs[u32 >> 18 & 63]
+                + b64chs[u32 >> 12 & 63]
+                + b64chs[u32 >> 6 & 63]
+                + b64chs[u32 & 63];
+        }
+        return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
+    };
+    /**
+     * does what `window.btoa` of web browsers do.
+     * @param {String} bin binary string
+     * @returns {string} Base64-encoded string
+     */
+    var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }
+        : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }
+            : btoaPolyfill;
+    var _fromUint8Array = _hasBuffer
+        ? function (u8a) { return Buffer.from(u8a).toString('base64'); }
+        : function (u8a) {
+            // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
+            var maxargs = 0x1000;
+            var strs = [];
+            for (var i = 0, l = u8a.length; i < l; i += maxargs) {
+                strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
+            }
+            return _btoa(strs.join(''));
+        };
+    /**
+     * converts a Uint8Array to a Base64 string.
+     * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
+     * @returns {string} Base64 string
+     */
+    var fromUint8Array = function (u8a, urlsafe) {
+        if (urlsafe === void 0) { urlsafe = false; }
+        return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
+    };
+    // This trick is found broken https://github.com/dankogai/js-base64/issues/130
+    // const utob = (src: string) => unescape(encodeURIComponent(src));
+    // reverting good old fationed regexp
+    var cb_utob = function (c) {
+        if (c.length < 2) {
+            var cc = c.charCodeAt(0);
+            return cc < 0x80 ? c
+                : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
+                    + _fromCC(0x80 | (cc & 0x3f)))
+                    : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
+                        + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
+                        + _fromCC(0x80 | (cc & 0x3f)));
+        }
+        else {
+            var cc = 0x10000
+                + (c.charCodeAt(0) - 0xD800) * 0x400
+                + (c.charCodeAt(1) - 0xDC00);
+            return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
+                + _fromCC(0x80 | ((cc >>> 12) & 0x3f))
+                + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
+                + _fromCC(0x80 | (cc & 0x3f)));
+        }
+    };
+    var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
+    /**
+     * @deprecated should have been internal use only.
+     * @param {string} src UTF-8 string
+     * @returns {string} UTF-16 string
+     */
+    var utob = function (u) { return u.replace(re_utob, cb_utob); };
+    //
+    var _encode = _hasBuffer
+        ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }
+        : _TE
+            ? function (s) { return _fromUint8Array(_TE.encode(s)); }
+            : function (s) { return _btoa(utob(s)); };
+    /**
+     * converts a UTF-8-encoded string to a Base64 string.
+     * @param {boolean} [urlsafe] if `true` make the result URL-safe
+     * @returns {string} Base64 string
+     */
+    var encode = function (src, urlsafe) {
+        if (urlsafe === void 0) { urlsafe = false; }
+        return urlsafe
+            ? _mkUriSafe(_encode(src))
+            : _encode(src);
+    };
+    /**
+     * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
+     * @returns {string} Base64 string
+     */
+    var encodeURI = function (src) { return encode(src, true); };
+    // This trick is found broken https://github.com/dankogai/js-base64/issues/130
+    // const btou = (src: string) => decodeURIComponent(escape(src));
+    // reverting good old fationed regexp
+    var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
+    var cb_btou = function (cccc) {
+        switch (cccc.length) {
+            case 4:
+                var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
+                    | ((0x3f & cccc.charCodeAt(1)) << 12)
+                    | ((0x3f & cccc.charCodeAt(2)) << 6)
+                    | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
+                return (_fromCC((offset >>> 10) + 0xD800)
+                    + _fromCC((offset & 0x3FF) + 0xDC00));
+            case 3:
+                return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
+                    | ((0x3f & cccc.charCodeAt(1)) << 6)
+                    | (0x3f & cccc.charCodeAt(2)));
+            default:
+                return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
+                    | (0x3f & cccc.charCodeAt(1)));
+        }
+    };
+    /**
+     * @deprecated should have been internal use only.
+     * @param {string} src UTF-16 string
+     * @returns {string} UTF-8 string
+     */
+    var btou = function (b) { return b.replace(re_btou, cb_btou); };
+    /**
+     * polyfill version of `atob`
+     */
+    var atobPolyfill = function (asc) {
+        // console.log('polyfilled');
+        asc = asc.replace(/\s+/g, '');
+        if (!b64re.test(asc))
+            throw new TypeError('malformed base64.');
+        asc += '=='.slice(2 - (asc.length & 3));
+        var u24, bin = '', r1, r2;
+        for (var i = 0; i < asc.length;) {
+            u24 = b64tab[asc.charAt(i++)] << 18
+                | b64tab[asc.charAt(i++)] << 12
+                | (r1 = b64tab[asc.charAt(i++)]) << 6
+                | (r2 = b64tab[asc.charAt(i++)]);
+            bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
+                : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
+                    : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
+        }
+        return bin;
+    };
+    /**
+     * does what `window.atob` of web browsers do.
+     * @param {String} asc Base64-encoded string
+     * @returns {string} binary string
+     */
+    var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }
+        : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }
+            : atobPolyfill;
+    //
+    var _toUint8Array = _hasBuffer
+        ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
+        : function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };
+    /**
+     * converts a Base64 string to a Uint8Array.
+     */
+    var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };
+    //
+    var _decode = _hasBuffer
+        ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }
+        : _TD
+            ? function (a) { return _TD.decode(_toUint8Array(a)); }
+            : function (a) { return btou(_atob(a)); };
+    var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };
+    /**
+     * converts a Base64 string to a UTF-8 string.
+     * @param {String} src Base64 string.  Both normal and URL-safe are supported
+     * @returns {string} UTF-8 string
+     */
+    var decode = function (src) { return _decode(_unURI(src)); };
+    /**
+     * check if a value is a valid Base64 string
+     * @param {String} src a value to check
+      */
+    var isValid = function (src) {
+        if (typeof src !== 'string')
+            return false;
+        var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
+        return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
+    };
+    //
+    var _noEnum = function (v) {
+        return {
+            value: v, enumerable: false, writable: true, configurable: true
+        };
+    };
+    /**
+     * extend String.prototype with relevant methods
+     */
+    var extendString = function () {
+        var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };
+        _add('fromBase64', function () { return decode(this); });
+        _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
+        _add('toBase64URI', function () { return encode(this, true); });
+        _add('toBase64URL', function () { return encode(this, true); });
+        _add('toUint8Array', function () { return toUint8Array(this); });
+    };
+    /**
+     * extend Uint8Array.prototype with relevant methods
+     */
+    var extendUint8Array = function () {
+        var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };
+        _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
+        _add('toBase64URI', function () { return fromUint8Array(this, true); });
+        _add('toBase64URL', function () { return fromUint8Array(this, true); });
+    };
+    /**
+     * extend Builtin prototypes with relevant methods
+     */
+    var extendBuiltins = function () {
+        extendString();
+        extendUint8Array();
+    };
+    var gBase64 = {
+        version: version,
+        VERSION: VERSION,
+        atob: _atob,
+        atobPolyfill: atobPolyfill,
+        btoa: _btoa,
+        btoaPolyfill: btoaPolyfill,
+        fromBase64: decode,
+        toBase64: encode,
+        encode: encode,
+        encodeURI: encodeURI,
+        encodeURL: encodeURI,
+        utob: utob,
+        btou: btou,
+        decode: decode,
+        isValid: isValid,
+        fromUint8Array: fromUint8Array,
+        toUint8Array: toUint8Array,
+        extendString: extendString,
+        extendUint8Array: extendUint8Array,
+        extendBuiltins: extendBuiltins
+    };
+    //
+    // export Base64 to the namespace
+    //
+    // ES5 is yet to have Object.assign() that may make transpilers unhappy.
+    // gBase64.Base64 = Object.assign({}, gBase64);
+    gBase64.Base64 = {};
+    Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });
+    return gBase64;
+}));

+ 211 - 0
service/tools.js

@@ -0,0 +1,211 @@
+import 'jweixin-module'
+
+const wxJs = (typeof window !== 'undefined') ? (window.jWeixin || window.wx) : {}
+
+let tools = {}
+let wxInitPromise = null
+
+/**
+ * 错误提示
+ * @param msg
+ */
+tools.error = function(msg) {
+  uni.showToast({
+    'title': msg,
+    'icon': 'error',
+    'mask': true,
+    'duration': 1500
+  })
+}
+
+/**
+ * 成功提示
+ * @param msg
+ */
+tools.success = function(msg) {
+  uni.showToast({
+    'title': msg,
+    'icon': 'success',
+    'mask': true,
+    'duration': 1500
+  })
+}
+
+/**
+ * 显示Loading
+ */
+tools.showLoading = function() {
+  uni.showLoading({
+    title: '加载中...',
+    mask: true
+  });
+}
+
+/**
+ * 关闭Loading
+ */
+tools.hideLoading = function() {
+  uni.hideLoading();
+}
+
+
+
+
+
+/**
+ * 获取平台类型  1:微信,2:支付宝
+ * @returns {boolean|number}
+ */
+tools.platformType = function() {
+  let ua = window.navigator.userAgent.toLowerCase();
+  if (ua.indexOf('micromessenger') != -1) {
+    return 1;
+  } else if (ua.indexOf('alipay') != -1) {
+    return 2;
+  } else {
+    return 0;
+  }
+}
+
+
+/**
+ * 获取开发平台
+ * @returns {string}
+ */
+tools.getPlatform = function() {
+  let platForm = undefined;
+  // #ifdef H5
+  platForm = 'H5';
+  //#endif
+  // #ifdef APP-PLUS
+  platForm = 'APP';
+  //#endif
+  // #ifdef APP-PLUS-NVUE
+  platForm = 'APP';
+  //#endif
+  // #ifdef APP-NVUE
+  platForm = 'APP';
+  //#endif
+  // #ifdef MP-WEIXIN
+  platForm = 'MP-WEIXIN'; // 小程序
+  //#endif
+  // #ifdef MP-ALIPAY
+  platForm = 'MP-ALIPAY';
+  //#endif
+  // #ifdef MP-BAIDU
+  platForm = 'MP-BAIDU';
+  //#endif
+  // #ifdef MP-TOUTIAO
+  platForm = 'MP-TOUTIAO';
+  //#endif
+  // #ifdef MP-LARK
+  platForm = 'MP-LARK';
+  //#endif
+  // #ifdef MP-QQ
+  platForm = 'MP-QQ';
+  //#endif
+  // #ifdef MP-KUAISHOU
+  platForm = 'MP-KUAISHOU';
+  //#endif
+  // #ifdef QUICKAPP-WEBVIEW
+  platForm = 'QUICKAPP-WEBVIEW';
+  //#endif
+  return platForm;
+}
+
+
+
+tools.wxInitialize = async function(jsApiList, debug) {
+	// 如果已有成功的初始化缓存,直接返回
+	if (wxInitPromise) {
+		return wxInitPromise;
+	}
+
+	let url = window.location.href.replace('#', '');
+
+	wxInitPromise = getJsConfig({
+		'url': url
+	}).then((ret) => {
+		if (ret.code === 1) {
+			wxJs.config({
+				debug: debug ? true : false,
+				appId: ret.data.appid,
+				timestamp: ret.data.timestamp * 1,
+				nonceStr: ret.data.noncestr,
+				signature: ret.data.signature,
+				jsApiList: jsApiList
+			});
+			return new Promise((resolve) => {
+				wxJs.ready(function() {
+					resolve(true);
+				});
+				wxJs.error(function(res) {
+					console.error('微信JSSDK初始化失败:', res);
+					wxInitPromise = null; // 重置缓存,允许重试
+					resolve(false);
+				});
+			});
+		} else {
+			console.error('获取微信配置失败:', ret);
+			wxInitPromise = null;
+			return false;
+		}
+	}).catch((err) => {
+		console.error('微信JSSDK初始化异常:', err);
+		wxInitPromise = null;
+		return false;
+	});
+
+	return wxInitPromise;
+}
+
+
+tools.weiXinPay = function(data) {
+	return new Promise((resolve, reject) => {
+		wxJs.chooseWXPay({
+			appId: data.appId, // 必填,公众号的唯一标识
+			timestamp: data
+				.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
+			nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
+			package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
+			signType: data.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
+			paySign: data.paySign, // 支付签名
+			success: function(res) {
+				resolve(true)
+			},
+			fail: function(res) {
+				resolve(false)
+			},
+		});
+	})
+}
+
+
+// tools.wxSilentLogin = function(urlPath) {
+// 	// 微信浏览器
+// 	let url = encodeURIComponent(window.location.origin + '/#' + urlPath);
+// 	let appid = 'wx27df73f402695133';
+// 	let toUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=" + url +
+// 		"&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
+
+// 	location.href = toUrl
+// }
+
+tools.wxLogin = function(urlPath) {
+	// 微信浏览器
+	// let appid = 'wx5f2adeb213567b23';//测试
+	let appid = 'wx27df73f402695133'; //正式
+	let url = window.location.href;
+	var type = '';
+	if(appid = 'wx27df73f402695133'){
+		type = 1
+	}else{
+		type = window.location.host === 'testwap.jhcs888.com' ? '3' : '1'; 
+	}
+	url = url.replace('&code=', '&code_a=1')
+	url = encodeURIComponent(url);
+	window.location.href = `https://wapwx2.jhcs888.com/#/?redirect_url=${Base64.encode(url)}&type=${type}`
+}
+
+
+export default tools

+ 72 - 0
service/utils.js

@@ -0,0 +1,72 @@
+export const getPlatform = function() {
+	let platForm = undefined
+	// #ifdef H5
+	platForm = 'H5'
+	//#endif
+	// #ifdef APP-PLUS
+	platForm = 'APP'
+	//#endif
+	// #ifdef APP-PLUS-NVUE
+	platForm = 'APP'
+	//#endif
+	// #ifdef APP-NVUE
+	platForm = 'APP'
+	//#endif
+	// #ifdef MP-WEIXIN
+	platForm = 'MP-WEIXIN'
+	//#endif
+	// #ifdef MP-ALIPAY
+	platForm = 'MP-ALIPAY'
+	//#endif
+	// #ifdef MP-BAIDU
+	platForm = 'MP-BAIDU'
+	//#endif
+	// #ifdef MP-TOUTIAO
+	platForm = 'MP-TOUTIAO'
+	//#endif
+	return platForm
+}
+
+export const isWx = function() {
+	//#ifdef H5
+	let ua = window.navigator.userAgent.toLowerCase()
+	if (ua.indexOf('micromessenger') !== -1) {
+		return true
+	} else {
+		return false
+	}
+	//#endif
+	// #ifndef H5
+	return false
+	// #endif
+}
+
+/**
+ * 获取小程序胶囊居中对齐的高度
+ */
+export const getNavHeight = function () {
+    let platForm = getPlatform();
+    if (platForm === 'MP-WEIXIN') {
+        let res = uni.getSystemInfoSync();
+        let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+        let navHeight =
+            menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2;
+        return navHeight
+    } else {
+        return 44;
+    }
+}
+
+/**
+ * 手机顶部高度
+ */
+export const getPhoneTopHeight = function () {
+    let platForm = getPlatform();
+    if (platForm === 'MP-WEIXIN') {
+        let height = uni.getSystemInfoSync().statusBarHeight;
+        return height
+    } else {
+        return 0;
+    }
+
+}

BIN
static/success.png


BIN
static/ts-icon.png


+ 13 - 0
uni.promisify.adaptor.js

@@ -0,0 +1,13 @@
+uni.addInterceptor({
+  returnValue (res) {
+    if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
+      return res;
+    }
+    return new Promise((resolve, reject) => {
+      res.then((res) => {
+        if (!res) return resolve(res) 
+        return res[0] ? reject(res[0]) : resolve(res[1])
+      });
+    });
+  },
+});

+ 76 - 0
uni.scss

@@ -0,0 +1,76 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:12px;
+$uni-font-size-base:14px;
+$uni-font-size-lg:16px;
+
+/* 图片尺寸 */
+$uni-img-size-sm:20px;
+$uni-img-size-base:26px;
+$uni-img-size-lg:40px;
+
+/* Border Radius */
+$uni-border-radius-sm: 2px;
+$uni-border-radius-base: 3px;
+$uni-border-radius-lg: 6px;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 5px;
+$uni-spacing-row-base: 10px;
+$uni-spacing-row-lg: 15px;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 4px;
+$uni-spacing-col-base: 8px;
+$uni-spacing-col-lg: 12px;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:20px;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:26px;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:15px;

+ 15 - 0
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -0,0 +1,15 @@
+{
+  "hash": "cd811743",
+  "configHash": "ba3053f6",
+  "lockfileHash": "5db22517",
+  "browserHash": "7cdae728",
+  "optimized": {
+    "jweixin-module": {
+      "src": "../../../../../node_modules/jweixin-module/lib/index.js",
+      "file": "jweixin-module.js",
+      "fileHash": "4b9056f8",
+      "needsInterop": true
+    }
+  },
+  "chunks": {}
+}

+ 386 - 0
unpackage/dist/cache/.vite/deps/jweixin-module.js

@@ -0,0 +1,386 @@
+// ../../../../zh_zpj/zh-h5-pay/node_modules/jweixin-module/lib/index.js
+!function(e, n) {
+  "function" == typeof define && (define.amd || define.cmd) ? define(function() {
+    return n(e);
+  }) : n(e, true);
+}(window, function(o, e) {
+  if (!o.jWeixin) {
+    var n, c = { config: "preVerifyJSAPI", onMenuShareTimeline: "menu:share:timeline", onMenuShareAppMessage: "menu:share:appmessage", onMenuShareQQ: "menu:share:qq", onMenuShareWeibo: "menu:share:weiboApp", onMenuShareQZone: "menu:share:QZone", previewImage: "imagePreview", getLocation: "geoLocation", openProductSpecificView: "openProductViewWithPid", addCard: "batchAddCard", openCard: "batchViewCard", chooseWXPay: "getBrandWCPayRequest", openEnterpriseRedPacket: "getRecevieBizHongBaoRequest", startSearchBeacons: "startMonitoringBeacons", stopSearchBeacons: "stopMonitoringBeacons", onSearchBeacons: "onBeaconsInRange", consumeAndShareCard: "consumedShareCard", openAddress: "editAddress" }, a = function() {
+      var e2 = {};
+      for (var n2 in c)
+        e2[c[n2]] = n2;
+      return e2;
+    }(), i = o.document, t = i.title, r = navigator.userAgent.toLowerCase(), s = navigator.platform.toLowerCase(), d = !(!s.match("mac") && !s.match("win")), u = -1 != r.indexOf("wxdebugger"), l = -1 != r.indexOf("micromessenger"), p = -1 != r.indexOf("android"), f = -1 != r.indexOf("iphone") || -1 != r.indexOf("ipad"), m = (n = r.match(/micromessenger\/(\d+\.\d+\.\d+)/) || r.match(/micromessenger\/(\d+\.\d+)/)) ? n[1] : "", g = { initStartTime: L(), initEndTime: 0, preVerifyStartTime: 0, preVerifyEndTime: 0 }, h = { version: 1, appId: "", initTime: 0, preVerifyTime: 0, networkType: "", isPreVerifyOk: 1, systemType: f ? 1 : p ? 2 : -1, clientVersion: m, url: encodeURIComponent(location.href) }, v = {}, S = { _completes: [] }, y = { state: 0, data: {} };
+    O(function() {
+      g.initEndTime = L();
+    });
+    var I = false, _ = [], w = { config: function(e2) {
+      B("config", v = e2);
+      var t2 = false !== v.check;
+      O(function() {
+        if (t2)
+          M(c.config, { verifyJsApiList: C(v.jsApiList), verifyOpenTagList: C(v.openTagList) }, function() {
+            S._complete = function(e4) {
+              g.preVerifyEndTime = L(), y.state = 1, y.data = e4;
+            }, S.success = function(e4) {
+              h.isPreVerifyOk = 0;
+            }, S.fail = function(e4) {
+              S._fail ? S._fail(e4) : y.state = -1;
+            };
+            var t3 = S._completes;
+            return t3.push(function() {
+              !function() {
+                if (!(d || u || v.debug || m < "6.0.2" || h.systemType < 0)) {
+                  var i3 = new Image();
+                  h.appId = v.appId, h.initTime = g.initEndTime - g.initStartTime, h.preVerifyTime = g.preVerifyEndTime - g.preVerifyStartTime, w.getNetworkType({ isInnerInvoke: true, success: function(e4) {
+                    h.networkType = e4.networkType;
+                    var n3 = "https://open.weixin.qq.com/sdk/report?v=" + h.version + "&o=" + h.isPreVerifyOk + "&s=" + h.systemType + "&c=" + h.clientVersion + "&a=" + h.appId + "&n=" + h.networkType + "&i=" + h.initTime + "&p=" + h.preVerifyTime + "&u=" + h.url;
+                    i3.src = n3;
+                  } });
+                }
+              }();
+            }), S.complete = function(e4) {
+              for (var n3 = 0, i3 = t3.length; n3 < i3; ++n3)
+                t3[n3]();
+              S._completes = [];
+            }, S;
+          }()), g.preVerifyStartTime = L();
+        else {
+          y.state = 1;
+          for (var e3 = S._completes, n2 = 0, i2 = e3.length; n2 < i2; ++n2)
+            e3[n2]();
+          S._completes = [];
+        }
+      }), w.invoke || (w.invoke = function(e3, n2, i2) {
+        o.WeixinJSBridge && WeixinJSBridge.invoke(e3, x(n2), i2);
+      }, w.on = function(e3, n2) {
+        o.WeixinJSBridge && WeixinJSBridge.on(e3, n2);
+      });
+    }, ready: function(e2) {
+      0 != y.state ? e2() : (S._completes.push(e2), !l && v.debug && e2());
+    }, error: function(e2) {
+      m < "6.0.2" || (-1 == y.state ? e2(y.data) : S._fail = e2);
+    }, checkJsApi: function(e2) {
+      M("checkJsApi", { jsApiList: C(e2.jsApiList) }, (e2._complete = function(e3) {
+        if (p) {
+          var n2 = e3.checkResult;
+          n2 && (e3.checkResult = JSON.parse(n2));
+        }
+        e3 = function(e4) {
+          var n3 = e4.checkResult;
+          for (var i2 in n3) {
+            var t2 = a[i2];
+            t2 && (n3[t2] = n3[i2], delete n3[i2]);
+          }
+          return e4;
+        }(e3);
+      }, e2));
+    }, onMenuShareTimeline: function(e2) {
+      P(c.onMenuShareTimeline, { complete: function() {
+        M("shareTimeline", { title: e2.title || t, desc: e2.title || t, img_url: e2.imgUrl || "", link: e2.link || location.href, type: e2.type || "link", data_url: e2.dataUrl || "" }, e2);
+      } }, e2);
+    }, onMenuShareAppMessage: function(n2) {
+      P(c.onMenuShareAppMessage, { complete: function(e2) {
+        "favorite" === e2.scene ? M("sendAppMessage", { title: n2.title || t, desc: n2.desc || "", link: n2.link || location.href, img_url: n2.imgUrl || "", type: n2.type || "link", data_url: n2.dataUrl || "" }) : M("sendAppMessage", { title: n2.title || t, desc: n2.desc || "", link: n2.link || location.href, img_url: n2.imgUrl || "", type: n2.type || "link", data_url: n2.dataUrl || "" }, n2);
+      } }, n2);
+    }, onMenuShareQQ: function(e2) {
+      P(c.onMenuShareQQ, { complete: function() {
+        M("shareQQ", { title: e2.title || t, desc: e2.desc || "", img_url: e2.imgUrl || "", link: e2.link || location.href }, e2);
+      } }, e2);
+    }, onMenuShareWeibo: function(e2) {
+      P(c.onMenuShareWeibo, { complete: function() {
+        M("shareWeiboApp", { title: e2.title || t, desc: e2.desc || "", img_url: e2.imgUrl || "", link: e2.link || location.href }, e2);
+      } }, e2);
+    }, onMenuShareQZone: function(e2) {
+      P(c.onMenuShareQZone, { complete: function() {
+        M("shareQZone", { title: e2.title || t, desc: e2.desc || "", img_url: e2.imgUrl || "", link: e2.link || location.href }, e2);
+      } }, e2);
+    }, updateTimelineShareData: function(e2) {
+      M("updateTimelineShareData", { title: e2.title, link: e2.link, imgUrl: e2.imgUrl }, e2);
+    }, updateAppMessageShareData: function(e2) {
+      M("updateAppMessageShareData", { title: e2.title, desc: e2.desc, link: e2.link, imgUrl: e2.imgUrl }, e2);
+    }, startRecord: function(e2) {
+      M("startRecord", {}, e2);
+    }, stopRecord: function(e2) {
+      M("stopRecord", {}, e2);
+    }, onVoiceRecordEnd: function(e2) {
+      P("onVoiceRecordEnd", e2);
+    }, playVoice: function(e2) {
+      M("playVoice", { localId: e2.localId }, e2);
+    }, pauseVoice: function(e2) {
+      M("pauseVoice", { localId: e2.localId }, e2);
+    }, stopVoice: function(e2) {
+      M("stopVoice", { localId: e2.localId }, e2);
+    }, onVoicePlayEnd: function(e2) {
+      P("onVoicePlayEnd", e2);
+    }, uploadVoice: function(e2) {
+      M("uploadVoice", { localId: e2.localId, isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1 }, e2);
+    }, downloadVoice: function(e2) {
+      M("downloadVoice", { serverId: e2.serverId, isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1 }, e2);
+    }, translateVoice: function(e2) {
+      M("translateVoice", { localId: e2.localId, isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1 }, e2);
+    }, chooseImage: function(e2) {
+      M("chooseImage", { scene: "1|2", count: e2.count || 9, sizeType: e2.sizeType || ["original", "compressed"], sourceType: e2.sourceType || ["album", "camera"] }, (e2._complete = function(e3) {
+        if (p) {
+          var n2 = e3.localIds;
+          try {
+            n2 && (e3.localIds = JSON.parse(n2));
+          } catch (e4) {
+          }
+        }
+      }, e2));
+    }, getLocation: function(e2) {
+    }, previewImage: function(e2) {
+      M(c.previewImage, { current: e2.current, urls: e2.urls }, e2);
+    }, uploadImage: function(e2) {
+      M("uploadImage", { localId: e2.localId, isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1 }, e2);
+    }, downloadImage: function(e2) {
+      M("downloadImage", { serverId: e2.serverId, isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1 }, e2);
+    }, getLocalImgData: function(e2) {
+      false === I ? (I = true, M("getLocalImgData", { localId: e2.localId }, (e2._complete = function(e3) {
+        if (I = false, 0 < _.length) {
+          var n2 = _.shift();
+          wx.getLocalImgData(n2);
+        }
+      }, e2))) : _.push(e2);
+    }, getNetworkType: function(e2) {
+      M("getNetworkType", {}, (e2._complete = function(e3) {
+        e3 = function(e4) {
+          var n2 = e4.errMsg;
+          e4.errMsg = "getNetworkType:ok";
+          var i2 = e4.subtype;
+          if (delete e4.subtype, i2)
+            e4.networkType = i2;
+          else {
+            var t2 = n2.indexOf(":"), o2 = n2.substring(t2 + 1);
+            switch (o2) {
+              case "wifi":
+              case "edge":
+              case "wwan":
+                e4.networkType = o2;
+                break;
+              default:
+                e4.errMsg = "getNetworkType:fail";
+            }
+          }
+          return e4;
+        }(e3);
+      }, e2));
+    }, openLocation: function(e2) {
+      M("openLocation", { latitude: e2.latitude, longitude: e2.longitude, name: e2.name || "", address: e2.address || "", scale: e2.scale || 28, infoUrl: e2.infoUrl || "" }, e2);
+    }, getLocation: function(e2) {
+      M(c.getLocation, { type: (e2 = e2 || {}).type || "wgs84" }, (e2._complete = function(e3) {
+        delete e3.type;
+      }, e2));
+    }, hideOptionMenu: function(e2) {
+      M("hideOptionMenu", {}, e2);
+    }, showOptionMenu: function(e2) {
+      M("showOptionMenu", {}, e2);
+    }, closeWindow: function(e2) {
+      M("closeWindow", {}, e2 = e2 || {});
+    }, hideMenuItems: function(e2) {
+      M("hideMenuItems", { menuList: e2.menuList }, e2);
+    }, showMenuItems: function(e2) {
+      M("showMenuItems", { menuList: e2.menuList }, e2);
+    }, hideAllNonBaseMenuItem: function(e2) {
+      M("hideAllNonBaseMenuItem", {}, e2);
+    }, showAllNonBaseMenuItem: function(e2) {
+      M("showAllNonBaseMenuItem", {}, e2);
+    }, scanQRCode: function(e2) {
+      M("scanQRCode", { needResult: (e2 = e2 || {}).needResult || 0, scanType: e2.scanType || ["qrCode", "barCode"] }, (e2._complete = function(e3) {
+        if (f) {
+          var n2 = e3.resultStr;
+          if (n2) {
+            var i2 = JSON.parse(n2);
+            e3.resultStr = i2 && i2.scan_code && i2.scan_code.scan_result;
+          }
+        }
+      }, e2));
+    }, openAddress: function(e2) {
+      M(c.openAddress, {}, (e2._complete = function(e3) {
+        e3 = function(e4) {
+          return e4.postalCode = e4.addressPostalCode, delete e4.addressPostalCode, e4.provinceName = e4.proviceFirstStageName, delete e4.proviceFirstStageName, e4.cityName = e4.addressCitySecondStageName, delete e4.addressCitySecondStageName, e4.countryName = e4.addressCountiesThirdStageName, delete e4.addressCountiesThirdStageName, e4.detailInfo = e4.addressDetailInfo, delete e4.addressDetailInfo, e4;
+        }(e3);
+      }, e2));
+    }, openProductSpecificView: function(e2) {
+      M(c.openProductSpecificView, { pid: e2.productId, view_type: e2.viewType || 0, ext_info: e2.extInfo }, e2);
+    }, addCard: function(e2) {
+      for (var n2 = e2.cardList, i2 = [], t2 = 0, o2 = n2.length; t2 < o2; ++t2) {
+        var r2 = n2[t2], a2 = { card_id: r2.cardId, card_ext: r2.cardExt };
+        i2.push(a2);
+      }
+      M(c.addCard, { card_list: i2 }, (e2._complete = function(e3) {
+        var n3 = e3.card_list;
+        if (n3) {
+          for (var i3 = 0, t3 = (n3 = JSON.parse(n3)).length; i3 < t3; ++i3) {
+            var o3 = n3[i3];
+            o3.cardId = o3.card_id, o3.cardExt = o3.card_ext, o3.isSuccess = !!o3.is_succ, delete o3.card_id, delete o3.card_ext, delete o3.is_succ;
+          }
+          e3.cardList = n3, delete e3.card_list;
+        }
+      }, e2));
+    }, chooseCard: function(e2) {
+      M("chooseCard", { app_id: v.appId, location_id: e2.shopId || "", sign_type: e2.signType || "SHA1", card_id: e2.cardId || "", card_type: e2.cardType || "", card_sign: e2.cardSign, time_stamp: e2.timestamp + "", nonce_str: e2.nonceStr }, (e2._complete = function(e3) {
+        e3.cardList = e3.choose_card_info, delete e3.choose_card_info;
+      }, e2));
+    }, openCard: function(e2) {
+      for (var n2 = e2.cardList, i2 = [], t2 = 0, o2 = n2.length; t2 < o2; ++t2) {
+        var r2 = n2[t2], a2 = { card_id: r2.cardId, code: r2.code };
+        i2.push(a2);
+      }
+      M(c.openCard, { card_list: i2 }, e2);
+    }, consumeAndShareCard: function(e2) {
+      M(c.consumeAndShareCard, { consumedCardId: e2.cardId, consumedCode: e2.code }, e2);
+    }, chooseWXPay: function(e2) {
+      M(c.chooseWXPay, V(e2), e2);
+    }, openEnterpriseRedPacket: function(e2) {
+      M(c.openEnterpriseRedPacket, V(e2), e2);
+    }, startSearchBeacons: function(e2) {
+      M(c.startSearchBeacons, { ticket: e2.ticket }, e2);
+    }, stopSearchBeacons: function(e2) {
+      M(c.stopSearchBeacons, {}, e2);
+    }, onSearchBeacons: function(e2) {
+      P(c.onSearchBeacons, e2);
+    }, openEnterpriseChat: function(e2) {
+      M("openEnterpriseChat", { useridlist: e2.userIds, chatname: e2.groupName }, e2);
+    }, launchMiniProgram: function(e2) {
+      M("launchMiniProgram", { targetAppId: e2.targetAppId, path: function(e3) {
+        if ("string" == typeof e3 && 0 < e3.length) {
+          var n2 = e3.split("?")[0], i2 = e3.split("?")[1];
+          return n2 += ".html", void 0 !== i2 ? n2 + "?" + i2 : n2;
+        }
+      }(e2.path), envVersion: e2.envVersion }, e2);
+    }, openBusinessView: function(e2) {
+      M("openBusinessView", { businessType: e2.businessType, queryString: e2.queryString || "", envVersion: e2.envVersion }, (e2._complete = function(n2) {
+        if (p) {
+          var e3 = n2.extraData;
+          if (e3)
+            try {
+              n2.extraData = JSON.parse(e3);
+            } catch (e4) {
+              n2.extraData = {};
+            }
+        }
+      }, e2));
+    }, miniProgram: { navigateBack: function(e2) {
+      e2 = e2 || {}, O(function() {
+        M("invokeMiniProgramAPI", { name: "navigateBack", arg: { delta: e2.delta || 1 } }, e2);
+      });
+    }, navigateTo: function(e2) {
+      O(function() {
+        M("invokeMiniProgramAPI", { name: "navigateTo", arg: { url: e2.url } }, e2);
+      });
+    }, redirectTo: function(e2) {
+      O(function() {
+        M("invokeMiniProgramAPI", { name: "redirectTo", arg: { url: e2.url } }, e2);
+      });
+    }, switchTab: function(e2) {
+      O(function() {
+        M("invokeMiniProgramAPI", { name: "switchTab", arg: { url: e2.url } }, e2);
+      });
+    }, reLaunch: function(e2) {
+      O(function() {
+        M("invokeMiniProgramAPI", { name: "reLaunch", arg: { url: e2.url } }, e2);
+      });
+    }, postMessage: function(e2) {
+      O(function() {
+        M("invokeMiniProgramAPI", { name: "postMessage", arg: e2.data || {} }, e2);
+      });
+    }, getEnv: function(e2) {
+      O(function() {
+        e2({ miniprogram: "miniprogram" === o.__wxjs_environment });
+      });
+    } } }, T = 1, k = {};
+    return i.addEventListener("error", function(e2) {
+      if (!p) {
+        var n2 = e2.target, i2 = n2.tagName, t2 = n2.src;
+        if ("IMG" == i2 || "VIDEO" == i2 || "AUDIO" == i2 || "SOURCE" == i2) {
+          if (-1 != t2.indexOf("wxlocalresource://")) {
+            e2.preventDefault(), e2.stopPropagation();
+            var o2 = n2["wx-id"];
+            if (o2 || (o2 = T++, n2["wx-id"] = o2), k[o2])
+              return;
+            k[o2] = true, wx.ready(function() {
+              wx.getLocalImgData({ localId: t2, success: function(e3) {
+                n2.src = e3.localData;
+              } });
+            });
+          }
+        }
+      }
+    }, true), i.addEventListener("load", function(e2) {
+      if (!p) {
+        var n2 = e2.target, i2 = n2.tagName;
+        n2.src;
+        if ("IMG" == i2 || "VIDEO" == i2 || "AUDIO" == i2 || "SOURCE" == i2) {
+          var t2 = n2["wx-id"];
+          t2 && (k[t2] = false);
+        }
+      }
+    }, true), e && (o.wx = o.jWeixin = w), w;
+  }
+  function M(n2, e2, i2) {
+    o.WeixinJSBridge ? WeixinJSBridge.invoke(n2, x(e2), function(e3) {
+      A(n2, e3, i2);
+    }) : B(n2, i2);
+  }
+  function P(n2, i2, t2) {
+    o.WeixinJSBridge ? WeixinJSBridge.on(n2, function(e2) {
+      t2 && t2.trigger && t2.trigger(e2), A(n2, e2, i2);
+    }) : B(n2, t2 || i2);
+  }
+  function x(e2) {
+    return (e2 = e2 || {}).appId = v.appId, e2.verifyAppId = v.appId, e2.verifySignType = "sha1", e2.verifyTimestamp = v.timestamp + "", e2.verifyNonceStr = v.nonceStr, e2.verifySignature = v.signature, e2;
+  }
+  function V(e2) {
+    return { timeStamp: e2.timestamp + "", nonceStr: e2.nonceStr, package: e2.package, paySign: e2.paySign, signType: e2.signType || "SHA1" };
+  }
+  function A(e2, n2, i2) {
+    "openEnterpriseChat" != e2 && "openBusinessView" !== e2 || (n2.errCode = n2.err_code), delete n2.err_code, delete n2.err_desc, delete n2.err_detail;
+    var t2 = n2.errMsg;
+    t2 || (t2 = n2.err_msg, delete n2.err_msg, t2 = function(e3, n3) {
+      var i3 = e3, t3 = a[i3];
+      t3 && (i3 = t3);
+      var o3 = "ok";
+      if (n3) {
+        var r2 = n3.indexOf(":");
+        "confirm" == (o3 = n3.substring(r2 + 1)) && (o3 = "ok"), "failed" == o3 && (o3 = "fail"), -1 != o3.indexOf("failed_") && (o3 = o3.substring(7)), -1 != o3.indexOf("fail_") && (o3 = o3.substring(5)), "access denied" != (o3 = (o3 = o3.replace(/_/g, " ")).toLowerCase()) && "no permission to execute" != o3 || (o3 = "permission denied"), "config" == i3 && "function not exist" == o3 && (o3 = "ok"), "" == o3 && (o3 = "fail");
+      }
+      return n3 = i3 + ":" + o3;
+    }(e2, t2), n2.errMsg = t2), (i2 = i2 || {})._complete && (i2._complete(n2), delete i2._complete), t2 = n2.errMsg || "", v.debug && !i2.isInnerInvoke && alert(JSON.stringify(n2));
+    var o2 = t2.indexOf(":");
+    switch (t2.substring(o2 + 1)) {
+      case "ok":
+        i2.success && i2.success(n2);
+        break;
+      case "cancel":
+        i2.cancel && i2.cancel(n2);
+        break;
+      default:
+        i2.fail && i2.fail(n2);
+    }
+    i2.complete && i2.complete(n2);
+  }
+  function C(e2) {
+    if (e2) {
+      for (var n2 = 0, i2 = e2.length; n2 < i2; ++n2) {
+        var t2 = e2[n2], o2 = c[t2];
+        o2 && (e2[n2] = o2);
+      }
+      return e2;
+    }
+  }
+  function B(e2, n2) {
+    if (!(!v.debug || n2 && n2.isInnerInvoke)) {
+      var i2 = a[e2];
+      i2 && (e2 = i2), n2 && n2._complete && delete n2._complete, console.log('"' + e2 + '",', n2 || "");
+    }
+  }
+  function L() {
+    return (/* @__PURE__ */ new Date()).getTime();
+  }
+  function O(e2) {
+    l && (o.WeixinJSBridge ? e2() : i.addEventListener && i.addEventListener("WeixinJSBridgeReady", e2, false));
+  }
+});
+//# sourceMappingURL=jweixin-module.js.map

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 3 - 0
unpackage/dist/cache/.vite/deps/jweixin-module.js.map


+ 3 - 0
unpackage/dist/cache/.vite/deps/package.json

@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно