Commit d519adff authored by lijiongliang's avatar lijiongliang

逻辑修改

parent 13981ac8
const baseUrl = 'https://r.ucaret.cn/test-api';
// const baseUrl = 'http://nrucci.natappfree.cc';
// const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地址
const baseUrl = 'https://jduniapp.uzosp.com'; // 线上地址
const httpRequest = (opts, data) => {
let httpDefaultOpts = {
url: baseUrl + opts.url,
......
......@@ -61,7 +61,10 @@
"mp-weixin" : {
"appid" : "wx8fd4dc1c4b9f6f41",
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"minified" : true,
"es6" : true,
"postcss" : false
},
"usingComponents" : true,
"permission" : {
......@@ -69,10 +72,10 @@
"desc" : "你的位置信息将用于定位"
}
},
"plugins": {
"loginPlugin": {
"version": "1.5.4",
"provider": "wxefe655223916819e"
"plugins" : {
"loginPlugin" : {
"version" : "1.5.4",
"provider" : "wxefe655223916819e"
}
}
},
......
......@@ -275,7 +275,7 @@
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "首页",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#ffffff",
"rpxCalcMaxDeviceWidth": 750, // rpx 计算所支持的最大设备宽度,单位 px,默认值为 960
......
......@@ -95,8 +95,9 @@
methods: {
goJdLogin(){
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url:"/pages/login/index/index"
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
},
getPrice() {
......@@ -136,11 +137,6 @@
// }
// });
this.pooupCoupon = true
// util.h5Init(); //
plugin.getLoginToken().then((res={})=>{
//res.err_code 0 res.token_key
//tokenB
if(res.token_key){
this.timer = setInterval(()=>{
if(this.timerNum > 0){
this.timerNum --
......@@ -160,8 +156,6 @@
clearInterval(this.timer)
}
},1000)
}
})
} else {
//跳转到领取优惠卷页面
// uni.navigateTo({
......
export let config = {
appid: 1814,
returnPage: '/pages/main',
pageType: undefined,
pageType: "switchTab",
isLogout: 1,
noWXinfo: 1,
h5path: undefined,
......
......@@ -54,30 +54,7 @@
// 领券判断
let firstCoupon= uni.getStorageSync('firstCoupon') || false
if(firstCoupon){
// let opts = { url: '/app/user/send/coupon', method: 'post' };
// this.http.httpTokenRequest(opts, {}).then(res => {
// if(res.data.code == 200){
// }
// })
uni.removeStorageSync('firstCoupon')
uni.showToast({
title: "领取成功!",
icon: 'none',
});
let timer = setTimeout(()=>{
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success:(res)=> {
// 打开成功
clearTimeout(timer)
}
})
},600)
this.getCarList()
}
},
onReachBottom() {
......@@ -152,8 +129,10 @@
}
});
} else {
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url: '/pages/login/index/index'
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
}
break;
......@@ -204,8 +183,49 @@
}
})
},
// 获取爱车列表
getCarList(){
uni.removeStorageSync('firstCoupon')
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.statusCode == 200) {
this.carList = res.data
if(res.data.length > 0){
let opts = { url: '/app/user/send/coupon', method: 'post' };
this.http.httpTokenRequest(opts, {}).then(res => {
if(res.data.code == 200){
uni.showToast({
title: "领取成功!",
icon: 'none',
});
let timer = setTimeout(()=>{
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success:(res)=> {
// 打开成功
clearTimeout(timer)
}
})
},600)
}
})
}else{
uni.showToast({
title: "请添加爱车后再领取!",
icon: 'none',
duration: 1500
});
}
}
})
}
},
onLoad(option) {
console.log(option,888888888)
// 静默授权获取openid
let openid = uni.getStorageSync('openid');
if (!openid) {
......@@ -240,7 +260,7 @@
token,
message
} = res;
console.log(res,22222222)
console.log(res,"pin_key失效")
if (!token) {
uni.navigateTo({
url:"/pages/login/index/index"
......@@ -289,6 +309,12 @@
that.gotoBindMoveCar(that.scene);
}
uni.removeStorageSync('scene')
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
}
})
}
......@@ -302,16 +328,20 @@
})
}else{
// 判断是否扫码进入
console.log("扫码进入但是未登录")
if (option && option.scene) {
uni.setStorageSync('scene', decodeURIComponent(option.scene))
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url:"/pages/login/index/index"
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
}
}
}else{
// 判断是否扫码进入
if (option && option.scene) {
console.log(option.scene,"扫码一登录")
//获取二维码携带的参数
//扫码后得到的参数
that.scene = decodeURIComponent(option.scene)
......@@ -327,6 +357,12 @@
} else {
that.gotoBindMoveCar(that.scene);
}
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
}
})
}
......
......@@ -152,8 +152,10 @@ export default {
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url: '/pages/login/index/index'
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
return;
}
......@@ -167,8 +169,10 @@ export default {
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url: '/pages/login/index/index'
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
return;
}
......
......@@ -157,8 +157,10 @@ export default {
goDetail(id,link) {
let token = uni.getStorageSync('userToken');
if(!token){
let returnPage= '/pages/main';
let pageType = "reLaunch"
uni.navigateTo({
url: '/pages/login/index/index'
url:"/pages/login/index/index?returnPage="+returnPage+'&pageType='+pageType
})
return;
}
......
......@@ -56,18 +56,58 @@
url: '/app/user/send/coupon',
method: 'post'
};
// this.http.httpTokenRequest(opts, {}).then(res => {
// console.log(res.data, 1111111)
// if (res.data.code == 200) {
this.http.httpTokenRequest(opts, {}).then(res => {
console.log(res.data, 1111111)
if (res.data.code == 200) {
uni.showToast({
title: "领取成功!",
icon: 'none',
});
this.pooupSuccess = true
let timer = setInterval(() => {
if (this.timerNum > 0) {
this.timerNum--
} else {
this.pooupSuccess = false
this.timerNum = 3
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {// 打开成功
}
})
clearInterval(timer)
}
}, 1000)
}else if(res.data.code == 1000000001){
uni.showToast({
title: "您已领取优惠券!",
icon: 'none',
duration:1500,
success() {
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {// 打开成功
}
})
}
});
}
})
// uni.showToast({
// title: "领取成功!",
// icon: 'none',
// });
// this.pooupSuccess = true
// let timer = setInterval(() => {
// if (this.timerNum > 0) {
// this.timerNum--
// } else {
// let timer = setInterval(()=>{
// if(this.timerNum > 0){
// this.timerNum --
// }else{
// this.pooupSuccess = false
// this.timerNum = 3
// uni.navigateToMiniProgram({
......@@ -82,51 +122,7 @@
// })
// clearInterval(timer)
// }
// }, 1000)
// }else if(res.data.code == 1000000001){
// uni.showToast({
// title: "您已领取优惠券!",
// icon: 'none',
// duration:1500,
// success() {
// uni.navigateToMiniProgram({
// appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
// path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
// extraData: { // 需要携带的参数
// },
// success(res) {
// // 打开成功
// }
// })
// }
// });
// }
// })
uni.showToast({
title: "领取成功!",
icon: 'none',
});
this.pooupSuccess = true
let timer = setInterval(()=>{
if(this.timerNum > 0){
this.timerNum --
}else{
this.pooupSuccess = false
this.timerNum = 3
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {
// 打开成功
}
})
clearInterval(timer)
}
},1000)
// },1000)
},
goUseCoupon() {
this.timerNum = 3;
......
......@@ -31,7 +31,7 @@
<u-checkbox-group placement="row">
<u-checkbox :checked='checked' @change="changeBtn"></u-checkbox>
</u-checkbox-group>
请先阅读并同意<span @click="goArticle">《京东挪车牌隐私权政策》</span>
请先阅读并同意<span @click="goArticle(2)">《京东挪车牌隐私权政策》</span>
</div>
</div>
<div class="view__btn view__no__bind" @click="confirmBinding">
......@@ -209,6 +209,27 @@ export default {
})
}
},
// 跳转协议政策页面
goArticle(index) {
let opts = {
url: '',
method: 'get'
};
if (index == 1) {
opts.url = "/app/user/registerAgreement"
} else {
opts.url = "/app/user/ofPrivacy"
}
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = res.data.msg
uni.setStorageSync("articelContent", data)
uni.navigateTo({
url: '/pages/binding/article'
});
}
})
}
},
onLoad(option) {
this.moveCode = option.moveCode
......
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