diff --git a/components/scanCode.vue b/components/scanCode.vue index de84ff3..1b4a19b 100644 --- a/components/scanCode.vue +++ b/components/scanCode.vue @@ -1,7 +1,7 @@ @@ -20,14 +20,16 @@ methods: { onDecode(result) { this.result = result; - _this.$emit("success", result) + this.$emit("success", result) }, async initQR(promise) { let _this = this + try { + const { capabilities } = await promise; const TORCH_IS_SUPPORTED = !!capabilities.torch; - try { + let res = await promise; console.log(res) } catch (error) { @@ -54,3 +56,26 @@ } + + diff --git a/manifest.json b/manifest.json index c6353ad..c342f8f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "daoyou", - "appid" : "__UNI__359C6E6", + "appid" : "__UNI__4A60AD2", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/pages/user/user.vue b/pages/user/user.vue index b4294a6..c631761 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -2,7 +2,7 @@ - + {{userInfo.nickname}} {{userInfo.group_data.name}} @@ -41,7 +41,7 @@ path: '/subPackages/user/accountPassword' } ], - userInfo: {} + userInfo: {group_data: {}} } }, onShow() { diff --git a/pages/verification/index.vue b/pages/verification/index.vue index dc15f67..8ebbe6f 100644 --- a/pages/verification/index.vue +++ b/pages/verification/index.vue @@ -9,32 +9,36 @@ - - - 点击扫码核销 - - - - 输入核销码 - + + + + + 订单详情 下单日期: @@ -46,7 +50,7 @@ 订单名称: - {{item.name}} + {{item.goods_title}} 数量: @@ -58,81 +62,32 @@ 时段: - + {{item.use_date}} 出行人: - {{item.nickname}} + {{item.contact_name}} 出行人手机号: - {{item.phone}} + {{item.contact_tel}} - 出行人身份证: - {{item.user_id_number}} - + 出行人身份证: + {{item.id_number}} + 核销 + - - - - 确认是否核销 - - - - - - 核销 - - - - + @@ -163,6 +118,12 @@ getCode (res) { console.log(res) this.showScan = false + + if (res) { + let param = {child_id: res} + this.getOrderList(param) + } + }, scanFail(res) { this.showScan = false @@ -173,26 +134,35 @@ setType (type) { + if (this.type != type) { + this.orderList = [] + } this.type = type }, - // 微信扫码获取订单详情 - getOrderByCode (code) { - this.Post({ - code: code - }, '/api/wx/jsSdk').then(res=>{ + // 查询订单 + getOrderList (param) { + this.orderList = [] + this.Post(param, '/api/Merchants/search').then(res=>{ if (res && res.code == 1 && res.data) { - this.orderList = [res.data] - this.$refs.popup.open() + this.orderList = res.data || [] + + if (this.orderList.length<=0) { + uni.showToast({ + title:'未查询到需核销的订单', + icon:"none" + }) + } } }) }, - // 核销码核销 + // 核销搜索 verifyByCode () { if (this.HXCode.trim() == '') { uni.showToast({title:'请输入核销码',icon:"none"}) return } - this.getOrderByCode(this.HXCode) + let param = {child_id: this.HXCode.trim()} + this.getOrderList(param) }, // 确认核销 confirmVerify () { @@ -216,12 +186,8 @@ uni.showToast({title:'查询手机号最低4位',icon:"none"}) return } - // this.Post({ - // mobile: this.HXPhone - // }, '/api/wx/jsSdk').then(res=>{ - - // }) - this.orderList = [{}] + let param = {mobile: this.HXPhone.trim()} + this.getOrderList(param) }, // 手机号核销 verifyByPhone () { @@ -241,46 +207,6 @@ }, - // 微信扫码 - initWX () { - try { - // if (window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") { - let that = this - this.Post({ - web_url: encodeURIComponent(window.location.href.split('#')[0]), - apis: 'scanQRCode' - }, '').then(res => { - if (res) { - let data = res.jssdk - //初始化微信功能 - wx.config({ - debug: false, - appId: data.appId, - timestamp: data.timestamp, - nonceStr: data.nonceStr, - signature: data.signature,// + "asdfasdf",//测试获取地理位置失败 - jsApiList: ['scanQRCode'] - }); - } - }) - // } - } catch (e) {} - }, - // 调起微信扫码 - saoma() { - let that = this - wx.scanQRCode({ - needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, - scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有 - success: function (res) { - that.getOrderByCode(res.resultStr.split('?')[1].split('=')[1]) - }, - fail: function (error) { - console.log(error) - } - }); - - }, }, } @@ -413,6 +339,7 @@ font-weight: 500; font-size: 28rpx; color: #000000; + margin-bottom: 30rpx; &>view{ margin-bottom: 26rpx; } @@ -434,44 +361,11 @@ .hexiao-btn{ margin: 0; margin-left: auto; - } - } - - .pop-order-detail{ - width: 640rpx; - height: 800rpx; - background: #FFFFFF; - border-radius: 13rpx; - display: flex; - flex-direction: column; - overflow: hidden; - .pop-order-content{ - overflow-x: hidden; - overflow-y: auto; - &>view{ - margin-bottom: 12rpx; - } - } - .bottom-btn{ - display: flex; - width: 100%; - padding: 20rpx 0 0; - align-items: center; - justify-content: space-between; - margin: 0; - } - .hexiao-btn{ - width: 160rpx; - height: 60rpx; - background: #96684F; - border-radius: 30rpx; + width: 200rpx; + height: 66rpx; + line-height: 66rpx; font-weight: 500; - font-size: 24rpx; - color: #FFFFFF; - line-height: 60rpx; - text-align: center; - display: block; + font-size: 28rpx; } - } \ No newline at end of file diff --git a/static/js/request.js b/static/js/request.js index 63b8bd9..3f8efda 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -1,7 +1,7 @@ import Vue from 'vue' import store from '@/store' -let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010' +let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'https://guide.sz-trip.com' : 'https://guide.sz-trip.com' Vue.prototype.NEWAPIURL = NEWAPIURL // #ifdef H5 NEWAPIURL = '/api' @@ -10,7 +10,7 @@ Vue.prototype.NEWAPIURL = NEWAPIURL Vue.prototype.Post = (params, apiurl) => { if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.merchants_token = JSON.parse(uni.getStorageSync('userInfo')).token else if (store.state.user.userInfo.token) params.merchants_token = store.state.user.userInfo.token - params.merchants_token = "f6339f83-a62a-4030-81d3-34429c7d4c95" + // params.merchants_token = "f6339f83-a62a-4030-81d3-34429c7d4c95" return new Promise((resolve, reject) => { uni.showLoading({ title: '加载中' diff --git a/subPackages/user/infoFilling.vue b/subPackages/user/infoFilling.vue index 6218a24..5dd88c1 100644 --- a/subPackages/user/infoFilling.vue +++ b/subPackages/user/infoFilling.vue @@ -327,16 +327,15 @@ // } // console.log(this.fileList) const tempFilePaths = res.tempFilePaths; + const uploadTask = uni.uploadFile({ url: url, filePath: tempFilePaths[0], name: 'file', - header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'}, success: (uploadFileRes) => { try { let res = JSON.parse(uploadFileRes.data) if (res.code == 1) { - // _this.fileList.push(res.data.fullurl) _this.fileList.push(res.data.url) } } catch(e) {} @@ -377,7 +376,6 @@ url: url, filePath: tempFilePath, name: 'file', - header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'}, success: (uploadFileRes) => { uni.hideLoading() try { diff --git a/subPackages/user/register.vue b/subPackages/user/register.vue index 3839ed8..2903ef9 100644 --- a/subPackages/user/register.vue +++ b/subPackages/user/register.vue @@ -196,12 +196,11 @@ url: url, filePath: tempFilePaths[0], name: 'file', - header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'}, success: (uploadFileRes) => { try { let res = JSON.parse(uploadFileRes.data) if (res.code == 1) { - _this.info.avatar = res.data.fullurl + _this.info.avatar = res.data.url } } catch(e) {} diff --git a/subPackages/user/userInfo.vue b/subPackages/user/userInfo.vue index 8f38c88..e9701e7 100644 --- a/subPackages/user/userInfo.vue +++ b/subPackages/user/userInfo.vue @@ -206,12 +206,11 @@ url: url, filePath: tempFilePaths[0], name: 'file', - header: {"token": '7e4bd097-8298-4cbe-8c75-535874a5c0e0'}, success: (uploadFileRes) => { try { let res = JSON.parse(uploadFileRes.data) if (res.code == 1) { - _this.info.avatar = res.data.fullurl + _this.info.avatar = res.data.url } } catch(e) {}