Commit 28abc381 authored by lijiongliang's avatar lijiongliang

流程修改

parent 37156ead
const baseUrl = 'https://jduniapp.uzosp.com/test-api'; const baseUrl = 'https://jduniapp.uzosp.com//test-api';
// const baseUrl = 'http://64qycp.natappfree.cc'; // const baseUrl = 'http://nrucci.natappfree.cc';
const httpRequest = (opts, data) => { const httpRequest = (opts, data) => {
let httpDefaultOpts = { let httpDefaultOpts = {
url: baseUrl + opts.url, url: baseUrl + opts.url,
...@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => { ...@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
if(res[1].data.code == 401){ if(res[1].data.code == 401){
uni.removeStorageSync('userToken') uni.removeStorageSync('userToken')
uni.navigateTo({ uni.navigateTo({
url:"/pages/binding/index?failure=401" url:"/pages/login/index/index?failure=401"
}) })
return; return;
} }
......
...@@ -69,6 +69,12 @@ ...@@ -69,6 +69,12 @@
"style": { "style": {
"navigationBarTitleText": "获取挪车码" "navigationBarTitleText": "获取挪车码"
} }
},
{
"path": "pages/index/getCoupon",
"style": {
"navigationBarTitleText": "领取优惠券"
}
} }
] ]
}, },
...@@ -199,6 +205,12 @@ ...@@ -199,6 +205,12 @@
"navigationBarTitleText": "我的订单" "navigationBarTitleText": "我的订单"
} }
}, },
{
"path": "pages/personal/myJdOrder",
"style": {
"navigationBarTitleText": "我的订单"
}
},
{ {
"path": "pages/personal/orderDetail", "path": "pages/personal/orderDetail",
"style": { "style": {
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
list5: [], list5: [],
//免费挪车码 //免费挪车码
freeCode: {}, freeCode: {},
carList:[], // 爱车列表
}; };
}, },
methods: { methods: {
...@@ -79,11 +80,21 @@ ...@@ -79,11 +80,21 @@
let that = this let that = this
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if (!token) { if (!token) {
uni.navigateTo({ uni.showModal({
url: '/pages/binding/index?url=/pages/main&index=0' title: "未绑定账号",
}) content: "您没有绑定京东账号,请绑定后再领取",
success:function(res){
if (res.confirm) {
that.goJdLogin()
}
}
});
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=0'
// })
return; return;
} }
let opts = { let opts = {
url: '/app/user/info', url: '/app/user/info',
method: 'get' method: 'get'
...@@ -91,33 +102,25 @@ ...@@ -91,33 +102,25 @@
that.http.httpTokenRequest(opts, {}).then(res => { that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let freeMoveFlag = res.data.data.freeMoveFlag let freeMoveFlag = res.data.data.freeMoveFlag
let bindPin = res.data.data.bindPin
if(!bindPin) { if (freeMoveFlag) {
uni.showModal({ uni.showToast({
title: "未绑定账号", title: "您的免费领取次数已用完",
content: "您没有绑定京东账号,请绑定后再领取", icon: 'none',
success:function(res){ duration: 2000,
if (res.confirm) { success:function(){
that.goJdLogin()
}
} }
}); });
// if (freeMoveFlag) { } else {
// uni.showToast({ //跳转到领取优惠卷页面
// title: "您的免费领取次数已用完",
// icon: 'none',
// duration: 2000,
// success:function(){
// }
// });
// } else {
// //跳转到领取优惠卷页面
// uni.navigateTo({ // uni.navigateTo({
// url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id // url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
// }); // });
// } uni.showLoading({
title: '加载中'
});
this.getCarList()
} }
} }
}) })
...@@ -165,7 +168,25 @@ ...@@ -165,7 +168,25 @@
uni.navigateTo({ uni.navigateTo({
url: link url: link
}) })
},
// 获取爱车列表
getCarList(){
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.statusCode == 200) {
this.carList = res.data
uni.hideLoading()
if(res.data.length == 0){
let url = "car.m.jd.com/h5/list.html?source=managerprocedure"
util.redirectToH5({page:url})
}else{
uni.navigateTo({
url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
});
} }
}
})
},
}, },
created() { created() {
this.getMoveCode() this.getMoveCode()
......
...@@ -17,9 +17,7 @@ export default { ...@@ -17,9 +17,7 @@ export default {
onLoad: function (options = {}) { onLoad: function (options = {}) {
let { h5_url = '' } = options; let { h5_url = '' } = options;
util.h5Init(options); util.h5Init(options);
this.setData({ this.h5_url = h5_url
h5_url
});
util.setCustomNavigation(); util.setCustomNavigation();
this._genToken(); this._genToken();
...@@ -42,9 +40,7 @@ export default { ...@@ -42,9 +40,7 @@ export default {
let { isSuccess, err_code, url, tokenkey, err_msg } = res; let { isSuccess, err_code, url, tokenkey, err_msg } = res;
if (isSuccess && !err_code) { if (isSuccess && !err_code) {
this.setData({ this.url = `${url}?to=${h5_url}&tokenkey=${tokenkey}`
url: `${url}?to=${h5_url}&tokenkey=${tokenkey}`
});
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
......
...@@ -6,23 +6,24 @@ ...@@ -6,23 +6,24 @@
<personal v-if="tab=='personal'" ref="personal"></personal> <personal v-if="tab=='personal'" ref="personal"></personal>
<u-gap bgColor="transparent" height="055"></u-gap> <u-gap bgColor="transparent" height="055"></u-gap>
<view class="tabbar"> <view class="tabbar">
<v-tabbar ref="myTab" :list="tabbar" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></v-tabbar> <v-tabbar ref="myTab" :list="tabbar" style="position:fixed;bottom:0;width:100%;left:0;right:0;"
@tabChange="tabChange"></v-tabbar>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
mapState mapState
} from 'vuex'; } from 'vuex';
import tabbar from '@/common/hans-tabbar/hans-tabbar' import tabbar from '@/common/hans-tabbar/hans-tabbar'
import index from './home' import index from './home'
import moveCar from './moveCar' import moveCar from './moveCar'
import shop from './shop' import shop from './shop'
import personal from './personal' import personal from './personal'
let plugin = requirePlugin('loginPlugin'); let plugin = requirePlugin('loginPlugin');
export default { export default {
components: { components: {
index, index,
moveCar, moveCar,
...@@ -33,7 +34,7 @@ export default { ...@@ -33,7 +34,7 @@ export default {
data() { data() {
return { return {
tab: "index", tab: "index",
page:1 page: 1
} }
}, },
computed: { computed: {
...@@ -43,16 +44,16 @@ export default { ...@@ -43,16 +44,16 @@ export default {
tabbar: "tabbar" tabbar: "tabbar"
}) })
}, },
onShow: function () { onShow: function() {
uni.hideHomeButton() uni.hideHomeButton()
if(this.tab == 'personal'){ if (this.tab == 'personal') {
this.$refs.personal.getUserInfo(); this.$refs.personal.getUserInfo();
} }
}, },
onReachBottom(){ onReachBottom() {
let refresh = uni.getStorageSync("refresh") let refresh = uni.getStorageSync("refresh")
if(refresh == 0){ if (refresh == 0) {
if(this.tab == 'shop'){ if (this.tab == 'shop') {
this.page++; this.page++;
} }
} }
...@@ -69,17 +70,21 @@ export default { ...@@ -69,17 +70,21 @@ export default {
break; break;
case 2: case 2:
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(token) { if (token) {
uni.scanCode({ uni.scanCode({
success: function (res) { success: function(res) {
let path = res.path let path = res.path
let opts = { url: '/app/user/info', method: 'get' } let opts = {
url: '/app/user/info',
method: 'get'
}
that.http.httpTokenRequest(opts, {}).then(res => { that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let xcxIndexPath = res.data.data.xcxIndexPath let xcxIndexPath = res.data.data.xcxIndexPath
if (xcxIndexPath) { if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '') xcxIndexPath = path.replace(xcxIndexPath, '').replace(
"?", '')
if (xcxIndexPath.indexOf('scene') >= 0) { if (xcxIndexPath.indexOf('scene') >= 0) {
let scene = xcxIndexPath.replace('scene=', '') let scene = xcxIndexPath.replace('scene=', '')
let param = { let param = {
...@@ -89,7 +94,8 @@ export default { ...@@ -89,7 +94,8 @@ export default {
url: '/app/user/check/move/code', url: '/app/user/check/move/code',
method: 'post' method: 'post'
} }
that.http.httpTokenRequest(opts, param).then(res => { that.http.httpTokenRequest(opts, param).then(
res => {
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.bindFlag) { if (res.data.data.bindFlag) {
that.gotoMoveCar(scene) that.gotoMoveCar(scene)
...@@ -116,7 +122,7 @@ export default { ...@@ -116,7 +122,7 @@ export default {
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index' url: '/pages/login/index/index'
}) })
} }
break; break;
...@@ -142,27 +148,66 @@ export default { ...@@ -142,27 +148,66 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + s url: '/pagesB/pages/move-car/scan?moveCode=' + s
}); });
},
wechatLogin() {
wx.login({
success: (res) => {
this.wechatSession(res.code)
} }
})
},
//获取session_key
async wechatSession(code) {
let that = this
let param = {
code: code,
}
let opts = { url: '/xcx/code/session', method: 'post' }
await that.http.httpRequest(opts, param).then(res => {
if (res.data.code == 200) {
that.openid = res.data.data.openid
uni.setStorageSync('openid', that.openid);
}
})
},
}, },
onLoad(option) { onLoad(option) {
// 静默授权获取openid
let openid = uni.getStorageSync('openid');
if(!openid) {
this.wechatLogin()
}
let that = this let that = this
if(option && option.index){ if (option && option.index) {
that.$nextTick(() => { that.$nextTick(() => {
let i = parseInt(option.index); let i = parseInt(option.index);
if(!i){ if (!i) {
i= 0; i = 0;
} }
that.tabChange(i) that.tabChange(i)
that.$refs.myTab.current = i; that.$refs.myTab.current = i;
}); });
} }
let token = uni.getStorageSync('userToken')
if(!token){
let ptKey = plugin.getPtKey(); let ptKey = plugin.getPtKey();
if(ptKey) { if (ptKey) {
plugin.isvObfuscator({url:'https://wxapplogin2.m.jd.com/cgi-bin/login/isv/isvObfuscator'}).then(res=>{ uni.showLoading({
let { token, message } = res; title: '登录中'
});
plugin.isvObfuscator({
url: 'https://wxapplogin2.m.jd.com/cgi-bin/login/isv/isvObfuscator'
}).then(res => {
let {
token,
message
} = res;
if(!token) { if (!token) {
uni.hideLoading()
uni.showToast({ uni.showToast({
title: `京东登录失败:${message}`, title: `京东登录失败:${message}`,
icon: 'none', icon: 'none',
...@@ -170,31 +215,40 @@ export default { ...@@ -170,31 +215,40 @@ export default {
}); });
} else { } else {
let opts = { let opts = {
url: '/app/user/bind/jd', url: '/xcx/login',
method: 'post' method: 'post'
} }
that.http.httpTokenRequest(opts, {'token' : token}).then(res => { let openid = uni.getStorageSync('openid')
that.http.httpTokenRequest(opts, {
token: token,
openid:openid
}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let token = res.data.data.token
uni.setStorageSync('userToken',token)
uni.hideLoading()
uni.showToast({ uni.showToast({
title: "京东账号绑定成功", title: "登录成功",
icon: 'none', icon: 'none',
duration: 1000 duration: 2000
}); });
} }
}) })
} }
}).catch(err=>{ }).catch(err => {
console.log('err',err) console.log('err', err)
}) })
} }
}
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main_content { .main_content {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
</style> </style>
...@@ -60,8 +60,11 @@ export default { ...@@ -60,8 +60,11 @@ export default {
goUrl(vo) { goUrl(vo) {
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(!token){ if(!token){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=1'
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&index=1' url: '/pages/login/index/index'
}) })
return; return;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="ps__shop"> <!-- <div class="ps__shop">
<div class="shop__tab"> <div class="shop__tab">
<div class="tab__top"> <div class="tab__top">
<span>商品订单</span> <span>商品订单</span>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="ps__list"> <div class="ps__list">
<div class="list__item" v-for="(vo,inx) in menu" :key="inx" @click="goUrl(vo)"> <div class="list__item" v-for="(vo,inx) in menu" :key="inx" @click="goUrl(vo)">
...@@ -68,6 +68,10 @@ export default { ...@@ -68,6 +68,10 @@ export default {
show:false, show:false,
logoutFlag : true, logoutFlag : true,
menu: [{ menu: [{
icon: require("@/static/my/my01.png"),
title: "我的订单",
url: "/pagesD/pages/personal/myJdOrder"
},{
icon: require("@/static/my/my12.png"), icon: require("@/static/my/my12.png"),
title: "我的地址", title: "我的地址",
url: "/pagesD/pages/personal/myAddress" url: "/pagesD/pages/personal/myAddress"
...@@ -140,8 +144,11 @@ export default { ...@@ -140,8 +144,11 @@ export default {
goOrder(current) { goOrder(current) {
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(!token){ if(!token){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&index=4' url: '/pages/login/index/index'
}) })
return; return;
} }
...@@ -152,8 +159,11 @@ export default { ...@@ -152,8 +159,11 @@ export default {
goUrl(vo) { goUrl(vo) {
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(!token){ if(!token){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&index=4' url: '/pages/login/index/index'
}) })
return; return;
} }
...@@ -169,8 +179,11 @@ export default { ...@@ -169,8 +179,11 @@ export default {
editInfo() { editInfo() {
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(!token){ if(!token){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&index=4' url: '/pages/login/index/index'
}) })
return; return;
} }
...@@ -304,6 +317,7 @@ export default { ...@@ -304,6 +317,7 @@ export default {
background: url('http://euzhi.com/my15.png') no-repeat; background: url('http://euzhi.com/my15.png') no-repeat;
background-size: cover; background-size: cover;
z-index: 999; z-index: 999;
padding-bottom:50rpx;
.ps__title { .ps__title {
font-size: 40rpx; font-size: 40rpx;
...@@ -429,7 +443,9 @@ export default { ...@@ -429,7 +443,9 @@ export default {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16); box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 20rpx; border-radius: 20rpx;
margin-top: 20rpx; // margin-top: 20rpx;
position: relative;
top: -20rpx;
.list__item { .list__item {
position: relative; position: relative;
...@@ -472,7 +488,7 @@ export default { ...@@ -472,7 +488,7 @@ export default {
background: rgba(0, 0, 0, .1); background: rgba(0, 0, 0, .1);
} }
.list__item:nth-of-type(2) { .list__item:nth-of-type(3) {
.list__left { .list__left {
image { image {
width: 29rpx; width: 29rpx;
...@@ -482,7 +498,7 @@ export default { ...@@ -482,7 +498,7 @@ export default {
} }
} }
.list__item:nth-of-type(3) { .list__item:nth-of-type(4) {
.list__left { .list__left {
image { image {
width: 28rpx; width: 28rpx;
...@@ -492,7 +508,17 @@ export default { ...@@ -492,7 +508,17 @@ export default {
} }
} }
.list__item:nth-of-type(4) { .list__item:nth-of-type(5) {
.list__left {
image {
width: 28rpx;
height: 28rpx;
margin-right: 33rpx;
}
}
}
.list__item:last-child {
.list__left { .list__left {
image { image {
width: 28rpx; width: 28rpx;
......
<template>
<!-- 我的订单 -->
<view class="get-coupon">
<view class="box">
<view class="title">订单信息请前往京东查看</view>
<image src="../../../static/index/box.png"></image>
<view class="btn" @click="getCoupon">
点击领取优惠券
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
}
},
methods:{
getCoupon(){
uni.showToast({
title: "领取成功!",
icon: 'none',
});
}
}
}
</script>
<style lang="scss" scoped>
.get-coupon{
width:100%;height:100vh;
display: flex;
align-items: center;
justify-content: center;
.box{
position: relative;
top:-120rpx;
text-align: center;
.title{
font-size:36rpx;
font-weight: bold;
}
image{
width:400rpx;height:300rpx;
margin-top:80rpx;
}
.btn{
width:660rpx;
line-height:80rpx;
margin:50rpx auto 0;
text-align: center;
color:#fff;
font-size: 32rpx;
border-radius:50rpx;
background: linear-gradient(to right, #E2241B , #E14A1B);
}
}
}
</style>
\ No newline at end of file
...@@ -4,172 +4,183 @@ ...@@ -4,172 +4,183 @@
--> -->
<template> <template>
<view class="appCotent"> <view class="appCotent">
<div class="getPrice"> <view class="get_price">
<u-gap bgColor="transparent" height="30"></u-gap> <view class="content__code">
<div class="content__code"> <view class="code__img">
<div class="code__img">
<image :src="freeCode.mainImgUrl" class="code__img"></image> <image :src="freeCode.mainImgUrl" class="code__img"></image>
</div> </view>
<div class="code__money"> <view class="code__money">
<div class="money__title"> <view class="money__title">
<text>{{freeCode.title}}</text> <text>{{freeCode.title}}</text>
</div> </view>
<div class="code__tips"> <view class="code__tips" style="margin:6rpx 0 20rpx;">
<text>{{freeCode.spec}}</text> <text>{{freeCode.spec}}</text>
</div> </view>
<div class="money__num"> <view class="money__num">
<text class="num__one">¥0.00</text> <text class="num__one">¥0.00</text>
</div> </view>
</div> </view>
</div> </view>
<u-gap bgColor="transparent" height="30"></u-gap> <!-- 未绑定车辆信息 -->
<div class="car_info"> <view class="no_car_info" v-if="!carInfoState">
<div class="car_info__title">填写车辆信息</div> <view class="no_title">
<u--form labelPosition="left" :model="model1" ref="form1" labelWidth="100"> 添加绑定车辆信息
<u-form-item label="品牌" prop="carInfo.brand" borderBottom ref="item1"> </view>
<u--input v-model="model1.carInfo.brand" placeholder="请输入" border="none"></u--input> <view class="no_content">
</u-form-item> 暂无任何车辆信息
<u-form-item label="车型" prop="carInfo.carModel" borderBottom ref="item2"> </view>
<u--input v-model="model1.carInfo.carModel" placeholder="请输入" border="none"></u--input> <view class="no_btn" @click="selectCar = true">
</u-form-item> 从爱车选择
<u-form-item label="行驶里程" prop="carInfo.mileage" borderBottom ref="item3"> </view>
<div class="self__input__km"> </view>
<u--input v-model="model1.carInfo.mileage" placeholder="请输入" border="none"></u--input><span>KM</span>
</div> <!-- 已绑定车辆信息 -->
</u-form-item> <view class="car_info" v-else>
<u-form-item label="车牌号" prop="carInfo.carNo" ref="item1"> </u-form-item> <view class="info_list">
<car-number v-model="model1.carInfo.carNo"></car-number> <view class="left">
</u--form> 品牌
<div class="select__car" @click="goLoveCar"> </view>
从爱车选择 <image src="@/static/index/zhankai.png" alt=""> <view class="right">
</div> {{carInfo.brand}}
</view>
<div class="add__user"> </view>
<u-checkbox-group placement="row"> <view class="info_list">
<u-checkbox :checked='checked' @change="changeBtn"></u-checkbox> <view class="left">
</u-checkbox-group> 车型
请先阅读并同意<span @click="goArticle">《京东挪车牌隐私权政策》</span> </view>
</div> <view class="right">
</div> {{carInfo.carModel}}
</view>
</view>
<view class="info_list">
<div class="price__bottom"> <view class="left">
<div class="price"> 车牌号
<div class="price__num"> </view>
<span>1</span> <view class="right">
</div> {{carInfo.carNo}}
<div class="price__all"> </view>
合计<span>¥00.00</span> </view>
</div> <view class="info_list">
</div> <view class="left">
<div class="price__next" @click="getCarCode"> 行驶里程
下一步 </view>
</div> <view class="right">
</div> {{carInfo.mileage}}KM
<div class="price__bottom"> </view>
<div class="price"> </view>
¥0.00
</div> <view class="car_btn" @click="selectCar = true">
<div class="price__next" @click="getCarCode"> 从爱车选择
免费领取 </view>
</div> </view>
</div>
</div> <view class="bind_car_btn" @click="getCarCode">
绑定车辆
</view>
<!-- 爱车选择弹框 -->
<u-popup :show="selectCar" mode="bottom" round="10" @close="selectCar = false">
<view class="love_car_list">
<view class="love_title">
选择车辆
<text @click.stop="selectCar = false">x</text>
</view>
<view class="love_list">
<radio-group @change="radioChange">
<view class="love_item" v-for="(item,i) in carList" :key="i">
<image src="@/static/move-car/love-car6.png"></image>
<view class="love_info">
<view>
{{item.brand}}
</view>
<view>
{{item.carModel}}
</view>
</view>
<view class="radio">
<radio :value="i" :checked="i === radioValue " color="#3A86F7"/>
</view>
</view>
</radio-group>
</view>
<view class="love_btn">
<u-button type="primary" icon="plus" text="添加车辆" @click="addCar"></u-button>
</view>
</view>
</u-popup>
</view>
</view> </view>
</template> </template>
<script> <script>
import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue"; import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue";
import util from '@/pages/login/util.js';
export default { export default {
components: { components: {
CarNumber, CarNumber,
}, },
data() { data() {
return { return {
model1: { carInfoState:false,
carInfo: {
carNo: '',
brand: '',
carModel: '',
mileage: '',
},
},
rules: {
"carInfo.brand": {
type: "string",
required: false,
message: "请填写品牌",
trigger: ["blur", "change"],
},
"carInfo.carModel": {
type: "string",
required: false,
message: "请填写车型",
trigger: ["blur", "change"],
},
"carInfo.mileage": {
type: "number",
required: false,
message: "请填写正确的里程数",
trigger: ["blur", "change"],
},
"carInfo.carNo": [{
min: 7,
max: 8,
message: '车牌长度在7-8个字符之间'
},
{
type: "string",
required: true,
message: "请填写车牌号",
trigger: ["blur", "change"],
},
]
},
carId: '', carId: '',
//免费挪车码 //免费挪车码
freeCode: {}, freeCode: {},
checked:false selectCar:false, //爱车选择弹框
carList:[] ,// 爱车列表
carInfo:{}, // 车辆信息
radioValue:null
}; };
}, },
methods: { methods: {
changeBtn() { radioChange(e) {
this.checked = !this.checked; let index = e.detail.value
this.radioValue = index
this.carInfo = this.carList[index];
this.selectCar = false
this.carInfoState = true
}, },
goLoveCar() { // 获取爱车列表
uni.navigateTo({ getCarList(){
url: '/pagesB/pages/move-car/loveCar?price=1' uni.showLoading({
title: '加载中'
}); });
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.statusCode == 200) {
uni.hideLoading()
this.carList = res.data
}
})
}, },
// 调到领取优惠券页面
getCarCode() { getCarCode() {
//跳转到获取挪车码页面 //跳转到获取挪车码页面
this.$refs.form1.validate().then(res => { if (!this.carInfoState) {
if (!this.checked) {
uni.showToast({ uni.showToast({
title: "请同意京东挪车牌隐私权政策", title: "请选择车辆信息!",
icon: 'none', icon: 'none',
duration: 2000, duration: 2000,
}); });
return return
} }
if (!this.model1.carInfo.id) { // let opts = {
let opts = { // url: '/app/vehicleAdmin/add',
url: '/app/vehicleAdmin/add', // method: 'post'
method: 'post' // };
}; // this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => {
this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => { // if (res.data.code == 200) {
if (res.data.code == 200) {
// }
} // })
}) uni.showToast({
} title: "绑定成功!!",
icon: 'none',
});
setTimeout(()=>{
uni.navigateTo({ uni.navigateTo({
url: '/pagesA/pages/index/getCarCode?carNo=' + this.model1.carInfo.carNo url: '/pagesA/pages/index/getCoupon'
}); });
}).catch(errors => { },500)
uni.$u.toast('校验失败')
})
}, },
getCarInfo() { getCarInfo() {
...@@ -202,28 +213,21 @@ export default { ...@@ -202,28 +213,21 @@ export default {
} }
}) })
}, },
// 跳转协议政策页面 addCar() {
goArticle(){ this.selectCar = false
let opts = { url: '/app/user/ofPrivacy', method: 'get' }; let url = "car.m.jd.com/h5/list.html?source=managerprocedure"
this.http.httpTokenRequest(opts, {}).then(res => { util.redirectToH5({page:url})
if (res.data.code == 200) { },
let data = res.data.msg
uni.setStorageSync("articelContent",data)
uni.navigateTo({
url: '/pages/binding/article'
});
}
})
}
}, },
onReady() { onReady() {
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则 // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
this.$refs.form1.setRules(this.rules) // this.$refs.form1.setRules(this.rules)
}, },
onShow() { onShow() {
this.$nextTick(() => { this.$nextTick(() => {
this.getCarInfo() // this.getCarInfo()
this.getMoveCode() this.getMoveCode()
this.getCarList()
}) })
}, },
...@@ -234,41 +238,18 @@ export default { ...@@ -234,41 +238,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.getPrice { .get_price{
width: 100%; padding:40rpx;
/deep/.uni-input-input,
.uni-input-placeholder {
text-align: right;
}
/deep/ .u-input__content__field-wrapper__field {
text-align: right !important;
}
.self__input__km {
display: flex;
align-items: center;
justify-content: space-between;
span {
text-align: right;
display: inline-block;
width: 100rpx;
}
}
.content__code { .content__code {
padding: 28rpx; padding: 28rpx;
box-sizing: border-box; box-sizing: border-box;
width: 670rpx; width: 100%;
height: 216rpx; height: 216rpx;
background: #ffffff; background: #fff;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16); box-shadow: 0rpx 0rpx 28rpx 2rpx rgba(232, 232, 232, 0.16);
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0 auto;
position: relative; position: relative;
.code__img { .code__img {
...@@ -286,9 +267,8 @@ export default { ...@@ -286,9 +267,8 @@ export default {
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
line-height: 42rpx; line-height: 42rpx;
}
.code__tips { .code__tips {
font-size: 26rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
...@@ -296,7 +276,6 @@ export default { ...@@ -296,7 +276,6 @@ export default {
color: #666666; color: #666666;
line-height: 42rpx; line-height: 42rpx;
} }
}
.money__num { .money__num {
.num__one { .num__one {
...@@ -333,87 +312,146 @@ export default { ...@@ -333,87 +312,146 @@ export default {
background-size: contain; background-size: contain;
} }
} }
// 未绑定车辆信息
.car_info { .no_car_info{
padding: 40rpx 40rpx 220rpx; width:100%;height: 358rpx;
background: #fff; background: #FFFFFF;
box-shadow: 0 0 28rpx 2rpx rgba(232, 232, 232, 0.16);
.car_info__title { border-radius: 20rpx;
font-size: 32rpx; background-color: #fff;
font-family: PingFang SC; text-align: center;
font-weight: bold; margin-top:30rpx;
color: #333333; padding:30rpx 0;
line-height: 42rpx; .no_title{
font-size: 36rpx;
} }
.no_content{
font-size: 30rpx;
color:#666;
margin:80rpx 0 100rpx;
} }
.no_btn{
.select__car { width: 400rpx;height: 76rpx;
font-size: 26rpx; line-height:72rpx;
font-family: PingFang SC; background: linear-gradient(180deg, #E1251B, #E15C1B);
font-weight: 500; box-shadow: 0 6rpx 13rpx 2rpx rgba(225, 50, 27, 0.17), 2rpx -5rpx 8rpx 0 rgba(225, 41, 27, 0.46);
color: #f1251b; border-radius: 10rpx;
text-align: right; margin:0 auto;
margin-top: 40rpx; color: #fff;
margin-bottom: 20rpx;
image {
width: 10rpx;
height: 20rpx;
margin-left: 10rpx;
} }
} }
// 已绑定车辆信息
.add__user { .car_info{
background: #FFFFFF;
box-shadow: 0 0 28rpx 2rpx rgba(232, 232, 232, 0.16);
border-radius: 20rpx;
background-color: #fff;
margin-top:30rpx;
padding:0 30rpx 30rpx;
.info_list{
line-height:90rpx;
display: flex; display: flex;
justify-content: space-between;
align-items: center;
border-bottom:2rpx solid #ccc;
&:nth-child(4){
border:none;
}
.left{
font-size: 32rpx;
}
.right{
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC; color: #666;
font-weight: 500;
color: #999999;
// padding-left: 20rpx;
margin-top: 40rpx;
margin-bottom: 60rpx;
span {
color: rgba(58, 134, 247, 1);
padding: 0 5rpx;
} }
} }
.car_btn{
.price__bottom { width: 400rpx;
width: 100%; line-height: 76rpx;
height: 156rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 8rpx 19rpx 2rpx rgba(215, 215, 215, 0.21); border: 2rpx solid #DDDDDD;
border-radius: 20rpx 20rpx 0rpx 0rpx; border-radius: 10rpx;
position: fixed; text-align: center;
bottom: 0; margin:30rpx auto 0;
padding: 32rpx 40rpx; font-size: 32rpx;
box-sizing: border-box; color: #666;
clear: both; }
.price {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #E1251B;
} }
.price__next { .bind_car_btn{
width: 240rpx; width:100%;
height: 98rpx; line-height:80rpx;
background: url('@/static/index/border-btn.png') no-repeat; margin:60rpx auto 0;
background-size: contain; text-align: center;
color:#fff;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; border-radius:50rpx;
background: linear-gradient(to right, #E2241B , #E14A1B);
}
// 爱车列表
.love_car_list{
padding:30rpx 40rpx;
.love_title{
text-align: center;
font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #FFFFFF; margin-bottom:30rpx;
opacity: 0.96; position: relative;
text{
position: absolute;
right:20rpx;
top:-4rpx;
font-size:40rpx;
font-weight:500;
color: #666;
}
}
.love_list{
height:400rpx;
overflow: auto;
.love_item{
padding:20rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: space-between;
position: absolute; border-top: 2rpx solid #E8E8E8;
right: 0; &:first-child{
top: -10rpx; border:none;
}
image{
width:100rpx;height:100rpx;
}
.love_info{
width:450rpx;
>view{
&:first-child{
font-size:34rpx;
font-weight: bold;
margin-bottom:10rpx;
}
&:last-child{
font-size: 28rpx;
color:#666;
}
}
}
.radio{
width:60rpx;
}
}
}
.love_btn{
padding:50rpx;
/deep/ .u-button {
border-radius:50rpx;
background: linear-gradient(150deg, #E1251B, #E14A1B);
box-shadow: 0 6rpx 13rpx 2rpx rgba(225, 50, 27, 0.17);
border:0;
}
/deep/ .u-button__text{
font-size:32rpx !important;
}
} }
} }
} }
......
...@@ -14,14 +14,22 @@ ...@@ -14,14 +14,22 @@
<image src="@/static/move-car/love-car6.png" /> <image src="@/static/move-car/love-car6.png" />
</div> </div>
<div class="item__title" @click="goGetPrice(vo.id)"> <div class="item__title" @click="goGetPrice(vo.id)">
{{vo.carNo}} <view class="title">
{{vo.brand}}
</view>
<view class="type">
{{vo.carModel}}
</view>
<view class="route">
行驶里程 {{vo.mileage}}KM
</view>
</div> </div>
<div class="item__edit" @click="editCar(vo.id)"> <!-- <div class="item__edit" @click="editCar(vo.id)">
<image src="@/static/move-car/love-car2.png" /> <image src="@/static/move-car/love-car2.png" />
</div> </div>
<div class="item__del" @click="deleteModal(vo.id)"> <div class="item__del" @click="deleteModal(vo.id)">
<image src="@/static/move-car/love-car3.png" /> <image src="@/static/move-car/love-car3.png" />
</div> </div> -->
</div> </div>
</div> </div>
<div> <div>
...@@ -37,6 +45,7 @@ ...@@ -37,6 +45,7 @@
</template> </template>
<script> <script>
import util from '@/pages/login/util.js';
export default { export default {
data() { data() {
return { return {
...@@ -57,9 +66,11 @@ export default { ...@@ -57,9 +66,11 @@ export default {
}); });
}, },
addCar() { addCar() {
uni.navigateTo({ // uni.navigateTo({
url: '/pagesB/pages/move-car/addCar' // url: '/pagesB/pages/move-car/addCar'
}) // })
let url = "car.m.jd.com/h5/list.html?source=managerprocedure"
util.redirectToH5({page:url})
}, },
editCar(id) { editCar(id) {
uni.navigateTo({ uni.navigateTo({
...@@ -94,10 +105,14 @@ export default { ...@@ -94,10 +105,14 @@ export default {
this.deleteShow = false this.deleteShow = false
}, },
getCarList(){ getCarList(){
uni.showLoading({
title: '加载中'
});
let opts = { url: '/app/vehicleAdmin/list', method: 'get' }; let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.statusCode == 200) {
this.carList = res.data.rows uni.hideLoading()
this.carList = res.data
} }
}) })
}, },
...@@ -155,14 +170,14 @@ export default { ...@@ -155,14 +170,14 @@ export default {
.love__item { .love__item {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2); box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
border-radius: 20rpx; border-radius: 20rpx;
padding: 30rpx; padding:20rpx 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.itme__img { .itme__img {
margin-right:30rpx;
image { image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
...@@ -170,12 +185,22 @@ export default { ...@@ -170,12 +185,22 @@ export default {
} }
.item__title { .item__title {
font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 48rpx; line-height: 48rpx;
width: 350rpx; // width: 350rpx;
.title{
font-size: 34rpx;
font-weight: bold;
}
.type{
color: #666666;
font-size: 28rpx;
}
.route{
font-size: 30rpx;
}
} }
.item__edit { .item__edit {
......
...@@ -45,8 +45,11 @@ export default { ...@@ -45,8 +45,11 @@ export default {
pay(){ pay(){
let token = uni.getStorageSync('userToken'); let token = uni.getStorageSync('userToken');
if(!token){ if(!token){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pagesC/pages/shop/detail&id=' + this.id
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index?url=/pagesC/pages/shop/detail&id=' + this.id url: '/pages/login/index/index'
}) })
return; return;
} }
......
<template>
<!-- 我的订单 -->
<view class="my-jd-order">
<view class="box">
<text>订单信息请前往京东查看</text>
<view class="btn">
前往京东查看
</view>
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.my-jd-order{
width:100%;height:100vh;
display: flex;
align-items: center;
justify-content: center;
.box{
position: relative;
top:-120rpx;
text-align: center;
text{
font-size:36rpx;
font-weight: bold;
}
.btn{
width:660rpx;
line-height:80rpx;
margin:50rpx auto 0;
text-align: center;
color:#fff;
font-size: 32rpx;
border-radius:50rpx;
background: linear-gradient(to right, #E2241B , #E14A1B);
}
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment