From 46083a2914a62c1835612fb0872d7fdc76d7bb9d Mon Sep 17 00:00:00 2001 From: wzp <2880584989@qq.com> Date: 星期二, 22 二月 2022 15:41:49 +0800 Subject: [PATCH] 最新 --- assetMgtH5/pages/assets/repair.vue | 119 ++++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 72 insertions(+), 47 deletions(-) diff --git a/assetMgtH5/pages/assets/repair.vue b/assetMgtH5/pages/assets/repair.vue index fb68e28..ead681e 100644 --- a/assetMgtH5/pages/assets/repair.vue +++ b/assetMgtH5/pages/assets/repair.vue @@ -7,74 +7,99 @@ <block slot="content">璧勪骇鎶ヤ慨</block> </cu-custom> </view> - <view class="flex align-center justify-center Tbox"> - <view class="btnBox"> - <view @click="navigateTo('Qrcode')" class="no1" hover-class="active"> - <image src="../../static/shao02.svg" mode="widthFix"></image> - <text>鐐瑰嚮鎵爜鑾峰彇璧勪骇淇℃伅</text> + <!-- <view class="uni-padding-wrap uni-common-mt"> + <view class="uni-title">鎵爜缁撴灉锛�</view> + <view class="uni-list" v-if="result"> + <view class="uni-cell"> + <view class="scan-result"> + {{result}} + </view> </view> </view> + </view> --> + <!-- <view> + url:{{url}} + </view> + <view class=""> + <u--textarea v-model="value1" placeholder="璇疯緭鍏ュ唴瀹�" ></u--textarea> + </view> --> + + <view class="btnBox"> + <button type="primary" @click="getWxConfig">鐐瑰嚮鎵竴鎵�</button> </view> </view> </template> <script> - + import permision from "@/common/permission.js" export default { data() { return { + result:'', } }, methods: { - navigateTo(url) { - setTimeout(()=>{ - uni.navigateTo({ - url: `./${url}/${url}` + getWxConfig() { + let wPath = window.document.location.href.split('#')[0]; + // this.url = wPath; + // let urlStr ="http://localhost:8085/h5/pages/assets/repair"; + console.log(wPath); + this.$http.get('/assets/approval/getWxConfig',{params:{url:wPath}}) + .then(res => { + // debugger; + if(res.data.code===0){ + let data = res.data.data; + this.value1 = JSON.stringify(data); + wx.config({ + beta: true,// 蹇呴』杩欎箞鍐欙紝鍚﹀垯wx.invoke璋冪敤褰㈠紡鐨刯sapi浼氭湁闂 + debug: false, // 寮�鍚皟璇曟ā寮�,璋冪敤鐨勬墍鏈塧pi鐨勮繑鍥炲�间細鍦ㄥ鎴风alert鍑烘潵锛岃嫢瑕佹煡鐪嬩紶鍏ョ殑鍙傛暟锛屽彲浠ュ湪pc绔墦寮�锛屽弬鏁颁俊鎭細閫氳繃log鎵撳嚭锛屼粎鍦╬c绔椂鎵嶄細鎵撳嵃銆� + appId: data.appId, // 蹇呭~锛屼紒涓氬井淇$殑corpID + timestamp: data.timestamp, // 蹇呭~锛岀敓鎴愮鍚嶇殑鏃堕棿鎴� + nonceStr: data.nonceStr, // 蹇呭~锛岀敓鎴愮鍚嶇殑闅忔満涓� + signature: data.signature,// 蹇呭~锛岀鍚嶏紝瑙� 闄勫綍-JS-SDK浣跨敤鏉冮檺绛惧悕绠楁硶 + jsApiList: ['scanQRCode'] // 蹇呭~锛岄渶瑕佷娇鐢ㄧ殑JS鎺ュ彛鍒楄〃锛屽嚒鏄璋冪敤鐨勬帴鍙i兘闇�瑕佷紶杩涙潵 + }); + + wx.ready(function(){ + // config淇℃伅楠岃瘉鍚庝細鎵цready鏂规硶锛屾墍鏈夋帴鍙h皟鐢ㄩ兘蹇呴』鍦╟onfig鎺ュ彛鑾峰緱缁撴灉涔嬪悗锛� + //config鏄竴涓鎴风鐨勫紓姝ユ搷浣滐紝鎵�浠ュ鏋滈渶瑕佸湪椤甸潰鍔犺浇鏃跺氨璋冪敤鐩稿叧鎺ュ彛锛屽垯椤绘妸鐩稿叧鎺ュ彛鏀惧湪ready鍑芥暟涓皟鐢ㄦ潵纭繚姝g‘鎵ц銆傚浜庣敤鎴疯Е鍙戞椂鎵嶈皟鐢ㄧ殑鎺ュ彛锛屽垯鍙互鐩存帴璋冪敤锛屼笉闇�瑕佹斁鍦╮eady鍑芥暟涓�� + wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 0, // 榛樿涓�0锛屾壂鎻忕粨鏋滅敱浼佷笟寰俊澶勭悊锛�1鍒欑洿鎺ヨ繑鍥炴壂鎻忕粨鏋滐紝 + scanType: ["qrCode", "barCode"], // 鍙互鎸囧畾鎵簩缁寸爜杩樻槸鏉″舰鐮侊紙涓�缁寸爜锛夛紝榛樿浜岃�呴兘鏈� + success: function(res) { + // 鍥炶皟 + this.result = res.resultStr;//褰搉eedResult涓�1鏃惰繑鍥炲鐞嗙粨鏋� + console.log('缁撴灉',this.result) + }, + error: function(res) { + if (res.errMsg.indexOf('function_not_exist') > 0) { + alert('鐗堟湰杩囦綆璇峰崌绾�') + } + } + }); + }); + + + } + + + }).catch(err => { + console.log(err.data) }) - },300) - } + }, + } } </script> <style lang="scss"> -page { - background-color: #6a6a6a; - } - - .Tbox{ - height: 100vh; - width: 100vw; - } - - .btnBox { - // border: 1rpx red solid; + .btnBox{ + height: 50vh; display: flex; - padding: 5rpx; - - >view { - color: #fff; - width: 270rpx; - height: 270rpx; - font-size: 26rpx; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - background-color: #777777; - margin: 8rpx; - border: 1px solid #777777; - image { - margin-bottom: 12rpx; - width: 60rpx; - } - } - - >view.active { - border: 1px solid #C0C0C0; - background-color: #868686; - } + align-items: center; + justify-content: center; } </style> -- Gitblit v1.9.1