diff --git a/api/oli-user.js b/api/oli-user.js index 944f54d..d23b972 100644 --- a/api/oli-user.js +++ b/api/oli-user.js @@ -94,4 +94,11 @@ export default{ method: 'GET' }) }, + // 查询企业配置 + getCompanyConfigByCompanyId(id) { + return request({ + url: `/${service_name}/sysCompanyConfig/getCompanyConfigByCompanyId/${id}`, + method: 'GET' + }) + }, } \ No newline at end of file diff --git a/api/packageIntegral/orderList.js b/api/packageIntegral/orderList.js new file mode 100644 index 0000000..5967824 --- /dev/null +++ b/api/packageIntegral/orderList.js @@ -0,0 +1,24 @@ +import request from '@/utils/request' + +export default{ + getByPageCloudMini(data) { + return request({ + url: `/oil-mall/mallOrderInfo/getByPageCloudMini`, + method: 'post', + data + }) + }, + get(id) { + return request({ + url: `/oil-mall/mallOrderInfo/get/${id}`, + method: 'get', + }) + }, + takeOrder(data) { + return request({ + url: `/oil-mall/mallOrderInfo/takeOrder`, + method: 'post', + data + }) + }, +} \ No newline at end of file diff --git a/packageIntegral/components/mulpicker.vue b/packageIntegral/components/mulpicker.vue new file mode 100644 index 0000000..eb1b465 --- /dev/null +++ b/packageIntegral/components/mulpicker.vue @@ -0,0 +1,172 @@ + + + + + \ No newline at end of file diff --git a/packageIntegral/orderDetails/index.vue b/packageIntegral/orderDetails/index.vue new file mode 100644 index 0000000..eeec860 --- /dev/null +++ b/packageIntegral/orderDetails/index.vue @@ -0,0 +1,336 @@ + + + + + diff --git a/packageIntegral/orderList/index.vue b/packageIntegral/orderList/index.vue new file mode 100644 index 0000000..a13f107 --- /dev/null +++ b/packageIntegral/orderList/index.vue @@ -0,0 +1,279 @@ + + + + + diff --git a/packageIntegral/productAddition/index.vue b/packageIntegral/productAddition/index.vue new file mode 100644 index 0000000..04a0c16 --- /dev/null +++ b/packageIntegral/productAddition/index.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/packageIntegral/productAddition/productAddStep2.vue b/packageIntegral/productAddition/productAddStep2.vue new file mode 100644 index 0000000..fa962aa --- /dev/null +++ b/packageIntegral/productAddition/productAddStep2.vue @@ -0,0 +1,55 @@ + + + + + \ No newline at end of file diff --git a/packageIntegral/productList/index.vue b/packageIntegral/productList/index.vue new file mode 100644 index 0000000..54e62db --- /dev/null +++ b/packageIntegral/productList/index.vue @@ -0,0 +1,529 @@ + + + + + diff --git a/packageIntegral/takeGoods/index.vue b/packageIntegral/takeGoods/index.vue new file mode 100644 index 0000000..1fd931f --- /dev/null +++ b/packageIntegral/takeGoods/index.vue @@ -0,0 +1,357 @@ + + + + + diff --git a/pages.json b/pages.json index cd74b1b..cf9ca96 100644 --- a/pages.json +++ b/pages.json @@ -87,6 +87,25 @@ } ], "subPackages": [{ + "root": "packageIntegral", + "pages": [{ + "path": "takeGoods/index", + "style": {} + },{ + "path": "orderDetails/index", + "style": {} + },{ + "path": "orderList/index", + "style": {} + },{ + "path": "productList/index", + "style": {} + },{ + "path": "productAddition/index", + "style": {} + }] + }, + { "root": "packageOrders", "pages": [{ "path": "pages/orderList/OrderDetail/OrderDetail", diff --git a/pages/home/home.vue b/pages/home/home.vue index 9147611..fd18300 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -421,6 +421,30 @@ obj.color = 'blue', obj.badge = 0 obj.name = list.roleName + } else if (list.roleName == '订单提货') { + obj.cuIcon = 'punch', + obj.path = '/packageIntegral/takeGoods/index', + obj.color = 'blue', + obj.badge = 0 + obj.name = list.roleName + } else if (list.roleName == '商城订单') { + obj.cuIcon = 'punch', + obj.path = '/packageIntegral/orderList/index', + obj.color = 'blue', + obj.badge = 0 + obj.name = list.roleName + }else if (list.roleName == '商品列表') { + obj.cuIcon = 'punch', + obj.path = '/packageIntegral/productList/index', + obj.color = 'blue', + obj.badge = 0 + obj.name = list.roleName + }else if (list.roleName == '新增商品') { + obj.cuIcon = 'punch', + obj.path = '/packageIntegral/productAddition/index', + obj.color = 'blue', + obj.badge = 0 + obj.name = list.roleName } return obj }, diff --git a/pages/index/index.vue b/pages/index/index.vue index a0aca94..72499a2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -173,65 +173,65 @@ }) }, - Splicing(list) { - let obj = { - cuIcon: '', - path: '', - color: '', - badge: 0, - name: '' - } - if (list.roleName == '扫码加油') { - obj.cuIcon = 'scan', - obj.path = '/pages/station-info/scan-camera/scan-camera', - obj.color = 'olive', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '经营分析') { - obj.cuIcon = 'new', - obj.path = '', - obj.color = 'orange', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '加油订单') { - obj.cuIcon = 'form', - obj.path = '/packageOrders/pages/orderList/orderList', - obj.color = 'yellow', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '油站二维码') { - obj.cuIcon = 'qr_code', - obj.path = '/packageQr/pages/qrsite/QrCode_xy', - obj.color = 'cyan', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '员工管理') { - obj.cuIcon = 'expressman', - obj.path = '/packageStaff/pages/staff/List/List', - obj.color = 'mauve', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '油站信息') { - obj.cuIcon = 'punch', - obj.path = '/packageQr/pages/partnership/partnership', - obj.color = 'blue', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '交易统计') { - obj.cuIcon = 'punch', - obj.path = '/pages/TransactionStatistics/TransactionStatistics', - obj.color = 'blue', - obj.badge = 0, - obj.name = list.roleName - } else if (list.roleName == '星油云站超级管理员') { - obj.cuIcon = 'punch', - obj.path = ' ', - obj.color = 'blue', - obj.badge = 0, - obj.name = list.roleName - } - return obj - }, + // Splicing(list) { + // let obj = { + // cuIcon: '', + // path: '', + // color: '', + // badge: 0, + // name: '' + // } + // if (list.roleName == '扫码加油') { + // obj.cuIcon = 'scan', + // obj.path = '/pages/station-info/scan-camera/scan-camera', + // obj.color = 'olive', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '经营分析') { + // obj.cuIcon = 'new', + // obj.path = '', + // obj.color = 'orange', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '加油订单') { + // obj.cuIcon = 'form', + // obj.path = '/packageOrders/pages/orderList/orderList', + // obj.color = 'yellow', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '油站二维码') { + // obj.cuIcon = 'qr_code', + // obj.path = '/packageQr/pages/qrsite/QrCode_xy', + // obj.color = 'cyan', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '员工管理') { + // obj.cuIcon = 'expressman', + // obj.path = '/packageStaff/pages/staff/List/List', + // obj.color = 'mauve', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '油站信息') { + // obj.cuIcon = 'punch', + // obj.path = '/packageQr/pages/partnership/partnership', + // obj.color = 'blue', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '交易统计') { + // obj.cuIcon = 'punch', + // obj.path = '/pages/TransactionStatistics/TransactionStatistics', + // obj.color = 'blue', + // obj.badge = 0, + // obj.name = list.roleName + // } else if (list.roleName == '星油云站超级管理员') { + // obj.cuIcon = 'punch', + // obj.path = ' ', + // obj.color = 'blue', + // obj.badge = 0, + // obj.name = list.roleName + // } + // return obj + // }, // getSiteInfo() { // //获取油站基本资料 // oliSiteApi.getSiteDetail(this.channelId) diff --git a/pages/stationDetail/ZYSite.vue b/pages/stationDetail/ZYSite.vue index 7f8eda6..37817fa 100644 --- a/pages/stationDetail/ZYSite.vue +++ b/pages/stationDetail/ZYSite.vue @@ -21,7 +21,7 @@ - @@ -186,7 +199,7 @@ - + --> @@ -310,6 +323,39 @@ + + + + + + + + + + + + + + + + 识别失败! + + + + + + + + + + + + + + + + @@ -320,6 +366,7 @@ import g7Api from '@/api/g7.js' import utils from '@/utils/encode' import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue' + import user from '@/api/oli-user.js' export default { components: { PlateNumberPicker @@ -386,10 +433,14 @@ type: '', curIndex: null, InputNumber: 0, + plateNumberOcr:'', + plateNumberOcrShow:false, + showPlicePhoto:'', + plateNumberImages:'' } }, onLoad(option) { - console.log(option) //接收option.type + console.log(option) //接收option.type if (option.user == 'kl') { let code = uni.getStorageSync('qrCode'), orderId = code.slice(0, -3) @@ -399,18 +450,18 @@ console.log(this.qrCode) } // if(option.type =='RIRISHUN'){ - // console.log('这里是日日顺') + // console.log('这里是日日顺') this.type = option.type //根据option.type 进行本地赋值 // }if(option.type =='zeyi'){ - // console.log('这里是日日顺') + // console.log('这里是日日顺') // this.type = 'zeyi' //根据option.type 进行本地赋值 // } // if(option.type =='shunfeng'){ - // console.log('这里是顺丰') + // console.log('这里是顺丰') // this.type = 'shunfeng' //根据option.type 进行本地赋值 // } // if(option.type =='fykc'){ - // console.log('这里是福佑') + // console.log('这里是福佑') // this.type = 'fykc' //根据option.type 进行本地赋值 // } if (this.qrCode) { @@ -427,6 +478,7 @@ this.timer = null; } }, + watch: { oilTypeList: { handler(newVal, oldVal) { @@ -477,7 +529,87 @@ }, methods: { - hz(e) { + manualInput(){ + this.showPlicePhoto='' + this.$refs.inputDialog.open() + }, + inputClose(){ + this.$refs.inputDialog.close() + }, + inputConfirm(val){ + if(val){ + this.plateNumberOcr = val + this.$refs.inputDialog.close() + }else{ + uni.showToast({ + title: '请输入车牌号', + icon: 'none' + }) + } + + }, + getCompanyConfig(companyId){ + if(companyId){ + user.getCompanyConfigByCompanyId(companyId).then(res=>{ + console.log(res,'res') + if(res.data.plateNumberOcr==1){ + this.plateNumberOcrShow = true + }else{ + this.plateNumberOcrShow = false + } + + }) + } + }, + srcPhoto(){ + this.showPlicePhoto='' + let _that = this + uni.chooseImage({ + count: 1, //默认9 + sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ['camera'], // 只能拍照 + success: function(res) { + uni.showLoading({ + title: '识别中', + mask: true + }); + + const JSESSIONID = utils.uuid() + uni.uploadFile({ + url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/carNoIdentify', + filePath: res.tempFilePaths[0], + name: 'file', + header: { + "Content-Type": "multipart/form-data", + "Authorization": uni.getStorageSync('Authorization'), + 'dataSources': 'MP', + "imei": uni.getStorageSync('unionid'), + "openId": uni.getStorageSync('openid'), + 'JSESSIONID': JSESSIONID, + 'token': utils.md5Salt(JSESSIONID) + }, + success(e) { + uni.hideLoading() + console.log(e) + let obj = JSON.parse(e.data) + if(obj.data&&obj.data.carNo){ + _that.plateNumberOcr = obj.data.carNo + _that.plateNumberImages = obj.data.imgUrl + }else{ + _that.plateNumberOcr = '' + _that.showPlicePhoto = 'show' + } + },fail(res){ + uni.hideLoading() + _that.showPlicePhoto = 'show' + } + }) + + + } + }) + }, + hz(e){ // carNumber.length>0 // console.log(new RegExp("[\u4E00-\u9FA5]+").test(e),'*-*-*-*-*-*') return new RegExp("[\u4E00-\u9FA5]+").test(e) @@ -1077,7 +1209,41 @@ xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } } else { - var data6 = { + if(this.plateNumberOcrShow == true){ + if(!this.plateNumberOcr){ + uni.showToast({ + icon: 'none', + title: '请上传车牌照片' + }) + return + } + var data6 = { + siteId: this.siteData.siteId, + priceId: this.insertResult.priceId, + customerOrderId: this.siteData.customerOrderId, + volume: this.insertResult.vol, + plateNumberImage: this.PlateNumberImages, + engineImage: this.refuellerImages, + createSource: "WECHAT_MINIAPPS", //类型:String 必有字段 备注:创建来源 + orderSource: "WECHAT_MINIAPPS", + vehicleLicenseNum: this.plateNumberOcr, + plateNumberImages: this.plateNumberImages, // 车牌照片地址 + customerId: this.siteData.customerId, //类型:String 必有字段 备注:司机id + companyId: this.siteData.companyId, //类型:String 必有字段 备注:企业id + oilsBar: this.insertResult.bar, + oilsCode: this.insertResult.oilProductCode, + orderMethod: "SITE_SCAN", //类型:String 必有字段 备注:订单产生方式 + suppleMark: 0, + orderType: "REAL_ORDER", //类型:String 必有字段 备注:订单类型 ( REAL_ORDER:真实订单 VIRTUAL_ORDER:虚拟订单) + payChannel: "BALANCE_PAYMENT", //类型:String 必有字段 备注:支付渠道 + oilCardType: this.siteData.oilCardNature, //类型:String 必有字段 备注:油卡性质 1:个人 2:企业 3:外请 + accountCardCode: this.siteData.accountCardCode, //类型:String 必有字段 备注:油卡卡号 + siteUserName: "1", //类型:String 必有字段 备注:加油员名称 + version: this.siteData.siteType=='2'?null:"1", //类型:Number 必有字段 备注:版本号 + xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 + } + }else{ + var data6 = { siteId: this.siteData.siteId, priceId: this.insertResult.priceId, customerOrderId: this.siteData.customerOrderId, @@ -1101,6 +1267,8 @@ version: this.siteData.siteType == '2' ? null : "1", //类型:Number 必有字段 备注:版本号 xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } + } + } if (!data6.oilsCode) { @@ -1150,7 +1318,7 @@ // title:'请授权位置', // icon:'error' // }) - // } + // } // console.log(location,'**************************************************') // return // } @@ -1182,7 +1350,7 @@ // }, // }); // return - // + // console.log(data6, 'data6+++++') oliSiteApi.xoilPay(Object.assign(data6, { longitude: location.longitude, @@ -1389,7 +1557,7 @@ } else if (res.data.plateNumbers) { this.carNumber = res.data.plateNumbers[0] } - + this.getCompanyConfig(res.data.companyId) } else { uni.showToast({ title: res.msg ? res.msg : '请确认是否油站二维码', diff --git a/uni_modules/xt-verify-code/changelog.md b/uni_modules/xt-verify-code/changelog.md new file mode 100644 index 0000000..99a0317 --- /dev/null +++ b/uni_modules/xt-verify-code/changelog.md @@ -0,0 +1,46 @@ +## 1.3.1(2023-06-08) +- 修改验证码过小 出现两个光标的问题 +## 1.3.0(2023-05-20) +- 增加自定义输入文字的颜色 +## 1.2.6(2023-05-17) +- 光标增加层级 +## 1.2.5(2023-05-14) +- 处理多次触犯confirm 问题 +## 1.2.4(2023-05-07) +- 兼容vue3 h5打包后运行找到createSelectorQuery 函数的问题 +## 1.2.3(2023-04-25) +- 双向绑定v-model 写法兼容性 +## 1.2.2(2023-03-31) +- 抽离公共代码,部分优化 +## 1.2.1(2023-03-19) +- 处理vue2情况下,出现引入vue3api bug +## 1.2.0(2023-03-19) +- 增加vue3 环境 +## 1.1.6(2023-01-01) +- scss样式修改成css +- size 去除 数量限制,限制只能输入正整数 +## 1.1.5(2022-12-08) +- 修复支付宝小程序,因input组件遮蔽的问题。显示样式不一致问题 +## 1.1.4(2022-12-02) +- 修复密码形式ios手机失去焦点后再聚焦,不能删除的问题 +## 1.1.3(2022-12-02) +- 撤销对ios手机的特殊处理 +## 1.1.2(2022-11-13) +- 处理ios问题,添加ios机型判断 +## 1.1.1(2022-10-11) +- 优化对ios的input组件bug的处理 +## 1.1.0(2022-10-11) +- 修复ios环境下input组件,失去焦点后再次输入会自动清空bug +## 1.0.4(2021-12-27) +## 修改文档 +## 1.0.3(2021-10-18) +修改说明文档 +## 1.0.2(2021-10-18) +修改size 传入值,可以传入1~6 的值 + +## 1.0.1(2021-09-02) +- type 属性参数修改 box、middle、bottom 三种 +- 新增middle模式 +## 1.0.0(2021-08-31) +- 验证码输入 +- 提供两种显示模式 diff --git a/uni_modules/xt-verify-code/components/xt-verify-code/config.js b/uni_modules/xt-verify-code/components/xt-verify-code/config.js new file mode 100644 index 0000000..fbd5e1f --- /dev/null +++ b/uni_modules/xt-verify-code/components/xt-verify-code/config.js @@ -0,0 +1,51 @@ +export const propsMap = { + // #ifdef VUE2 + value: { + type: String, + default: () => '' + }, + // #endif + + // #ifdef VUE3 + modelValue: { + type: String, + default: () => '' + }, + // #endif + type: { + type: String, + default: () => 'box' + }, + inputType: { + type: String, + default: () => 'number' + }, + size: { + type: Number, + default: () => 6 + }, + isFocus: { + type: Boolean, + default: () => true + }, + isPassword: { + type: Boolean, + default: () => false + }, + cursorColor: { + type: String, + default: () => '#cccccc' + }, + boxNormalColor: { + type: String, + default: () => '#cccccc' + }, + boxActiveColor: { + type: String, + default: () => '#000000' + }, + color: { + type: String, + default: () => '#333333' + } +} \ No newline at end of file diff --git a/uni_modules/xt-verify-code/components/xt-verify-code/util.js b/uni_modules/xt-verify-code/components/xt-verify-code/util.js new file mode 100644 index 0000000..e73d1ad --- /dev/null +++ b/uni_modules/xt-verify-code/components/xt-verify-code/util.js @@ -0,0 +1,35 @@ +/** + * @description 获取元素节点 - 大小等信息 + * @param {string} elm - 节点的id、class 相当于 document.querySelect的参数 -eg: #id + * @param {string} type = [single|array] - 单个元素获取多个元素 默认是单个元素 + * @param {Function} callback - 回调函数 + * @param {object} that - 上下文环境 vue2:this ,vue3: getCurrentInstance(); + */ +export const getElementRect = (that) => (elm, type = 'single', callback) => { + + // #ifndef H5 + uni + .createSelectorQuery() + .in(that)[type === 'array' ? 'selectAll' : 'select'](elm) + .boundingClientRect() + .exec(data => { + callback(data[0]); + }); + // #endif + + // #ifdef H5 + let elmArr = []; + const result = []; + if (type === 'array') { + elmArr = document.querySelectorAll(elm); + } else { + elmArr.push(document.querySelector(elm)); + } + + for (let elm of elmArr) { + result.push(elm.getBoundingClientRect()); + } + console.log('result', result) + callback(type === 'array' ? result : result[0]); + // #endif +} \ No newline at end of file diff --git a/uni_modules/xt-verify-code/components/xt-verify-code/xt-verify-code.vue b/uni_modules/xt-verify-code/components/xt-verify-code/xt-verify-code.vue new file mode 100644 index 0000000..7559358 --- /dev/null +++ b/uni_modules/xt-verify-code/components/xt-verify-code/xt-verify-code.vue @@ -0,0 +1,408 @@ + + + + + + + + + + + diff --git a/uni_modules/xt-verify-code/package.json b/uni_modules/xt-verify-code/package.json new file mode 100644 index 0000000..856a562 --- /dev/null +++ b/uni_modules/xt-verify-code/package.json @@ -0,0 +1,79 @@ +{ + "id": "xt-verify-code", + "displayName": "xt-verify-code验证码输入", + "version": "1.3.1", + "description": "xt-verify-code验证码输入组件,提供三种显示模式", + "keywords": [ + "xt-verify-code", + "verify", + "验证码" + ], + "repository": "https://github.com/xiaodaweb/xt-ui/tree/main/uni_modules/xt-verify-code", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "1010161292" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "y", + "联盟": "y" + } + } + } + } +} diff --git a/uni_modules/xt-verify-code/readme.md b/uni_modules/xt-verify-code/readme.md new file mode 100644 index 0000000..f347b56 --- /dev/null +++ b/uni_modules/xt-verify-code/readme.md @@ -0,0 +1,20 @@ +# 验证码输入框 +## 使用方法 +```vue + +``` + +## 参数 +|属性 |类型 |说明 |默认值 | +|-- |-- |-- |-- | +|value(v-model) |string |值(可双向绑定) |'' | +|type |string |验证输入框类型可选值: box、middle、bottom |box | +|inputType |string |输入类型 可选值:text、number |number | +|size |number |验证码框数量 |6 | +|isFocus |boolean|是否一开始聚焦 |true | +|isPassword |boolean|是否使用密码方式显示 |false | +|cursorColor |string |光标颜色 |#cccccc| +|boxNormalColor |string |显示框未选中的颜色 |#cccccc| +|boxActiveColor |string |显示框选中的颜色如果type='middle' 则是线的默认样式 |#000000| +|color |string |输入文字的颜色 |#333333| +|@confirm |event |输入完成的回调事件 {(code)=>{}} | | \ No newline at end of file