| @ -0,0 +1,59 @@ | |||
| import http from './http.js' | |||
| const config = { | |||
| // 示例 | |||
| // wxLogin : {url : '/api/wxLogin', method : 'POST', | |||
| // auth : false, showLoading : true, loadingTitle : '加载中...', | |||
| // limit : 1000 | |||
| // }, | |||
| getConfig : {url : '/api/getConfig', method : 'GET', limit : 500}, | |||
| } | |||
| export function api(key, data, callback, loadingTitle){ | |||
| let req = config[key] | |||
| if (!req) { | |||
| console.error('无效key' + key); | |||
| return | |||
| } | |||
| if(typeof callback == 'string'){ | |||
| loadingTitle = callback | |||
| } | |||
| if(typeof data == 'function'){ | |||
| callback = data | |||
| data = {} | |||
| } | |||
| // 接口限流 | |||
| if(req.limit){ | |||
| let storageKey = 'limit:' + req.url | |||
| let storage = uni.getStorageSync(storageKey) | |||
| if(storage && new Date().getTime() - parseInt(storage) < req.limit){ | |||
| return | |||
| } | |||
| uni.setStorageSync(storageKey, new Date().getTime()) | |||
| } | |||
| //必须登录 | |||
| if (req.auth) { | |||
| if (!uni.getStorageSync('token')) { | |||
| uni.navigateTo({ | |||
| url: '/pages/login/mobile' | |||
| }) | |||
| console.error('需要登录') | |||
| return | |||
| } | |||
| } | |||
| http.http(req.url, data, callback, req.method, | |||
| loadingTitle || req.showLoading, loadingTitle || req.loadingTitle) | |||
| } | |||
| export default api | |||
| @ -0,0 +1,46 @@ | |||
| import Vue from 'vue' | |||
| import api from '@/api/api.js' | |||
| import utils from './utils/utils.js' | |||
| // 当前环境 | |||
| const type = 'dev' | |||
| // 环境配置 | |||
| const config = { | |||
| dev : { | |||
| baseUrl : 'http://www.gcosc.fun:82', | |||
| }, | |||
| prod : { | |||
| baseUrl : 'http://xxx.xxx.xxx/xxx', | |||
| } | |||
| } | |||
| // 默认配置 | |||
| const defaultConfig = { | |||
| mapKey : 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU', | |||
| aliOss : { | |||
| url : 'https://tennis-oss.xzaiyp.top/', | |||
| config : { | |||
| //桶的地址 | |||
| region: 'oss-cn-guangzhou', | |||
| //id | |||
| accessKeyId:'LTAI5tNycA46YTwm383dRvMV', | |||
| //密钥 | |||
| accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG', | |||
| //桶的名字 | |||
| bucket: 'zhuoqiu-image', | |||
| endpoint:'oss-cn-guangzhou.aliyuncs.com', | |||
| } | |||
| }, | |||
| } | |||
| Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type]) | |||
| Vue.prototype.$api = api | |||
| export default Vue.prototype.$config | |||
| @ -0,0 +1,23 @@ | |||
| { | |||
| "name": "knowledge-payment-uniapp", | |||
| "version": "1.0.0", | |||
| "description": "", | |||
| "main": "main.js", | |||
| "directories": { | |||
| "doc": "doc" | |||
| }, | |||
| "scripts": { | |||
| "test": "echo \"Error: no test specified\" && exit 1" | |||
| }, | |||
| "repository": { | |||
| "type": "git", | |||
| "url": "http://175.178.51.79:3000/hly/knowledge-payment-uniapp.git" | |||
| }, | |||
| "keywords": [], | |||
| "author": "", | |||
| "license": "ISC", | |||
| "dependencies": { | |||
| "ali-oss": "^6.21.0", | |||
| "dayjs": "^1.11.12" | |||
| } | |||
| } | |||
| @ -1,218 +0,0 @@ | |||
| <template> | |||
| <view class="content"> | |||
| <!-- <img src="/static/logo.png" style="position: absolute;right: 10px;top: 10px;" height="25rpx" /> --> | |||
| <img :src="item" width="100%" v-for="(item, index) in list" /> | |||
| <view class="bottom"> | |||
| <view class="shang" style="padding-bottom: 200rpx;"> | |||
| <!-- <view style="margin-bottom: 20rpx;margin-top: 10rpx;text-align: center;"> | |||
| <text style="color: #eee;font-size: 30rpx; | |||
| margin-right: 10rpx;">单价{{ price }}¥</text> | |||
| </view> --> | |||
| <!-- <view class="info" style="color: #fff;margin: 20rpx 0; | |||
| display: flex;align-items: center;"> | |||
| <view style="padding: 0 10rpx;"> | |||
| 购买数量 | |||
| </view> | |||
| <u-number-box v-model="registerForm.num" @change="valChange"></u-number-box> | |||
| </view> --> | |||
| <!-- <div class="register-username"> | |||
| <u--input placeholder="请输入学生姓名" type="number" border="surround" | |||
| v-model="registerForm.name"></u--input> | |||
| </div> --> | |||
| <!-- <view style="margin-bottom: 20rpx;margin-top: 10rpx;text-align: center;"> | |||
| <text style="color: #fff;font-size: 40rpx; | |||
| margin-right: 10rpx;">总金额 {{ price * registerForm.num }}¥</text> | |||
| </view> --> | |||
| <!-- <u-button type="primary" @click="Register()" style="border-radius: 20rpx;color: #000;width: 200rpx;" | |||
| color="#fff">立即支付</u-button> --> | |||
| <view style=" | |||
| color: #fff;margin-top: 60rpx; | |||
| border: 1px solid #fff; | |||
| padding: 10rpx 20rpx;"> | |||
| 联系客服 | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <div class="abtn"> | |||
| <!-- <u-number-box | |||
| v-model="registerForm.num" | |||
| @change="valChange"></u-number-box> --> | |||
| <view style="padding: 10px;"> | |||
| <text style="color: #000;font-size: 25rpx;"> | |||
| 单价{{ price }}¥</text> | |||
| </view> | |||
| <u-number-box | |||
| style="margin: 0 auto;" | |||
| v-model="registerForm.num" | |||
| :min="1"> | |||
| <view slot="minus" class="minus"> | |||
| <u-icon name="minus" size="12"></u-icon> | |||
| </view> | |||
| <view slot="plus" class="plus"> | |||
| <u-icon name="plus" color="#FFFFFF" size="12"></u-icon> | |||
| </view> | |||
| </u-number-box> | |||
| <view class="zhif"> | |||
| 立即支付 | |||
| <text style="padding-left: 10rpx;">{{ price * registerForm.num }}¥</text> | |||
| </view> | |||
| </div> | |||
| </view> | |||
| </template> | |||
| <script> | |||
| import api from '@/plugins/api.js' | |||
| export default { | |||
| data() { | |||
| return { | |||
| code: '', | |||
| price: 10, | |||
| registerForm: { | |||
| num: 1 | |||
| }, | |||
| type: 1, //0是money,1是price | |||
| phone: '400-026-7262', | |||
| list: [ | |||
| // '/static/0240718173256.jpg', | |||
| // '/static/24.png', | |||
| // '/static/123.png', | |||
| "https://img.alicdn.com/imgextra/i2/2263306098/O1CN01bDUHBB1uuwAxlahWT_!!2263306098.jpg", | |||
| "https://img.alicdn.com/imgextra/i3/2263306098/O1CN01SNLRO41uuwAuR6xLb_!!2263306098.jpg", | |||
| ] | |||
| } | |||
| }, | |||
| onLoad() { | |||
| // if(this.GetQueryString('code')){ //路径上面有code说明微信已授权 | |||
| // this.code = this.GetQueryString('code'); | |||
| // //直接去登录发起请求 | |||
| // this.toWxLogin(this.code) | |||
| // }else{ | |||
| // this.getwx_authorize() | |||
| // } | |||
| }, | |||
| methods: { | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped lang="scss"> | |||
| .content { | |||
| display: flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| } | |||
| .bottom { | |||
| display: flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| position: relative; | |||
| width: 100%; | |||
| // --color : #890404; | |||
| --color: #dc2808; | |||
| .shang { | |||
| width: 100%; | |||
| box-sizing: border-box; | |||
| // background: linear-gradient(to right, rgb(239, 118, 66), rgb(220, 38, 7)); | |||
| background: #000; | |||
| overflow: hidden; | |||
| padding: 30rpx 0; | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| } | |||
| .register-username { | |||
| display: flex; | |||
| border: 1px solid #ED762F; | |||
| height: 35px; | |||
| align-items: center; | |||
| margin-bottom: 20px; | |||
| padding: 0 10px; | |||
| border-radius: 5px; | |||
| box-sizing: border-box; | |||
| background-color: #fff; | |||
| color: #000; | |||
| image { | |||
| width: 20px; | |||
| height: 20px; | |||
| } | |||
| } | |||
| .abtn { | |||
| position: fixed; | |||
| bottom: 0; | |||
| left: 0; | |||
| width: 100%; | |||
| height: 60px; | |||
| background-color: #fff; | |||
| display: flex; | |||
| align-items: center; | |||
| .zhif { | |||
| width: 45%; | |||
| height: 100%; | |||
| margin-left: auto; | |||
| background-color: #f60; | |||
| color: #fff; | |||
| text-align: center; | |||
| line-height: 60px; | |||
| } | |||
| } | |||
| .minus { | |||
| width: 22px; | |||
| height: 22px; | |||
| border-width: 1px; | |||
| border-color: #E6E6E6; | |||
| border-style: solid; | |||
| border-top-left-radius: 100px; | |||
| border-top-right-radius: 100px; | |||
| border-bottom-left-radius: 100px; | |||
| border-bottom-right-radius: 100px; | |||
| @include flex; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| .input { | |||
| padding: 0 10px; | |||
| } | |||
| .plus { | |||
| width: 22px; | |||
| height: 22px; | |||
| background-color: #FF0000; | |||
| border-radius: 50%; | |||
| /* #ifndef APP-NVUE */ | |||
| display: flex; | |||
| /* #endif */ | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| </style> | |||
| @ -1,35 +0,0 @@ | |||
| import http from './http.js' | |||
| const config = { | |||
| // 微信登录 | |||
| wxLogin : {url : '/api/wxLogin', method : 'POST', auth : false}, | |||
| // 2 用户支付 | |||
| createOrder : {url : '/api/createOrder', method : 'POST', auth : true}, | |||
| } | |||
| export function api(key, data, callback, loadingTitle){ | |||
| if (!config[key]) { | |||
| return console.error('无效key' + key); | |||
| } | |||
| if (config[key].auth) { | |||
| if (!localStorage.getItem('token')) { | |||
| uni.navigateTo({ | |||
| url: '/pages/login/mobile' | |||
| }) | |||
| console.error('需要登录') | |||
| return { | |||
| then() {} | |||
| }; | |||
| } | |||
| } | |||
| http.http(config[key].url, data, callback, config[key].method, | |||
| loadingTitle || config[key].showLoading, loadingTitle || config[key].loadingTitle) | |||
| } | |||
| export default api | |||
| @ -1,56 +0,0 @@ | |||
| import http from './http.js' | |||
| function upload(files, callback) { | |||
| const uploadResults = []; | |||
| let count = files.length; | |||
| files.forEach(file => { | |||
| http.get("/oss/get", {}, (res) => { | |||
| console.log('get', res); | |||
| const sign = res.data; | |||
| doUpload(sign, file.path, (result) => { | |||
| uploadResults.push(result); | |||
| count--; | |||
| if (count === 0) { | |||
| callback(uploadResults); | |||
| } | |||
| }); | |||
| }); | |||
| }); | |||
| } | |||
| function doUpload(sign, filePath, callback, module = 'upload') { | |||
| const key = `${module}/${new Date().getTime()}.png`; | |||
| const prk = sign.host + "/" + key; | |||
| uni.uploadFile({ | |||
| url: sign.host, | |||
| filePath, | |||
| name: 'file', | |||
| formData: { | |||
| key, | |||
| policy: sign.policy, | |||
| OSSAccessKeyId: sign.accessKeyId, | |||
| signature: sign.signature, | |||
| success_action_status: '200' | |||
| }, | |||
| success: (res) => { | |||
| console.log('oss', prk); | |||
| callback(prk); | |||
| }, | |||
| fail: (err) => { | |||
| console.log('oss', err); | |||
| callback({ error: err }); | |||
| } | |||
| }); | |||
| } | |||
| // 调用示例 | |||
| //upload(files, (uploadUrls) => { | |||
| // console.log('All upload URLs:', uploadUrls); | |||
| //}); | |||
| export default { | |||
| upload: upload | |||
| } | |||
| @ -1,33 +0,0 @@ | |||
| import http from './http.js' | |||
| import util from './utils.js' | |||
| import time from './timeUtils.js' | |||
| import storage from './storage.js' | |||
| import oss from './oss.js' | |||
| import api from './api.js' | |||
| // import 'dayjs/locale/zh-cn' | |||
| // import dayjs from 'dayjs' | |||
| // dayjs.locale('zh-cn') | |||
| // import uploadFileToOSS from './upload.js' | |||
| const plugins = { | |||
| install(app) { | |||
| // app.config.globalProperties.uploadFileToOSS = uploadFileToOSS | |||
| // app.config.globalProperties.dayjs = dayjs | |||
| app.config.globalProperties.$api = api | |||
| app.config.globalProperties.$http = http.http | |||
| app.config.globalProperties.$httpGet = http.get | |||
| app.config.globalProperties.$httpPost = http.post | |||
| app.config.globalProperties.$httpDelete = http.delete | |||
| app.config.globalProperties.$httpSync = http.syncHttp | |||
| app.config.globalProperties.$upload = oss.upload | |||
| app.config.globalProperties.$timeUtils = time | |||
| app.config.globalProperties.$utils = util | |||
| app.config.globalProperties.$storage = storage | |||
| } | |||
| } | |||
| export default plugins; | |||
| @ -1,19 +0,0 @@ | |||
| function getData(key, data) { | |||
| if( !(data instanceof String) ) data = JSON.stringify(data) | |||
| return uni.setStorageSync(key, data) | |||
| } | |||
| function setData(key) { | |||
| return uni.getStorageSync(key); | |||
| } | |||
| function safeDistance() { | |||
| return uni.getStorageSync("safeDistance"); | |||
| } | |||
| export default { | |||
| get: getData, | |||
| set: setData, | |||
| safeDistance: safeDistance, | |||
| } | |||
| @ -1,53 +0,0 @@ | |||
| import OSS from "ali-oss" | |||
| import { v4 as uuidv4 } from 'uuid'; | |||
| function uploadFileToOSS(file) { | |||
| uni.showLoading({ | |||
| title: '图片上传中...' | |||
| }); | |||
| return new Promise((resolve,reject) => { | |||
| // 创建OSS实例 | |||
| const client = new OSS({ | |||
| // region: 'oss-cn-shenzhen', | |||
| // accessKeyId: 'LTAI5tMan18fjJPUtr3Aim2W', | |||
| // accessKeySecret: 'lhALqqgYijc115wY8c1KfTYkbSnq5I', | |||
| // bucket: 'mangoimageapplet', | |||
| // endpoint:'oss-cn-shenzhen.aliyuncs.com' | |||
| //桶的地址 | |||
| region: 'oss-cn-guangzhou', | |||
| //id | |||
| accessKeyId:'LTAI5tNycA46YTwm383dRvMV', | |||
| //密钥 | |||
| accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG', | |||
| //桶的名字 | |||
| bucket: 'zhuoqiu-image', | |||
| endpoint:'oss-cn-guangzhou.aliyuncs.com', | |||
| }); | |||
| // 设置文件名和文件目录 | |||
| const suffix = '.' + file.name.split('.').pop(); | |||
| const fileName = uuidv4() + suffix; // 注意:文件名需要是唯一的 | |||
| // 使用put接口上传文件 | |||
| client.multipartUpload(fileName, file, { | |||
| headers: { | |||
| 'Content-Disposition': 'inline', | |||
| 'Content-Type': file.type | |||
| } | |||
| }).then(res => { | |||
| uni.hideLoading(); | |||
| resolve('https://tennis-oss.xzaiyp.top/' + res.name); | |||
| }).catch(err => { | |||
| uni.hideLoading(); | |||
| reject(err) | |||
| }) | |||
| }) | |||
| } | |||
| export default uploadFileToOSS | |||
| @ -1,90 +0,0 @@ | |||
| function toArray(data) { | |||
| if (!data) return data | |||
| let arr = new Array() | |||
| if (data instanceof Array){ | |||
| return data | |||
| } else { | |||
| return [data] | |||
| } | |||
| } | |||
| function generateUUID() { | |||
| const timestamp = new Date().getTime().toString(); // 获取当前时间戳 | |||
| const random = Math.random().toString().substr(2, 8); // 生成8位随机数 | |||
| const increment = Math.floor(Math.random() * 1000000000).toString().padStart(9, '0'); // 生成9位自增数 | |||
| return timestamp + random + increment; | |||
| } | |||
| function generateRandomColor() { | |||
| const letters = '0123456789ABCDEF'; | |||
| let color = '#'; | |||
| for (let i = 0; i < 6; i++) { | |||
| color += letters[Math.floor(Math.random() * 16)]; | |||
| } | |||
| return color; | |||
| } | |||
| function generateLightRandomColor() { | |||
| const min = 150; | |||
| const range = 105; | |||
| const r = Math.floor(Math.random() * range + min); | |||
| const g = Math.floor(Math.random() * range + min); | |||
| const b = Math.floor(Math.random() * range + min); | |||
| const color = 'rgb(' + r + ',' + g + ',' + b + ')'; | |||
| return color; | |||
| } | |||
| function verificationAll(data){ | |||
| console.log("verificationAll:", data); | |||
| if (!data){ | |||
| uni.showToast({ | |||
| title: '表单数据未填写', | |||
| icon: "error" | |||
| }) | |||
| return true | |||
| } | |||
| for (let key in data) { | |||
| if (!data[key] || data[key] === "") { | |||
| console.log(key); | |||
| uni.showToast({ | |||
| title: '必填数据未填写' + key, | |||
| icon: "error" | |||
| }) | |||
| return true | |||
| } | |||
| } | |||
| return false | |||
| } | |||
| function getLocation(fn){ | |||
| uni.getLocation({ | |||
| type: 'wgs84', | |||
| geocode:true,//设置该参数为true可直接获取经纬度及城市信息 | |||
| success(orientation) { | |||
| console.log('获取定位信息',orientation); | |||
| let data = { | |||
| latitude : orientation.latitude,//纬度 | |||
| longitude : orientation.longitude,//经度 | |||
| } | |||
| fn && fn(data) | |||
| }, | |||
| fail(err) { | |||
| console.log("获取定位失败",err); | |||
| uni.showToast({ | |||
| title: '获取地址失败,将导致部分功能不可用', | |||
| icon:'none' | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| export default { | |||
| toArray: toArray, | |||
| generateUUID: generateUUID, | |||
| verificationAll: verificationAll, | |||
| generateRandomColor: generateRandomColor, | |||
| generateLightRandomColor: generateLightRandomColor, | |||
| getLocation, | |||
| } | |||
| @ -1,316 +0,0 @@ | |||
| (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/index/index"],{ | |||
| /***/ 169: | |||
| /*!**************************************************************************************************!*\ | |||
| !*** E:/file/2024/newGitOrder/knowledge-payment-uniapp/main.js?{"page":"pages%2Findex%2Findex"} ***! | |||
| \**************************************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, exports, __webpack_require__) { | |||
| "use strict"; | |||
| /* WEBPACK VAR INJECTION */(function(wx, createPage) { | |||
| var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); | |||
| __webpack_require__(/*! uni-pages */ 26); | |||
| var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25)); | |||
| var _index = _interopRequireDefault(__webpack_require__(/*! ./pages/index/index.vue */ 170)); | |||
| // @ts-ignore | |||
| wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__; | |||
| createPage(_index.default); | |||
| /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["createPage"])) | |||
| /***/ }), | |||
| /***/ 170: | |||
| /*!*******************************************************************************!*\ | |||
| !*** E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue ***! | |||
| \*******************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| __webpack_require__.r(__webpack_exports__); | |||
| /* harmony import */ var _index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=57280228&scoped=true& */ 171); | |||
| /* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ 173); | |||
| /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); | |||
| /* harmony import */ var _index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&id=57280228&scoped=true&lang=scss& */ 175); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 32); | |||
| var renderjs | |||
| /* normalize component */ | |||
| var component = Object(_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( | |||
| _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], | |||
| _index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], | |||
| _index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], | |||
| false, | |||
| null, | |||
| "57280228", | |||
| null, | |||
| false, | |||
| _index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"], | |||
| renderjs | |||
| ) | |||
| component.options.__file = "pages/index/index.vue" | |||
| /* harmony default export */ __webpack_exports__["default"] = (component.exports); | |||
| /***/ }), | |||
| /***/ 171: | |||
| /*!**************************************************************************************************************************!*\ | |||
| !*** E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=template&id=57280228&scoped=true& ***! | |||
| \**************************************************************************************************************************/ | |||
| /*! exports provided: render, staticRenderFns, recyclableRender, components */ | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| __webpack_require__.r(__webpack_exports__); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=template&id=57280228&scoped=true& */ 172); | |||
| /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); | |||
| /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); | |||
| /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; }); | |||
| /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; }); | |||
| /***/ }), | |||
| /***/ 172: | |||
| /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ | |||
| !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=template&id=57280228&scoped=true& ***! | |||
| \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ | |||
| /*! exports provided: render, staticRenderFns, recyclableRender, components */ | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| __webpack_require__.r(__webpack_exports__); | |||
| /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); | |||
| /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); | |||
| /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; }); | |||
| /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; }); | |||
| var components | |||
| try { | |||
| components = { | |||
| uNumberBox: function () { | |||
| return Promise.all(/*! import() | uni_modules/uview-ui/components/u-number-box/u-number-box */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-number-box/u-number-box")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-number-box/u-number-box.vue */ 202)) | |||
| }, | |||
| uIcon: function () { | |||
| return Promise.all(/*! import() | uni_modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-icon/u-icon.vue */ 193)) | |||
| }, | |||
| } | |||
| } catch (e) { | |||
| if ( | |||
| e.message.indexOf("Cannot find module") !== -1 && | |||
| e.message.indexOf(".vue") !== -1 | |||
| ) { | |||
| console.error(e.message) | |||
| console.error("1. 排查组件名称拼写是否正确") | |||
| console.error( | |||
| "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom" | |||
| ) | |||
| console.error( | |||
| "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件" | |||
| ) | |||
| } else { | |||
| throw e | |||
| } | |||
| } | |||
| var render = function () { | |||
| var _vm = this | |||
| var _h = _vm.$createElement | |||
| var _c = _vm._self._c || _h | |||
| } | |||
| var recyclableRender = false | |||
| var staticRenderFns = [] | |||
| render._withStripped = true | |||
| /***/ }), | |||
| /***/ 173: | |||
| /*!********************************************************************************************************!*\ | |||
| !*** E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=script&lang=js& ***! | |||
| \********************************************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| __webpack_require__.r(__webpack_exports__); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js& */ 174); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__); | |||
| /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); | |||
| /* harmony default export */ __webpack_exports__["default"] = (_D_software_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); | |||
| /***/ }), | |||
| /***/ 174: | |||
| /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ | |||
| !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=script&lang=js& ***! | |||
| \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, exports, __webpack_require__) { | |||
| "use strict"; | |||
| var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); | |||
| Object.defineProperty(exports, "__esModule", { | |||
| value: true | |||
| }); | |||
| exports.default = void 0; | |||
| var _api = _interopRequireDefault(__webpack_require__(/*! @/plugins/api.js */ 165)); | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // | |||
| var _default = { | |||
| data: function data() { | |||
| return { | |||
| code: '', | |||
| price: 10, | |||
| registerForm: { | |||
| num: 1 | |||
| }, | |||
| type: 1, | |||
| //0是money,1是price | |||
| phone: '400-026-7262', | |||
| list: [ | |||
| // '/static/0240718173256.jpg', | |||
| // '/static/24.png', | |||
| // '/static/123.png', | |||
| "https://img.alicdn.com/imgextra/i2/2263306098/O1CN01bDUHBB1uuwAxlahWT_!!2263306098.jpg", "https://img.alicdn.com/imgextra/i3/2263306098/O1CN01SNLRO41uuwAuR6xLb_!!2263306098.jpg"] | |||
| }; | |||
| }, | |||
| onLoad: function onLoad() { | |||
| // if(this.GetQueryString('code')){ //路径上面有code说明微信已授权 | |||
| // this.code = this.GetQueryString('code'); | |||
| // //直接去登录发起请求 | |||
| // this.toWxLogin(this.code) | |||
| // }else{ | |||
| // this.getwx_authorize() | |||
| // } | |||
| }, | |||
| methods: {} | |||
| }; | |||
| exports.default = _default; | |||
| /***/ }), | |||
| /***/ 175: | |||
| /*!*****************************************************************************************************************************************!*\ | |||
| !*** E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=style&index=0&id=57280228&scoped=true&lang=scss& ***! | |||
| \*****************************************************************************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||
| "use strict"; | |||
| __webpack_require__.r(__webpack_exports__); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&id=57280228&scoped=true&lang=scss& */ 176); | |||
| /* harmony import */ var _D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__); | |||
| /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); | |||
| /* harmony default export */ __webpack_exports__["default"] = (_D_software_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_software_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_software_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_software_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a); | |||
| /***/ }), | |||
| /***/ 176: | |||
| /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ | |||
| !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/file/2024/newGitOrder/knowledge-payment-uniapp/pages/index/index.vue?vue&type=style&index=0&id=57280228&scoped=true&lang=scss& ***! | |||
| \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ | |||
| /*! no static exports found */ | |||
| /***/ (function(module, exports, __webpack_require__) { | |||
| // extracted by mini-css-extract-plugin | |||
| if(false) { var cssReload; } | |||
| /***/ }) | |||
| },[[169,"common/runtime","common/vendor"]]]); | |||
| //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map | |||
| @ -1,8 +0,0 @@ | |||
| { | |||
| "navigationBarTitleText": "", | |||
| "navigationStyle": "custom", | |||
| "usingComponents": { | |||
| "u-number-box": "/uni_modules/uview-ui/components/u-number-box/u-number-box", | |||
| "u-icon": "/uni_modules/uview-ui/components/u-icon/u-icon" | |||
| } | |||
| } | |||
| @ -1 +0,0 @@ | |||
| <view class="content data-v-57280228"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index"><image src="{{item}}" width="100%" class="_img data-v-57280228"></image></block><view class="bottom data-v-57280228"><view class="shang data-v-57280228" style="padding-bottom:200rpx;"><view style="color:#fff;margin-top:60rpx;border:1px solid #fff;padding:10rpx 20rpx;" class="data-v-57280228">联系客服</view></view></view><view class="abtn _div data-v-57280228"><view style="padding:10px;" class="data-v-57280228"><text style="color:#000;font-size:25rpx;" class="data-v-57280228">{{'单价'+price+"¥"}}</text></view><u-number-box bind:input="__e" style="margin:0 auto;" vue-id="8dd740cc-1" min="{{1}}" value="{{registerForm.num}}" data-event-opts="{{[['^input',[['__set_model',['$0','num','$event',[]],['registerForm']]]]]}}" class="data-v-57280228" bind:__l="__l" vue-slots="{{['minus','plus']}}"><view class="minus data-v-57280228" slot="minus"><u-icon vue-id="{{('8dd740cc-2')+','+('8dd740cc-1')}}" name="minus" size="12" class="data-v-57280228" bind:__l="__l"></u-icon></view><view class="plus data-v-57280228" slot="plus"><u-icon vue-id="{{('8dd740cc-3')+','+('8dd740cc-1')}}" name="plus" color="#FFFFFF" size="12" class="data-v-57280228" bind:__l="__l"></u-icon></view></u-number-box><view class="zhif data-v-57280228">立即支付<text style="padding-left:10rpx;" class="data-v-57280228">{{price*registerForm.num+"¥"}}</text></view></view></view> | |||
| @ -1,113 +0,0 @@ | |||
| @charset "UTF-8"; | |||
| /** | |||
| * 这里是uni-app内置的常用样式变量 | |||
| * | |||
| * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 | |||
| * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App | |||
| * | |||
| */ | |||
| /** | |||
| * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 | |||
| * | |||
| * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 | |||
| */ | |||
| /* 颜色变量 */ | |||
| /* 行为相关颜色 */ | |||
| /* 文字基本颜色 */ | |||
| /* 背景颜色 */ | |||
| /* 边框颜色 */ | |||
| /* 尺寸变量 */ | |||
| /* 文字尺寸 */ | |||
| /* 图片尺寸 */ | |||
| /* Border Radius */ | |||
| /* 水平间距 */ | |||
| /* 垂直间距 */ | |||
| /* 透明度 */ | |||
| /* 文章场景相关 */ | |||
| .content.data-v-57280228 { | |||
| display: flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| } | |||
| .bottom.data-v-57280228 { | |||
| display: flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| position: relative; | |||
| width: 100%; | |||
| --color: #dc2808; | |||
| } | |||
| .bottom .shang.data-v-57280228 { | |||
| width: 100%; | |||
| box-sizing: border-box; | |||
| background: #000; | |||
| overflow: hidden; | |||
| padding: 30rpx 0; | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| .register-username.data-v-57280228 { | |||
| display: flex; | |||
| border: 1px solid #ED762F; | |||
| height: 35px; | |||
| align-items: center; | |||
| margin-bottom: 20px; | |||
| padding: 0 10px; | |||
| border-radius: 5px; | |||
| box-sizing: border-box; | |||
| background-color: #fff; | |||
| color: #000; | |||
| } | |||
| .register-username image.data-v-57280228 { | |||
| width: 20px; | |||
| height: 20px; | |||
| } | |||
| .abtn.data-v-57280228 { | |||
| position: fixed; | |||
| bottom: 0; | |||
| left: 0; | |||
| width: 100%; | |||
| height: 60px; | |||
| background-color: #fff; | |||
| display: flex; | |||
| align-items: center; | |||
| } | |||
| .abtn .zhif.data-v-57280228 { | |||
| width: 45%; | |||
| height: 100%; | |||
| margin-left: auto; | |||
| background-color: #f60; | |||
| color: #fff; | |||
| text-align: center; | |||
| line-height: 60px; | |||
| } | |||
| .minus.data-v-57280228 { | |||
| width: 22px; | |||
| height: 22px; | |||
| border-width: 1px; | |||
| border-color: #E6E6E6; | |||
| border-style: solid; | |||
| border-top-left-radius: 100px; | |||
| border-top-right-radius: 100px; | |||
| border-bottom-left-radius: 100px; | |||
| border-bottom-right-radius: 100px; | |||
| display: flex; | |||
| flex-direction: row; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| .input.data-v-57280228 { | |||
| padding: 0 10px; | |||
| } | |||
| .plus.data-v-57280228 { | |||
| width: 22px; | |||
| height: 22px; | |||
| background-color: #FF0000; | |||
| border-radius: 50%; | |||
| display: flex; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| @ -0,0 +1,30 @@ | |||
| import Vue from 'vue' | |||
| import util from './utils.js' | |||
| import time from './timeUtils.js' | |||
| import 'dayjs/locale/zh-cn' | |||
| import dayjs from 'dayjs' | |||
| import md5 from './lib/md5.js' | |||
| // #ifdef H5 | |||
| import jWeixin from './lib/jweixin-module.js' | |||
| import { wxPay } from './pay.js' | |||
| Vue.prototype.$jWeixin = jWeixin | |||
| Vue.prototype.$wxPay = wxPay | |||
| // #endif | |||
| dayjs.locale('zh-cn') | |||
| import Oss from '@/utils/oss-upload/oss/index.js' | |||
| import { handleTree } from './tree.js' | |||
| Vue.prototype.$handleTree = handleTree | |||
| Vue.prototype.$Oss = Oss | |||
| Vue.prototype.$dayjs = dayjs | |||
| Vue.prototype.$timeUtils = time | |||
| Vue.prototype.$utils = util | |||
| Vue.prototype.$md5 = md5 | |||
| @ -0,0 +1,733 @@ | |||
| ! function(e, n) { | |||
| "function" == typeof define && (define.amd || define.cmd) ? define(function() { | |||
| return n(e) | |||
| }) : n(e, !0) | |||
| }(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 e = {}; | |||
| for (var n in c) e[c[n]] = n; | |||
| return e | |||
| }(), | |||
| 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 = !1, | |||
| _ = [], | |||
| w = { | |||
| config: function(e) { | |||
| B("config", v = e); | |||
| var t = !1 !== v.check; | |||
| O(function() { | |||
| if (t) M(c.config, { | |||
| verifyJsApiList: C(v.jsApiList), | |||
| verifyOpenTagList: C(v.openTagList) | |||
| }, function() { | |||
| S._complete = function(e) { | |||
| g.preVerifyEndTime = L(), y.state = 1, y.data = e | |||
| }, S.success = function(e) { | |||
| h.isPreVerifyOk = 0 | |||
| }, S.fail = function(e) { | |||
| S._fail ? S._fail(e) : y.state = -1 | |||
| }; | |||
| var t = S._completes; | |||
| return t.push(function() { | |||
| ! function() { | |||
| if (!(d || u || v.debug || m < "6.0.2" || h | |||
| .systemType < 0)) { | |||
| var i = new Image; | |||
| h.appId = v.appId, h.initTime = g.initEndTime - | |||
| g.initStartTime, h.preVerifyTime = g | |||
| .preVerifyEndTime - g.preVerifyStartTime, w | |||
| .getNetworkType({ | |||
| isInnerInvoke: !0, | |||
| success: function(e) { | |||
| h.networkType = e | |||
| .networkType; | |||
| var n = | |||
| "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; | |||
| i.src = n | |||
| } | |||
| }) | |||
| } | |||
| }() | |||
| }), S.complete = function(e) { | |||
| for (var n = 0, i = t.length; n < i; ++n) t[n](); | |||
| S._completes = [] | |||
| }, S | |||
| }()), g.preVerifyStartTime = L(); | |||
| else { | |||
| y.state = 1; | |||
| for (var e = S._completes, n = 0, i = e.length; n < i; ++n) e[n](); | |||
| S._completes = [] | |||
| } | |||
| }), w.invoke || (w.invoke = function(e, n, i) { | |||
| o.WeixinJSBridge && WeixinJSBridge.invoke(e, x(n), i) | |||
| }, w.on = function(e, n) { | |||
| o.WeixinJSBridge && WeixinJSBridge.on(e, n) | |||
| }) | |||
| }, | |||
| ready: function(e) { | |||
| 0 != y.state ? e() : (S._completes.push(e), !l && v.debug && e()) | |||
| }, | |||
| error: function(e) { | |||
| m < "6.0.2" || (-1 == y.state ? e(y.data) : S._fail = e) | |||
| }, | |||
| checkJsApi: function(e) { | |||
| M("checkJsApi", { | |||
| jsApiList: C(e.jsApiList) | |||
| }, (e._complete = function(e) { | |||
| if (p) { | |||
| var n = e.checkResult; | |||
| n && (e.checkResult = JSON.parse(n)) | |||
| } | |||
| e = function(e) { | |||
| var n = e.checkResult; | |||
| for (var i in n) { | |||
| var t = a[i]; | |||
| t && (n[t] = n[i], delete n[i]) | |||
| } | |||
| return e | |||
| }(e) | |||
| }, e)) | |||
| }, | |||
| onMenuShareTimeline: function(e) { | |||
| P(c.onMenuShareTimeline, { | |||
| complete: function() { | |||
| M("shareTimeline", { | |||
| title: e.title || t, | |||
| desc: e.title || t, | |||
| img_url: e.imgUrl || "", | |||
| link: e.link || location.href, | |||
| type: e.type || "link", | |||
| data_url: e.dataUrl || "" | |||
| }, e) | |||
| } | |||
| }, e) | |||
| }, | |||
| onMenuShareAppMessage: function(n) { | |||
| P(c.onMenuShareAppMessage, { | |||
| complete: function(e) { | |||
| "favorite" === e.scene ? M("sendAppMessage", { | |||
| title: n.title || t, | |||
| desc: n.desc || "", | |||
| link: n.link || location.href, | |||
| img_url: n.imgUrl || "", | |||
| type: n.type || "link", | |||
| data_url: n.dataUrl || "" | |||
| }) : M("sendAppMessage", { | |||
| title: n.title || t, | |||
| desc: n.desc || "", | |||
| link: n.link || location.href, | |||
| img_url: n.imgUrl || "", | |||
| type: n.type || "link", | |||
| data_url: n.dataUrl || "" | |||
| }, n) | |||
| } | |||
| }, n) | |||
| }, | |||
| onMenuShareQQ: function(e) { | |||
| P(c.onMenuShareQQ, { | |||
| complete: function() { | |||
| M("shareQQ", { | |||
| title: e.title || t, | |||
| desc: e.desc || "", | |||
| img_url: e.imgUrl || "", | |||
| link: e.link || location.href | |||
| }, e) | |||
| } | |||
| }, e) | |||
| }, | |||
| onMenuShareWeibo: function(e) { | |||
| P(c.onMenuShareWeibo, { | |||
| complete: function() { | |||
| M("shareWeiboApp", { | |||
| title: e.title || t, | |||
| desc: e.desc || "", | |||
| img_url: e.imgUrl || "", | |||
| link: e.link || location.href | |||
| }, e) | |||
| } | |||
| }, e) | |||
| }, | |||
| onMenuShareQZone: function(e) { | |||
| P(c.onMenuShareQZone, { | |||
| complete: function() { | |||
| M("shareQZone", { | |||
| title: e.title || t, | |||
| desc: e.desc || "", | |||
| img_url: e.imgUrl || "", | |||
| link: e.link || location.href | |||
| }, e) | |||
| } | |||
| }, e) | |||
| }, | |||
| updateTimelineShareData: function(e) { | |||
| M("updateTimelineShareData", { | |||
| title: e.title, | |||
| link: e.link, | |||
| imgUrl: e.imgUrl | |||
| }, e) | |||
| }, | |||
| updateAppMessageShareData: function(e) { | |||
| M("updateAppMessageShareData", { | |||
| title: e.title, | |||
| desc: e.desc, | |||
| link: e.link, | |||
| imgUrl: e.imgUrl | |||
| }, e) | |||
| }, | |||
| startRecord: function(e) { | |||
| M("startRecord", {}, e) | |||
| }, | |||
| stopRecord: function(e) { | |||
| M("stopRecord", {}, e) | |||
| }, | |||
| onVoiceRecordEnd: function(e) { | |||
| P("onVoiceRecordEnd", e) | |||
| }, | |||
| playVoice: function(e) { | |||
| M("playVoice", { | |||
| localId: e.localId | |||
| }, e) | |||
| }, | |||
| pauseVoice: function(e) { | |||
| M("pauseVoice", { | |||
| localId: e.localId | |||
| }, e) | |||
| }, | |||
| stopVoice: function(e) { | |||
| M("stopVoice", { | |||
| localId: e.localId | |||
| }, e) | |||
| }, | |||
| onVoicePlayEnd: function(e) { | |||
| P("onVoicePlayEnd", e) | |||
| }, | |||
| uploadVoice: function(e) { | |||
| M("uploadVoice", { | |||
| localId: e.localId, | |||
| isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 | |||
| }, e) | |||
| }, | |||
| downloadVoice: function(e) { | |||
| M("downloadVoice", { | |||
| serverId: e.serverId, | |||
| isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 | |||
| }, e) | |||
| }, | |||
| translateVoice: function(e) { | |||
| M("translateVoice", { | |||
| localId: e.localId, | |||
| isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 | |||
| }, e) | |||
| }, | |||
| chooseImage: function(e) { | |||
| M("chooseImage", { | |||
| scene: "1|2", | |||
| count: e.count || 9, | |||
| sizeType: e.sizeType || ["original", "compressed"], | |||
| sourceType: e.sourceType || ["album", "camera"] | |||
| }, (e._complete = function(e) { | |||
| if (p) { | |||
| var n = e.localIds; | |||
| try { | |||
| n && (e.localIds = JSON.parse(n)) | |||
| } catch (e) {} | |||
| } | |||
| }, e)) | |||
| }, | |||
| getLocation: function(e) {}, | |||
| previewImage: function(e) { | |||
| M(c.previewImage, { | |||
| current: e.current, | |||
| urls: e.urls | |||
| }, e) | |||
| }, | |||
| uploadImage: function(e) { | |||
| M("uploadImage", { | |||
| localId: e.localId, | |||
| isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 | |||
| }, e) | |||
| }, | |||
| downloadImage: function(e) { | |||
| M("downloadImage", { | |||
| serverId: e.serverId, | |||
| isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 | |||
| }, e) | |||
| }, | |||
| getLocalImgData: function(e) { | |||
| !1 === I ? (I = !0, M("getLocalImgData", { | |||
| localId: e.localId | |||
| }, (e._complete = function(e) { | |||
| if (I = !1, 0 < _.length) { | |||
| var n = _.shift(); | |||
| wx.getLocalImgData(n) | |||
| } | |||
| }, e))) : _.push(e) | |||
| }, | |||
| getNetworkType: function(e) { | |||
| M("getNetworkType", {}, (e._complete = function(e) { | |||
| e = function(e) { | |||
| var n = e.errMsg; | |||
| e.errMsg = "getNetworkType:ok"; | |||
| var i = e.subtype; | |||
| if (delete e.subtype, i) e.networkType = i; | |||
| else { | |||
| var t = n.indexOf(":"), | |||
| o = n.substring(t + 1); | |||
| switch (o) { | |||
| case "wifi": | |||
| case "edge": | |||
| case "wwan": | |||
| e.networkType = o; | |||
| break; | |||
| default: | |||
| e.errMsg = "getNetworkType:fail" | |||
| } | |||
| } | |||
| return e | |||
| }(e) | |||
| }, e)) | |||
| }, | |||
| openLocation: function(e) { | |||
| M("openLocation", { | |||
| latitude: e.latitude, | |||
| longitude: e.longitude, | |||
| name: e.name || "", | |||
| address: e.address || "", | |||
| scale: e.scale || 28, | |||
| infoUrl: e.infoUrl || "" | |||
| }, e) | |||
| }, | |||
| getLocation: function(e) { | |||
| M(c.getLocation, { | |||
| type: (e = e || {}).type || "wgs84" | |||
| }, (e._complete = function(e) { | |||
| delete e.type | |||
| }, e)) | |||
| }, | |||
| hideOptionMenu: function(e) { | |||
| M("hideOptionMenu", {}, e) | |||
| }, | |||
| showOptionMenu: function(e) { | |||
| M("showOptionMenu", {}, e) | |||
| }, | |||
| closeWindow: function(e) { | |||
| M("closeWindow", {}, e = e || {}) | |||
| }, | |||
| hideMenuItems: function(e) { | |||
| M("hideMenuItems", { | |||
| menuList: e.menuList | |||
| }, e) | |||
| }, | |||
| showMenuItems: function(e) { | |||
| M("showMenuItems", { | |||
| menuList: e.menuList | |||
| }, e) | |||
| }, | |||
| hideAllNonBaseMenuItem: function(e) { | |||
| M("hideAllNonBaseMenuItem", {}, e) | |||
| }, | |||
| showAllNonBaseMenuItem: function(e) { | |||
| M("showAllNonBaseMenuItem", {}, e) | |||
| }, | |||
| scanQRCode: function(e) { | |||
| M("scanQRCode", { | |||
| needResult: (e = e || {}).needResult || 0, | |||
| scanType: e.scanType || ["qrCode", "barCode"] | |||
| }, (e._complete = function(e) { | |||
| if (f) { | |||
| var n = e.resultStr; | |||
| if (n) { | |||
| var i = JSON.parse(n); | |||
| e.resultStr = i && i.scan_code && i.scan_code.scan_result | |||
| } | |||
| } | |||
| }, e)) | |||
| }, | |||
| openAddress: function(e) { | |||
| M(c.openAddress, {}, (e._complete = function(e) { | |||
| e = function(e) { | |||
| return e.postalCode = e.addressPostalCode, delete e | |||
| .addressPostalCode, e.provinceName = e.proviceFirstStageName, | |||
| delete e.proviceFirstStageName, e.cityName = e | |||
| .addressCitySecondStageName, delete e | |||
| .addressCitySecondStageName, e.countryName = e | |||
| .addressCountiesThirdStageName, delete e | |||
| .addressCountiesThirdStageName, e.detailInfo = e | |||
| .addressDetailInfo, delete e.addressDetailInfo, e | |||
| }(e) | |||
| }, e)) | |||
| }, | |||
| openProductSpecificView: function(e) { | |||
| M(c.openProductSpecificView, { | |||
| pid: e.productId, | |||
| view_type: e.viewType || 0, | |||
| ext_info: e.extInfo | |||
| }, e) | |||
| }, | |||
| addCard: function(e) { | |||
| for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) { | |||
| var r = n[t], | |||
| a = { | |||
| card_id: r.cardId, | |||
| card_ext: r.cardExt | |||
| }; | |||
| i.push(a) | |||
| } | |||
| M(c.addCard, { | |||
| card_list: i | |||
| }, (e._complete = function(e) { | |||
| var n = e.card_list; | |||
| if (n) { | |||
| for (var i = 0, t = (n = JSON.parse(n)).length; i < t; ++i) { | |||
| var o = n[i]; | |||
| o.cardId = o.card_id, o.cardExt = o.card_ext, o.isSuccess = !!o | |||
| .is_succ, delete o.card_id, delete o.card_ext, delete o.is_succ | |||
| } | |||
| e.cardList = n, delete e.card_list | |||
| } | |||
| }, e)) | |||
| }, | |||
| chooseCard: function(e) { | |||
| M("chooseCard", { | |||
| app_id: v.appId, | |||
| location_id: e.shopId || "", | |||
| sign_type: e.signType || "SHA1", | |||
| card_id: e.cardId || "", | |||
| card_type: e.cardType || "", | |||
| card_sign: e.cardSign, | |||
| time_stamp: e.timestamp + "", | |||
| nonce_str: e.nonceStr | |||
| }, (e._complete = function(e) { | |||
| e.cardList = e.choose_card_info, delete e.choose_card_info | |||
| }, e)) | |||
| }, | |||
| openCard: function(e) { | |||
| for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) { | |||
| var r = n[t], | |||
| a = { | |||
| card_id: r.cardId, | |||
| code: r.code | |||
| }; | |||
| i.push(a) | |||
| } | |||
| M(c.openCard, { | |||
| card_list: i | |||
| }, e) | |||
| }, | |||
| consumeAndShareCard: function(e) { | |||
| M(c.consumeAndShareCard, { | |||
| consumedCardId: e.cardId, | |||
| consumedCode: e.code | |||
| }, e) | |||
| }, | |||
| chooseWXPay: function(e) { | |||
| M(c.chooseWXPay, V(e), e) | |||
| }, | |||
| openEnterpriseRedPacket: function(e) { | |||
| M(c.openEnterpriseRedPacket, V(e), e) | |||
| }, | |||
| startSearchBeacons: function(e) { | |||
| M(c.startSearchBeacons, { | |||
| ticket: e.ticket | |||
| }, e) | |||
| }, | |||
| stopSearchBeacons: function(e) { | |||
| M(c.stopSearchBeacons, {}, e) | |||
| }, | |||
| onSearchBeacons: function(e) { | |||
| P(c.onSearchBeacons, e) | |||
| }, | |||
| openEnterpriseChat: function(e) { | |||
| M("openEnterpriseChat", { | |||
| useridlist: e.userIds, | |||
| chatname: e.groupName | |||
| }, e) | |||
| }, | |||
| launchMiniProgram: function(e) { | |||
| M("launchMiniProgram", { | |||
| targetAppId: e.targetAppId, | |||
| path: function(e) { | |||
| if ("string" == typeof e && 0 < e.length) { | |||
| var n = e.split("?")[0], | |||
| i = e.split("?")[1]; | |||
| return n += ".html", void 0 !== i ? n + "?" + i : n | |||
| } | |||
| }(e.path), | |||
| envVersion: e.envVersion | |||
| }, e) | |||
| }, | |||
| openBusinessView: function(e) { | |||
| M("openBusinessView", { | |||
| businessType: e.businessType, | |||
| queryString: e.queryString || "", | |||
| envVersion: e.envVersion | |||
| }, (e._complete = function(n) { | |||
| if (p) { | |||
| var e = n.extraData; | |||
| if (e) try { | |||
| n.extraData = JSON.parse(e) | |||
| } catch (e) { | |||
| n.extraData = {} | |||
| } | |||
| } | |||
| }, e)) | |||
| }, | |||
| miniProgram: { | |||
| navigateBack: function(e) { | |||
| e = e || {}, O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "navigateBack", | |||
| arg: { | |||
| delta: e.delta || 1 | |||
| } | |||
| }, e) | |||
| }) | |||
| }, | |||
| navigateTo: function(e) { | |||
| O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "navigateTo", | |||
| arg: { | |||
| url: e.url | |||
| } | |||
| }, e) | |||
| }) | |||
| }, | |||
| redirectTo: function(e) { | |||
| O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "redirectTo", | |||
| arg: { | |||
| url: e.url | |||
| } | |||
| }, e) | |||
| }) | |||
| }, | |||
| switchTab: function(e) { | |||
| O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "switchTab", | |||
| arg: { | |||
| url: e.url | |||
| } | |||
| }, e) | |||
| }) | |||
| }, | |||
| reLaunch: function(e) { | |||
| O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "reLaunch", | |||
| arg: { | |||
| url: e.url | |||
| } | |||
| }, e) | |||
| }) | |||
| }, | |||
| postMessage: function(e) { | |||
| O(function() { | |||
| M("invokeMiniProgramAPI", { | |||
| name: "postMessage", | |||
| arg: e.data || {} | |||
| }, e) | |||
| }) | |||
| }, | |||
| getEnv: function(e) { | |||
| O(function() { | |||
| e({ | |||
| miniprogram: "miniprogram" === o.__wxjs_environment | |||
| }) | |||
| }) | |||
| } | |||
| } | |||
| }, | |||
| T = 1, | |||
| k = {}; | |||
| return i.addEventListener("error", function(e) { | |||
| if (!p) { | |||
| var n = e.target, | |||
| i = n.tagName, | |||
| t = n.src; | |||
| if ("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) | |||
| if (-1 != t.indexOf("wxlocalresource://")) { | |||
| e.preventDefault(), e.stopPropagation(); | |||
| var o = n["wx-id"]; | |||
| if (o || (o = T++, n["wx-id"] = o), k[o]) return; | |||
| k[o] = !0, wx.ready(function() { | |||
| wx.getLocalImgData({ | |||
| localId: t, | |||
| success: function(e) { | |||
| n.src = e.localData | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| } | |||
| }, !0), i.addEventListener("load", function(e) { | |||
| if (!p) { | |||
| var n = e.target, | |||
| i = n.tagName; | |||
| n.src; | |||
| if ("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) { | |||
| var t = n["wx-id"]; | |||
| t && (k[t] = !1) | |||
| } | |||
| } | |||
| }, !0), e && (o.wx = o.jWeixin = w), w | |||
| } | |||
| function M(n, e, i) { | |||
| o.WeixinJSBridge ? WeixinJSBridge.invoke(n, x(e), function(e) { | |||
| A(n, e, i) | |||
| }) : B(n, i) | |||
| } | |||
| function P(n, i, t) { | |||
| o.WeixinJSBridge ? WeixinJSBridge.on(n, function(e) { | |||
| t && t.trigger && t.trigger(e), A(n, e, i) | |||
| }) : B(n, t || i) | |||
| } | |||
| function x(e) { | |||
| return (e = e || {}).appId = v.appId, e.verifyAppId = v.appId, e.verifySignType = "sha1", e | |||
| .verifyTimestamp = v.timestamp + "", e.verifyNonceStr = v.nonceStr, e.verifySignature = v.signature, e | |||
| } | |||
| function V(e) { | |||
| return { | |||
| timeStamp: e.timestamp + "", | |||
| nonceStr: e.nonceStr, | |||
| package: e.package, | |||
| paySign: e.paySign, | |||
| signType: e.signType || "SHA1" | |||
| } | |||
| } | |||
| function A(e, n, i) { | |||
| "openEnterpriseChat" != e && "openBusinessView" !== e || (n.errCode = n.err_code), delete n.err_code, | |||
| delete n.err_desc, delete n.err_detail; | |||
| var t = n.errMsg; | |||
| t || (t = n.err_msg, delete n.err_msg, t = function(e, n) { | |||
| var i = e, | |||
| t = a[i]; | |||
| t && (i = t); | |||
| var o = "ok"; | |||
| if (n) { | |||
| var r = n.indexOf(":"); | |||
| "confirm" == (o = n.substring(r + 1)) && (o = "ok"), "failed" == o && (o = "fail"), -1 != o | |||
| .indexOf("failed_") && (o = o.substring(7)), -1 != o.indexOf("fail_") && (o = o | |||
| .substring(5)), "access denied" != (o = (o = o.replace(/_/g, " ")).toLowerCase()) && | |||
| "no permission to execute" != o || (o = "permission denied"), "config" == i && | |||
| "function not exist" == o && (o = "ok"), "" == o && (o = "fail") | |||
| } | |||
| return n = i + ":" + o | |||
| }(e, t), n.errMsg = t), (i = i || {})._complete && (i._complete(n), delete i._complete), t = n.errMsg || | |||
| "", v.debug && !i.isInnerInvoke && alert(JSON.stringify(n)); | |||
| var o = t.indexOf(":"); | |||
| switch (t.substring(o + 1)) { | |||
| case "ok": | |||
| i.success && i.success(n); | |||
| break; | |||
| case "cancel": | |||
| i.cancel && i.cancel(n); | |||
| break; | |||
| default: | |||
| i.fail && i.fail(n) | |||
| } | |||
| i.complete && i.complete(n) | |||
| } | |||
| function C(e) { | |||
| if (e) { | |||
| for (var n = 0, i = e.length; n < i; ++n) { | |||
| var t = e[n], | |||
| o = c[t]; | |||
| o && (e[n] = o) | |||
| } | |||
| return e | |||
| } | |||
| } | |||
| function B(e, n) { | |||
| if (!(!v.debug || n && n.isInnerInvoke)) { | |||
| var i = a[e]; | |||
| i && (e = i), n && n._complete && delete n._complete, console.log('"' + e + '",', n || "") | |||
| } | |||
| } | |||
| function L() { | |||
| return (new Date).getTime() | |||
| } | |||
| function O(e) { | |||
| l && (o.WeixinJSBridge ? e() : i.addEventListener && i.addEventListener("WeixinJSBridgeReady", e, !1)) | |||
| } | |||
| }); | |||
| @ -0,0 +1,876 @@ | |||
| /** | |||
| * [js-md5]{@link https://github.com/emn178/js-md5} | |||
| * | |||
| * @namespace md5 | |||
| * @version 0.8.3 | |||
| * @author Chen, Yi-Cyuan [emn178@gmail.com] | |||
| * @copyright Chen, Yi-Cyuan 2014-2023 | |||
| * @license MIT | |||
| */ | |||
| (function () { | |||
| 'use strict'; | |||
| var INPUT_ERROR = 'input is invalid type'; | |||
| var FINALIZE_ERROR = 'finalize already called'; | |||
| var WINDOW = typeof window === 'object'; | |||
| var root = WINDOW ? window : {}; | |||
| if (root.JS_MD5_NO_WINDOW) { | |||
| WINDOW = false; | |||
| } | |||
| var WEB_WORKER = !WINDOW && typeof self === 'object'; | |||
| var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; | |||
| if (NODE_JS) { | |||
| root = global; | |||
| } else if (WEB_WORKER) { | |||
| root = self; | |||
| } | |||
| var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports; | |||
| var AMD = typeof define === 'function' && define.amd; | |||
| var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; | |||
| var HEX_CHARS = '0123456789abcdef'.split(''); | |||
| var EXTRA = [128, 32768, 8388608, -2147483648]; | |||
| var SHIFT = [0, 8, 16, 24]; | |||
| var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64']; | |||
| var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); | |||
| var blocks = [], buffer8; | |||
| if (ARRAY_BUFFER) { | |||
| var buffer = new ArrayBuffer(68); | |||
| buffer8 = new Uint8Array(buffer); | |||
| blocks = new Uint32Array(buffer); | |||
| } | |||
| var isArray = Array.isArray; | |||
| if (root.JS_MD5_NO_NODE_JS || !isArray) { | |||
| isArray = function (obj) { | |||
| return Object.prototype.toString.call(obj) === '[object Array]'; | |||
| }; | |||
| } | |||
| var isView = ArrayBuffer.isView; | |||
| if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !isView)) { | |||
| isView = function (obj) { | |||
| return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; | |||
| }; | |||
| } | |||
| // [message: string, isString: bool] | |||
| var formatMessage = function (message) { | |||
| var type = typeof message; | |||
| if (type === 'string') { | |||
| return [message, true]; | |||
| } | |||
| if (type !== 'object' || message === null) { | |||
| throw new Error(INPUT_ERROR); | |||
| } | |||
| if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { | |||
| return [new Uint8Array(message), false]; | |||
| } | |||
| if (!isArray(message) && !isView(message)) { | |||
| throw new Error(INPUT_ERROR); | |||
| } | |||
| return [message, false]; | |||
| } | |||
| /** | |||
| * @method hex | |||
| * @memberof md5 | |||
| * @description Output hash as hex string | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {String} Hex string | |||
| * @example | |||
| * md5.hex('The quick brown fox jumps over the lazy dog'); | |||
| * // equal to | |||
| * md5('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method digest | |||
| * @memberof md5 | |||
| * @description Output hash as bytes array | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Array} Bytes array | |||
| * @example | |||
| * md5.digest('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method array | |||
| * @memberof md5 | |||
| * @description Output hash as bytes array | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Array} Bytes array | |||
| * @example | |||
| * md5.array('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method arrayBuffer | |||
| * @memberof md5 | |||
| * @description Output hash as ArrayBuffer | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @example | |||
| * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method buffer | |||
| * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. | |||
| * @memberof md5 | |||
| * @description Output hash as ArrayBuffer | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @example | |||
| * md5.buffer('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method base64 | |||
| * @memberof md5 | |||
| * @description Output hash as base64 string | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {String} base64 string | |||
| * @example | |||
| * md5.base64('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| var createOutputMethod = function (outputType) { | |||
| return function (message) { | |||
| return new Md5(true).update(message)[outputType](); | |||
| }; | |||
| }; | |||
| /** | |||
| * @method create | |||
| * @memberof md5 | |||
| * @description Create Md5 object | |||
| * @returns {Md5} Md5 object. | |||
| * @example | |||
| * var hash = md5.create(); | |||
| */ | |||
| /** | |||
| * @method update | |||
| * @memberof md5 | |||
| * @description Create and update Md5 object | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Md5} Md5 object. | |||
| * @example | |||
| * var hash = md5.update('The quick brown fox jumps over the lazy dog'); | |||
| * // equal to | |||
| * var hash = md5.create(); | |||
| * hash.update('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| var createMethod = function () { | |||
| var method = createOutputMethod('hex'); | |||
| if (NODE_JS) { | |||
| method = nodeWrap(method); | |||
| } | |||
| method.create = function () { | |||
| return new Md5(); | |||
| }; | |||
| method.update = function (message) { | |||
| return method.create().update(message); | |||
| }; | |||
| for (var i = 0; i < OUTPUT_TYPES.length; ++i) { | |||
| var type = OUTPUT_TYPES[i]; | |||
| method[type] = createOutputMethod(type); | |||
| } | |||
| return method; | |||
| }; | |||
| var nodeWrap = function (method) { | |||
| var crypto = require('crypto') | |||
| var Buffer = require('buffer').Buffer; | |||
| var bufferFrom; | |||
| if (Buffer.from && !root.JS_MD5_NO_BUFFER_FROM) { | |||
| bufferFrom = Buffer.from; | |||
| } else { | |||
| bufferFrom = function (message) { | |||
| return new Buffer(message); | |||
| }; | |||
| } | |||
| var nodeMethod = function (message) { | |||
| if (typeof message === 'string') { | |||
| return crypto.createHash('md5').update(message, 'utf8').digest('hex'); | |||
| } else { | |||
| if (message === null || message === undefined) { | |||
| throw new Error(INPUT_ERROR); | |||
| } else if (message.constructor === ArrayBuffer) { | |||
| message = new Uint8Array(message); | |||
| } | |||
| } | |||
| if (isArray(message) || isView(message) || | |||
| message.constructor === Buffer) { | |||
| return crypto.createHash('md5').update(bufferFrom(message)).digest('hex'); | |||
| } else { | |||
| return method(message); | |||
| } | |||
| }; | |||
| return nodeMethod; | |||
| }; | |||
| /** | |||
| * @namespace md5.hmac | |||
| */ | |||
| /** | |||
| * @method hex | |||
| * @memberof md5.hmac | |||
| * @description Output hash as hex string | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {String} Hex string | |||
| * @example | |||
| * md5.hmac.hex('key', 'The quick brown fox jumps over the lazy dog'); | |||
| * // equal to | |||
| * md5.hmac('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method digest | |||
| * @memberof md5.hmac | |||
| * @description Output hash as bytes array | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Array} Bytes array | |||
| * @example | |||
| * md5.hmac.digest('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method array | |||
| * @memberof md5.hmac | |||
| * @description Output hash as bytes array | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Array} Bytes array | |||
| * @example | |||
| * md5.hmac.array('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method arrayBuffer | |||
| * @memberof md5.hmac | |||
| * @description Output hash as ArrayBuffer | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @example | |||
| * md5.hmac.arrayBuffer('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method buffer | |||
| * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. | |||
| * @memberof md5.hmac | |||
| * @description Output hash as ArrayBuffer | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @example | |||
| * md5.hmac.buffer('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| /** | |||
| * @method base64 | |||
| * @memberof md5.hmac | |||
| * @description Output hash as base64 string | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {String} base64 string | |||
| * @example | |||
| * md5.hmac.base64('key', 'The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| var createHmacOutputMethod = function (outputType) { | |||
| return function (key, message) { | |||
| return new HmacMd5(key, true).update(message)[outputType](); | |||
| }; | |||
| }; | |||
| /** | |||
| * @method create | |||
| * @memberof md5.hmac | |||
| * @description Create HmacMd5 object | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @returns {HmacMd5} HmacMd5 object. | |||
| * @example | |||
| * var hash = md5.hmac.create('key'); | |||
| */ | |||
| /** | |||
| * @method update | |||
| * @memberof md5.hmac | |||
| * @description Create and update HmacMd5 object | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} key key | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {HmacMd5} HmacMd5 object. | |||
| * @example | |||
| * var hash = md5.hmac.update('key', 'The quick brown fox jumps over the lazy dog'); | |||
| * // equal to | |||
| * var hash = md5.hmac.create('key'); | |||
| * hash.update('The quick brown fox jumps over the lazy dog'); | |||
| */ | |||
| var createHmacMethod = function () { | |||
| var method = createHmacOutputMethod('hex'); | |||
| method.create = function (key) { | |||
| return new HmacMd5(key); | |||
| }; | |||
| method.update = function (key, message) { | |||
| return method.create(key).update(message); | |||
| }; | |||
| for (var i = 0; i < OUTPUT_TYPES.length; ++i) { | |||
| var type = OUTPUT_TYPES[i]; | |||
| method[type] = createHmacOutputMethod(type); | |||
| } | |||
| return method; | |||
| }; | |||
| /** | |||
| * Md5 class | |||
| * @class Md5 | |||
| * @description This is internal class. | |||
| * @see {@link md5.create} | |||
| */ | |||
| function Md5(sharedMemory) { | |||
| if (sharedMemory) { | |||
| blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = | |||
| blocks[4] = blocks[5] = blocks[6] = blocks[7] = | |||
| blocks[8] = blocks[9] = blocks[10] = blocks[11] = | |||
| blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; | |||
| this.blocks = blocks; | |||
| this.buffer8 = buffer8; | |||
| } else { | |||
| if (ARRAY_BUFFER) { | |||
| var buffer = new ArrayBuffer(68); | |||
| this.buffer8 = new Uint8Array(buffer); | |||
| this.blocks = new Uint32Array(buffer); | |||
| } else { | |||
| this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; | |||
| } | |||
| } | |||
| this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0; | |||
| this.finalized = this.hashed = false; | |||
| this.first = true; | |||
| } | |||
| /** | |||
| * @method update | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Update hash | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {Md5} Md5 object. | |||
| * @see {@link md5.update} | |||
| */ | |||
| Md5.prototype.update = function (message) { | |||
| if (this.finalized) { | |||
| throw new Error(FINALIZE_ERROR); | |||
| } | |||
| var result = formatMessage(message); | |||
| message = result[0]; | |||
| var isString = result[1]; | |||
| var code, index = 0, i, length = message.length, blocks = this.blocks; | |||
| var buffer8 = this.buffer8; | |||
| while (index < length) { | |||
| if (this.hashed) { | |||
| this.hashed = false; | |||
| blocks[0] = blocks[16]; | |||
| blocks[16] = blocks[1] = blocks[2] = blocks[3] = | |||
| blocks[4] = blocks[5] = blocks[6] = blocks[7] = | |||
| blocks[8] = blocks[9] = blocks[10] = blocks[11] = | |||
| blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; | |||
| } | |||
| if (isString) { | |||
| if (ARRAY_BUFFER) { | |||
| for (i = this.start; index < length && i < 64; ++index) { | |||
| code = message.charCodeAt(index); | |||
| if (code < 0x80) { | |||
| buffer8[i++] = code; | |||
| } else if (code < 0x800) { | |||
| buffer8[i++] = 0xc0 | (code >>> 6); | |||
| buffer8[i++] = 0x80 | (code & 0x3f); | |||
| } else if (code < 0xd800 || code >= 0xe000) { | |||
| buffer8[i++] = 0xe0 | (code >>> 12); | |||
| buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f); | |||
| buffer8[i++] = 0x80 | (code & 0x3f); | |||
| } else { | |||
| code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); | |||
| buffer8[i++] = 0xf0 | (code >>> 18); | |||
| buffer8[i++] = 0x80 | ((code >>> 12) & 0x3f); | |||
| buffer8[i++] = 0x80 | ((code >>> 6) & 0x3f); | |||
| buffer8[i++] = 0x80 | (code & 0x3f); | |||
| } | |||
| } | |||
| } else { | |||
| for (i = this.start; index < length && i < 64; ++index) { | |||
| code = message.charCodeAt(index); | |||
| if (code < 0x80) { | |||
| blocks[i >>> 2] |= code << SHIFT[i++ & 3]; | |||
| } else if (code < 0x800) { | |||
| blocks[i >>> 2] |= (0xc0 | (code >>> 6)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; | |||
| } else if (code < 0xd800 || code >= 0xe000) { | |||
| blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; | |||
| } else { | |||
| code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); | |||
| blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3]; | |||
| blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; | |||
| } | |||
| } | |||
| } | |||
| } else { | |||
| if (ARRAY_BUFFER) { | |||
| for (i = this.start; index < length && i < 64; ++index) { | |||
| buffer8[i++] = message[index]; | |||
| } | |||
| } else { | |||
| for (i = this.start; index < length && i < 64; ++index) { | |||
| blocks[i >>> 2] |= message[index] << SHIFT[i++ & 3]; | |||
| } | |||
| } | |||
| } | |||
| this.lastByteIndex = i; | |||
| this.bytes += i - this.start; | |||
| if (i >= 64) { | |||
| this.start = i - 64; | |||
| this.hash(); | |||
| this.hashed = true; | |||
| } else { | |||
| this.start = i; | |||
| } | |||
| } | |||
| if (this.bytes > 4294967295) { | |||
| this.hBytes += this.bytes / 4294967296 << 0; | |||
| this.bytes = this.bytes % 4294967296; | |||
| } | |||
| return this; | |||
| }; | |||
| Md5.prototype.finalize = function () { | |||
| if (this.finalized) { | |||
| return; | |||
| } | |||
| this.finalized = true; | |||
| var blocks = this.blocks, i = this.lastByteIndex; | |||
| blocks[i >>> 2] |= EXTRA[i & 3]; | |||
| if (i >= 56) { | |||
| if (!this.hashed) { | |||
| this.hash(); | |||
| } | |||
| blocks[0] = blocks[16]; | |||
| blocks[16] = blocks[1] = blocks[2] = blocks[3] = | |||
| blocks[4] = blocks[5] = blocks[6] = blocks[7] = | |||
| blocks[8] = blocks[9] = blocks[10] = blocks[11] = | |||
| blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; | |||
| } | |||
| blocks[14] = this.bytes << 3; | |||
| blocks[15] = this.hBytes << 3 | this.bytes >>> 29; | |||
| this.hash(); | |||
| }; | |||
| Md5.prototype.hash = function () { | |||
| var a, b, c, d, bc, da, blocks = this.blocks; | |||
| if (this.first) { | |||
| a = blocks[0] - 680876937; | |||
| a = (a << 7 | a >>> 25) - 271733879 << 0; | |||
| d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708; | |||
| d = (d << 12 | d >>> 20) + a << 0; | |||
| c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375; | |||
| c = (c << 17 | c >>> 15) + d << 0; | |||
| b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209; | |||
| b = (b << 22 | b >>> 10) + c << 0; | |||
| } else { | |||
| a = this.h0; | |||
| b = this.h1; | |||
| c = this.h2; | |||
| d = this.h3; | |||
| a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936; | |||
| a = (a << 7 | a >>> 25) + b << 0; | |||
| d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586; | |||
| d = (d << 12 | d >>> 20) + a << 0; | |||
| c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819; | |||
| c = (c << 17 | c >>> 15) + d << 0; | |||
| b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330; | |||
| b = (b << 22 | b >>> 10) + c << 0; | |||
| } | |||
| a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897; | |||
| a = (a << 7 | a >>> 25) + b << 0; | |||
| d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426; | |||
| d = (d << 12 | d >>> 20) + a << 0; | |||
| c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341; | |||
| c = (c << 17 | c >>> 15) + d << 0; | |||
| b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983; | |||
| b = (b << 22 | b >>> 10) + c << 0; | |||
| a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416; | |||
| a = (a << 7 | a >>> 25) + b << 0; | |||
| d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417; | |||
| d = (d << 12 | d >>> 20) + a << 0; | |||
| c += (b ^ (d & (a ^ b))) + blocks[10] - 42063; | |||
| c = (c << 17 | c >>> 15) + d << 0; | |||
| b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162; | |||
| b = (b << 22 | b >>> 10) + c << 0; | |||
| a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682; | |||
| a = (a << 7 | a >>> 25) + b << 0; | |||
| d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101; | |||
| d = (d << 12 | d >>> 20) + a << 0; | |||
| c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290; | |||
| c = (c << 17 | c >>> 15) + d << 0; | |||
| b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329; | |||
| b = (b << 22 | b >>> 10) + c << 0; | |||
| a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510; | |||
| a = (a << 5 | a >>> 27) + b << 0; | |||
| d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632; | |||
| d = (d << 9 | d >>> 23) + a << 0; | |||
| c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713; | |||
| c = (c << 14 | c >>> 18) + d << 0; | |||
| b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302; | |||
| b = (b << 20 | b >>> 12) + c << 0; | |||
| a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691; | |||
| a = (a << 5 | a >>> 27) + b << 0; | |||
| d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083; | |||
| d = (d << 9 | d >>> 23) + a << 0; | |||
| c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335; | |||
| c = (c << 14 | c >>> 18) + d << 0; | |||
| b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848; | |||
| b = (b << 20 | b >>> 12) + c << 0; | |||
| a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438; | |||
| a = (a << 5 | a >>> 27) + b << 0; | |||
| d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690; | |||
| d = (d << 9 | d >>> 23) + a << 0; | |||
| c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961; | |||
| c = (c << 14 | c >>> 18) + d << 0; | |||
| b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501; | |||
| b = (b << 20 | b >>> 12) + c << 0; | |||
| a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467; | |||
| a = (a << 5 | a >>> 27) + b << 0; | |||
| d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784; | |||
| d = (d << 9 | d >>> 23) + a << 0; | |||
| c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473; | |||
| c = (c << 14 | c >>> 18) + d << 0; | |||
| b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734; | |||
| b = (b << 20 | b >>> 12) + c << 0; | |||
| bc = b ^ c; | |||
| a += (bc ^ d) + blocks[5] - 378558; | |||
| a = (a << 4 | a >>> 28) + b << 0; | |||
| d += (bc ^ a) + blocks[8] - 2022574463; | |||
| d = (d << 11 | d >>> 21) + a << 0; | |||
| da = d ^ a; | |||
| c += (da ^ b) + blocks[11] + 1839030562; | |||
| c = (c << 16 | c >>> 16) + d << 0; | |||
| b += (da ^ c) + blocks[14] - 35309556; | |||
| b = (b << 23 | b >>> 9) + c << 0; | |||
| bc = b ^ c; | |||
| a += (bc ^ d) + blocks[1] - 1530992060; | |||
| a = (a << 4 | a >>> 28) + b << 0; | |||
| d += (bc ^ a) + blocks[4] + 1272893353; | |||
| d = (d << 11 | d >>> 21) + a << 0; | |||
| da = d ^ a; | |||
| c += (da ^ b) + blocks[7] - 155497632; | |||
| c = (c << 16 | c >>> 16) + d << 0; | |||
| b += (da ^ c) + blocks[10] - 1094730640; | |||
| b = (b << 23 | b >>> 9) + c << 0; | |||
| bc = b ^ c; | |||
| a += (bc ^ d) + blocks[13] + 681279174; | |||
| a = (a << 4 | a >>> 28) + b << 0; | |||
| d += (bc ^ a) + blocks[0] - 358537222; | |||
| d = (d << 11 | d >>> 21) + a << 0; | |||
| da = d ^ a; | |||
| c += (da ^ b) + blocks[3] - 722521979; | |||
| c = (c << 16 | c >>> 16) + d << 0; | |||
| b += (da ^ c) + blocks[6] + 76029189; | |||
| b = (b << 23 | b >>> 9) + c << 0; | |||
| bc = b ^ c; | |||
| a += (bc ^ d) + blocks[9] - 640364487; | |||
| a = (a << 4 | a >>> 28) + b << 0; | |||
| d += (bc ^ a) + blocks[12] - 421815835; | |||
| d = (d << 11 | d >>> 21) + a << 0; | |||
| da = d ^ a; | |||
| c += (da ^ b) + blocks[15] + 530742520; | |||
| c = (c << 16 | c >>> 16) + d << 0; | |||
| b += (da ^ c) + blocks[2] - 995338651; | |||
| b = (b << 23 | b >>> 9) + c << 0; | |||
| a += (c ^ (b | ~d)) + blocks[0] - 198630844; | |||
| a = (a << 6 | a >>> 26) + b << 0; | |||
| d += (b ^ (a | ~c)) + blocks[7] + 1126891415; | |||
| d = (d << 10 | d >>> 22) + a << 0; | |||
| c += (a ^ (d | ~b)) + blocks[14] - 1416354905; | |||
| c = (c << 15 | c >>> 17) + d << 0; | |||
| b += (d ^ (c | ~a)) + blocks[5] - 57434055; | |||
| b = (b << 21 | b >>> 11) + c << 0; | |||
| a += (c ^ (b | ~d)) + blocks[12] + 1700485571; | |||
| a = (a << 6 | a >>> 26) + b << 0; | |||
| d += (b ^ (a | ~c)) + blocks[3] - 1894986606; | |||
| d = (d << 10 | d >>> 22) + a << 0; | |||
| c += (a ^ (d | ~b)) + blocks[10] - 1051523; | |||
| c = (c << 15 | c >>> 17) + d << 0; | |||
| b += (d ^ (c | ~a)) + blocks[1] - 2054922799; | |||
| b = (b << 21 | b >>> 11) + c << 0; | |||
| a += (c ^ (b | ~d)) + blocks[8] + 1873313359; | |||
| a = (a << 6 | a >>> 26) + b << 0; | |||
| d += (b ^ (a | ~c)) + blocks[15] - 30611744; | |||
| d = (d << 10 | d >>> 22) + a << 0; | |||
| c += (a ^ (d | ~b)) + blocks[6] - 1560198380; | |||
| c = (c << 15 | c >>> 17) + d << 0; | |||
| b += (d ^ (c | ~a)) + blocks[13] + 1309151649; | |||
| b = (b << 21 | b >>> 11) + c << 0; | |||
| a += (c ^ (b | ~d)) + blocks[4] - 145523070; | |||
| a = (a << 6 | a >>> 26) + b << 0; | |||
| d += (b ^ (a | ~c)) + blocks[11] - 1120210379; | |||
| d = (d << 10 | d >>> 22) + a << 0; | |||
| c += (a ^ (d | ~b)) + blocks[2] + 718787259; | |||
| c = (c << 15 | c >>> 17) + d << 0; | |||
| b += (d ^ (c | ~a)) + blocks[9] - 343485551; | |||
| b = (b << 21 | b >>> 11) + c << 0; | |||
| if (this.first) { | |||
| this.h0 = a + 1732584193 << 0; | |||
| this.h1 = b - 271733879 << 0; | |||
| this.h2 = c - 1732584194 << 0; | |||
| this.h3 = d + 271733878 << 0; | |||
| this.first = false; | |||
| } else { | |||
| this.h0 = this.h0 + a << 0; | |||
| this.h1 = this.h1 + b << 0; | |||
| this.h2 = this.h2 + c << 0; | |||
| this.h3 = this.h3 + d << 0; | |||
| } | |||
| }; | |||
| /** | |||
| * @method hex | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as hex string | |||
| * @returns {String} Hex string | |||
| * @see {@link md5.hex} | |||
| * @example | |||
| * hash.hex(); | |||
| */ | |||
| Md5.prototype.hex = function () { | |||
| this.finalize(); | |||
| var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; | |||
| return HEX_CHARS[(h0 >>> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + | |||
| HEX_CHARS[(h0 >>> 12) & 0x0F] + HEX_CHARS[(h0 >>> 8) & 0x0F] + | |||
| HEX_CHARS[(h0 >>> 20) & 0x0F] + HEX_CHARS[(h0 >>> 16) & 0x0F] + | |||
| HEX_CHARS[(h0 >>> 28) & 0x0F] + HEX_CHARS[(h0 >>> 24) & 0x0F] + | |||
| HEX_CHARS[(h1 >>> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + | |||
| HEX_CHARS[(h1 >>> 12) & 0x0F] + HEX_CHARS[(h1 >>> 8) & 0x0F] + | |||
| HEX_CHARS[(h1 >>> 20) & 0x0F] + HEX_CHARS[(h1 >>> 16) & 0x0F] + | |||
| HEX_CHARS[(h1 >>> 28) & 0x0F] + HEX_CHARS[(h1 >>> 24) & 0x0F] + | |||
| HEX_CHARS[(h2 >>> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + | |||
| HEX_CHARS[(h2 >>> 12) & 0x0F] + HEX_CHARS[(h2 >>> 8) & 0x0F] + | |||
| HEX_CHARS[(h2 >>> 20) & 0x0F] + HEX_CHARS[(h2 >>> 16) & 0x0F] + | |||
| HEX_CHARS[(h2 >>> 28) & 0x0F] + HEX_CHARS[(h2 >>> 24) & 0x0F] + | |||
| HEX_CHARS[(h3 >>> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + | |||
| HEX_CHARS[(h3 >>> 12) & 0x0F] + HEX_CHARS[(h3 >>> 8) & 0x0F] + | |||
| HEX_CHARS[(h3 >>> 20) & 0x0F] + HEX_CHARS[(h3 >>> 16) & 0x0F] + | |||
| HEX_CHARS[(h3 >>> 28) & 0x0F] + HEX_CHARS[(h3 >>> 24) & 0x0F]; | |||
| }; | |||
| /** | |||
| * @method toString | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as hex string | |||
| * @returns {String} Hex string | |||
| * @see {@link md5.hex} | |||
| * @example | |||
| * hash.toString(); | |||
| */ | |||
| Md5.prototype.toString = Md5.prototype.hex; | |||
| /** | |||
| * @method digest | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as bytes array | |||
| * @returns {Array} Bytes array | |||
| * @see {@link md5.digest} | |||
| * @example | |||
| * hash.digest(); | |||
| */ | |||
| Md5.prototype.digest = function () { | |||
| this.finalize(); | |||
| var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; | |||
| return [ | |||
| h0 & 0xFF, (h0 >>> 8) & 0xFF, (h0 >>> 16) & 0xFF, (h0 >>> 24) & 0xFF, | |||
| h1 & 0xFF, (h1 >>> 8) & 0xFF, (h1 >>> 16) & 0xFF, (h1 >>> 24) & 0xFF, | |||
| h2 & 0xFF, (h2 >>> 8) & 0xFF, (h2 >>> 16) & 0xFF, (h2 >>> 24) & 0xFF, | |||
| h3 & 0xFF, (h3 >>> 8) & 0xFF, (h3 >>> 16) & 0xFF, (h3 >>> 24) & 0xFF | |||
| ]; | |||
| }; | |||
| /** | |||
| * @method array | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as bytes array | |||
| * @returns {Array} Bytes array | |||
| * @see {@link md5.array} | |||
| * @example | |||
| * hash.array(); | |||
| */ | |||
| Md5.prototype.array = Md5.prototype.digest; | |||
| /** | |||
| * @method arrayBuffer | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as ArrayBuffer | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @see {@link md5.arrayBuffer} | |||
| * @example | |||
| * hash.arrayBuffer(); | |||
| */ | |||
| Md5.prototype.arrayBuffer = function () { | |||
| this.finalize(); | |||
| var buffer = new ArrayBuffer(16); | |||
| var blocks = new Uint32Array(buffer); | |||
| blocks[0] = this.h0; | |||
| blocks[1] = this.h1; | |||
| blocks[2] = this.h2; | |||
| blocks[3] = this.h3; | |||
| return buffer; | |||
| }; | |||
| /** | |||
| * @method buffer | |||
| * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as ArrayBuffer | |||
| * @returns {ArrayBuffer} ArrayBuffer | |||
| * @see {@link md5.buffer} | |||
| * @example | |||
| * hash.buffer(); | |||
| */ | |||
| Md5.prototype.buffer = Md5.prototype.arrayBuffer; | |||
| /** | |||
| * @method base64 | |||
| * @memberof Md5 | |||
| * @instance | |||
| * @description Output hash as base64 string | |||
| * @returns {String} base64 string | |||
| * @see {@link md5.base64} | |||
| * @example | |||
| * hash.base64(); | |||
| */ | |||
| Md5.prototype.base64 = function () { | |||
| var v1, v2, v3, base64Str = '', bytes = this.array(); | |||
| for (var i = 0; i < 15;) { | |||
| v1 = bytes[i++]; | |||
| v2 = bytes[i++]; | |||
| v3 = bytes[i++]; | |||
| base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + | |||
| BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] + | |||
| BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] + | |||
| BASE64_ENCODE_CHAR[v3 & 63]; | |||
| } | |||
| v1 = bytes[i]; | |||
| base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] + | |||
| BASE64_ENCODE_CHAR[(v1 << 4) & 63] + | |||
| '=='; | |||
| return base64Str; | |||
| }; | |||
| /** | |||
| * HmacMd5 class | |||
| * @class HmacMd5 | |||
| * @extends Md5 | |||
| * @description This is internal class. | |||
| * @see {@link md5.hmac.create} | |||
| */ | |||
| function HmacMd5(key, sharedMemory) { | |||
| var i, result = formatMessage(key); | |||
| key = result[0]; | |||
| if (result[1]) { | |||
| var bytes = [], length = key.length, index = 0, code; | |||
| for (i = 0; i < length; ++i) { | |||
| code = key.charCodeAt(i); | |||
| if (code < 0x80) { | |||
| bytes[index++] = code; | |||
| } else if (code < 0x800) { | |||
| bytes[index++] = (0xc0 | (code >>> 6)); | |||
| bytes[index++] = (0x80 | (code & 0x3f)); | |||
| } else if (code < 0xd800 || code >= 0xe000) { | |||
| bytes[index++] = (0xe0 | (code >>> 12)); | |||
| bytes[index++] = (0x80 | ((code >>> 6) & 0x3f)); | |||
| bytes[index++] = (0x80 | (code & 0x3f)); | |||
| } else { | |||
| code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff)); | |||
| bytes[index++] = (0xf0 | (code >>> 18)); | |||
| bytes[index++] = (0x80 | ((code >>> 12) & 0x3f)); | |||
| bytes[index++] = (0x80 | ((code >>> 6) & 0x3f)); | |||
| bytes[index++] = (0x80 | (code & 0x3f)); | |||
| } | |||
| } | |||
| key = bytes; | |||
| } | |||
| if (key.length > 64) { | |||
| key = (new Md5(true)).update(key).array(); | |||
| } | |||
| var oKeyPad = [], iKeyPad = []; | |||
| for (i = 0; i < 64; ++i) { | |||
| var b = key[i] || 0; | |||
| oKeyPad[i] = 0x5c ^ b; | |||
| iKeyPad[i] = 0x36 ^ b; | |||
| } | |||
| Md5.call(this, sharedMemory); | |||
| this.update(iKeyPad); | |||
| this.oKeyPad = oKeyPad; | |||
| this.inner = true; | |||
| this.sharedMemory = sharedMemory; | |||
| } | |||
| HmacMd5.prototype = new Md5(); | |||
| HmacMd5.prototype.finalize = function () { | |||
| Md5.prototype.finalize.call(this); | |||
| if (this.inner) { | |||
| this.inner = false; | |||
| var innerHash = this.array(); | |||
| Md5.call(this, this.sharedMemory); | |||
| this.update(this.oKeyPad); | |||
| this.update(innerHash); | |||
| Md5.prototype.finalize.call(this); | |||
| } | |||
| }; | |||
| var exports = createMethod(); | |||
| exports.md5 = exports; | |||
| exports.md5.hmac = createHmacMethod(); | |||
| if (COMMON_JS) { | |||
| module.exports = exports; | |||
| } else { | |||
| /** | |||
| * @method md5 | |||
| * @description Md5 hash function, export to global in browsers. | |||
| * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash | |||
| * @returns {String} md5 hashes | |||
| * @example | |||
| * md5(''); // d41d8cd98f00b204e9800998ecf8427e | |||
| * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 | |||
| * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 | |||
| * | |||
| * // It also supports UTF-8 encoding | |||
| * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07 | |||
| * | |||
| * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` | |||
| * md5([]); // d41d8cd98f00b204e9800998ecf8427e | |||
| * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e | |||
| */ | |||
| root.md5 = exports; | |||
| if (AMD) { | |||
| define(function () { | |||
| return exports; | |||
| }); | |||
| } | |||
| } | |||
| })(); | |||
| @ -0,0 +1,95 @@ | |||
| export const Base64 = { | |||
| _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |||
| encode: function(input) { | |||
| var output = ""; | |||
| var chr1, chr2, chr3, enc1, enc2, enc3, enc4; | |||
| var i = 0; | |||
| input = Base64._utf8_encode(input); | |||
| while (i < input.length) { | |||
| chr1 = input.charCodeAt(i++); | |||
| chr2 = input.charCodeAt(i++); | |||
| chr3 = input.charCodeAt(i++); | |||
| enc1 = chr1 >> 2; | |||
| enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); | |||
| enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); | |||
| enc4 = chr3 & 63; | |||
| if (isNaN(chr2)) { | |||
| enc3 = enc4 = 64; | |||
| } else if (isNaN(chr3)) { | |||
| enc4 = 64; | |||
| } | |||
| output = output + | |||
| this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + | |||
| this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); | |||
| } | |||
| return output; | |||
| }, | |||
| decode: function(input) { | |||
| var output = ""; | |||
| var chr1, chr2, chr3; | |||
| var enc1, enc2, enc3, enc4; | |||
| var i = 0; | |||
| input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); | |||
| while (i < input.length) { | |||
| enc1 = this._keyStr.indexOf(input.charAt(i++)); | |||
| enc2 = this._keyStr.indexOf(input.charAt(i++)); | |||
| enc3 = this._keyStr.indexOf(input.charAt(i++)); | |||
| enc4 = this._keyStr.indexOf(input.charAt(i++)); | |||
| chr1 = (enc1 << 2) | (enc2 >> 4); | |||
| chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); | |||
| chr3 = ((enc3 & 3) << 6) | enc4; | |||
| output = output + String.fromCharCode(chr1); | |||
| if (enc3 != 64) { | |||
| output = output + String.fromCharCode(chr2); | |||
| } | |||
| if (enc4 != 64) { | |||
| output = output + String.fromCharCode(chr3); | |||
| } | |||
| } | |||
| output = Base64._utf8_decode(output); | |||
| return output; | |||
| }, | |||
| _utf8_encode: function(string) { | |||
| string = string.replace(/\r\n/g, "\n"); | |||
| var utftext = ""; | |||
| for (var n = 0; n < string.length; n++) { | |||
| var c = string.charCodeAt(n); | |||
| if (c < 128) { | |||
| utftext += String.fromCharCode(c); | |||
| } else if ((c > 127) && (c < 2048)) { | |||
| utftext += String.fromCharCode((c >> 6) | 192); | |||
| utftext += String.fromCharCode((c & 63) | 128); | |||
| } else { | |||
| utftext += String.fromCharCode((c >> 12) | 224); | |||
| utftext += String.fromCharCode(((c >> 6) & 63) | 128); | |||
| utftext += String.fromCharCode((c & 63) | 128); | |||
| } | |||
| } | |||
| return utftext; | |||
| }, | |||
| _utf8_decode: function(utftext) { | |||
| var string = ""; | |||
| var i = 0; | |||
| var c = c1 = c2 = 0; | |||
| while (i < utftext.length) { | |||
| c = utftext.charCodeAt(i); | |||
| if (c < 128) { | |||
| string += String.fromCharCode(c); | |||
| i++; | |||
| } else if ((c > 191) && (c < 224)) { | |||
| c2 = utftext.charCodeAt(i + 1); | |||
| string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); | |||
| i += 2; | |||
| } else { | |||
| c2 = utftext.charCodeAt(i + 1); | |||
| c3 = utftext.charCodeAt(i + 2); | |||
| string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); | |||
| i += 3; | |||
| } | |||
| } | |||
| return string; | |||
| } | |||
| } | |||
| @ -0,0 +1,117 @@ | |||
| var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |||
| let Crypto = {}; | |||
| var util = Crypto.util = { | |||
| rotl: function(n, b) { | |||
| return (n << b) | (n >>> (32 - b)); | |||
| }, | |||
| rotr: function(n, b) { | |||
| return (n << (32 - b)) | (n >>> b); | |||
| }, | |||
| endian: function(n) { | |||
| if (n.constructor == Number) { | |||
| return util.rotl(n, 8) & 0x00FF00FF | | |||
| util.rotl(n, 24) & 0xFF00FF00; | |||
| } | |||
| for (var i = 0; i < n.length; i++) | |||
| n[i] = util.endian(n[i]); | |||
| return n; | |||
| }, | |||
| randomBytes: function(n) { | |||
| for (var bytes = []; n > 0; n--) | |||
| bytes.push(Math.floor(Math.random() * 256)); | |||
| return bytes; | |||
| }, | |||
| stringToBytes: function(str) { | |||
| var bytes = []; | |||
| for (var i = 0; i < str.length; i++) | |||
| bytes.push(str.charCodeAt(i)); | |||
| return bytes; | |||
| }, | |||
| bytesToString: function(bytes) { | |||
| var str = []; | |||
| for (var i = 0; i < bytes.length; i++) | |||
| str.push(String.fromCharCode(bytes[i])); | |||
| return str.join(""); | |||
| }, | |||
| stringToWords: function(str) { | |||
| var words = []; | |||
| for (var c = 0, b = 0; c < str.length; c++, b += 8) | |||
| words[b >>> 5] |= str.charCodeAt(c) << (24 - b % 32); | |||
| return words; | |||
| }, | |||
| bytesToWords: function(bytes) { | |||
| var words = []; | |||
| for (var i = 0, b = 0; i < bytes.length; i++, b += 8) | |||
| words[b >>> 5] |= bytes[i] << (24 - b % 32); | |||
| return words; | |||
| }, | |||
| wordsToBytes: function(words) { | |||
| var bytes = []; | |||
| for (var b = 0; b < words.length * 32; b += 8) | |||
| bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); | |||
| return bytes; | |||
| }, | |||
| bytesToHex: function(bytes) { | |||
| var hex = []; | |||
| for (var i = 0; i < bytes.length; i++) { | |||
| hex.push((bytes[i] >>> 4).toString(16)); | |||
| hex.push((bytes[i] & 0xF).toString(16)); | |||
| } | |||
| return hex.join(""); | |||
| }, | |||
| hexToBytes: function(hex) { | |||
| var bytes = []; | |||
| for (var c = 0; c < hex.length; c += 2) | |||
| bytes.push(parseInt(hex.substr(c, 2), 16)); | |||
| return bytes; | |||
| }, | |||
| bytesToBase64: function(bytes) { | |||
| if (typeof btoa == "function") return btoa(util.bytesToString(bytes)); | |||
| var base64 = [], | |||
| overflow; | |||
| for (var i = 0; i < bytes.length; i++) { | |||
| switch (i % 3) { | |||
| case 0: | |||
| base64.push(base64map.charAt(bytes[i] >>> 2)); | |||
| overflow = (bytes[i] & 0x3) << 4; | |||
| break; | |||
| case 1: | |||
| base64.push(base64map.charAt(overflow | (bytes[i] >>> 4))); | |||
| overflow = (bytes[i] & 0xF) << 2; | |||
| break; | |||
| case 2: | |||
| base64.push(base64map.charAt(overflow | (bytes[i] >>> 6))); | |||
| base64.push(base64map.charAt(bytes[i] & 0x3F)); | |||
| overflow = -1; | |||
| } | |||
| } | |||
| if (overflow != undefined && overflow != -1) | |||
| base64.push(base64map.charAt(overflow)); | |||
| while (base64.length % 4 != 0) base64.push("="); | |||
| return base64.join(""); | |||
| }, | |||
| base64ToBytes: function(base64) { | |||
| if (typeof atob == "function") return util.stringToBytes(atob(base64)); | |||
| base64 = base64.replace(/[^A-Z0-9+\/]/ig, ""); | |||
| var bytes = []; | |||
| for (var i = 0; i < base64.length; i++) { | |||
| switch (i % 4) { | |||
| case 1: | |||
| bytes.push((base64map.indexOf(base64.charAt(i - 1)) << 2) | | |||
| (base64map.indexOf(base64.charAt(i)) >>> 4)); | |||
| break; | |||
| case 2: | |||
| bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & 0xF) << 4) | | |||
| (base64map.indexOf(base64.charAt(i)) >>> 2)); | |||
| break; | |||
| case 3: | |||
| bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & 0x3) << 6) | | |||
| (base64map.indexOf(base64.charAt(i)))); | |||
| break; | |||
| } | |||
| } | |||
| return bytes; | |||
| } | |||
| }; | |||
| Crypto.mode = {}; | |||
| export default Crypto; | |||
| @ -0,0 +1,29 @@ | |||
| import Crypto from '@/utils/oss-upload/common/crypto/crypto.js.js'; | |||
| (function() { | |||
| // Shortcut | |||
| var util = Crypto.util; | |||
| Crypto.HMAC = function(hasher, message, key, options) { | |||
| // Allow arbitrary length keys | |||
| key = key.length > hasher._blocksize * 4 ? | |||
| hasher(key, { | |||
| asBytes: true | |||
| }) : | |||
| util.stringToBytes(key); | |||
| // XOR keys with pad constants | |||
| var okey = key, | |||
| ikey = key.slice(0); | |||
| for (var i = 0; i < hasher._blocksize * 4; i++) { | |||
| okey[i] ^= 0x5C; | |||
| ikey[i] ^= 0x36; | |||
| } | |||
| var hmacbytes = hasher(util.bytesToString(okey) + | |||
| hasher(util.bytesToString(ikey) + message, { | |||
| asString: true | |||
| }), { | |||
| asBytes: true | |||
| }); | |||
| return options && options.asBytes ? hmacbytes : | |||
| options && options.asString ? util.bytesToString(hmacbytes) : | |||
| util.bytesToHex(hmacbytes); | |||
| }; | |||
| })(); | |||
| @ -0,0 +1,59 @@ | |||
| import Crypto from '@/utils/oss-upload/common/crypto/crypto.js.js'; | |||
| (function() { | |||
| // Shortcut | |||
| var util = Crypto.util; | |||
| // Public API | |||
| var SHA1 = Crypto.SHA1 = function(message, options) { | |||
| var digestbytes = util.wordsToBytes(SHA1._sha1(message)); | |||
| return options && options.asBytes ? digestbytes : | |||
| options && options.asString ? util.bytesToString(digestbytes) : | |||
| util.bytesToHex(digestbytes); | |||
| }; | |||
| // The core | |||
| SHA1._sha1 = function(message) { | |||
| var m = util.stringToWords(message), | |||
| l = message.length * 8, | |||
| w = [], | |||
| H0 = 1732584193, | |||
| H1 = -271733879, | |||
| H2 = -1732584194, | |||
| H3 = 271733878, | |||
| H4 = -1009589776; | |||
| // Padding | |||
| m[l >> 5] |= 0x80 << (24 - l % 32); | |||
| m[((l + 64 >>> 9) << 4) + 15] = l; | |||
| for (var i = 0; i < m.length; i += 16) { | |||
| var a = H0, | |||
| b = H1, | |||
| c = H2, | |||
| d = H3, | |||
| e = H4; | |||
| for (var j = 0; j < 80; j++) { | |||
| if (j < 16) w[j] = m[i + j]; | |||
| else { | |||
| var n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16]; | |||
| w[j] = (n << 1) | (n >>> 31); | |||
| } | |||
| var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + ( | |||
| j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 : | |||
| j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : | |||
| j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : | |||
| (H1 ^ H2 ^ H3) - 899497514); | |||
| H4 = H3; | |||
| H3 = H2; | |||
| H2 = (H1 << 30) | (H1 >>> 2); | |||
| H1 = H0; | |||
| H0 = t; | |||
| } | |||
| H0 += a; | |||
| H1 += b; | |||
| H2 += c; | |||
| H3 += d; | |||
| H4 += e; | |||
| } | |||
| return [H0, H1, H2, H3, H4]; | |||
| }; | |||
| // Package private blocksize | |||
| SHA1._blocksize = 16; | |||
| })(); | |||
| @ -0,0 +1,36 @@ | |||
| import Crypto from '@/utils/oss-upload/common/crypto/crypto.js.js'; | |||
| import '@/utils/oss-upload/common/crypto/hmac.js'; | |||
| import '@/utils/oss-upload/common/crypto/sha1.js'; | |||
| import { Base64 } from '@/utils/oss-upload/common/crypto/base64.js'; | |||
| import ossConfig from '@/config.js' | |||
| let date = new Date() | |||
| date = date.setHours(date.getHours() + 1) | |||
| let extime = "" + new Date(date).toISOString() | |||
| let policyText = { | |||
| "expiration": extime, | |||
| "conditions": [ | |||
| ["content-length-range", 0, 1024 * 1024 * 100] // 设置上传文件的大小限制 | |||
| ] | |||
| }; | |||
| let config = { | |||
| accessid: ossConfig.aliOss.config.accessKeyId, | |||
| accesskey: ossConfig.aliOss.config.accessKeySecret, | |||
| osshost: ossConfig.aliOss.url, | |||
| policyBase64: Base64.encode(JSON.stringify(policyText)) | |||
| } | |||
| let message = config.policyBase64; | |||
| let bytes = Crypto.HMAC(Crypto.SHA1, message, config.accesskey, { | |||
| asBytes: true | |||
| }); | |||
| let signature = Crypto.util.bytesToBase64(bytes); | |||
| let timetamp = new Date().getTime(); | |||
| let OSSConfig = { | |||
| name: 'aliyun', | |||
| host: config.osshost, | |||
| accessid: config.accessid, | |||
| signature: signature, | |||
| policyBase64: config.policyBase64, | |||
| } | |||
| export default OSSConfig; | |||
| @ -0,0 +1,139 @@ | |||
| /** | |||
| * 阿里云OSS工具类 | |||
| */ | |||
| import OSSConfig from "@/utils/oss-upload/oss/OSSConfig.js" | |||
| //支持web端 | |||
| import { | |||
| uploadFileToOSS | |||
| } from '@/utils/oss-upload/oss/web.js' | |||
| import ossConfig from '@/config.js' | |||
| /** | |||
| * 生成一个随机的Key | |||
| */ | |||
| function storeKey() { | |||
| let s = []; | |||
| let hexDigits = "0123456789abcdef"; | |||
| for (let i = 0; i < 36; i++) { | |||
| s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); | |||
| } | |||
| s[14] = "4"; | |||
| s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); | |||
| s[8] = s[13] = s[18] = s[23] = "-"; | |||
| return s.join(""); | |||
| } | |||
| /** | |||
| * 根据当天日期在OSS端生成文件夹 | |||
| */ | |||
| function storeFolder() { | |||
| const date = new Date(); | |||
| const formatNumber = n => { | |||
| n = n.toString() | |||
| return n[1] ? n : '0' + n | |||
| } | |||
| return [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(formatNumber).join('-') | |||
| } | |||
| /** | |||
| * 阿里云OSS上传文件, 所有具体功能的工具函数均基于此 | |||
| * 注意, resolve时一定为上传成功, 返回OSS上的Key | |||
| * @param filePath 待上传文件的URI | |||
| * @param key 存储桶中的目标文件名 | |||
| * @param folder 存储桶中的目标文件夹 | |||
| */ | |||
| export function ossUpload(filePath, key = storeKey(), folder = storeFolder()) { | |||
| return new Promise((resolve, reject) => { | |||
| if (folder && folder?.length > 0) { | |||
| if (folder[0] == "/") folder = folder.slice(1, folder.length) | |||
| if (folder[folder.length - 1] != "/") folder += "/" | |||
| key = folder + key | |||
| } | |||
| const filePrefixArr = filePath.split(".") | |||
| key += `.${filePrefixArr[filePrefixArr.length - 1]}` | |||
| let config = { | |||
| url: OSSConfig.host, | |||
| name: 'file', | |||
| filePath, | |||
| formData: { | |||
| key, | |||
| policy: OSSConfig.policyBase64, | |||
| OSSAccessKeyId: OSSConfig.accessid, | |||
| success_action_status: '200', | |||
| signature: OSSConfig.signature, | |||
| }, | |||
| success(res) { | |||
| if (res.errMsg.includes("uploadFile:ok")) { | |||
| resolve(ossConfig.aliOss.url + key) | |||
| } else { | |||
| reject(res) | |||
| } | |||
| }, | |||
| fail(err) { | |||
| reject(err) | |||
| } | |||
| } | |||
| uni.uploadFile(config) | |||
| }) | |||
| } | |||
| /** | |||
| * 阿里云OSS上传图片 | |||
| * @param {compressed, key, folder, success, fail} compressed: 是否压缩 key: 存储桶中的目标文件名 folder: 存储桶中的目标文件夹 | |||
| */ | |||
| export function ossUploadImage({ | |||
| key, | |||
| folder, | |||
| compressed = true, //是否压缩 | |||
| success, //成功时的回调 | |||
| fail //失败时的回调 | |||
| }) { | |||
| const sizeType = [compressed ? 'compressed' : 'original'] | |||
| uni.chooseImage({ | |||
| count: 1, | |||
| sizeType, | |||
| success(res) { | |||
| // #ifdef H5 | |||
| return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail) | |||
| // #endif | |||
| ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail) | |||
| }, | |||
| fail | |||
| }) | |||
| } | |||
| /** | |||
| * 阿里云OSS上传视频 | |||
| * @param { key, folder, sourceType, compressed, maxDuration, camera, success, fail} | |||
| * key: 存储桶中的目标文件名 folder: 存储桶中的目标文件夹 其它参数同uni.chooseVideo(mpWeixin) | |||
| */ | |||
| export function ossUploadVideo({ | |||
| key, | |||
| folder, | |||
| sourceType = ['album', 'camera'], //album 从相册选视频, camera 使用相机拍摄 | |||
| compressed = true, //是否压缩所选的视频源文件 | |||
| maxDuration = 60, //拍摄视频最长拍摄时间, 单位秒。最长支持 60 秒 | |||
| camera = 'back', //调用相机方向, 'front'、'back', 默认'back' | |||
| success, //成功时的回调 | |||
| fail //失败时的回调 | |||
| }) { | |||
| uni.chooseVideo({ | |||
| sourceType, | |||
| compressed, | |||
| maxDuration, | |||
| camera, | |||
| success(res) { | |||
| // #ifdef H5 | |||
| return uploadFileToOSS(res.tempFile).then(success).catch(fail) | |||
| // #endif | |||
| ossUpload(res.tempFilePath, key, folder).then(success).catch(fail) | |||
| }, | |||
| fail | |||
| }) | |||
| } | |||
| const OSS = { | |||
| ossUploadVideo, | |||
| ossUploadImage, | |||
| ossUpload | |||
| } | |||
| export default OSS; | |||
| @ -0,0 +1,63 @@ | |||
| // 此方法适用于web | |||
| import OSS from "ali-oss" | |||
| import config from '@/config.js' | |||
| /** | |||
| * 生成一个随机的Key | |||
| */ | |||
| function storeKey() { | |||
| let s = []; | |||
| let hexDigits = "0123456789abcdef"; | |||
| for (let i = 0; i < 36; i++) { | |||
| s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); | |||
| } | |||
| s[14] = "4"; | |||
| s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); | |||
| s[8] = s[13] = s[18] = s[23] = "-"; | |||
| return s.join(""); | |||
| } | |||
| /** | |||
| * 根据当天日期在OSS端生成文件夹 | |||
| */ | |||
| function storeFolder() { | |||
| const date = new Date(); | |||
| const formatNumber = n => { | |||
| n = n.toString() | |||
| return n[1] ? n : '0' + n | |||
| } | |||
| return [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(formatNumber).join('-') | |||
| } | |||
| export function uploadFileToOSS(file) { | |||
| uni.showLoading({ | |||
| title: '上传中...' | |||
| }); | |||
| return new Promise((resolve,reject) => { | |||
| // 创建OSS实例 | |||
| const client = new OSS(config.aliOss.config); | |||
| // 设置文件名和文件目录 | |||
| const suffix = '.' + file.name.split('.').pop(); | |||
| let key = storeFolder() | |||
| if(key[key.length - 1] != '/') key += '/' | |||
| const fileName = key + storeKey() + suffix; // 注意:文件名需要是唯一的 | |||
| // 使用put接口上传文件 | |||
| client.multipartUpload(fileName, file, { | |||
| headers: { | |||
| 'Content-Disposition': 'inline', | |||
| 'Content-Type': file.type | |||
| } | |||
| }).then(res => { | |||
| uni.hideLoading(); | |||
| resolve(config.aliOss.url + res.name); | |||
| }).catch(err => { | |||
| uni.hideLoading(); | |||
| reject(err) | |||
| }) | |||
| }) | |||
| } | |||
| @ -0,0 +1,39 @@ | |||
| // #ifdef H5 | |||
| import jWeixin from './lib/jweixin-module.js' | |||
| // #endif | |||
| export function wxPay(res, successCallback, failCallback, optionCallback) { | |||
| jWeixin.config({ | |||
| debug: false, | |||
| appId: res.result.appId, //必填 | |||
| jsApiList: ['chooseWXPay'] | |||
| }); | |||
| jWeixin.ready(function() { | |||
| jWeixin.chooseWXPay({ | |||
| appId: res.result.appId, | |||
| timestamp: res.result | |||
| .timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符 | |||
| nonceStr: res.result.nonceStr, // 支付签名随机串,不长于 32 位 | |||
| package: res.result.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*) | |||
| signType: res.result.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致 | |||
| paySign: res.result.paySign, // 支付签名 | |||
| success: function() { // 支付成功取消处理 | |||
| successCallback && successCallback(); | |||
| }, | |||
| fail: function(error) { // 支付失败或取消处理 | |||
| failCallback && failCallback(); | |||
| }, | |||
| cancel : function(){ | |||
| failCallback && failCallback(); | |||
| } | |||
| }); | |||
| }); | |||
| jWeixin.error(function(res) { | |||
| // 配置失败处理 | |||
| optionCallback && optionCallback() | |||
| }); | |||
| } | |||
| @ -0,0 +1,177 @@ | |||
| import config from '../config.js' | |||
| function calculateDistance(lat1, lon1, lat2, lon2) { //计算两点距离 | |||
| let distance = 0 | |||
| if (!lat2 || !lon2) return distance | |||
| //先强制转换一下(后端给的字符串) | |||
| lat1 = parseFloat(lat1) | |||
| lon1 = parseFloat(lon1) | |||
| lat2 = parseFloat(lat2) | |||
| lon2 = parseFloat(lon2) | |||
| // 将角度转换为弧度 | |||
| const R = 6371; // 地球半径,单位公里 | |||
| const dLat = (lat2 - lat1) * Math.PI / 180; | |||
| const dLon = (lon2 - lon1) * Math.PI / 180; | |||
| lat1 = lat1 * Math.PI / 180; | |||
| lat2 = lat2 * Math.PI / 180; | |||
| // Haversine公式 | |||
| const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + | |||
| Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2); | |||
| const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | |||
| // 计算距离 | |||
| distance = R * c; | |||
| return distance.toFixed(0) | |||
| } | |||
| function getLocation(fn) { //获取用户经纬度 | |||
| wxGetLocation() //此方法只用于提示用户打开gps | |||
| uni.getLocation({ | |||
| type: 'gcj02', | |||
| isHighAccuracy: true, | |||
| highAccuracyExpireTime: 1000, | |||
| success: function(position) { | |||
| fn(position) | |||
| }, | |||
| fail: function() { //使用ip获取定位 | |||
| let key = config.mapKey; //腾讯地图key | |||
| getUserAddressByIp(key).then(res => { | |||
| fn(res.position) //返回经纬度 | |||
| }) | |||
| } | |||
| }) | |||
| } | |||
| function getLocationDetail() { //获取用户详细地址 | |||
| wxGetLocation() | |||
| return new Promise((resolve, reject) => { | |||
| let key = config.mapKey; //腾讯地图key | |||
| uni.getLocation({ | |||
| type: 'gcj02', | |||
| isHighAccuracy: true, | |||
| highAccuracyExpireTime: 1000, | |||
| success: function(position) { | |||
| getUserAddress(position.latitude, position.longitude, key).then(res => { | |||
| resolve(res) | |||
| }) | |||
| }, | |||
| fail: function() { //使用ip获取定位 | |||
| getUserAddressByIp(key).then(res => { | |||
| resolve(res) | |||
| }) | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| function getUserAddress(latitude, longitude, key) { //通过经纬度获取用户详细地址 | |||
| return new Promise((resolve, reject) => { | |||
| let url = `/ws/geocoder/v1/?location=${latitude},${longitude}&key=${key}` | |||
| // #ifndef H5 | |||
| url = `https://apis.map.qq.com` + url | |||
| // #endif | |||
| uni.request({ | |||
| url, | |||
| success: (res) => { | |||
| let { | |||
| lat, | |||
| lng | |||
| } = res.data.result.ad_info.location; | |||
| let data = { | |||
| position: { | |||
| latitude: lat, | |||
| longitude: lng | |||
| }, | |||
| addressDetail: res.data.result.ad_info | |||
| } | |||
| resolve(data) | |||
| }, | |||
| fail(err) { | |||
| reject(err) | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| function getUserAddressByIp(key) { //根据IP获取当前用户位置 | |||
| return new Promise((resolve, reject) => { | |||
| uni.request({ | |||
| url: 'https://api.ipify.org?format=json', | |||
| success: (ipInfo) => { | |||
| let url = `/ws/location/v1/ip?ip=${ipInfo.data.ip}&key=${key}` | |||
| // #ifndef H5 | |||
| url = `https://apis.map.qq.com` + url | |||
| // #endif | |||
| uni.request({ | |||
| url, | |||
| success: (res) => { | |||
| let { | |||
| lat, | |||
| lng | |||
| } = res.data.result.location; | |||
| let data = { | |||
| addressDetail: res.data.result.ad_info, | |||
| ip: res.data.result.ip, | |||
| position: { | |||
| latitude: lat, | |||
| longitude: lng | |||
| } | |||
| } | |||
| resolve(data) | |||
| }, | |||
| fail(err) { | |||
| reject(err) | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| //打开地图让用户选择位置 | |||
| function selectAddress(longitude, latitude, successCallback) { | |||
| uni.chooseLocation({ | |||
| longitude, //经度 | |||
| latitude, //纬度 | |||
| success: function(res) { | |||
| successCallback && successCallback(res) | |||
| } | |||
| }); | |||
| } | |||
| //sdk自带获取位置方法(只支持微信环境),这里只当提示在用了(具体获取地址逻辑上面几个方法已完成) | |||
| function wxGetLocation(successCallback, failCallback) { | |||
| // #ifdef MP-WEIXIN | |||
| // #endif | |||
| console.log('wx.getLocation'); | |||
| wx.getLocation({ | |||
| type: 'gcj02', | |||
| isHighAccuracy: true, | |||
| highAccuracyExpireTime: 2000, | |||
| success(res) {}, | |||
| fail(err) { | |||
| if(err.errMsg == 'getLocation:gps closed'){ | |||
| uni.showToast({ | |||
| title: '请打开GPS定位,否则定位不准确', | |||
| icon: 'none' | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| export default { | |||
| calculateDistance, //计算两点距离 | |||
| getLocationDetail, //获取用户详细地址 | |||
| getLocation, //获取用户经纬度 | |||
| selectAddress, //打开地图让用户选择位置 | |||
| wxGetLocation, | |||
| } | |||
| @ -0,0 +1,75 @@ | |||
| import api from '@/api/api.js' | |||
| import config from "../config.js" | |||
| import jWeixin from './lib/jweixin-module.js' | |||
| function share() { //微信分享 | |||
| //获取签名 | |||
| let data = { | |||
| url: import.meta.env.VITE_REDIRECT_URI + '/#/' | |||
| } | |||
| api('getVipShareSign', data, res => { | |||
| if (res.code == 200) { | |||
| let { | |||
| appId, | |||
| nonceStr, | |||
| signature, | |||
| timestamp | |||
| } = res.result | |||
| jWeixin.config({ | |||
| debug: false, | |||
| appId: appId, | |||
| nonceStr: nonceStr, | |||
| signature: signature, | |||
| timestamp: timestamp, | |||
| jsApiList: [ | |||
| 'updateTimelineShareData', | |||
| 'updateAppMessageShareData', | |||
| 'onMenuShareWeibo', | |||
| 'getLocation' | |||
| ] | |||
| }); | |||
| jWeixin.ready(function() { | |||
| // 微信分享的数据 | |||
| var shareData = { | |||
| "link": addQueryParams(data.url), | |||
| "desc": "泰柔到家", | |||
| "title": "泰柔到家,温柔呵护每一刻!", | |||
| imgUrl : import.meta.env.VITE_REDIRECT_URI + '/static/share/logo.png', | |||
| success: function() { | |||
| //分享成功可以做相应的数据处理 | |||
| // uni.showToast({ | |||
| // mask: true, | |||
| // duration: 1000, | |||
| // title: '注册分享成功', | |||
| // }); | |||
| } | |||
| }; | |||
| //分享微信朋友圈内容设置 | |||
| jWeixin.updateTimelineShareData(shareData); | |||
| //分享给朋友内容设置 | |||
| jWeixin.updateAppMessageShareData(shareData); | |||
| //分享到微博内容设置 | |||
| jWeixin.onMenuShareWeibo(shareData); | |||
| }); | |||
| jWeixin.error(function(err){ | |||
| console.error(err); | |||
| // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 | |||
| }) | |||
| } | |||
| }) | |||
| } | |||
| function addQueryParams(url) { | |||
| if (url) { | |||
| //获取用户id | |||
| let userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : null | |||
| if(userInfo){ | |||
| url += `?vid=${userInfo.id}` | |||
| } | |||
| } | |||
| return url | |||
| } | |||
| export default share | |||
| @ -0,0 +1,43 @@ | |||
| export function handleTree(data, id, parentId, children) { | |||
| let config = { | |||
| id: id || 'id', | |||
| parentId: parentId || 'parentId', | |||
| childrenList: children || 'children' | |||
| }; | |||
| var childrenListMap = {}; | |||
| var nodeIds = {}; | |||
| var tree = []; | |||
| for (let d of data) { | |||
| let parentId = d[config.parentId]; | |||
| if (childrenListMap[parentId] == null) { | |||
| childrenListMap[parentId] = []; | |||
| } | |||
| nodeIds[d[config.id]] = d; | |||
| childrenListMap[parentId].push(d); | |||
| } | |||
| for (let d of data) { | |||
| let parentId = d[config.parentId]; | |||
| if (nodeIds[parentId] == null) { | |||
| tree.push(d); | |||
| } | |||
| } | |||
| for (let t of tree) { | |||
| adaptToChildrenList(t); | |||
| } | |||
| function adaptToChildrenList(o) { | |||
| if (childrenListMap[o[config.id]] !== null) { | |||
| o[config.childrenList] = childrenListMap[o[config.id]]; | |||
| } | |||
| if (o[config.childrenList]) { | |||
| for (let c of o[config.childrenList]) { | |||
| adaptToChildrenList(c); | |||
| } | |||
| } | |||
| } | |||
| return tree; | |||
| } | |||
| @ -0,0 +1,134 @@ | |||
| function toArray(data) { | |||
| if (!data) return [] | |||
| if (data instanceof Array){ | |||
| return data | |||
| } else { | |||
| return [data] | |||
| } | |||
| } | |||
| function generateUUID() { | |||
| return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |||
| var r = Math.random() * 16 | 0, | |||
| v = c == 'x' ? r : (r & 0x3 | 0x8); | |||
| return v.toString(16); | |||
| }); | |||
| } | |||
| function generateRandomColor() { | |||
| const letters = '0123456789ABCDEF'; | |||
| let color = '#'; | |||
| for (let i = 0; i < 6; i++) { | |||
| color += letters[Math.floor(Math.random() * 16)]; | |||
| } | |||
| return color; | |||
| } | |||
| function generateLightRandomColor() { | |||
| const min = 150; | |||
| const range = 105; | |||
| const r = Math.floor(Math.random() * range + min); | |||
| const g = Math.floor(Math.random() * range + min); | |||
| const b = Math.floor(Math.random() * range + min); | |||
| const color = 'rgb(' + r + ',' + g + ',' + b + ')'; | |||
| return color; | |||
| } | |||
| function verificationAll(data){ | |||
| if (!data){ | |||
| uni.showToast({ | |||
| title: '表单数据未填写', | |||
| icon: "error" | |||
| }) | |||
| return true | |||
| } | |||
| for (let key in data) { | |||
| if (!data[key] || data[key] === "") { | |||
| uni.showToast({ | |||
| title: '必填数据未填写' + key, | |||
| icon: "error" | |||
| }) | |||
| return true | |||
| } | |||
| } | |||
| return false | |||
| } | |||
| //验证手机号是否合法 | |||
| function verificationPhone(phone){ | |||
| if(!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(phone)){ | |||
| return false | |||
| } | |||
| return true | |||
| } | |||
| //获取url中参数的方法 | |||
| export function getHrefParams(name) { | |||
| var url = window.location.href; | |||
| try { | |||
| var cs = url.split('?')[1]; //获取?之后的参数字符串 | |||
| var cs_arr = cs.split('&'); //参数字符串分割为数组 | |||
| for (var i = 0; i < cs_arr.length; i++) { //遍历数组,拿到json对象 | |||
| if (cs_arr[i].split('=')[0] == name) { | |||
| return cs_arr[i].split('=')[1]; | |||
| } | |||
| } | |||
| return ""; | |||
| } catch { | |||
| return ""; | |||
| } | |||
| } | |||
| //深度对比合并两个对象,相同属性b会覆盖a | |||
| export function deepMergeObject(a, b){ | |||
| let data = JSON.parse(JSON.stringify(a)) | |||
| function mergeObject(obj1, obj2){ | |||
| for(let key in obj2){ | |||
| if(typeof obj1[key] == 'object'){ | |||
| obj1[key] = mergeObject(obj1[key], obj2[key]) | |||
| }else{ | |||
| obj1[key] = obj2[key] | |||
| } | |||
| } | |||
| return obj1 | |||
| } | |||
| return mergeObject(data, b) | |||
| } | |||
| function params(url){ | |||
| if(typeof url == 'object'){ | |||
| data.url = '/pages' + data.url | |||
| return url | |||
| } | |||
| let data = { | |||
| url | |||
| } | |||
| data.url = '/pages' + data.url | |||
| return data | |||
| } | |||
| export function navigateTo(...args){ | |||
| uni.navigateTo(params(...args)) | |||
| } | |||
| export function navigateBack(num = -1){ | |||
| uni.navigateBack(num) | |||
| } | |||
| export default { | |||
| toArray, | |||
| generateUUID, | |||
| verificationAll, | |||
| generateRandomColor, | |||
| generateLightRandomColor, | |||
| verificationPhone, | |||
| getHrefParams, | |||
| deepMergeObject, | |||
| navigateTo, | |||
| navigateBack | |||
| } | |||