我的订单+我的
This commit is contained in:
168
common/commonJS.js
Normal file
168
common/commonJS.js
Normal file
@@ -0,0 +1,168 @@
|
||||
|
||||
import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'
|
||||
import $http from '@/config/requestConfig'
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
export default {
|
||||
...mapMutations(["setUserInfo"]),
|
||||
|
||||
// imgShow(url){
|
||||
// if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
// return oss访问图片地址 + img;
|
||||
// } else {
|
||||
// return oss访问图片地址 + img + '?x-oss-process=image/format,webp'; }
|
||||
|
||||
// },
|
||||
|
||||
|
||||
showToast(title, icon) {
|
||||
return uni.showToast({
|
||||
title: title,
|
||||
icon: icon ? icon : 'none'
|
||||
})
|
||||
},
|
||||
//拨打电话
|
||||
handleMakingPhoneCalls(value, title) {
|
||||
uni.showModal({
|
||||
title: title ? title : '联系我们',
|
||||
content: value,
|
||||
confirmText: '确认',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: value, //电话号码
|
||||
success: function (e) {
|
||||
console.log(e);
|
||||
},
|
||||
fail: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//复制内容
|
||||
handleCopy(value, title) {
|
||||
uniCopy({
|
||||
content: value,
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: title + '复制成功',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
error: (e) => {
|
||||
// uni.showToast({
|
||||
// title: e,
|
||||
// icon: 'none',
|
||||
// duration:3000,
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//用户协议
|
||||
async getAgreement(id) {
|
||||
console.log('id at line 56:', id)
|
||||
var data = {
|
||||
id: id
|
||||
}
|
||||
var result = {
|
||||
title:'',
|
||||
content:''
|
||||
}
|
||||
await $http
|
||||
.request({
|
||||
url: "sys/agreement/getAgreement",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: data,
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).then((res) => {
|
||||
console.log('res at line 111:', res)
|
||||
if (res.code == 0) {
|
||||
result = res.agreement
|
||||
}
|
||||
|
||||
})
|
||||
return result
|
||||
},
|
||||
async getCheckCourseStatus(data) {
|
||||
var result
|
||||
await $http
|
||||
.post('app/phone.do?getCheckCourseStatus', {
|
||||
customerType
|
||||
:
|
||||
"D",
|
||||
token
|
||||
: uni.getStorageSync("token")
|
||||
,
|
||||
customerOid
|
||||
: uni.getStorageSync("customerOid"),
|
||||
oid: data.oid
|
||||
|
||||
|
||||
|
||||
})
|
||||
.then(async res => {
|
||||
|
||||
result = res.obj
|
||||
|
||||
|
||||
})
|
||||
return result
|
||||
},
|
||||
// 退出登录
|
||||
signOut() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定要退出当前账户吗?",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
setUserInfo({ token: null });
|
||||
uni.reLaunch({
|
||||
url: "/pages/user/login/login",
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
// 取消操作
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
// this.signShow = false;
|
||||
// this.setUserInfo({ token: null });
|
||||
// uni.reLaunch({
|
||||
// url: "/pages/user/login/login",
|
||||
// });
|
||||
}, // 注销账户
|
||||
logout() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定要注销当前账户吗?",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
showCancel: false,
|
||||
content: `注销申请已提交成功,请联系客服进行后续操作:022-24142321`,
|
||||
success: function (res1) {
|
||||
if (res1.confirm) {
|
||||
that.signOut();
|
||||
}
|
||||
},
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
// 取消操作
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user