success() { | success() { | ||||
console.log("扫描蓝牙中"); | console.log("扫描蓝牙中"); | ||||
tools.showLoadingAlert("扫描蓝牙中"); | tools.showLoadingAlert("扫描蓝牙中"); | ||||
console.log("11111111") | |||||
openBluetooth(); | openBluetooth(); | ||||
}, | }, | ||||
fail() { | fail() { | ||||
success(authData) { | success(authData) { | ||||
if (authData.authSetting["scope.bluetooth"] == true) { | if (authData.authSetting["scope.bluetooth"] == true) { | ||||
tools.showLoadingAlert("扫描蓝牙中"); | tools.showLoadingAlert("扫描蓝牙中"); | ||||
console.log("2222222") | |||||
openBluetooth(); | openBluetooth(); | ||||
} else { | } else { | ||||
uni.closeBluetoothAdapter(); | uni.closeBluetoothAdapter(); | ||||
* 打开蓝牙 | * 打开蓝牙 | ||||
*/ | */ | ||||
const openBluetooth = () => { | const openBluetooth = () => { | ||||
console.log("进来了") | |||||
let foundDevices = []; //扫描到的蓝牙列表 | let foundDevices = []; //扫描到的蓝牙列表 | ||||
uni.closeBluetoothAdapter(); //先关闭蓝牙 | uni.closeBluetoothAdapter(); //先关闭蓝牙 | ||||
//打开蓝牙 | //打开蓝牙 | ||||
device.deviceId = deviceId; | device.deviceId = deviceId; | ||||
device.prefixName = prefixName; | device.prefixName = prefixName; | ||||
device.selected = false; //防止重复点击 | device.selected = false; //防止重复点击 | ||||
console.log("device._prefixName", prefixName) | |||||
let _name = ""; | let _name = ""; | ||||
switch (prefixName) { | switch (prefixName) { | ||||
case "WJ": | case "WJ": | ||||
break; | break; | ||||
} | } | ||||
device._name = _name; | device._name = _name; | ||||
console.log("device._name11111", device._name) | |||||
if (deviceList.value.length == 0) { | if (deviceList.value.length == 0) { | ||||
// #ifdef MP-ALIPAY | |||||
if (device._name == '聚利' || device._name == '万集' || device._name == '天地融') { | |||||
foundDevices.push(device); | |||||
console.log("device._name", device._name) | |||||
} | |||||
// #endif | |||||
// #ifdef MP-WEIXIN | |||||
foundDevices.push(device); | foundDevices.push(device); | ||||
// #endif | |||||
} else { | } else { | ||||
let isHave = false; | let isHave = false; | ||||
for (let j = 0; j < foundDevices.length; j++) { | for (let j = 0; j < foundDevices.length; j++) { | ||||
foundDevices.push(device); | foundDevices.push(device); | ||||
} | } | ||||
} | } | ||||
deviceList.value = foundDevices; | |||||
console.log("deviceList.value", foundDevices) | |||||
// deviceList.value = foundDevices; | |||||
foundDevices = []; | foundDevices = []; | ||||
// console.log(foundDevices); | // console.log(foundDevices); | ||||
} | } | ||||
console.info("停止扫描蓝牙"); | console.info("停止扫描蓝牙"); | ||||
uni.stopBluetoothDevicesDiscovery({ | uni.stopBluetoothDevicesDiscovery({ | ||||
success: function (res) { | success: function (res) { | ||||
console.log(device,item); | |||||
console.log(device, item); | |||||
if (item.selected == false) { | if (item.selected == false) { | ||||
console.log("第一次点击了"); | console.log("第一次点击了"); | ||||
item.selected = true; | item.selected = true; | ||||
// delete device._name | // delete device._name | ||||
console.log(item); | console.log(item); | ||||
datas.setData("deviceId", device,device.deviceId); | |||||
datas.setData("deviceId", device, device.deviceId); | |||||
tools.showLoadingAlert("蓝牙连接中"); | tools.showLoadingAlert("蓝牙连接中"); | ||||
console.info("连接的是" + prefixName); | console.info("连接的是" + prefixName); | ||||
switch (prefixName) { | switch (prefixName) { |
<view v-if="item.mode === 'custom'" :class="item[item.value] ? 'text' : 'text-hint'" | <view v-if="item.mode === 'custom'" :class="item[item.value] ? 'text' : 'text-hint'" | ||||
style="flex: 1" @click="emit('pickerCustom', item)"> | style="flex: 1" @click="emit('pickerCustom', item)"> | ||||
{{ | {{ | ||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
</view> | </view> | ||||
<template v-else-if="item.mode === 'search'"> | |||||
<template v-else-if="item.mode === 'search' && state.sysType == 'WECHAT'"> | |||||
<view :disabled="item.disabled" :class="item[item.value] ? 'text' : 'text-hint'" | <view :disabled="item.disabled" :class="item[item.value] ? 'text' : 'text-hint'" | ||||
style="flex: 1" @click="item.searchPickerVisible = true"> | style="flex: 1" @click="item.searchPickerVisible = true"> | ||||
{{ | {{ | ||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
</view> | </view> | ||||
<search-picker :visible="item.searchPickerVisible" :dataSource="item.itemData" | <search-picker :visible="item.searchPickerVisible" :dataSource="item.itemData" | ||||
v-model="item[item.value]" | v-model="item[item.value]" | ||||
@hidePicker="item.searchPickerVisible = false"></search-picker> | @hidePicker="item.searchPickerVisible = false"></search-picker> | ||||
</template> | </template> | ||||
<picker v-else :disabled="item.disabled" :range-key="item.itemKey" | |||||
:mode="item.mode ? item.mode : 'selector'" @change="bindPickerChange($event, item)" | |||||
:range="item.itemData" style="flex: 1"> | |||||
<picker v-else mode="selector" :range="item.itemData" | |||||
@change="bindPickerChange($event, item)"> | |||||
<view :class="item[item.value] ? 'text' : 'text-hint'"> | <view :class="item[item.value] ? 'text' : 'text-hint'"> | ||||
{{ | {{ | ||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
</view> | </view> | ||||
</picker> | </picker> | ||||
placeholder-class="text-hint" style="width: 100%" :maxlength="item.maxlength" | placeholder-class="text-hint" style="width: 100%" :maxlength="item.maxlength" | ||||
:placeholder="item.hint ? item.hint : '请输入' + item.title"> | :placeholder="item.hint ? item.hint : '请输入' + item.title"> | ||||
</textarea> | </textarea> | ||||
<!-- <view v-if="item.maxlength" class="as-gravity-center-end" | |||||
style="display: flex;flex-direction: row;margin-top:120rpx;"> | |||||
<view class="text-hint">{{!item.num ? '0' : item.num}}</view> | |||||
<view class="text-hint">/{{item.maxlength ? item.maxlength : 100}}</view> | |||||
</view> --> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 省市区选择 --> | <!-- 省市区选择 --> | ||||
<view v-if="item.type === 10" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'"> | <view v-if="item.type === 10" style="width: 100%" :class="item.bg ? 'bg' : 'notbg'"> | ||||
<view class="as-layout-horizontal" style="align-items: center"> | <view class="as-layout-horizontal" style="align-items: center"> | ||||
<!-- <pick-regions :defaultRegionCode="defaultRegionCode" | |||||
@getRegion="handleGetRegion($event, item)" style="flex: 1"> | |||||
<view :class="item[item.value] ? 'text' : 'text-hint'"> | |||||
{{ | |||||
item[item.value] | |||||
? item.itemKey | |||||
? item[item.value][item.itemKey] | |||||
: item[item.value] | |||||
: item.hint | |||||
? item.hint | |||||
: "请选择" + item.title | |||||
}} | |||||
</view> | |||||
</pick-regions> --> | |||||
<picker mode="region" @change="handleGetRegion($event, item)" :value="item.region"> | <picker mode="region" @change="handleGetRegion($event, item)" :value="item.region"> | ||||
<view class="uni-input"> | <view class="uni-input"> | ||||
{{item.region?item.region[0]+item.region[1]+item.region[2]:""}} | {{item.region?item.region[0]+item.region[1]+item.region[2]:""}} | ||||
</view> | </view> | ||||
</picker> | </picker> | ||||
<image class="arror" :src="`${$imgUrl}common/arror-right.png`" mode="aspectFill"> | |||||
<image class="arror" v-if="state.sysType == 'WECHAT'" | |||||
:src="`${$imgUrl}common/arror-right.png`" mode="aspectFill"> | |||||
</image> | </image> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<submit-button :title="config ? config.submitName : '提交'" form-type="submit" | <submit-button :title="config ? config.submitName : '提交'" form-type="submit" | ||||
@submit="formSubmit"></submit-button> | @submit="formSubmit"></submit-button> | ||||
</view> | </view> | ||||
</form> | </form> | ||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { onLoad, onShow } from "@dcloudio/uni-app"; | |||||
import { TypeData, ImgData } from "./tools"; | import { TypeData, ImgData } from "./tools"; | ||||
import { request } from "@/utils/network/request.js"; | import { request } from "@/utils/network/request.js"; | ||||
import carNumBerInput from "@/components/car-number-input/car-number-input"; | import carNumBerInput from "@/components/car-number-input/car-number-input"; | ||||
import pickRegions from "@/login/pick-regions/pick-regions.vue"; | import pickRegions from "@/login/pick-regions/pick-regions.vue"; | ||||
import { onMounted, ref } from "vue"; | import { onMounted, ref } from "vue"; | ||||
import { reactive } from "vue"; | import { reactive } from "vue"; | ||||
onShow((option : any) => { | |||||
// #ifdef MP-ALIPAY | |||||
state.sysType = 'ALI'; | |||||
// #endif | |||||
// #ifdef MP-WEIXIN | |||||
state.sysType = 'WECHAT'; | |||||
// #endif | |||||
}); | |||||
const defaultRegionCode = "520115"; | const defaultRegionCode = "520115"; | ||||
const props = defineProps({ | const props = defineProps({ | ||||
formData: { | formData: { | ||||
}, | }, | ||||
}); | }); | ||||
const state = reactive({ | const state = reactive({ | ||||
multiIndex: [0, 0, 0] | |||||
multiIndex: [0, 0, 0], | |||||
sysType: "" | |||||
}) | }) | ||||
//defineEmits | //defineEmits | ||||
const emit = defineEmits<{ | const emit = defineEmits<{ | ||||
/* 普通选择器*/ | /* 普通选择器*/ | ||||
item[item.value] = item.itemData[select]; | item[item.value] = item.itemData[select]; | ||||
} | } | ||||
console.log("111111", item.mode, item[item.value]) | |||||
} | } | ||||
//输入框后按钮点击 | //输入框后按钮点击 | ||||
// 获取选择的地区 | // 获取选择的地区 | ||||
function handleGetRegion(e : any, item : TypeData) { | function handleGetRegion(e : any, item : TypeData) { | ||||
console.log("获取选择的地区", e) | |||||
// item[item.value] = e[0].name + "/" + e[1].name + "/" + e[2].name; | |||||
console.log("获取选择的地区", e, item) | |||||
item[item.value] = e.detail.value; | item[item.value] = e.detail.value; | ||||
emit("handleGetRegion", e, item); | emit("handleGetRegion", e, item); | ||||
console.log("获取选择的地区", item) | |||||
} | } | ||||
//多项选择器 | //多项选择器 |
let name = res.devices[i]["name"]; | let name = res.devices[i]["name"]; | ||||
let prefixName = ""; | let prefixName = ""; | ||||
let deviceId = res.devices[i]["deviceId"]; | let deviceId = res.devices[i]["deviceId"]; | ||||
console.log(res.devices[i]["name"]); | |||||
console.log("res.devices[i]", res.devices[i]["name"]); | |||||
if (name != "" && name != undefined && name != "undefined") { | if (name != "" && name != undefined && name != "undefined") { | ||||
if ( | if ( | ||||
name.indexOf("G-WJ") != -1 || | name.indexOf("G-WJ") != -1 || | ||||
device.deviceId = deviceId; | device.deviceId = deviceId; | ||||
device.prefixName = prefixName; | device.prefixName = prefixName; | ||||
device.selected = false; //防止重复点击 | device.selected = false; //防止重复点击 | ||||
console.log("device._prefixName", prefixName) | |||||
let _name = ""; | let _name = ""; | ||||
switch (prefixName) { | switch (prefixName) { | ||||
case "WJ": | case "WJ": | ||||
device._name = _name; | device._name = _name; | ||||
if (deviceList.value.length == 0) { | if (deviceList.value.length == 0) { | ||||
// #ifdef MP-ALIPAY | |||||
if (device._name == '聚利' || device._name == '万集' || device._name == '天地融') { | |||||
foundDevices.push(device); | |||||
console.log("device._name", device._name) | |||||
} | |||||
// #endif | |||||
// #ifdef MP-WEIXIN | |||||
foundDevices.push(device); | foundDevices.push(device); | ||||
// #endif | |||||
} else { | } else { | ||||
let isHave = false; | let isHave = false; | ||||
for (let j = 0; j < foundDevices.length; j++) { | for (let j = 0; j < foundDevices.length; j++) { | ||||
// //断开蓝牙 | // //断开蓝牙 | ||||
// bluetoothUtil.disconnectDevice(); | // bluetoothUtil.disconnectDevice(); | ||||
tools.showLoadingAlert("蓝牙连接中"); | tools.showLoadingAlert("蓝牙连接中"); | ||||
console.info("连接的是" + prefixName , device); | |||||
console.info("连接的是" + prefixName, device); | |||||
switch (prefixName) { | switch (prefixName) { | ||||
case "WJ": | case "WJ": | ||||
wjApi.connectDevice( | wjApi.connectDevice( | ||||
alertF(res.msg); | alertF(res.msg); | ||||
} | } | ||||
}; | }; | ||||
function oks(){ | |||||
function oks() { | |||||
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.信息重写 4.信息读取 5从哪里来回哪里去监听bluetoothLink | //routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.信息重写 4.信息读取 5从哪里来回哪里去监听bluetoothLink | ||||
if (routeType.value == "1") { | if (routeType.value == "1") { | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: `/pages/recharge/recharge?connectSuccess=1&&cardId=${state.cardId}&&fee=${state.fee}`, | url: `/pages/recharge/recharge?connectSuccess=1&&cardId=${state.cardId}&&fee=${state.fee}`, | ||||
}); | }); | ||||
} else if (routeType.value == "3") { | } else if (routeType.value == "3") { | ||||
} else if (routeType.value == "4") { | } else if (routeType.value == "4") { | ||||
uni.navigateTo({ | uni.navigateTo({ | ||||
url: "/subpackage/after-sale/deviceInfo/deviceInfo", | url: "/subpackage/after-sale/deviceInfo/deviceInfo", | ||||
tools.showToastAlert("蓝牙已断开"); | tools.showToastAlert("蓝牙已断开"); | ||||
// #ifdef MP-ALIPAY | // #ifdef MP-ALIPAY | ||||
my.closeBluetoothAdapter({ | my.closeBluetoothAdapter({ | ||||
success(res) { | |||||
// 关闭蓝牙适配器成功 | |||||
}, | |||||
fail(err) { | |||||
// 处理关闭蓝牙适配器失败的情况 | |||||
} | |||||
success(res) { | |||||
// 关闭蓝牙适配器成功 | |||||
}, | |||||
fail(err) { | |||||
// 处理关闭蓝牙适配器失败的情况 | |||||
} | |||||
}) | }) | ||||
// #endif | // #endif | ||||
} | } |
<!-- 按钮导航 --> | <!-- 按钮导航 --> | ||||
<view class="nav"> | <view class="nav"> | ||||
<view class="item-box" @click="$util.navTo('/pages/recharge/select-car',true)"> | |||||
<view class="item-box" @click="cardRecharge(1)"> | |||||
<view class="item item-1"> | <view class="item item-1"> | ||||
<image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill" /> | <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill" /> | ||||
</view> | </view> | ||||
<view class="text">储值卡充值</view> | <view class="text">储值卡充值</view> | ||||
</view> | </view> | ||||
<view class="item-box" @click="$util.navTo('/subpackage/personal-center/search/select-car',true)"> | |||||
<view class="item-box" @click="cardRecharge(2)"> | |||||
<view class="item item-2"> | <view class="item item-2"> | ||||
<image :src="fileURL + 'image/index/item-2.png'" mode="aspectFill" /> | <image :src="fileURL + 'image/index/item-2.png'" mode="aspectFill" /> | ||||
</view> | </view> | ||||
<view class="text">账单查询</view> | |||||
<view class="text">卡签信息查询</view> | |||||
</view> | </view> | ||||
<!-- <view class="item-box" @click="$util.navTo('/subpackage/orders/Invoice-mannager',true)"> | <!-- <view class="item-box" @click="$util.navTo('/subpackage/orders/Invoice-mannager',true)"> | ||||
<view class="item item-3"> | <view class="item item-3"> | ||||
<view class="text">设备遗失</view> | <view class="text">设备遗失</view> | ||||
</view> | </view> | ||||
<!-- <view class="item-box" @click="$util.navTo('/subpackage/after-sale/rescind-carId/rescind-carId-select',true)"> --> | <!-- <view class="item-box" @click="$util.navTo('/subpackage/after-sale/rescind-carId/rescind-carId-select',true)"> --> | ||||
<view class="item-box" | |||||
@click="$util.navTo('/subpackage/after-sale/rescind-carId/rescind-carId-select',true)"> | |||||
<view class="item-box" @click="cardRecharge(3)"> | |||||
<view class="item item-6"> | <view class="item item-6"> | ||||
<image :src="fileURL + 'image/index/item-6.png'" mode="aspectFill" /> | <image :src="fileURL + 'image/index/item-6.png'" mode="aspectFill" /> | ||||
</view> | </view> | ||||
} from "@/datas/fileURL.js"; | } from "@/datas/fileURL.js"; | ||||
import { | import { | ||||
navTo, | navTo, | ||||
confirm | |||||
confirm, | |||||
msg | |||||
} from "@/utils/utils"; | } from "@/utils/utils"; | ||||
import { | import { | ||||
getCodeName | getCodeName | ||||
url: `../order/order?index=${index}` | url: `../order/order?index=${index}` | ||||
}) | }) | ||||
} | } | ||||
const cardRecharge = (val) => { | |||||
// #ifdef MP-ALIPAY | |||||
msg("业务升级中,请前往九州ETC公众号进行办理。或拨打客服电话400-800-8787") | |||||
// #endif | |||||
// #ifdef MP-WEIXIN | |||||
if (val == 1) { | |||||
navTo('/pages/recharge/select-car', true) | |||||
} else if (val == 2) { | |||||
navTo('/subpackage/personal-center/search/select-car', true) | |||||
} else if (val == 3) { | |||||
navTo('/subpackage/after-sale/rescind-carId/rescind-carId-select', true) | |||||
} | |||||
// #endif | |||||
} | |||||
</script> | </script> | ||||
<style> | <style> |
</view> | </view> | ||||
<view class="btn-unbind" @click="del(item.vehicleId)">解除绑定</view> | <view class="btn-unbind" @click="del(item.vehicleId)">解除绑定</view> | ||||
</view> | </view> | ||||
<view> | |||||
<view class="loading-more" v-if="state.carNumber>5" | |||||
@click="$util.navTo('/subpackage/personal-center/vehicle-information', true)">加载更多~</view> | |||||
</view> | |||||
<view class="sub-bind"> | <view class="sub-bind"> | ||||
<view class="item-tit"> | <view class="item-tit"> | ||||
<image :src="`${$imgUrl}user/icon-car-3.png`" class="icon icon-2"></image> | <image :src="`${$imgUrl}user/icon-car-3.png`" class="icon icon-2"></image> | ||||
} | } | ||||
} | } | ||||
} | } | ||||
state.list = data; | |||||
state.carNumber = data.length | state.carNumber = data.length | ||||
state.list = data.slice(0, 5); | |||||
console.log("state.list", state.list) | console.log("state.list", state.list) | ||||
}) | }) | ||||
.catch((err) => { | .catch((err) => { | ||||
margin-left: 20rpx; | margin-left: 20rpx; | ||||
font-size: 24rpx; | font-size: 24rpx; | ||||
} | } | ||||
.loading-more { | |||||
text-align: center; | |||||
font-size: 28rpx; | |||||
margin-bottom: 20rpx; | |||||
color: #999; | |||||
} | |||||
</style> | </style> |
<u-form-item prop="code"> | <u-form-item prop="code"> | ||||
<view class="from_item"> | <view class="from_item"> | ||||
<text><text style="color: red"></text>验证码:</text> | <text><text style="color: red"></text>验证码:</text> | ||||
<u-input v-model="form.code" placeholder="请输入验证码" class="input" /> | |||||
<u-input v-model="form.code" placeholder="请输入验证码" class="input" type="number" /> | |||||
<view class="hint2"> | <view class="hint2"> | ||||
<view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view> | <view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view> | ||||
<view class="grey" @click="getCode">{{ | <view class="grey" @click="getCode">{{ |
import { | import { | ||||
onLoad, onShow | onLoad, onShow | ||||
} from '@dcloudio/uni-app' | } from '@dcloudio/uni-app' | ||||
// import { | |||||
// getItem | |||||
// } from "../../utils/storage"; | |||||
import { | import { | ||||
request | request | ||||
} from "@/utils/network/request.js"; | } from "@/utils/network/request.js"; | ||||
// import { | |||||
// IntegerToHexString, | |||||
// AsciToHexString, | |||||
// } from "../../utils/util/fileData.js"; | |||||
import { | import { | ||||
stringToJson | stringToJson | ||||
} from "@/utils/network/encryption.js"; | } from "@/utils/network/encryption.js"; | ||||
.then(() => { | .then(() => { | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
state.showPopup = true; | state.showPopup = true; | ||||
// setTimeout(() => { | |||||
// uni.navigateBack({ | |||||
// delta: 1, | |||||
// }) | |||||
// }, 1000) | |||||
}); | }); | ||||
}; | }; |
}; | }; | ||||
request(outletList, options).then((res) => { | request(outletList, options).then((res) => { | ||||
state.outlets = stringToJson(res.bizContent); | state.outlets = stringToJson(res.bizContent); | ||||
let nameList = []; | let nameList = []; | ||||
state.outlets.map((item) => { | state.outlets.map((item) => { | ||||
nameList.push(item.name); | nameList.push(item.name); | ||||
state.formData[7].itemData = nameList; | state.formData[7].itemData = nameList; | ||||
state.formData[14].itemData = nameList; | state.formData[14].itemData = nameList; | ||||
console.log("获取退货网点", state.outlets, nameList) | |||||
}); | }); | ||||
}; | }; | ||||
} | } | ||||
console.log("全部数据", state.formData) | console.log("全部数据", state.formData) | ||||
}; | }; | ||||
const handleGetRegion = (e : any, item : any) => { | |||||
console.log("dizhi") | |||||
} | |||||
// const handleGetRegion = (e : any, item : any) => { | |||||
// console.log("dizhi") | |||||
// } | |||||
//地址改变 | //地址改变 | ||||
const addressInfo = (content : any) => { | const addressInfo = (content : any) => { | ||||
console.log("content", `${content.provinceName}${content.cityName}${content.countyName}`) | |||||
// #ifdef MP-ALIPAY | // #ifdef MP-ALIPAY | ||||
state.formData[9][state.formData[9].value] = content.fullname; | state.formData[9][state.formData[9].value] = content.fullname; | ||||
state.formData[10][state.formData[10].value] = content.mobilePhone; | state.formData[10][state.formData[10].value] = content.mobilePhone; | ||||
state.formData[11][state.formData[11].value] = `${content.prov}/${content.city}/${content.area}`; | |||||
let arr = []; | |||||
arr.push(content.prov) | |||||
arr.push(content.city) | |||||
arr.push(content.area) | |||||
state.formData[11][ | |||||
state.formData[11].value | |||||
] = arr; | |||||
const addressArr = content.address.split("-") | const addressArr = content.address.split("-") | ||||
state.formData[12][state.formData[12].value] = addressArr[3]; | state.formData[12][state.formData[12].value] = addressArr[3]; | ||||
// state.formData[13][state.formData[13].value] = ""; | |||||
// #endif | // #endif | ||||
// #ifdef MP-WEIXIN | // #ifdef MP-WEIXIN | ||||
state.formData[9][state.formData[9].value] = content.userName; | state.formData[9][state.formData[9].value] = content.userName; | ||||
state.formData[10][state.formData[10].value] = content.telNumber; | state.formData[10][state.formData[10].value] = content.telNumber; | ||||
let arr = []; | |||||
arr.push(content.provinceName) | |||||
arr.push(content.cityName) | |||||
arr.push(content.countyName) | |||||
state.formData[11][ | state.formData[11][ | ||||
state.formData[11].value | state.formData[11].value | ||||
] = `${content.provinceName}/${content.cityName}/${content.countyName}`; | |||||
] = arr; | |||||
state.formData[12][state.formData[12].value] = content.detailInfo; | state.formData[12][state.formData[12].value] = content.detailInfo; | ||||
state.formData[13][state.formData[13].value] = content.postalCode; | state.formData[13][state.formData[13].value] = content.postalCode; | ||||
// #endif | // #endif | ||||
//提交换货申请 | //提交换货申请 | ||||
const submit = (e : any) => { | const submit = (e : any) => { | ||||
for (var k = 0; k < state.outlets.length; k++) { | |||||
if (e.exchangeRgNetworkName == state.outlets[k]['name']) { | |||||
e['exchangeRgNetworkId'] = state.outlets[k]['servicehallId'] | |||||
break; | |||||
} | |||||
} | |||||
console.log("是否确认换货", e) | |||||
confirm( | confirm( | ||||
"是否确认换货?", | "是否确认换货?", | ||||
() => { | () => { | ||||
? e.exchangeRgNetworkName | ? e.exchangeRgNetworkName | ||||
: e.exchangeNetworkName; | : e.exchangeNetworkName; | ||||
const curOutlet = state.outlets.find((out) => out.name === curOutletName); | const curOutlet = state.outlets.find((out) => out.name === curOutletName); | ||||
// const curRegin = e.region == null ? null : e.region.split("/"); | |||||
const curRegin = e.region == null ? null : e.region; | const curRegin = e.region == null ? null : e.region; | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
exchangeNetworkName: e.exchangeNetworkName, | exchangeNetworkName: e.exchangeNetworkName, | ||||
exchangeRgMode: e.exchangeRgMode, | exchangeRgMode: e.exchangeRgMode, | ||||
// exchangeRgNetworkId: curOutlet == null ? "" : curOutlet.servicehallId, | // exchangeRgNetworkId: curOutlet == null ? "" : curOutlet.servicehallId, | ||||
exchangeRgNetworkId: e.exchangeNetworkName, | |||||
exchangeRgNetworkId: e.exchangeRgNetworkId, | |||||
exchangeRgNetworkName: e.exchangeRgNetworkName, | exchangeRgNetworkName: e.exchangeRgNetworkName, | ||||
exchangeLogisticsCompany: e.exchangeLogisticsCompany, | exchangeLogisticsCompany: e.exchangeLogisticsCompany, | ||||
exchangeLogisticsNumber: e.exchangeLogisticsNumber, | exchangeLogisticsNumber: e.exchangeLogisticsNumber, | ||||
method: "POST", | method: "POST", | ||||
showLoading: true, | showLoading: true, | ||||
}; | }; | ||||
console.log("提交数据", options) | |||||
console.log("提交数据", options); | |||||
request(orderExchange, options).then((res) => { | request(orderExchange, options).then((res) => { | ||||
confirm( | confirm( | ||||
"您申办的ETC订单已申请换货", | "您申办的ETC订单已申请换货", |
<text class="d-label">业务类型:</text> | <text class="d-label">业务类型:</text> | ||||
<text class="d-value">换货</text> | <text class="d-value">换货</text> | ||||
</view> | </view> | ||||
<view class="d-row"> | |||||
<view class="d-row" v-if="state.orderInfo.XXX"> | |||||
<text class="d-label">创建时间:</text> | <text class="d-label">创建时间:</text> | ||||
<text class="d-value">{{getOrderTime(state.orderInfo.XXXX)}}</text> | <text class="d-value">{{getOrderTime(state.orderInfo.XXXX)}}</text> | ||||
</view> | </view> |
<view class="title"> | <view class="title"> | ||||
{{ item.payName }} | {{ item.payName }} | ||||
</view> | </view> | ||||
<!-- 1记账卡2储值卡3记存卡 --> | |||||
<!-- <view style="margin-top: 15rpx" class="tip" v-if="item.cardType=='1'"> | |||||
记账卡 | |||||
</view> --> | |||||
<view style="margin-top: 15rpx" class="tip"> | <view style="margin-top: 15rpx" class="tip"> | ||||
{{ item.payStatusName }} | {{ item.payStatusName }} | ||||
</view> | </view> | ||||
provider: "weixin", | provider: "weixin", | ||||
success: function (e) { | success: function (e) { | ||||
getOpenid(e.code); | getOpenid(e.code); | ||||
// uni.request({ | |||||
// url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`, | |||||
// success: (res: any) => { | |||||
// state.openid = res.data.openid; | |||||
// }, | |||||
// }); | |||||
}, | }, | ||||
}); | }); | ||||
}; | }; | ||||
scrollTop.value = e.scrollTop; | scrollTop.value = e.scrollTop; | ||||
}); | }); | ||||
// isValueCard 1 储值卡 2 记账卡 | |||||
const gotoEditUserOrUnitInfo = () => { | const gotoEditUserOrUnitInfo = () => { | ||||
if (state.isValueCard == 1) { | if (state.isValueCard == 1) { | ||||
uni.switchTab({ | uni.switchTab({ |
/** | /** | ||||
* 配置信息,针对不同的平台进行配置 | * 配置信息,针对不同的平台进行配置 | ||||
*/ | */ | ||||
// cardType 1 记账卡 2 储值卡 3 寄存卡 | |||||
// isValueCard 1 储值卡 2 记账卡 | |||||
export const envs = { | export const envs = { | ||||
//开发环境配置 | //开发环境配置 | ||||
development: { | development: { |
uni.reLaunch({ | uni.reLaunch({ | ||||
url: '/login/login', | url: '/login/login', | ||||
}) | }) | ||||
// uni.navigateBack({ | |||||
// delta: 1 | |||||
// }) | |||||
// setTimeout(() => { | |||||
// uni.navigateTo({ | |||||
// url: '/login/login', | |||||
// }) | |||||
// console.log("1111111111111111111111") | |||||
// }, 100) | |||||
} | } | ||||
} | } | ||||
} else { | } else { | ||||
let content = s4.decryptData_CBC(res, sm4Key) | let content = s4.decryptData_CBC(res, sm4Key) | ||||
// let content = res | |||||
// console.log(content); | |||||
// content.data.bizContent = JSON.stringify(content.data.bizContent) | |||||
console.log('请求成功返回参数:', code, content) | console.log('请求成功返回参数:', code, content) | ||||
resolve(content.data) | resolve(content.data) | ||||
} | } |