first commit
This commit is contained in:
1
金壶/appV1/utils/.pydio
Normal file
1
金壶/appV1/utils/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0f668d40-41e9-4be3-8eb2-cdf67e12117a
|
||||
69
金壶/appV1/utils/api.js
Normal file
69
金壶/appV1/utils/api.js
Normal file
@@ -0,0 +1,69 @@
|
||||
export default {
|
||||
x_register: '/user/register_App', //注册
|
||||
phonecode_app: '/user/phonecode_App', //手机短信验证码
|
||||
login: '/token/login', // 登录
|
||||
forgetPassword_app: '/user/forgetPassword_App', // 忘记密码
|
||||
|
||||
|
||||
x_Classification: '/Classification/index', //商品分类
|
||||
|
||||
message_getList: '/message/getList', // 消息列表
|
||||
service_getList: '/service/getList', // 售后列表
|
||||
service_getInfo: '/service/getInfo', // 售后详情
|
||||
x_index: '/index/index', //首页
|
||||
x_activity: '/activity/index', //活动详情
|
||||
x_searchList:'/Goods/searchList', // 搜索列表
|
||||
x_cancelOrder:'/order/cancel', //取消订单
|
||||
x_order_count:'/order/count', //订单数量
|
||||
x_shoppingCar: '/cart/getList', //购物车
|
||||
x_Collectlsit: '/Goods/Collectlsit', // 商品收藏列表
|
||||
X_addCollect_app: '/Goods/addCollect_app', //商品收藏
|
||||
x_goodsDetail: '/Goods/detail', // 商品详情
|
||||
x_tell: '/user/tell', //用户手机号码(个人中心)
|
||||
X_delCar: '/cart/multiDel', // 删除购物车
|
||||
X_getAliyunOssStsToken: '/ThirdApi/getAliyunOssStsToken', //上传阿里云图片,获取签名
|
||||
|
||||
|
||||
|
||||
// 热搜
|
||||
goodsRanking: '/Goods/goodsRanking',
|
||||
// 商品搜索
|
||||
search: '/Goods/search',
|
||||
// 商品列表
|
||||
goodsList: '/Goods/goodsList',
|
||||
X_submitSuggestion: '/index/submitSuggestion', //意见反馈
|
||||
X_accountInfo: '/SystemConstant/accountInfo', //对公账户
|
||||
x_custOmer:'/index/custOmer', // 专属客服
|
||||
|
||||
|
||||
// 收货地址
|
||||
shippingAddress: '/UserAddress/addresss',
|
||||
// 地址列表
|
||||
addressList: '/UserAddress/getAddressList',
|
||||
// 默认地址
|
||||
defaultAddress: '/UserAddress/setDefaultAddress',
|
||||
// 更新/新增收货地址
|
||||
makeChangeAddress: '/UserAddress/makeChangeAddress',
|
||||
// 删除配送地址
|
||||
deleteAddress: '/UserAddress/deleteAddress',
|
||||
|
||||
|
||||
// 企业认证检测
|
||||
checkAuth: '/user/checkAuth',
|
||||
// 企业认证第一步
|
||||
authBaisc: '/user/authBaisc',
|
||||
// 企业认证第二步
|
||||
authCertificate: '/user/authCertificate',
|
||||
// 企业认证第三步
|
||||
authBank: '/user/authBank',
|
||||
|
||||
|
||||
X_addCar: '/cart/add', // 添加购物车
|
||||
X_editphone: '/user/editPassword', //登录后,修改密码
|
||||
X_orderPreview: '/order/preview', //确认订单
|
||||
X_treeUserAddress: '/UserAddress/addresss', //地区三级地址
|
||||
X_appPay: '/pay/appPay', //支付
|
||||
X_create_order: '/order/submit', // 创建订单
|
||||
X_toPay: '/order/toPay', //去支付
|
||||
X_update:'/cart/update', //加减购物车数量
|
||||
}
|
||||
336
金壶/appV1/utils/http.js
Normal file
336
金壶/appV1/utils/http.js
Normal file
@@ -0,0 +1,336 @@
|
||||
import {Config} from './config'
|
||||
|
||||
|
||||
export const http_use = function(params,data) { // 实际使用的 请求方法
|
||||
// uni.showLoading({
|
||||
// title: '加载中',
|
||||
// mask: true
|
||||
// })
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
uni.request({
|
||||
url: Config.baseUrl + params, // 仅为示例,并非真实的接口地址
|
||||
method: 'get',
|
||||
data: data,
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded', // 默认值
|
||||
// 'Authorization': Config.Authorization,
|
||||
'authentication':uni.getStorageSync('isAuthentication') //加密后签名
|
||||
},
|
||||
success: function(res) {
|
||||
|
||||
// uni.hideLoading()
|
||||
if(res.data.code == 40000){
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
duration: 2000
|
||||
});
|
||||
uni.removeStorageSync('isAuthentication');
|
||||
setTimeout(function(){
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/x_login'
|
||||
})
|
||||
}, 1000);
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请先登录',
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// uni.removeStorageSync('isAuthentication');
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// } else if (res.cancel) {
|
||||
// // console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
if(res.data.errcode == 5000) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
return
|
||||
}
|
||||
if(res.data.code == 500) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
return
|
||||
}
|
||||
if(res.data.code == 40000){
|
||||
// uni.showToast({
|
||||
// title: res.data.message,
|
||||
// duration: 2000,
|
||||
// icon:"none"
|
||||
// });
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
}
|
||||
if(res.data.code == 200) {
|
||||
|
||||
resolve(res.data)
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
// uni.hideLoading()
|
||||
reject(res)
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
export const http_post = function(params,data,loading = true) { // 实际使用的 请求方法
|
||||
if(loading){
|
||||
// uni.showLoading({
|
||||
// title: '加载中',
|
||||
// mask: true
|
||||
// })
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: Config.baseUrl + params, // 仅为示例,并非真实的接口地址
|
||||
method: 'post',
|
||||
data: data,
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded', // 默认值
|
||||
// 'Authorization': Config.Authorization,
|
||||
'authentication':uni.getStorageSync('isAuthentication') //加密后签名
|
||||
},
|
||||
success: function(res) {
|
||||
|
||||
// uni.hideLoading()
|
||||
if(res.data.code == 40000){
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
duration: 2000
|
||||
});
|
||||
uni.removeStorageSync('isAuthentication');
|
||||
setTimeout(function(){
|
||||
uni.reLaunch({
|
||||
url: '/pages/my/x_login'
|
||||
})
|
||||
}, 1000);
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '请登录',
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// uni.removeStorageSync('isAuthentication');
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// } else if (res.cancel) {
|
||||
// //console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
if(res.data.errcode){
|
||||
uni.getStorage({
|
||||
key: 'isAuthentication',
|
||||
success: function (res) {
|
||||
|
||||
}
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/my/x_login.vue'
|
||||
// })
|
||||
}
|
||||
if(res.code == 5000){
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
}
|
||||
if(res.data.code == 40001) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
return
|
||||
}
|
||||
if(res.data.code == 401) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
return
|
||||
}
|
||||
if(res.data.errcode == 40001) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(res.data.code == 500) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
if(res.data.code == 200) {
|
||||
|
||||
resolve(res.data)
|
||||
}else{
|
||||
|
||||
if(res.data.code == 40002) {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
// resolve(res.data)
|
||||
if(res.data.errcode == 5000) {
|
||||
// uni.showToast({
|
||||
// title: res.message,
|
||||
// duration: 2000,
|
||||
// icon:"none"
|
||||
// });
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
return
|
||||
}
|
||||
if(res.data.errcode == 40002) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
|
||||
return
|
||||
}
|
||||
if(res.data.code == 40000){
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
return
|
||||
}
|
||||
// if(res.data.message){
|
||||
// uni.showToast({
|
||||
// title: res.data.message,
|
||||
// duration: 2000,
|
||||
// icon:"none"
|
||||
// });
|
||||
// }
|
||||
if(res.data.msg){
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
}
|
||||
if(res.msg){
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
}
|
||||
return
|
||||
}
|
||||
if(res.message == 40000){
|
||||
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
}
|
||||
if(res.data.code == 40000){
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
// setTimeout(function(){
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/my/x_login'
|
||||
// })
|
||||
// }, 2000);
|
||||
}
|
||||
if(res.data.message){
|
||||
// uni.showToast({
|
||||
// title: res.data.message,
|
||||
// duration: 2000,
|
||||
// icon:"none"
|
||||
// });
|
||||
}
|
||||
},
|
||||
|
||||
fail: function(res) {
|
||||
// uni.hideLoading()
|
||||
|
||||
reject(res)
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
1
金壶/appV1/utils/iconfont/.pydio
Normal file
1
金壶/appV1/utils/iconfont/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
24f38e8f-5a29-4846-a84b-9cde29fef360
|
||||
322
金壶/appV1/utils/iconfont/iconfont.css
Normal file
322
金壶/appV1/utils/iconfont/iconfont.css
Normal file
@@ -0,0 +1,322 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* project id 1177806 */
|
||||
src: url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.eot');
|
||||
src: url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.eot?#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.woff2') format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.woff') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.ttf') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_1177806_p0ky0vpxq3.svg#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icongouwucheman:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.iconqr2:before {
|
||||
content: "\e6a5";
|
||||
}
|
||||
|
||||
.iconxiajiantou:before {
|
||||
content: "\e6cc";
|
||||
}
|
||||
|
||||
.iconmaidan:before {
|
||||
content: "\e61d";
|
||||
}
|
||||
|
||||
.iconarrow-right:before {
|
||||
content: "\e646";
|
||||
}
|
||||
|
||||
.iconshouye1:before {
|
||||
content: "\e622";
|
||||
}
|
||||
|
||||
.iconprofile:before {
|
||||
content: "\e608";
|
||||
}
|
||||
|
||||
.iconiconfontxuanzhong1:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.iconiconfontjiantou1:before {
|
||||
content: "\e631";
|
||||
}
|
||||
|
||||
.iconiconfontjiantou3:before {
|
||||
content: "\e633";
|
||||
}
|
||||
|
||||
.iconshanchu1:before {
|
||||
content: "\e68a";
|
||||
}
|
||||
|
||||
.iconyoujiantou:before {
|
||||
content: "\e699";
|
||||
}
|
||||
|
||||
.iconshouji1:before {
|
||||
content: "\e652";
|
||||
}
|
||||
|
||||
.iconxiazai19:before {
|
||||
content: "\e613";
|
||||
}
|
||||
|
||||
.iconshouzhi:before {
|
||||
content: "\e69b";
|
||||
}
|
||||
|
||||
.iconlajitong:before {
|
||||
content: "\e65d";
|
||||
}
|
||||
|
||||
.iconqianbao:before {
|
||||
content: "\e640";
|
||||
}
|
||||
|
||||
.iconx:before {
|
||||
content: "\e660";
|
||||
}
|
||||
|
||||
.iconshouye:before {
|
||||
content: "\e677";
|
||||
}
|
||||
|
||||
.iconqrcode:before {
|
||||
content: "\e7ce";
|
||||
}
|
||||
|
||||
.iconxunhuan:before {
|
||||
content: "\e636";
|
||||
}
|
||||
|
||||
.iconedit:before {
|
||||
content: "\e61c";
|
||||
}
|
||||
|
||||
.iconmima1:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
|
||||
.iconchakan:before {
|
||||
content: "\e68b";
|
||||
}
|
||||
|
||||
.iconjiantou9:before {
|
||||
content: "\e60b";
|
||||
}
|
||||
|
||||
.icondianhua:before {
|
||||
content: "\e614";
|
||||
}
|
||||
|
||||
.iconsousuo:before {
|
||||
content: "\e634";
|
||||
}
|
||||
|
||||
.iconchenggong:before {
|
||||
content: "\e666";
|
||||
}
|
||||
|
||||
.icondiancan:before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.icondizhi-01:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
|
||||
.iconshanchu:before {
|
||||
content: "\e679";
|
||||
}
|
||||
|
||||
.iconadd:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.iconphone-channel:before {
|
||||
content: "\e686";
|
||||
}
|
||||
|
||||
.icondizhi1:before {
|
||||
content: "\e734";
|
||||
}
|
||||
|
||||
.iconbaozhuang:before {
|
||||
content: "\e610";
|
||||
}
|
||||
|
||||
.iconshouji:before {
|
||||
content: "\e62e";
|
||||
}
|
||||
|
||||
.iconweb_xiangxiazhankai:before {
|
||||
content: "\e64e";
|
||||
}
|
||||
|
||||
.iconqicheqianlian-:before {
|
||||
content: "\e618";
|
||||
}
|
||||
|
||||
.iconbag_icon:before {
|
||||
content: "\e656";
|
||||
}
|
||||
|
||||
.icondingdan:before {
|
||||
content: "\e619";
|
||||
}
|
||||
|
||||
.iconmembership-card_icon:before {
|
||||
content: "\e678";
|
||||
}
|
||||
|
||||
.iconlianxiren:before {
|
||||
content: "\e6fe";
|
||||
}
|
||||
|
||||
.iconshanchu2:before {
|
||||
content: "\e620";
|
||||
}
|
||||
|
||||
.icontupian:before {
|
||||
content: "\e643";
|
||||
}
|
||||
|
||||
.iconjia:before {
|
||||
content: "\e690";
|
||||
}
|
||||
|
||||
.iconshouji2:before {
|
||||
content: "\e62f";
|
||||
}
|
||||
|
||||
.iconicon--:before {
|
||||
content: "\e768";
|
||||
}
|
||||
|
||||
.iconyunshuche:before {
|
||||
content: "\e671";
|
||||
}
|
||||
|
||||
.icondianzan1:before {
|
||||
content: "\e628";
|
||||
}
|
||||
|
||||
.icondianzan:before {
|
||||
content: "\e627";
|
||||
}
|
||||
|
||||
.icondizhi:before {
|
||||
content: "\e78e";
|
||||
}
|
||||
|
||||
.icontubiaozhizuomoban:before {
|
||||
content: "\e615";
|
||||
}
|
||||
|
||||
.iconyouhuiquan:before {
|
||||
content: "\e697";
|
||||
}
|
||||
|
||||
.iconjiahao:before {
|
||||
content: "\e616";
|
||||
}
|
||||
|
||||
.iconshanchu3:before {
|
||||
content: "\e6e8";
|
||||
}
|
||||
|
||||
.iconshijian:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.iconyouhuiquan1:before {
|
||||
content: "\e65f";
|
||||
}
|
||||
|
||||
.iconchakan1:before {
|
||||
content: "\e624";
|
||||
}
|
||||
|
||||
.iconicon:before {
|
||||
content: "\e612";
|
||||
}
|
||||
|
||||
.iconlipin:before {
|
||||
content: "\e617";
|
||||
}
|
||||
|
||||
.icondizhilan:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.iconmima:before {
|
||||
content: "\e728";
|
||||
}
|
||||
|
||||
.iconyunshu-:before {
|
||||
content: "\ee92";
|
||||
}
|
||||
|
||||
.icondaishouhuo:before {
|
||||
content: "\e653";
|
||||
}
|
||||
|
||||
.iconwode:before {
|
||||
content: "\e67b";
|
||||
}
|
||||
|
||||
.iconjiahao1:before {
|
||||
content: "\e657";
|
||||
}
|
||||
|
||||
.iconjifen:before {
|
||||
content: "\e61f";
|
||||
}
|
||||
|
||||
.iconjiahao2:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
||||
.iconxiangshangshuangjiantou:before {
|
||||
content: "\e70b";
|
||||
}
|
||||
|
||||
.iconwodedangxuan:before {
|
||||
content: "\e607";
|
||||
}
|
||||
|
||||
.icondianpu:before {
|
||||
content: "\e739";
|
||||
}
|
||||
|
||||
.iconchenggong1:before {
|
||||
content: "\e644";
|
||||
}
|
||||
|
||||
.iconshinshopdingdan:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.iconhuiyuanqia:before {
|
||||
content: "\e611";
|
||||
}
|
||||
|
||||
.iconziyuan:before {
|
||||
content: "\e621";
|
||||
}
|
||||
|
||||
.iconadd-fill:before {
|
||||
content: "\e645";
|
||||
}
|
||||
|
||||
37
金壶/appV1/utils/index.js
Normal file
37
金壶/appV1/utils/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
function formatNumber (n) {
|
||||
const str = n.toString()
|
||||
return str[1] ? str : `0${str}`
|
||||
}
|
||||
|
||||
export function formatTime (date) {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
const t1 = [year, month, day].map(formatNumber).join('/')
|
||||
const t2 = [hour, minute, second].map(formatNumber).join(':')
|
||||
|
||||
return `${t1} ${t2}`
|
||||
}
|
||||
|
||||
function getLocalStorage(key) {
|
||||
try {
|
||||
const value = uni.getStorageSync(key);
|
||||
if (value) {
|
||||
return value
|
||||
}
|
||||
return false
|
||||
} catch (e) {
|
||||
console.error("数据读取出错:", JSON.stringify(e))
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
formatNumber,
|
||||
formatTime,
|
||||
getLocalStorage
|
||||
}
|
||||
19
金壶/appV1/utils/login.js
Normal file
19
金壶/appV1/utils/login.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import {Config} from "@/utils/config.js"
|
||||
export default {
|
||||
get(){
|
||||
uni.getStorage({
|
||||
key: 'token',
|
||||
success: function (res) {
|
||||
// Config.Authorization = res.data
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/x_orderchuli'
|
||||
// });
|
||||
},
|
||||
fail:function(res){
|
||||
// console.log(res)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
金壶/appV1/utils/mixin/.pydio
Normal file
1
金壶/appV1/utils/mixin/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
468ef05c-11fa-4967-87dc-1345ad6c3abb
|
||||
120
金壶/appV1/utils/mixin/index.js
Normal file
120
金壶/appV1/utils/mixin/index.js
Normal file
@@ -0,0 +1,120 @@
|
||||
// import { mapGetters } from 'vuex'
|
||||
// import { js_api_list } from "@/config/wx_config.js";
|
||||
// import WxFn from "@/project/models/wx.js";
|
||||
// import Config from "@/config/index.js";
|
||||
// import store from '@/store/index.js'
|
||||
let noop = function () { }
|
||||
|
||||
export default {
|
||||
install(Vue) {
|
||||
Vue.mixin({
|
||||
methods: {
|
||||
goBack() {
|
||||
window.history.length > 1 ? this.$router.go(-1) : this.$router.push('/')
|
||||
},
|
||||
handleError(data, fn = noop) {
|
||||
|
||||
// 处理参数不正确时直接返回请求
|
||||
if (!data) return;
|
||||
if (!data.data && data.code === '1') return fn(data)
|
||||
// 登录失效
|
||||
if ( data.data.code == 400) {
|
||||
this.$createToast({
|
||||
time: 1500,
|
||||
txt: "登录失效",
|
||||
type: 'txt'
|
||||
}).show();
|
||||
setTimeout(() => {
|
||||
this.$router.replace({
|
||||
path: '/'
|
||||
})
|
||||
}, 1000)
|
||||
// 没有数据了
|
||||
} else if ( data.data.code == '500') {
|
||||
// this.$toast_defalut("参数错误");
|
||||
if (data.data.msg) {
|
||||
this.$createToast({
|
||||
time: 1500,
|
||||
txt: data.data.msg,
|
||||
type: 'txt'
|
||||
}).show();
|
||||
}
|
||||
} else {
|
||||
|
||||
fn(data)
|
||||
}
|
||||
},
|
||||
// wxConfig(fn) {
|
||||
// this.$nextTick(async () => {
|
||||
// let url = window.location.href.split("#")[0];
|
||||
// let res = await WxFn.wx_config(js_api_list, url);
|
||||
// this.handleError(res, res => {
|
||||
// if (window.wx) {
|
||||
// let data = res.data;
|
||||
// wx.config({
|
||||
// debug: data.debug, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
// appId: data.appId, // 必填,公众号的唯一标识
|
||||
// timestamp: data.timestamp, // 必填,生成签名的时间戳
|
||||
// nonceStr: data.nonceStr, // 必填,生成签名的随机串
|
||||
// signature: data.signature, // 必填,签名
|
||||
// jsApiList: data.jsApiList // 必填,需要使用的JS接口列表
|
||||
// });
|
||||
// // wx.ready(function () {
|
||||
// fn()
|
||||
// // alert(1);
|
||||
// // wx.hideAllNonBaseMenuItem();
|
||||
// // });
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
// },
|
||||
// shareArticle(info) {
|
||||
// let _this = this;
|
||||
// // alert('开始配置分享')
|
||||
// // debugger
|
||||
// wx.ready(function () {
|
||||
// // alert('分享函数执行前')
|
||||
// // wx.showAllNonBaseMenuItem();
|
||||
//
|
||||
// wx.updateAppMessageShareData({
|
||||
// // ..._this.share_info
|
||||
// title: info.title, // 分享标题
|
||||
// desc: info.desc, // 分享描述
|
||||
// link: info.url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
// imgUrl: _this.get_img_url + info.image, // 分享图标
|
||||
// success: function () {
|
||||
// // 设置成功
|
||||
// // alert('分享成功1')
|
||||
// }
|
||||
// });
|
||||
// wx.updateTimelineShareData({
|
||||
// title: info.title, // 分享标题
|
||||
// link: info.url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||
// imgUrl: _this.get_img_url + info.image, // 分享图标
|
||||
// success: function () {
|
||||
// // 设置成功
|
||||
// // alert('分享成功2')
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// wx.error(function (res) {
|
||||
// // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
||||
// // alert.log(JSON.stringify(res));
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// //唤起微信授权
|
||||
// wxAuth(){
|
||||
// let wxUrl = Config.baseUrl + 'api_wechat/server/getOauthUrl?source=business'
|
||||
// location.href = wxUrl
|
||||
// },
|
||||
},
|
||||
computed: {
|
||||
// ...mapGetters([
|
||||
// 'user',
|
||||
// 'get_img_url'
|
||||
// ]),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
1
金壶/appV1/utils/models/.pydio
Normal file
1
金壶/appV1/utils/models/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0807f328-c7d6-45af-913e-a31a04093eff
|
||||
66
金壶/appV1/utils/models/auth.js
Normal file
66
金壶/appV1/utils/models/auth.js
Normal file
@@ -0,0 +1,66 @@
|
||||
import {
|
||||
http_use,
|
||||
http_post
|
||||
} from '../http.js'
|
||||
import api from '../api'
|
||||
|
||||
class auth {
|
||||
|
||||
// 企业认证检测
|
||||
async userTypeInfo(key) {
|
||||
let res = await http_post('/common/userTypeInfo',{key})
|
||||
return res
|
||||
}
|
||||
|
||||
// 企业认证检测
|
||||
async checkAuth() {
|
||||
let res = await http_post(api.checkAuth, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 企业认证第一步
|
||||
async authBaisc(parames) {
|
||||
let res = await http_post(api.authBaisc, parames)
|
||||
return res
|
||||
}
|
||||
// 企业认证第一步
|
||||
async viewBaisc() {
|
||||
let res = await http_use(api.authBaisc)
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
// 企业认证第二步
|
||||
async authCertificate(parames) {
|
||||
let res = await http_post(api.authCertificate, parames)
|
||||
return res
|
||||
}
|
||||
|
||||
// 企业认证第二步
|
||||
async viewCertificate() {
|
||||
let res = await http_use(api.authCertificate)
|
||||
return res
|
||||
}
|
||||
|
||||
// 企业认证第三步
|
||||
async authBank(invoice_rise, tax_number, bank_name, bank_account, account_name) {
|
||||
|
||||
let res = await http_post(api.authBank, {
|
||||
invoice_rise,
|
||||
tax_number,
|
||||
bank_name,
|
||||
bank_account,
|
||||
account_name
|
||||
})
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// 企业认证第三步
|
||||
async viewBank() {
|
||||
let res = await http_use(api.authBank)
|
||||
return res
|
||||
}
|
||||
}
|
||||
export default new auth
|
||||
231
金壶/appV1/utils/models/goods.js
Normal file
231
金壶/appV1/utils/models/goods.js
Normal file
@@ -0,0 +1,231 @@
|
||||
import {http_use,http_post} from '../http.js'
|
||||
import api from '../api'
|
||||
|
||||
class X_goods {
|
||||
// 专属客服
|
||||
async x_custOmer() {
|
||||
|
||||
let res = await http_post(api.x_custOmer, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 订单数量
|
||||
async x_order_count() {
|
||||
|
||||
let res = await http_post(api.x_order_count, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// x_cancelOrder 取消订单
|
||||
async x_cancelOrder(order_id) {
|
||||
|
||||
let res = await http_post(api.x_cancelOrder, {
|
||||
order_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 搜索联动列表
|
||||
async x_searchList(name) {
|
||||
|
||||
let res = await http_post(api.x_searchList, {
|
||||
name
|
||||
})
|
||||
return res
|
||||
}
|
||||
//X_update 加减购物车数量
|
||||
async X_update(id,goods_number) {
|
||||
|
||||
let res = await http_post(api.X_update, {
|
||||
id,
|
||||
goods_number
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
// 上传阿里云图片 获取签名
|
||||
async X_getAliyunOssStsToken() {
|
||||
|
||||
let res = await http_post(api.X_getAliyunOssStsToken, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// X_submitSuggestion 意见反馈
|
||||
async X_submitSuggestion(status,phone,type,suggestion_content,pic_url) {
|
||||
|
||||
let res = await http_post(api.X_submitSuggestion, {
|
||||
status,
|
||||
phone,
|
||||
type,
|
||||
suggestion_content,
|
||||
pic_url
|
||||
})
|
||||
return res
|
||||
}
|
||||
//X_toPay 去支付
|
||||
async X_toPay(order_id) {
|
||||
|
||||
let res = await http_post(api.X_toPay, {
|
||||
order_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 创建订单
|
||||
async X_create_order(id_group,address,consignee,tel,remark,address_id) {
|
||||
|
||||
let res = await http_post(api.X_create_order, {
|
||||
id_group,
|
||||
address,
|
||||
consignee,
|
||||
tel,
|
||||
remark,
|
||||
address_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
//支付
|
||||
async X_appPay(order_id,pay_type) {
|
||||
console.log(order_id)
|
||||
let res = await http_post(api.X_appPay, {
|
||||
order_id,
|
||||
pay_type
|
||||
})
|
||||
console.log(res)
|
||||
return res
|
||||
}
|
||||
//X_treeUserAddress 地区三级地址
|
||||
async X_treeUserAddress() {
|
||||
|
||||
let res = await http_post(api.X_treeUserAddress, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
//X_orderPreview 确认订单
|
||||
async X_orderPreview(id_group) {
|
||||
|
||||
let res = await http_post(api.X_orderPreview, {
|
||||
id_group
|
||||
})
|
||||
return res
|
||||
}
|
||||
//添加购物车
|
||||
async X_addCar(gba_id,batch_id,goods_number,add_type) {
|
||||
|
||||
let res = await http_post(api.X_addCar, {
|
||||
gba_id,
|
||||
batch_id,
|
||||
goods_number,
|
||||
add_type
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 商品分类
|
||||
async x_Classification() {
|
||||
let res = await http_post(api.x_Classification, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 购物车
|
||||
async x_shoppingCar() {
|
||||
|
||||
let res = await http_post(api.x_shoppingCar, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 删除购物车
|
||||
async X_delCar(id_group) {
|
||||
|
||||
let res = await http_post(api.X_delCar, {
|
||||
id_group
|
||||
})
|
||||
return res
|
||||
}
|
||||
//X_addCollect_app 商品收藏/ 取消收藏
|
||||
async X_addCollect_app(goods_id,status) {
|
||||
|
||||
let res = await http_post(api.X_addCollect_app, {
|
||||
goods_id,
|
||||
status
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 商品收藏列表
|
||||
async x_Collectlsit() {
|
||||
|
||||
let res = await http_post(api.x_Collectlsit, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 商品详情
|
||||
async x_goodsDetail(sku_id) {
|
||||
|
||||
let res = await http_post(api.x_goodsDetail, {
|
||||
sku_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 热搜
|
||||
async goodsRanking() {
|
||||
let res = await http_post(api.goodsRanking, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 商品搜索
|
||||
async search(
|
||||
search_words,
|
||||
cate_id,
|
||||
activity_id,
|
||||
retail_flag,
|
||||
sort_field,
|
||||
sort_order,
|
||||
term_validity,
|
||||
drug_form,
|
||||
manufacturer,
|
||||
price_start,
|
||||
price_end,
|
||||
current_page
|
||||
){
|
||||
let res = await http_post(api.search, {
|
||||
search_words,
|
||||
cate_id,
|
||||
activity_id,
|
||||
retail_flag,
|
||||
sort_field,
|
||||
sort_order,
|
||||
term_validity,
|
||||
drug_form,
|
||||
manufacturer,
|
||||
price_start,
|
||||
price_end,
|
||||
current_page
|
||||
})
|
||||
|
||||
return res
|
||||
}
|
||||
// 商品列表
|
||||
async goodsList(limit,page){
|
||||
let res = await http_post(api.goodsList, {
|
||||
limit, //每页多少条(默认20)
|
||||
page //当前页
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
export default new X_goods
|
||||
|
||||
|
||||
|
||||
32
金壶/appV1/utils/models/index.js
Normal file
32
金壶/appV1/utils/models/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import {http_use,http_post} from '../http.js'
|
||||
import api from '../api'
|
||||
|
||||
class X_index {
|
||||
|
||||
async x_index() {
|
||||
|
||||
let res = await http_post(api.x_index, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
async x_article(id){
|
||||
|
||||
let res = await http_post(api.x_article,{
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
async x_activity(id,limit,page,loading = true){
|
||||
|
||||
let res = await http_post(api.x_activity,{
|
||||
id,
|
||||
limit,
|
||||
page
|
||||
},loading)
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
export default new X_index
|
||||
|
||||
13
金壶/appV1/utils/models/message.js
Normal file
13
金壶/appV1/utils/models/message.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
http_use,
|
||||
http_post
|
||||
} from '../http.js'
|
||||
|
||||
class message {
|
||||
//更新用户信息
|
||||
async getList(parames) {
|
||||
let res = await http_use('/message/getList', parames)
|
||||
return res
|
||||
}
|
||||
}
|
||||
export default new message
|
||||
23
金壶/appV1/utils/models/order.js
Normal file
23
金壶/appV1/utils/models/order.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
http_use,
|
||||
http_post
|
||||
} from '../http.js'
|
||||
class order {
|
||||
//更新用户信息
|
||||
async getList(parames) {
|
||||
let res = await http_post('/order/index', parames)
|
||||
return res
|
||||
}
|
||||
async getInfo(order_id) {
|
||||
let res = await http_post('/order/detail', {
|
||||
order_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
async getExpress(parames) {
|
||||
let res = await http_post('/express/get_express', parames)
|
||||
return res
|
||||
}
|
||||
}
|
||||
export default new order
|
||||
35
金壶/appV1/utils/models/service.js
Normal file
35
金壶/appV1/utils/models/service.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import {
|
||||
http_use,
|
||||
http_post
|
||||
} from '../http.js'
|
||||
class service {
|
||||
//更新用户信息
|
||||
async getList(parames) {
|
||||
let res = await http_post('/service/getList', parames)
|
||||
return res
|
||||
}
|
||||
|
||||
async getInfo(id) {
|
||||
let res = await http_post('/service/getInfo', {
|
||||
id
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
async add(parames) {
|
||||
let res = await http_post("/service/add",parames)
|
||||
return res
|
||||
}
|
||||
|
||||
async express(parames) {
|
||||
let res = await http_post("/service/express",parames)
|
||||
return res
|
||||
}
|
||||
|
||||
async cancel(parames) {
|
||||
let res = await http_post("/service/cancel",parames)
|
||||
return res
|
||||
}
|
||||
|
||||
}
|
||||
export default new service
|
||||
83
金壶/appV1/utils/models/shop.js
Normal file
83
金壶/appV1/utils/models/shop.js
Normal file
@@ -0,0 +1,83 @@
|
||||
import {
|
||||
http_use,
|
||||
http_post
|
||||
} from '../http.js'
|
||||
|
||||
import api from '../api'
|
||||
class shop {
|
||||
//更新用户信息
|
||||
async getIndexShopInfo() {
|
||||
let res = await http_use(api.getIndexShopInfo, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
//修改商家信息
|
||||
async edit_shopInfo(address, tell, business_time, Paypal, name, shop_lang, member_lang, texts, avatar,url_code,country_id) {
|
||||
let res = await http_post(api.edit_shopInfo, {
|
||||
address,
|
||||
tell,
|
||||
business_time,
|
||||
Paypal,
|
||||
name,
|
||||
shop_lang,
|
||||
member_lang,
|
||||
texts,
|
||||
avatar,
|
||||
url_code,
|
||||
country_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
//获取店铺货币列表与语言种类
|
||||
async getShopLangAndCurrency() {
|
||||
let res = await http_use(api.getShopLangAndCurrency, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 收货地址
|
||||
async shippingAddress(){
|
||||
try {
|
||||
let res = uni.getStorageSync('address_key');
|
||||
if (res) {
|
||||
return res
|
||||
}
|
||||
res = await http_post(api.shippingAddress,{})
|
||||
uni.setStorageSync('address_key', res);
|
||||
return res
|
||||
} catch (e) {
|
||||
// error
|
||||
}
|
||||
|
||||
}
|
||||
// 收货列表
|
||||
async addressList(){
|
||||
let res = await http_post(api.addressList,{
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 默认地址
|
||||
async defaultAddress(address_id){
|
||||
let res = await http_post(api.defaultAddress,{
|
||||
address_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 更新/新增收货地址
|
||||
async makeChangeAddress(area_id,address,address_id,consignee,tel){
|
||||
let res = await http_post(api.makeChangeAddress,{
|
||||
area_id,address,address_id,consignee,tel
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 删除配送地址
|
||||
async deleteAddress(address_id){
|
||||
let res = await http_post(api.deleteAddress,{
|
||||
address_id
|
||||
})
|
||||
return res
|
||||
}
|
||||
}
|
||||
export default new shop
|
||||
77
金壶/appV1/utils/models/x_login.js
Normal file
77
金壶/appV1/utils/models/x_login.js
Normal file
@@ -0,0 +1,77 @@
|
||||
import {http_use,http_post} from '../http.js'
|
||||
import api from '../api'
|
||||
|
||||
class X_login {
|
||||
//X_accountInfo
|
||||
// 对公账号信息
|
||||
async X_accountInfo() {
|
||||
|
||||
let res = await http_post(api.X_accountInfo, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 注册
|
||||
async x_register(phone,smscode,password) {
|
||||
|
||||
let res = await http_post(api.x_register, {
|
||||
phone,
|
||||
smscode,
|
||||
password
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 手机短信验证码
|
||||
async phonecode_app(phone,smscode,status) {
|
||||
|
||||
let res = await http_post(api.phonecode_app, {
|
||||
phone,
|
||||
smscode,
|
||||
status
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 登录
|
||||
async login(phone,password,appid,timestamp,sign) {
|
||||
|
||||
let res = await http_post(api.login, {
|
||||
phone,
|
||||
password,
|
||||
appid,
|
||||
timestamp,
|
||||
sign
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 忘记密码
|
||||
async forgetPassword_app(phone,smscode,password) {
|
||||
|
||||
let res = await http_post(api.forgetPassword_app, {
|
||||
phone,
|
||||
smscode,
|
||||
password
|
||||
})
|
||||
return res
|
||||
}
|
||||
// 个人中心手机号码
|
||||
async x_tell() {
|
||||
|
||||
let res = await http_post(api.x_tell, {
|
||||
|
||||
})
|
||||
return res
|
||||
}
|
||||
// X_editphone 登录后修改密码
|
||||
async X_editphone(ordpassword,password) {
|
||||
|
||||
let res = await http_post(api.X_editphone, {
|
||||
ordpassword,
|
||||
password
|
||||
})
|
||||
return res
|
||||
}
|
||||
}
|
||||
export default new X_login
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user