Commit 5e9304df by 杨北旺

提交挪车码版本

1 parent f739a300
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 3
let index = 2
/**
*
......
......@@ -11,6 +11,7 @@ import common from './common'
import entmicroApi from './entmicro'
import strategyApi from './strategy'
import questionnaireApi from './questionnaire'
import rescueApi from './rescueApi'
module.exports = {
wechatApi,
......@@ -25,5 +26,6 @@ module.exports = {
common,
entmicroApi,
strategyApi,
questionnaireApi
questionnaireApi,
rescueApi
}
\ No newline at end of file
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-03 14:26:10
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-04 11:03:13
* @FilePath: \miniprogram\api\rescueApi.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import api from '../request/http'
module.exports = {
/** 获取道路救援卡小程序客户页面接口 */
getRescueCustomerView(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.getRescueCustomerView",
...data,
},
true
);
},
rescueSave(data) {
return api.post({
method: `entmicro.api.drac.rescue.card.scan.record.save`,
...data,
});
},
// 道路救援卡小程序重新定位接口
rescueReacquireLocation(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.rescueReacquireLocation",
...data,
},
true
);
},
/** 车主绑定挪车码 */
bindMovecode(data) {
return api.post({
method: "entmicro.api.drac.rescue.move.car.code.bind",
...data,
});
},
/** 挪车码校验是否被绑定 */
checkMovecode(data) {
return api.post({
method: "entmicro.api.drac.rescue.move.car.code.check",
...data,
});
},
/** 挪车码绑定信息获取 */
getRescueinfo(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.get",
...data,
},
true
);
},
/** 修改挪车码绑定信息 */
getUpdateRescueinfo(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.update",
...data,
},
true
);
},
// 调用百度接口绑定车主和X虚拟号码(返回值为虚拟号码X)
rescueMoveCarBindAx(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.ax",
...data,
},
true
);
},
};
......@@ -99,7 +99,10 @@
"pages/device/tachograph/tachograph",
"pages/vehicleInfo/index/index",
"pages/vehicleInfo/carBrandList/carBrandList",
"pages/questionnaire/questionnaire"
"pages/questionnaire/questionnaire",
"pages/move/index/index",
"pages/move/success/success",
"pages/accident/index/index"
]
},
{
......
// packageShopmall/packageRescue/pages/accident/index/index.js
import mapApi from '~/utils/mapapi/mapapi'
// import {
// ssoApi
// } from '~/api/api'
// import {
// login
// } from "~/utils/appFn/index";
Page({
/**
* 页面的初始数据
*/
data: {
rescueData: {},
isShow: true,
showLogin: false,
showMenuByLongpress: true,
qrCodePhone: ''
},
// async getRescueId() {
// if (!this.codeId) {
// if (options.scene) {
// const {
// data
// } = await wx.p.api.shopmallApi.getMovingcodeId({
// id: decodeURIComponent(options.scene).split("=")[1],
// });
// if (data.scene.indexOf('phone') !== -1) {
// let op = {}
// data.scene.split('&').map(item => {
// const [key, val] = item.split('=')
// op[key] = val
// })
// // wx.$storage.set('srcm_shopmall_merchant_id', op.merchantId)
// // this.codeId = op.codeId
// this.qrCodePhone = op.phone
// this.openId = op.openId
// this.setData({ qrCodePhone: this.qrCodePhone })
// } else {
// this.codeId = data.scene;
// }
// return Promise.resolve(this.codeId);
// } else {
// return wx.p.wxApi.showToast("无效救援码ID");
// }
// } else {
// return Promise.resolve(codeId);
// }
// },
// freeLogin() {
// return new Promise((resolve)=>{
// ssoApi.loginByOpenId({
// openId: this.openId
// }).then(({
// code,
// data,
// message
// }) => {
// wx.$authStatus = code != 0
// if (code == '0') {
// wx.$util.setUserInfo(data)
// wx.$util.setSessionId(data.sessionId)
// // let path = `/pages/tab/shopMall/index?tabIndex=${tabIndex}&merchantId=${merchantId}&pageType=${pageType}`
// // wx.reLaunch({
// // url: path,
// // });
// } else {
// wx.p.wxApi.showToast(message || '系统异常')
// }
// resolve()
// })
// })
// },
async getRescueCustomerView(phone) {
if (phone)
this.setData({
phone,
});
wx.p.wxApi.showLoading("加载中...");
const codeId = this.codeId
wx.p.api.rescueApi
.getRescueCustomerView({
codeId,
customerPhone: this.qrCodePhone ? this.qrCodePhone : this.data.phone,
})
.then(async (res) => {
if (res.code == 0) {
this.rescueSave(res.data.merchantId);
this.setData({
rescueData: res.data,
});
} else {
wx.p.wxApi.showToast(res.message);
}
wx.hideLoading();
});
},
// 打电话
callPhone(e) {
let {
mobile
} = e.target.dataset;
wx.makePhoneCall({
phoneNumber: mobile.toString(),
});
},
changeCard() {
const userInfo = wx.p.cache.userInfo.getUserInfo() || {};
if (!this.qrCodePhone && !userInfo.phone) {
this.login()
return
}
this.setData({
isShow: !this.data.isShow,
});
},
change() {
this.setData({
isShow: !this.data.isShow,
});
},
async rescueSave(merchantId) {
const userInfo = wx.p.cache.userInfo.getUserInfo() || {};
const address_info = wx.p.storage.get("address_info");
let data = {
openId: userInfo.openIdc || userInfo.weChatOpenId,
headImgUrl: userInfo.headImgUrl,
nickName: userInfo.nickName,
phone: userInfo.phone,
scanTime: new Date().format("yyyy-MM-dd hh:mm:ss"),
merchantId,
location: address_info.address,
};
wx.p.api.rescueApi.rescueSave(data).then((res) => { });
},
goActivity() {
wx.$router.go(this.data.rescueData.relLink);
},
goCoupon() {
wx.$router.go("/packageMine/pages/coupon/index/index");
},
openLocation(e) {
wx.getLocation({
type: "gcj02",
})
.then(({
latitude,
longitude
}) => {
mapApi.detailedAdrress([latitude, longitude]).then((detail) => {
let {
address
} = detail;
this.rescueReacquireLocation(address);
});
})
.catch((err) => {
// wx.p.wxApi.showToast('获取位置失败')
});
},
rescueReacquireLocation(location) {
wx.p.api.rescueApi
.rescueReacquireLocation({
customerPhone: this.data.phone,
location: location,
rescueCardId: this.data.rescueData.rescueCardId,
})
.then((res) => {
if (res.code == 0) {
wx.p.wxApi.showToast("定位发送成功");
}
});
},
/**登录 */
async login() {
wx.p.wxApi.showLoading("加载中...");
login().then((res) => {
wx.hideLoading();
if (res.data) {
let {
phone
} = res.data;
phone
?
this.getRescueCustomerView(phone) :
wx.$router.go("/pages/Login/Login", {
notIntercept: true,
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options);
if (options.codeId) {
this.codeId = options.codeId
this.qrCodePhone = options.phone
this.openId = options.openId
this.setData({ qrCodePhone: this.qrCodePhone })
} else return wx.p.wxApi.showToast("无效救援码ID");
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const userInfo = wx.p.cache.userInfo.getUserInfo() || {};
this.getRescueCustomerView(userInfo.phone)
}
});
\ No newline at end of file
{
"navigationBarTitleText": "道路救援",
"usingComponents": {}
}
\ No newline at end of file
.container {
background-color: #fff;
padding: 24rpx 32rpx;
box-sizing: border-box;
.exhibition {
width: 686rpx;
// height: 360rpx;
padding: 40rpx 32rpx;
box-sizing: border-box;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/rescue/rescue-bg.png?v=1.0.3');
position: relative;
.staffCode {
width: 192rpx;
height: 192rpx;
display: block;
margin: 12rpx auto 24rpx auto;
}
.long-press-text {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
text-align: center;
}
.store-name {
font-weight: 600;
font-size: 36rpx;
color: #0A0D14;
max-width: 500rpx;
line-height: 48rpx;
}
.rescue-navigation {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
line-height: 48rpx;
display: block;
}
.counselor {
font-size: 28rpx;
color: #282829;
margin: 40rpx 0 4rpx 0;
}
.quarters {
font-size: 22rpx;
color: #6E6E7A;
}
.information {
font-weight: 600;
font-size: 32rpx;
color: #FC5B32;
display: flex;
align-items: center;
margin-top: 58rpx;
.phone {
font-size: 48rpx;
color: #FC5B32;
margin: 0 16rpx;
white-space: nowrap;
width:340rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.rescue-phone {
width: 48rpx;
height: 48rpx;
}
}
.rescue-card {
width: 112rpx;
height: 120rpx;
position: absolute;
bottom: 0;
right: 0;
}
.rebate {
display: flex;
align-items: center;
width: 156rpx;
height: 50rpx;
background: #FFEFAD;
box-sizing: border-box;
font-size: 24rpx;
color: #F13C3D;
border-radius: 10rpx;
position: relative;
left: 480rpx;
top: -190rpx;
.rescue-subsidy {
width: 28rpx;
height: 28rpx;
margin: 0 12rpx 0 8rpx;
display: block;
}
}
.rebate::after {
position: absolute;
z-index: 9999;
box-sizing: content-box;
width: 0px;
height: 0px;
position: absolute;
top: -28rpx;
right: 35px;
padding: -2rpx;
border-bottom: 8px solid #FFEFAD;
border-top: 8px solid transparent;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
display: block;
content: '';
}
}
.equity {
width: 670rpx;
height: 136rpx;
display: block;
margin: 40rpx auto 0 auto;
}
.rescue-tips {
width: 232rpx;
height: 64rpx;
display: block;
margin: 80rpx auto 0 auto;
}
.rescue-info {
background-image: linear-gradient(180deg, rgba(252, 91, 50, 0.03) 26%, rgba(252, 91, 50, 0.07) 100%);
border-radius: 16rpx;
margin-top: -32rpx;
font-size: 26rpx;
color: #333333;
padding: 112rpx 52rpx 48rpx 56rpx;
.info-remind {
font-weight: 300;
font-size: 24rpx;
color: #282829;
line-height: 36rpx;
margin: 8rpx 0 40rpx 0;
}
.info-text {
line-height: 52rpx;
color: #3B3B3D;
}
.service-title {
margin-top: 32rpx;
color: #656566;
}
.service-phone {
display: flex;
flex-wrap: wrap;
color: #656566;
line-height: 48rpx;
text {
width: 50%;
text-align: left;
}
}
}
}
.activity {
padding: 0 24rpx;
width: 686rpx;
height: 72rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/rescue/subsidy-bg.png?v=1.0.3');
margin-top: 40rpx;
box-sizing: border-box;
.rescue-subsidy {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
display: block;
}
.look-btn {
padding: 6rpx 16rpx;
font-size: 24rpx;
color: #F13C3D;
background: #FFEFAD;
border-radius: 15rpx;
border-radius: 15rpx;
}
}
.modal {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.box {
width: calc(100% - 110rpx);
height: 366rpx;
background: #FFF;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
left:50%;
top:50%;
transform: translate(-50%,-50%);
}
.box .title {
text-align: center;
font-size: 36rpx;
font-weight: 500;
color: #333333;
/* line-height: 50px; */
margin-top: 40rpx;
}
.box .content {
width: 464rpx;
text-align: center;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 42rpx;
margin-top: 32rpx;
margin-bottom: 48rpx;
}
.box .dirver {
height: 1rpx;
width: 100%;
background: rgba(0, 0, 0, 0.1000);
}
.box .footer {
height: 110rpx;
position: relative;
width: 100%;
}
.box .footer .mid_line {
position: absolute;
left: 50%;
top: 0;
width: 1rpx;
height: 100%;
background: rgba(0, 0, 0, 0.1000);
z-index: 1;
}
.box .footer .btn {
width: 50%;
height: 100%;
font-size: 36rpx;
font-weight: 400;
color: #F13C3D;
background: white;
}
.box .footer .cancel {
color: #3A3A3A;
}
\ No newline at end of file
<view class="container">
<view class="exhibition">
<block wx:if="{{isShow}}">
<view class="flex_sc">
<view class="store-name">{{rescueData.merchantName }}</view>
<glsx-image class="rescue-navigation" bindtap="openLocation" webp src="mine/rescue/rescue-navigation.png"></glsx-image>
</view>
<view class="counselor">{{rescueData.staffName||'--' }}</view>
<view class="quarters">事故车服务顾问</view>
<view class="information" data-mobile="{{rescueData.sosPhone}}" bindtap="callPhone">
救援电话
<view class="phone" data-mobile="{{rescueData.sosPhone||'--'}}">{{rescueData.sosPhone ||'--'}}</view>
<glsx-image class="rescue-phone" data-mobile="{{rescueData.sosPhone}}" webp src="mine/rescue/rescue-phone.png"></glsx-image>
</view>
<view class="rebate" wx:if="{{rescueData.buyExpGold}}">
<glsx-image class="rescue-subsidy" webp src="mine/rescue/rescue-subsidy.png"></glsx-image>返店有补
</view>
</block>
<block wx:if="{{!isShow}}">
<glsx-image class="staffCode" webp src="{{rescueData.staffCode }}" showMenuByLongpress="{{showMenuByLongpress}}"></glsx-image>
<view class="long-press-text">长按可添加服务顾问,将事故现场照片发给顾问处理</view>
</block>
<glsx-image class="rescue-card" wx:if="{{isShow}}" webp src="mine/rescue/rescue-card.png" bindtap="changeCard"></glsx-image>
<glsx-image class="rescue-card" wx:if="{{!isShow}}" webp src="mine/rescue/rescue-code.png" bindtap="change"></glsx-image>
</view>
<block wx:if="{{rescueData.buyExpGold&&rescueData.relLink&&qrCodePhone==''}}">
<glsx-image class="equity" bindtap="goCoupon" webp src="mine/rescue/equity.png"></glsx-image>
</block>
<block wx:if="{{qrCodePhone}}">
<glsx-image class="equity" bindtap="goCoupon" webp src="mine/rescue/equity.png"></glsx-image>
</block>
<view class="activity flex_scb" wx:if="{{rescueData.relLink&&!rescueData.buyExpGold&&qrCodePhone==''}}" bindtap="goActivity">
<view class="flex_sc">
<glsx-image class="rescue-subsidy" webp src="mine/rescue/rescue-subsidy.png"></glsx-image>{{rescueData.expGoldActiveName}}
</view>
<view class="look-btn">立即查看</view>
</view>
<glsx-image class="rescue-tips" webp src="mine/rescue/rescue-tips.png"></glsx-image>
<view class="rescue-info">
<view data-mobile="{{4006123886}}" bindtap="callPhone">非事故免费救援:4006123886</view>
<view class="info-remind">除高速外,非事故单次30公里内免费救援,不限次数</view>
<text user-select class="info-text">1. 平复情绪,检查人员以及车辆状态,熄火停车<br />
2. 保护现场,防止二次事故,开双闪,放警示牌<br />
3. 有人员受伤的需要拨打120救助,不管是对方还是己方都有义务施救<br />
4. 留存固定证据,前后外观,远近细节<br />
5. 拨打122/110报警,明确事故责任,获取交警事故责任认定书<br />
6. 责任方报保险,无责方要主动获取责任方的联系方式,并确认后续的修车和理赔流程<br />
7. 定损修车,视损失情况而定</text>
<view class="service-title">附各大保险客服电话:</view>
<view class="service-phone" bindtap="callPhone">
<text data-mobile="{{95511}}">· 平安车险:95511 </text><text data-mobile="{{95518}}">· 中国人民保险:95518</text>
<text data-mobile="{{95500}}">· 太平洋保险:95500</text> <text data-mobile="{{95585}}">· 中国联合保险:95585</text>
</view>
</view>
</view>
\ No newline at end of file
Component({
/**
* 组件的属性列表
*/
options: {
styleIsolation: 'apply-shared' // apply-shared 或 shared
},
properties: {
codeId: {
type: String,
value: ''
},
userPhone: {
type: Number,
value: ''
}
},
observers: {
'codeId': function (data) { }
},
/**
* 组件的初始数据
*/
data: {
list_fill: [{
label: '手机号',
value: 'ownerPhone',
type: 'input'
},
{
label: '车牌号',
value: 'carNumber'
},
{
label: '留言',
value: 'ownerRemark',
type: 'textarea'
}
],
form: {
ownerPhone: '',
carNumber: '',
ownerRemark: '临时停靠,马上回来',
userPhone: ''
}
},
/**
* 组件的方法列表
*/
methods: {
inputHandle(e) {
let {
detail: {
value
},
currentTarget: {
dataset: {
index
}
}
} = e
const list = ['form.ownerPhone', '', 'form.ownerRemark']
this.setData({
[list[index]]: value
})
},
clickRow(e) {
let {
index
} = e.currentTarget.dataset
if (index == 1) {
wx.chooseLicensePlate().then(res => {
console
this.setData({
'form.carNumber': res.plateNumber
})
})
}
},
//绑定
bindHandle() {
const phoneRex = /^[1]([3-9])[0-9]{9}$/
let index;
let {
form: {
ownerPhone,
carNumber,
ownerRemark,
id
},
codeId,
userPhone
} = this.data
try {
if (!ownerPhone) throw '请输入手机号'
if (!phoneRex.test(ownerPhone)) throw '请输入正确的手机号'
} catch (error) {
wx.p.wxApi.showToast(error)
return
}
index = codeId ? 1 : 0
const Api = ['getUpdateRescueinfo', 'bindMovecode']
let params = {
ownerPhone,
carNumber,
ownerRemark
}
if (codeId) {
params.userPhone = userPhone
params.codeId = codeId
} else {
params.id = id
}
wx.p.api.rescueApi[Api[index]](params).then(res => {
if (res) {
wx.p.wxApi.showToast('绑定成功')
//数据上报
// this.trackHttp()
wx.p.router.redirectTo('/packageMine/pages/move/success/success')
} else {
wx.p.wxApi.showToast(res.message)
}
})
},
trackHttp() {
const {
merchantId
} = wx.p.storage.get('merchant_info')
let {
form: {
ownerPhone,
carNumber,
}
} = this.data,
userInfo = wx.p.cache.userInfo.getUserInfo() || {},
data = {
unionId: userInfo.unionId || null,
car_number: carNumber,
customer_phone: ownerPhone || null,
add_way: 110,
merchant_id: merchantId
}
const jsonList = [JSON.stringify(data)]
wx.p.api.shopmallApi.trackHttp({
jsonList
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
.container {
padding: 40rpx 32rpx;
.row_widget {
background-color: #fff;
padding: 36rpx 32rpx;
display: flex;
justify-content: space-between;
.label {
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.value {
font-weight: 400;
font-size: 30rpx;
color: #6E6E7A;
text {
max-width: 400rpx;
}
}
.icon {
width: 24rpx;
height: 24rpx;
margin-left: 8rpx;
}
.place-style {
font-size: 30rpx;
color: #9299AD;
}
.weui-input {
text-align: right;
font-size: 30rpx;
max-width: 400rpx;
}
.weui-textarea {
text-align: right;
font-size: 30rpx;
max-width: 400rpx;
height: 224rpx;
}
}
.border_line {
border-bottom: 2rpx solid #F0F0F0;
}
.bind-btn {
height: 88rpx;
background: #2A69FF;
border-radius: 12rpx;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 88rpx;
margin: 48rpx 0 32rpx 0;
}
.preview {
margin: 96rpx 0 32rpx 0;
color: #1B233D;
text-align: center;
line-height: 44rpx;
}
.move-platnum {
width: 472rpx;
height: 112rpx;
position: absolute;
transform: translateX(-50%);
left: 50%;
}
.licence {
font-weight: 600;
font-size: 72rpx;
color: #556AF5;
letter-spacing: 0;
text-align: center;
line-height: 112rpx;
}
}
\ No newline at end of file
<view class="container">
<block wx:for="{{list_fill}}" wx:key="index">
<view class="row_widget {{index==3?'':'border_line'}}" data-index="{{index}}" data-name="{{item.value}}" bind:tap="clickRow">
<view class="label">{{item.label}}</view>
<view class="value flex_sc" wx:if="{{item.type =='input'}}">
<input class="weui-input" placeholder="请输入" value="{{form[item.value]}}" placeholder-style="font-size: 30rpx; color: #9299AD;text-align:right" data-index="{{index}}" bindinput='inputHandle' maxlength="11"/>
</view>
<view class="value flex_sc" wx:elif="{{item.type =='textarea'}}">
<textarea class="weui-textarea" data-index="{{index}}" bindinput='inputHandle' value="{{form[item.value]}}" placeholder="临时停靠,马上回来" placeholder-style="color:#9299AD;" maxlength="50" />
</view>
<view class="value flex_sc" wx:else>
<text wx:if="{{form[item.value]}}">{{form[item.value]}}</text>
<text wx:else class="place-style">请选择</text>
<glsx-image class="icon" src="mine/mine-arrow.png" />
</view>
</view>
</block>
<view class="bind-btn" bindtap="bindHandle">{{codeId?'绑定':'确定'}}</view>
<view class="remind">已开启虚拟拨号,保护隐私</view>
<block wx:if="{{form.carNumber||form.ownerRemark}}">
<view class="preview">· 预览 ·</view>
<block wx:if="{{form.carNumber}}">
<glsx-image class="move-platnum" src="mine/rescue/move-platnum.png"></glsx-image>
<view class="licence">{{form.carNumber}}</view>
</block>
<block wx:if="{{form.ownerRemark}}">
<view class="ownerRemark mrg30">
<view class="owner-title">· 车主留言 ·</view>
<view class="remark-message">{{form.ownerRemark}}</view>
</view>
</block>
</block>
</view>
\ No newline at end of file
// packageShopmall/packageMine/pages/move/pages/have/have.js
Component({
/**
* 组件的属性列表
*/
options: {
styleIsolation: 'apply-shared' // apply-shared 或 shared
},
properties: {
codeId: {
type: String,
value: ''
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 打电话
callPhone(e) {
wx.p.api.rescueApi.rescueMoveCarBindAx({
codeId: this.data.codeId
}).then(res => {
if (res.code == 0) {
wx.makePhoneCall({
phoneNumber: res.data.toString()
})
}else{
wx.p.wxApi.showToast(res.message)
}
})
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageShopmall/packageMine/pages/move/pages/have/have.wxss */
.container {
background-color: #fff;
height: 100vh;
overflow: hidden;
padding: 160rpx 0;
box-sizing: border-box;
position: relative;
.move-platnum {
width: 472rpx;
height: 112rpx;
position: absolute;
transform: translateX(-50%);
left: 50%;
}
.licence {
font-weight: 600;
font-size: 72rpx;
color: #556AF5;
letter-spacing: 0;
text-align: center;
line-height: 112rpx;
}
.mrg64 {
margin: 64rpx auto;
}
.footer {
position: absolute;
bottom: 160rpx;
transform: translateX(-50%);
left:50%;
}
.move-phone {
width: 160rpx;
height: 160rpx;
display: block;
margin: 0 auto;
}
.concat-remind {
font-size: 30rpx;
color: #1B233D;
text-align: center;
line-height: 44rpx;
margin: 32rpx 0 40rpx 0;
}
}
\ No newline at end of file
<view class="container">
<blcok wx:if="{{form.carNumber}}">
<glsx-image class="move-platnum" src="mine/rescue/move-platnum.png"></glsx-image>
<view class="licence">{{form.carNumber}}</view>
</blcok>
<view class="ownerRemark mrg64" wx:if="{{form.ownerRemark}}">
<view class="owner-title">· 车主留言 ·</view>
<view class="remark-message">{{form.ownerRemark}}</view>
</view>
<view class="footer">
<glsx-image class="move-phone" src="mine/rescue/move-phone.png" bindtap="callPhone" data-mobile="{{form.ownerPhone}}"></glsx-image>
<view class='concat-remind'>电话联系车主</view>
<view class="remind">已开启虚拟拨号,保护隐私</view>
</view>
</view>
\ No newline at end of file
Page({
/**
* 页面的初始数据
*/
data: {
isbinding: '',
codeId: '',
},
onLoad(options) {
// 扫描挪车码,判断该挪车码是否被绑定过,
// 是,进入联系车主页
// 否,进入绑定页
// scene
const userInfo = wx.p.cache.userInfo.getUserInfo()
if (userInfo && userInfo.phone) this.setData({
phone: userInfo.phone
})
if (options.codeId) {
this.data.codeId = options.codeId
// this.checkMovecode(options.codeId)
} else {
this.setData({
isbinding: true,
})
this.getRescueinfo('#rescueAdd')
}
// if (options && options.scene) {
// this.getRescueId(decodeURIComponent(options.scene))
// } else {
// this.setData({
// isbinding: true,
// })
// this.getRescueinfo('#rescueAdd')
// }
},
// getRescueId(str) {
// wx.p.api.shopmallApi
// .getMovingcodeId({
// id: str.split('=')[1]
// })
// .then(({
// code,
// data
// }) => {
// this.setData({
// codeId: data.scene
// })
// this.checkMovecode()
// })
// },
getComponentPage(id) {
return this.selectComponent(id)
},
checkMovecode(codeId) {
wx.p.api.rescueApi.checkMovecode({
codeId
}).then(res => {
if (res) {
this.setData({
isbinding: false,
codeId
})
this.getRescueinfo('#rescueHave')
} else {
this.setData({
isbinding: true,
codeId
})
}
})
},
getRescueinfo(id) {
let params = {}
if (this.data.codeId) {
params.codeId = this.data.codeId
} else {
params.userPhone = this.data.phone
}
wx.p.api.rescueApi.getRescueinfo(params).then(res => {
if (res.code == 0) {
wx.hideLoading()
wx.nextTick(() => {
this.getComponentPage(id).setData({
form: res.data
})
})
}
})
},
onShow() {
if (this.data.codeId) this.checkMovecode(this.data.codeId)
},
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "绑定挪车码",
"usingComponents": {
"rescue-add": "../components/add/add",
"rescue-have": "../components/have/have"
}
}
\ No newline at end of file
/* packageShopmall/packageMine/pages/move/index/index.wxss */
.wrapper {
.remind {
font-size: 26rpx;
color: #9299AD;
text-align: center;
}
.ownerRemark {
width: 480rpx;
background: #FFFFFF;
border: 0 solid #424242;
box-shadow: 0 16rpx 32rpx 0 #EBEBEB;
border-radius: 32rpx;
padding: 32px;
box-sizing: border-box;
}
.mrg30 {
margin: 30rpx auto;
}
.owner-title {
font-weight: 600;
font-size: 36rpx;
color: #1B233D;
text-align: center;
}
.remark-message {
font-size: 32rpx;
color: #1B233D;
text-align: center;
line-height: 48rpx;
margin-top: 16rpx;
}
}
\ No newline at end of file
<view class="wrapper" wx:if="{{isbinding!==''}}">
<block wx:if="{{isbinding}}">
<rescue-add id="rescueAdd" codeId="{{codeId}}" userPhone="{{phone}}"></rescue-add>
</block>
<block wx:else>
<rescue-have id="rescueHave" codeId="{{codeId}}"></rescue-have>
</block>
</view>
\ No newline at end of file
No preview for this file type
{
"usingComponents": {},
"navigationBarTitleText": "绑定挪车码"
}
\ No newline at end of file
/* packageShopmall/packageMine/pages/move/success/success.wxss *//* packageStoreAssistant/packageMine/pages/successSupplement/successSupplement.wxss */
.container {
background-color: #fff;
height: 100vh;
width: 100%;
margin-bottom: 64rpx;
.success_icon {
width: 400rpx;
height: 400rpx;
text-align: center;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.success-info {
width: 100%;
text-align: center;
position: absolute;
top: 480rpx;
text {
font-weight: 400;
font-size: 28rpx;
color: #7A8299;
margin: 24rpx 0 128rpx 0;
display: inline-block;
}
view {
font-weight: 600;
font-size: 40rpx;
color: #1B233D;
}
.btn {
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #DCDFE6;
border-radius: 20rpx;
line-height: 88rpx;
margin: 0 28rpx;
font-weight: 400;
font-size: 32rpx;
color: #1B233D;
}
}
}
\ No newline at end of file
No preview for this file type
......@@ -173,6 +173,33 @@ Page({
} = e.currentTarget.dataset
wx.p.router.go(`/packageMine/pages/vehicleInfo/index/index`, item)
},
getRescueinfo() {
wx.p.router.intercept(false).then(sid => {
let {
toolList,
userInfo
} = this.data
if (!sid) {
wx.p.api.rescueApi.getRescueinfo({
userPhone: userInfo.phone
}).then(res => {
if (res.data) {
if (!toolList.find(e => e.text == '挪车码')) {
toolList.push({
text: '挪车码',
icon: 'myMoveCar',
url: '/packageMine/pages/move/index/index'
})
this.setData({
toolList
})
}
}
})
}
})
},
onShow() {
......@@ -180,14 +207,15 @@ Page({
this.toCheckMember()
this.getUserCarList()
this.getMemberCardData()
this.getRescueinfo()
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
showStore: !FIRST
})
},
freshMerchant(){
freshMerchant() {
this.getMemberCardData()
},
onShareAppMessage(){}
onShareAppMessage() { }
})
\ No newline at end of file
......@@ -18,7 +18,7 @@
<view class="nickName">
<text class="text text-hide">{{userInfo.nickName || '微信用户'}}</text>
<view class="vip_card" wx:if="{{isMember}}">
<glsx-image webp src="mine/vip-{{identity}}.png"></glsx-image>
<glsx-image webp src="mine/goldCard.png"></glsx-image>
</view>
</view>
<view class="phone">{{username}}{{userInfo.phone}}</view>
......@@ -141,7 +141,7 @@
<text class="tool-content">{{item.text}}</text>
</view>
</block>
<view class="independentBox">
<view wx:if="{{toolList.length<3}}" class="independentBox">
<view class="tool-img"></view>
</view>
<view class="independentBox">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!