Commit 5782232f authored by lijiongliang's avatar lijiongliang

提示修改

parent 152a3170
// const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地址 const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地址
const baseUrl = 'http://4v7u6z.natappfree.cc'; // 开发地址 // const baseUrl = 'http://4v7u6z.natappfree.cc'; // 开发地址
// const baseUrl = 'https://jduniapp.uzosp.com'; // 线上地址 // const baseUrl = 'https://jduniapp.uzosp.com'; // 线上地址
const httpRequest = (opts, data) => { const httpRequest = (opts, data) => {
let httpDefaultOpts = { let httpDefaultOpts = {
...@@ -61,7 +61,7 @@ const httpTokenRequest = (opts, data) => { ...@@ -61,7 +61,7 @@ const httpTokenRequest = (opts, data) => {
let promise = new Promise(function(resolve, reject) { let promise = new Promise(function(resolve, reject) {
uni.request(httpDefaultOpts).then( uni.request(httpDefaultOpts).then(
(res) => { (res) => {
console.log(33333333333,res[1]) // console.log(33333333333,res[1])
if(res[1].data.code == 401){ if(res[1].data.code == 401){
uni.removeStorageSync('userToken') uni.removeStorageSync('userToken')
uni.navigateTo({ uni.navigateTo({
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
}else{ }else{
sku = 100025676611 sku = 100025676611
} }
console.log(sku,777777777) // console.log(sku,777777777)
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku='+sku, // 目标小程序的页面路径 path: 'pages/item/detail/detail?sku='+sku, // 目标小程序的页面路径
...@@ -258,6 +258,11 @@ ...@@ -258,6 +258,11 @@
imgList.push(e) imgList.push(e)
}) })
this.list5 = imgList this.list5 = imgList
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
});
} }
}) })
}, },
...@@ -314,7 +319,7 @@ ...@@ -314,7 +319,7 @@
}, },
}, },
created() { created() {
this.getMoveCode() // this.getMoveCode()
this.getRotationList() this.getRotationList()
}, },
mounted() { mounted() {
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
}) })
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
console.log(res,111111) // console.log(res,111111)
if (res.from === 'menu') { if (res.from === 'menu') {
return { return {
title: '京东汽车挪车牌', title: '京东汽车挪车牌',
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
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
console.log(xcxIndexPath,path,'扫一扫进入') // console.log(xcxIndexPath,path,'扫一扫进入')
if (xcxIndexPath) { if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace( xcxIndexPath = path.replace(xcxIndexPath, '').replace(
"?", '') "?", '')
...@@ -211,6 +211,11 @@ ...@@ -211,6 +211,11 @@
if (res.data.code == 200) { if (res.data.code == 200) {
that.openid = res.data.data.openid that.openid = res.data.data.openid
uni.setStorageSync('openid', that.openid); uni.setStorageSync('openid', that.openid);
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
});
} }
}) })
}, },
...@@ -292,7 +297,7 @@ ...@@ -292,7 +297,7 @@
message message
} = res; } = res;
if (!token) { if (!token) {
console.log(res,"pin_key失效") // console.log(res,"pin_key失效")
uni.navigateTo({ uni.navigateTo({
url:"/pages/login/index/index" url:"/pages/login/index/index"
}) })
...@@ -324,7 +329,7 @@ ...@@ -324,7 +329,7 @@
// 判断是否扫码进入 // 判断是否扫码进入
that.scene = uni.getStorageSync('scene') that.scene = uni.getStorageSync('scene')
console.log(that.scene,"微信扫码进入") // console.log(that.scene,"微信扫码进入")
if (that.scene) { if (that.scene) {
//获取二维码携带的参数 //获取二维码携带的参数
//扫码后得到的参数 //扫码后得到的参数
...@@ -366,7 +371,7 @@ ...@@ -366,7 +371,7 @@
}) })
}else{ }else{
// 判断是否扫码进入 // 判断是否扫码进入
console.log("扫码进入但是未登录") // console.log("扫码进入但是未登录")
if (option && option.scene) { if (option && option.scene) {
uni.setStorageSync('scene', decodeURIComponent(option.scene)) uni.setStorageSync('scene', decodeURIComponent(option.scene))
let returnPage= '/pages/main'; let returnPage= '/pages/main';
...@@ -379,7 +384,7 @@ ...@@ -379,7 +384,7 @@
}else{ }else{
// 判断是否扫码进入 // 判断是否扫码进入
if (option && option.scene) { if (option && option.scene) {
console.log(option.scene,"扫码一登录") // console.log(option.scene,"扫码一登录")
//获取二维码携带的参数 //获取二维码携带的参数
//扫码后得到的参数 //扫码后得到的参数
that.scene = decodeURIComponent(option.scene) that.scene = decodeURIComponent(option.scene)
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
} }
that.http.httpTokenRequest(opts, param).then(res => { that.http.httpTokenRequest(opts, param).then(res => {
console.log(res, "扫码通知车主") // console.log(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)
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: 'none', icon: 'none',
icon: 'error',
}) })
} }
}) })
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
uni.removeStorageSync('xcxIndexPath') uni.removeStorageSync('xcxIndexPath')
// uni.removeStorageSync('openid') // uni.removeStorageSync('openid')
plugin.logout().then((res) => { plugin.logout().then((res) => {
console.jdLoginLog(res, 'logoutres'); // console.jdLoginLog(res, 'logoutres');
uni.reLaunch({ uni.reLaunch({
url: '/pages/main' url: '/pages/main'
}); });
...@@ -234,7 +234,13 @@ export default { ...@@ -234,7 +234,13 @@ export default {
if(this.userInfo.avatar){ if(this.userInfo.avatar){
this.avatar = this.userInfo.avatar this.avatar = this.userInfo.avatar
} }
} }else{
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
}
}) })
}, },
openMsg() { openMsg() {
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
methods: { methods: {
scroll: function (e) { scroll: function (e) {
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
console.log(this.old.scrollTop); // console.log(this.old.scrollTop);
}, },
goTop() { goTop() {
this.scrollTop = this.old.scrollTop this.scrollTop = this.old.scrollTop
...@@ -118,6 +118,11 @@ export default { ...@@ -118,6 +118,11 @@ export default {
} else { } else {
// 加载失败 // 加载失败
this.$refs.list.loadFail() this.$refs.list.loadFail()
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
} }
}) })
}, this.$u.random(100, 1000)); }, this.$u.random(100, 1000));
......
...@@ -116,6 +116,7 @@ export default { ...@@ -116,6 +116,7 @@ export default {
}); });
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 => {
// console.log(res,222222)
if (res.statusCode == 200) { if (res.statusCode == 200) {
uni.hideLoading() uni.hideLoading()
this.carList = res.data || [] this.carList = res.data || []
......
...@@ -75,6 +75,11 @@ export default { ...@@ -75,6 +75,11 @@ export default {
} }
list.push({title: "绑定手机号", value: data.userMobile}) list.push({title: "绑定手机号", value: data.userMobile})
this.items = list this.items = list
}else{
uni.showToast({
title: res.data.msg,
icon: "none",
});
} }
}) })
}, },
......
This diff is collapsed.
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
//查询挪车码失败 //查询挪车码失败
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: "error", icon: "none",
}); });
} }
}) })
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
let searchCondition = { let searchCondition = {
searchVal: this.keyword searchVal: this.keyword
} }
console.log(searchCondition,222222222) // console.log(searchCondition,222222222)
let opts = { url: '/app/index/mall/list', method: 'get' }; let opts = { url: '/app/index/mall/list', method: 'get' };
this.http.httpRequest(opts, searchCondition).then(res => { this.http.httpRequest(opts, searchCondition).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
......
...@@ -45,6 +45,12 @@ export default { ...@@ -45,6 +45,12 @@ export default {
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.askingList = res.data.data this.askingList = res.data.data
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
} }
}) })
}, },
......
...@@ -3,157 +3,166 @@ ...@@ -3,157 +3,166 @@
* @Description: 帮助使用 * @Description: 帮助使用
--> -->
<template> <template>
<view class="appCotent"> <view class="appCotent">
<div class="hlep"> <div class="hlep">
<!-- <u-cell-group> <!-- <u-cell-group>
<u-cell title="设置消息订阅" :isLink="true" @click="openMsg()"></u-cell> <u-cell title="设置消息订阅" :isLink="true" @click="openMsg()"></u-cell>
</u-cell-group> --> </u-cell-group> -->
<image v-if="image" :src="image" /> <image v-if="image" :src="image" />
<image v-else src="@/static/my/help.png"/> <image v-else src="@/static/my/help.png" />
</div> </div>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
image: '', image: '',
//是否订阅消息 //是否订阅消息
is_authorization: uni.getStorageSync('is_authorization'), is_authorization: uni.getStorageSync('is_authorization'),
} }
}, },
methods: { methods: {
getHelpInfo() { getHelpInfo() {
let opts = {url: '/app/user/help', method: 'get'}; let opts = {
this.http.httpTokenRequest(opts, {}).then(res => { url: '/app/user/help',
if (res.data.code == 200) { method: 'get'
if (res.data.data.imgPath != '') { };
this.image = res.data.data.imgPath this.http.httpTokenRequest(opts, {}).then(res => {
} if (res.data.code == 200) {
} if (res.data.data.imgPath != '') {
}) this.image = res.data.data.imgPath
}, }
//获取消息订阅 }else{
openMsg() { uni.showToast({
var that = this; title: res.data.msg,
let nc_templateid = that.nc_templateid; icon: 'none',
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问” duration: 2000
wx.getSetting({ });
withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回 }
success(res) { })
if (that.is_authorization) { },
//获取消息订阅
openMsg() {
var that = this;
let nc_templateid = that.nc_templateid;
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx.getSetting({
withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
success(res) {
if (that.is_authorization) {
} else { } else {
if (res.subscriptionsSetting[nc_templateid] == "reject") { if (res.subscriptionsSetting[nc_templateid] == "reject") {
//用户点击了“总是保持以上,不再询问” //用户点击了“总是保持以上,不再询问”
wx.showModal({ wx.showModal({
title: "温馨提示", title: "温馨提示",
content: "检测到您没有开启订阅消息的权限,是否去设置?", content: "检测到您没有开启订阅消息的权限,是否去设置?",
success: function (modal) { success: function(modal) {
if (modal.confirm) { if (modal.confirm) {
// 点击肯定 // 点击肯定
wx.openSetting({ wx.openSetting({
withSubscriptions: true, withSubscriptions: true,
}); });
that.is_authorization = true; that.is_authorization = true;
uni.setStorageSync("is_authorization", true); uni.setStorageSync("is_authorization", true);
} else { } else {
uni.showToast({ uni.showToast({
title: "您已拒绝订阅消息授权,无法接收通知", title: "您已拒绝订阅消息授权,无法接收通知",
icon: "error", icon: "error",
}); });
that.is_authorization = false; that.is_authorization = false;
} }
}, },
}); });
} else { } else {
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
// var templateid = that.setting.templateid.map(item => item.tempid); // var templateid = that.setting.templateid.map(item => item.tempid);
let tmpid = [nc_templateid]; let tmpid = [nc_templateid];
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: tmpid, tmplIds: tmpid,
success(res) { success(res) {
if (res[tmpid[0]] == "accept") { if (res[tmpid[0]] == "accept") {
uni.showToast({ uni.showToast({
title: "订阅成功", title: "订阅成功",
icon: "none", icon: "none",
}); });
that.is_authorization = true; that.is_authorization = true;
uni.setStorageSync("is_authorization", true); uni.setStorageSync("is_authorization", true);
} else { } else {
uni.showToast({ uni.showToast({
title: "您拒绝订阅消息授权,无法接收通知", title: "您拒绝订阅消息授权,无法接收通知",
icon: "none", icon: "none",
}); });
that.is_authorization = false; that.is_authorization = false;
} }
}, },
fail: (res) => { fail: (res) => {
wx.showModal({ wx.showModal({
title: "温馨提示", title: "温馨提示",
content: "检测到您没有开启订阅消息的权限,是否去设置?", content: "检测到您没有开启订阅消息的权限,是否去设置?",
success: function (modal) { success: function(modal) {
if (modal.confirm) { if (modal.confirm) {
// 点击肯定 // 点击肯定
wx.openSetting({ wx.openSetting({
withSubscriptions: true, withSubscriptions: true,
}); });
that.is_authorization = true; that.is_authorization = true;
uni.setStorageSync("is_authorization", true); uni.setStorageSync("is_authorization",
} else { true);
uni.showToast({ } else {
title: "您已拒绝订阅消息授权,无法接收通知", uni.showToast({
icon: "error", title: "您已拒绝订阅消息授权,无法接收通知",
}); icon: "error",
that.is_authorization = false; });
} that.is_authorization = false;
}, }
}); },
}, });
}); },
} });
} }
}, }
}); },
}, });
//改变消息订阅 },
changeMessages() { //改变消息订阅
wx.openSetting({ changeMessages() {
withSubscriptions: true, wx.openSetting({
}); withSubscriptions: true,
// if(!this.is_authorization){ });
// wx.openSetting({ // if(!this.is_authorization){
// withSubscriptions: true, // wx.openSetting({
// }); // withSubscriptions: true,
// this.is_authorization = false; // });
// uni.setStorageSync("is_authorization", false); // this.is_authorization = false;
// }else{ // uni.setStorageSync("is_authorization", false);
// wx.openSetting({ // }else{
// withSubscriptions: true, // wx.openSetting({
// }); // withSubscriptions: true,
// this.is_authorization = false; // });
// uni.setStorageSync("is_authorization", false); // this.is_authorization = false;
// } // uni.setStorageSync("is_authorization", false);
// }
},
},
onShow() {
this.getHelpInfo()
//this.openMsg()
},
}
},
},
onShow() {
this.getHelpInfo()
//this.openMsg()
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.hlep { .hlep {
padding: 0rpx 0; padding: 0rpx 0;
height: 1092rpx; height: 1092rpx;
image { image {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -163,7 +163,13 @@ export default { ...@@ -163,7 +163,13 @@ export default {
this.http.httpTokenRequest(opts, userInfoItem).then(response => { this.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) { if (response.data.code == 200) {
} }else{
uni.showToast({
title: response.data.msg,
icon: 'none',
duration: 2000
});
}
}) })
} }
}); });
...@@ -185,7 +191,13 @@ export default { ...@@ -185,7 +191,13 @@ export default {
this.http.httpTokenRequest(opts, userInfoItem).then(response => { this.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) { if (response.data.code == 200) {
} }else{
uni.showToast({
title: response.data.msg,
icon: 'none',
duration: 2000
});
}
}) })
} }
}); });
...@@ -208,7 +220,13 @@ export default { ...@@ -208,7 +220,13 @@ export default {
that.http.httpTokenRequest(opts, userInfoItem).then(response => { that.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) { if (response.data.code == 200) {
this.getUserInfo() this.getUserInfo()
} }else{
uni.showToast({
title: response.data.msg,
icon: 'none',
duration: 2000
});
}
}) })
} }
}); });
......
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