Browse Source

修改小程序与app的兼容文件

master
gaoxs 5 years ago
parent
commit
57ae931f2d
  1. 1
      App.vue
  2. 47
      api/order.js
  3. 78
      api/store.js
  4. 154
      api/user.js
  5. 11
      assets/css/style.less
  6. 2
      components/CouponListWindow.vue
  7. 8
      components/DataFormat.vue
  8. 10
      components/DataFormatT.vue
  9. 3
      libs/wechat.js
  10. 10
      main.js
  11. 22
      manifest.json
  12. 2
      pages/Loading/index.vue
  13. 7
      pages/authorization/index.vue
  14. 3
      pages/home/index.vue
  15. 4
      pages/order/MyOrder/index.vue
  16. 4
      pages/order/OrderDetails/index.vue
  17. 31
      pages/order/OrderSubmission/index.vue
  18. 4
      pages/orderAdmin/AdminOrder/index.vue
  19. 2
      pages/orderAdmin/AdminOrderList/index.vue
  20. 1
      pages/shop/GoodsClass/index.vue
  21. 1691
      pages/shop/GoodsCon/index.vue
  22. 1
      pages/shop/GoodsList/index.vue
  23. 1
      pages/shop/ShoppingCart/index.vue
  24. 28
      pages/user/Login/index.vue
  25. 11
      pages/user/User/index.vue
  26. 4
      pages/user/coupon/GetCoupon/index.vue
  27. 2
      pages/user/coupon/UserCoupon/index.vue
  28. 276
      pages/user/promotion/Poster/index.vue
  29. 2
      pages/user/signIn/Integral/index.vue
  30. 6
      utils/index.js
  31. 4
      utils/request.js

1
App.vue

@ -16,6 +16,7 @@
<style lang="less"> <style lang="less">
/*每个页面公共css */ /*每个页面公共css */
@import "animate.css";
@import "./assets/iconfont/iconfont.css"; @import "./assets/iconfont/iconfont.css";
@import "./assets/css/base.less"; @import "./assets/css/base.less";
@import "./assets/css/reset.less"; @import "./assets/css/reset.less";

47
api/order.js

@ -9,7 +9,9 @@ import request from "@/utils/request";
* @returns {*} * @returns {*}
*/ */
export function postOrderConfirm(cartId) { export function postOrderConfirm(cartId) {
return request.post("/order/confirm", { cartId }); return request.post("/order/confirm", {
cartId
});
} }
/** /**
@ -19,7 +21,7 @@ export function postOrderConfirm(cartId) {
* @returns {*} * @returns {*}
*/ */
export function postOrderComputed(key, data) { export function postOrderComputed(key, data) {
return request.post("/order/computed/" + key, data); return request.post("/order/computed/" + key, data);
} }
/** /**
@ -28,7 +30,7 @@ export function postOrderComputed(key, data) {
* @returns {*} * @returns {*}
*/ */
export function getOrderCoupon(price) { export function getOrderCoupon(price) {
return request.get("/coupons/order/" + (parseFloat(price) || 0)); return request.get("/coupons/order/" + (parseFloat(price) || 0));
} }
/** /**
@ -38,7 +40,7 @@ export function getOrderCoupon(price) {
* @returns {*} * @returns {*}
*/ */
export function createOrder(key, data) { export function createOrder(key, data) {
return request.post("/order/create/" + key, data || {}); return request.post("/order/create/" + key, data || {});
} }
/** /**
@ -46,7 +48,7 @@ export function createOrder(key, data) {
* @returns {*} * @returns {*}
*/ */
export function getOrderData() { export function getOrderData() {
return request.get("/order/data"); return request.get("/order/data");
} }
/** /**
@ -54,7 +56,7 @@ export function getOrderData() {
* @returns {*} * @returns {*}
*/ */
export function getOrderList(data) { export function getOrderList(data) {
return request.get("/order/list", data); return request.get("/order/list", data);
} }
/** /**
@ -62,7 +64,9 @@ export function getOrderList(data) {
* @returns {*} * @returns {*}
*/ */
export function cancelOrder(id) { export function cancelOrder(id) {
return request.post("/order/cancel", { id }); return request.post("/order/cancel", {
id
});
} }
/** /**
@ -70,7 +74,7 @@ export function cancelOrder(id) {
* @returns {*} * @returns {*}
*/ */
export function orderDetail(id) { export function orderDetail(id) {
return request.get("/order/detail/" + id); return request.get("/order/detail/" + id);
} }
/** /**
@ -78,7 +82,7 @@ export function orderDetail(id) {
* @returns {*} * @returns {*}
*/ */
export function getRefundReason() { export function getRefundReason() {
return request.get("/order/refund/reason"); return request.get("/order/refund/reason");
} }
/** /**
@ -86,7 +90,7 @@ export function getRefundReason() {
* @returns {*} * @returns {*}
*/ */
export function postOrderRefund(data) { export function postOrderRefund(data) {
return request.post("/order/refund/verify", data); return request.post("/order/refund/verify", data);
} }
/** /**
@ -94,7 +98,9 @@ export function postOrderRefund(data) {
* @returns {*} * @returns {*}
*/ */
export function takeOrder(uni) { export function takeOrder(uni) {
return request.post("/order/take", { uni }); return request.post("/order/take", {
uni
});
} }
/** /**
@ -102,7 +108,9 @@ export function takeOrder(uni) {
* @returns {*} * @returns {*}
*/ */
export function delOrder(uni) { export function delOrder(uni) {
return request.post("/order/del", { uni }); return request.post("/order/del", {
uni
});
} }
/** /**
@ -110,7 +118,7 @@ export function delOrder(uni) {
* @returns {*} * @returns {*}
*/ */
export function express(params) { export function express(params) {
return request.post("order/express",params); return request.post("order/express", params);
} }
/** /**
@ -118,12 +126,19 @@ export function express(params) {
* @returns {*} * @returns {*}
*/ */
export function payOrder(uni, paytype, from) { export function payOrder(uni, paytype, from) {
return request.post("order/pay", { uni, paytype, from }); return request.post("order/pay", {
uni,
paytype,
from
});
} }
/** /**
* 订单核销 * 订单核销
* @returns {*} * @returns {*}
*/ */
export function orderVerific(verify_code, is_confirm) { export function orderVerific(verify_code, is_confirm) {
return request.post("order/order_verific", { verify_code, is_confirm }); return request.post("order/order_verific", {
} verify_code,
is_confirm
});
}

78
api/store.js

@ -4,128 +4,158 @@ import request from "@/utils/request";
* 商品分类 * 商品分类
* */ * */
export function getCategory() { export function getCategory() {
return request.get("/category", {}, { login: false }); return request.get("/category", {}, {
login: false
});
} }
/* /*
* 商品详情 * 商品详情
* */ * */
export function getProductDetail(id) { export function getProductDetail(id, data) {
return request.get("/product/detail/" + id, {}, { login: true }); return request.get("/product/detail/" + id, data, {
login: true
});
} }
/* /*
* 商品分销二维码 * 商品分销二维码
* */ * */
export function getProductCode(id) { export function getProductCode(id) {
return request.get("/product/code/" + id, {}, { login: true }); return request.get("/product/code/" + id, {}, {
login: true
});
} }
/* /*
* 商品列表 * 商品列表
* */ * */
export function getProducts(q) { export function getProducts(q) {
return request.get("/products", q, { login: false }); return request.get("/products", q, {
login: false
});
} }
/* /*
* 购物车数量 * 购物车数量
* */ * */
export function getCartNum() { export function getCartNum() {
return request.get("/cart/count"); return request.get("/cart/count");
} }
/* /*
* 添加收藏 * 添加收藏
* */ * */
export function toCollect(id, category) { export function toCollect(id, category) {
return request.get("/collect/add/" + id + "/" + category); return request.get("/collect/add/" + id + "/" + category);
} }
/* /*
* 为你推荐 * 为你推荐
* */ * */
export function getHostProducts(page, limit) { export function getHostProducts(page, limit) {
return request.get( return request.get(
"/product/hot", "/product/hot", {
{ page: page, limit: limit }, page: page,
{ login: false } limit: limit
); }, {
login: false
}
);
} }
/* /*
* 精品热门首发列表 * 精品热门首发列表
* */ * */
export function getGroomList(type) { export function getGroomList(type) {
return request.get("/groom/list/" + type, {}, { login: false }); return request.get("/groom/list/" + type, {}, {
login: false
});
} }
/* /*
* 购物车 添加 * 购物车 添加
* */ * */
export function postCartAdd(data) { export function postCartAdd(data) {
return request.post("/cart/add", data); return request.post("/cart/add", data);
} }
/* /*
* 购物车列表 * 购物车列表
* */ * */
export function getCartList() { export function getCartList() {
return request.get("/cart/list"); return request.get("/cart/list");
} }
/* /*
* 购物车 删除 * 购物车 删除
* */ * */
export function postCartDel(ids) { export function postCartDel(ids) {
return request.post("/cart/del", { ids }); return request.post("/cart/del", {
ids
});
} }
/* /*
* 购物车 获取数量 * 购物车 获取数量
* */ * */
export function getCartCount(data) { export function getCartCount(data) {
return request.get("/cart/count", data); return request.get("/cart/count", data);
} }
/* /*
* 购物车 修改商品数量 * 购物车 修改商品数量
* */ * */
export function changeCartNum(id, number) { export function changeCartNum(id, number) {
return request.post("/cart/num", { id, number }); return request.post("/cart/num", {
id,
number
});
} }
/** /**
* 搜索推荐关键字 * 搜索推荐关键字
*/ */
export function getSearchKeyword() { export function getSearchKeyword() {
return request.get("/search/keyword", {}, { login: false }); return request.get("/search/keyword", {}, {
login: false
});
} }
/** /**
* 产品评论列表 * 产品评论列表
*/ */
export function getReplyList(id, q) { export function getReplyList(id, q) {
return request.get("/reply/list/" + id, q, { login: true }); return request.get("/reply/list/" + id, q, {
login: true
});
} }
/** /**
* 产品评价数量和好评度 * 产品评价数量和好评度
*/ */
export function getReplyConfig(id) { export function getReplyConfig(id) {
return request.get("/reply/config/" + id, {}, { login: true }); return request.get("/reply/config/" + id, {}, {
login: true
});
} }
/** /**
* 评价页面获取单个产品详情 * 评价页面获取单个产品详情
*/ */
export function postOrderProduct(unique) { export function postOrderProduct(unique) {
return request.post("/order/product", { unique }, { login: true }); return request.post("/order/product", {
unique
}, {
login: true
});
} }
/** /**
* 提交评价页面 * 提交评价页面
*/ */
export function postOrderComment(data) { export function postOrderComment(data) {
return request.post("/order/comment", data, { login: true }); return request.post("/order/comment", data, {
} login: true
});
}

154
api/user.js

@ -4,7 +4,9 @@ import request from "@/utils/request";
* 省市区 * 省市区
*/ */
export function district(data) { export function district(data) {
return request.get("/citys", data, { login: false }); return request.get("/citys", data, {
login: false
});
} }
/** /**
@ -12,7 +14,9 @@ export function district(data) {
* @param data object 用户账号密码 * @param data object 用户账号密码
*/ */
export function login(data) { export function login(data) {
return request.post("/login", data, { login: false }); return request.post("/login", data, {
login: false
});
} }
/** /**
@ -20,7 +24,9 @@ export function login(data) {
* @param data object 用户手机号 也只能 * @param data object 用户手机号 也只能
*/ */
export function loginMobile(data) { export function loginMobile(data) {
return request.post("/login/mobile", data, { login: false }); return request.post("/login/mobile", data, {
login: false
});
} }
/** /**
@ -28,7 +34,9 @@ export function loginMobile(data) {
* @param data object 用户手机号 * @param data object 用户手机号
*/ */
export function registerVerify(data) { export function registerVerify(data) {
return request.post("/register/verify", data, { login: false }); return request.post("/register/verify", data, {
login: false
});
} }
/** /**
@ -36,7 +44,9 @@ export function registerVerify(data) {
* @param data object 用户手机号 验证码 密码 * @param data object 用户手机号 验证码 密码
*/ */
export function register(data) { export function register(data) {
return request.post("/register", data, { login: false }); return request.post("/register", data, {
login: false
});
} }
/** /**
@ -44,42 +54,52 @@ export function register(data) {
* @param data object 用户手机号 验证码 密码 * @param data object 用户手机号 验证码 密码
*/ */
export function registerReset(data) { export function registerReset(data) {
return request.post("/register/reset", data, { login: false }); return request.post("/register/reset", data, {
login: false
});
} }
/* /*
* 领取优惠券列表 * 领取优惠券列表
* */ * */
export function getCoupon(q) { export function getCoupon(q) {
return request.get("/coupons", q, { login: true }); return request.get("/coupons", q, {
login: true
});
} }
/* /*
* 点击领取优惠券 * 点击领取优惠券
* */ * */
export function getCouponReceive(id) { export function getCouponReceive(id) {
return request.post("/coupon/receive", { couponId: id }, { login: true }); return request.post("/coupon/receive", {
couponId: id
}, {
login: true
});
} }
/* /*
* 批量领取优惠券 * 批量领取优惠券
* */ * */
export function couponReceiveBatch(couponId) { export function couponReceiveBatch(couponId) {
return request.post("/coupon/receive/batch", { couponId }); return request.post("/coupon/receive/batch", {
couponId
});
} }
/* /*
* 我的优惠券 * 我的优惠券
* */ * */
export function getCouponsUser(type) { export function getCouponsUser(type) {
return request.get("/coupons/user/" + type); return request.get("/coupons/user/" + type);
} }
/* /*
* 个人中心 * 个人中心
* */ * */
export function getUser() { export function getUser() {
return request.get("/user"); return request.get("/user");
} }
/* /*
@ -87,7 +107,9 @@ export function getUser() {
* */ * */
export function getUserInfo() { export function getUserInfo() {
return request.get("/userinfo", { login: true }); return request.get("/userinfo", {
login: true
});
} }
/* /*
@ -95,269 +117,295 @@ export function getUserInfo() {
* */ * */
export function wxappAuth(data) { export function wxappAuth(data) {
return request.post("/wxapp/auth", data, { login: false }); return request.post("/wxapp/auth", data, {
login: false
});
} }
/* /*
* 个人中心(功能列表) * 个人中心(功能列表)
* */ * */
export function getMenuUser() { export function getMenuUser() {
return request.get("/menu/user"); return request.get("/menu/user");
} }
/* /*
* 地址列表 * 地址列表
* */ * */
export function getAddressList(data) { export function getAddressList(data) {
return request.get("/address/list", data || {}); return request.get("/address/list", data || {});
} }
/* /*
* 删除地址 * 删除地址
* */ * */
export function getAddressRemove(id) { export function getAddressRemove(id) {
return request.post("/address/del", { id: id }); return request.post("/address/del", {
id: id
});
} }
/* /*
* 设置默认地址 * 设置默认地址
* */ * */
export function getAddressDefaultSet(id) { export function getAddressDefaultSet(id) {
return request.post("/address/default/set", { id: id }); return request.post("/address/default/set", {
id: id
});
} }
/* /*
* 获取默认地址 * 获取默认地址
* */ * */
export function getAddressDefault() { export function getAddressDefault() {
return request.get("/address/default"); return request.get("/address/default");
} }
/* /*
* 获取单个地址 * 获取单个地址
* */ * */
export function getAddress(id) { export function getAddress(id) {
return request.get("/address/detail/" + id); return request.get("/address/detail/" + id);
} }
/* /*
* 修改 添加地址 * 修改 添加地址
* */ * */
export function postAddress(data) { export function postAddress(data) {
return request.post("/address/edit", data); return request.post("/address/edit", data);
} }
/* /*
* 获取收藏产品 * 获取收藏产品
* */ * */
export function getCollectUser(page, limit) { export function getCollectUser(page, limit) {
return request.get("/collect/user", { page: page, limit: limit }); return request.get("/collect/user", {
page: page,
limit: limit
});
} }
/* /*
* 删除收藏产品 * 删除收藏产品
* */ * */
export function getCollectDel(id, category) { export function getCollectDel(id, category) {
return request.post("/collect/del", { id: id, category: category }); return request.post("/collect/del", {
id: id,
category: category
});
} }
/* /*
* 批量收藏产品 * 批量收藏产品
* */ * */
export function postCollectAll(data) { export function postCollectAll(data) {
return request.post("/collect/all", data); return request.post("/collect/all", data);
} }
/* /*
* 添加收藏产品 * 添加收藏产品
* */ * */
export function getCollectAdd(id, category) { export function getCollectAdd(id, category) {
return request.post("collect/add", { id: id, category: category }); return request.post("collect/add", {
id: id,
category: category
});
} }
/* /*
* 签到配置 * 签到配置
* */ * */
export function getSignConfig() { export function getSignConfig() {
return request.get("/sign/config"); return request.get("/sign/config");
} }
/* /*
* 签到里的签到列表 * 签到里的签到列表
* */ * */
export function getSignList(page, limit) { export function getSignList(page, limit) {
return request.get("/sign/list", { page: page, limit: limit }); return request.get("/sign/list", {
page: page,
limit: limit
});
} }
/* /*
* 签到列表 * 签到列表
* */ * */
export function getSignMonth(page, limit) { export function getSignMonth(page, limit) {
return request.get("/sign/month", { page: page, limit: limit }); return request.get("/sign/month", {
page: page,
limit: limit
});
} }
/* /*
* 签到用户信息 * 签到用户信息
* */ * */
export function postSignUser(sign) { export function postSignUser(sign) {
return request.post("/sign/user", sign); return request.post("/sign/user", sign);
} }
/* /*
* 签到 * 签到
* */ * */
export function postSignIntegral(sign) { export function postSignIntegral(sign) {
return request.post("/sign/integral", sign); return request.post("/sign/integral", sign);
} }
/* /*
* 推广数据 * 推广数据
* */ * */
export function getSpreadInfo() { export function getSpreadInfo() {
return request.get("/commission"); return request.get("/commission");
} }
/* /*
* 推广人列表 * 推广人列表
* */ * */
export function getSpreadUser(screen) { export function getSpreadUser(screen) {
return request.post("/spread/people", screen); return request.post("/spread/people", screen);
} }
/* /*
* 推广人订单 * 推广人订单
* */ * */
export function getSpreadOrder(where) { export function getSpreadOrder(where) {
return request.post("/spread/order", where); return request.post("/spread/order", where);
} }
/* /*
* 资金明细types|0=全部,1=消费,2=充值,3=返佣,4=提现 * 资金明细types|0=全部,1=消费,2=充值,3=返佣,4=提现
* */ * */
export function getCommissionInfo(q, types) { export function getCommissionInfo(q, types) {
return request.get("/spread/commission/" + types, q); return request.get("/spread/commission/" + types, q);
} }
/* /*
* 积分记录 * 积分记录
* */ * */
export function getIntegralList(q) { export function getIntegralList(q) {
return request.get("/integral/list", q); return request.get("/integral/list", q);
} }
/* /*
* 提现银行 * 提现银行
* */ * */
export function getBank() { export function getBank() {
return request.get("/extract/bank"); return request.get("/extract/bank");
} }
/* /*
* 提现申请 * 提现申请
* */ * */
export function postCashInfo(cash) { export function postCashInfo(cash) {
return request.post("/extract/cash", cash); return request.post("/extract/cash", cash);
} }
/* /*
* 会员中心 * 会员中心
* */ * */
export function getVipInfo() { export function getVipInfo() {
return request.get("/user/level/grade"); return request.get("/user/level/grade");
} }
/* /*
* 会员等级任务 * 会员等级任务
* */ * */
export function getVipTask(id) { export function getVipTask(id) {
return request.get("/user/level/task/" + id); return request.get("/user/level/task/" + id);
} }
/* /*
* 资金统计 * 资金统计
* */ * */
export function getBalance() { export function getBalance() {
return request.get("/user/balance"); return request.get("/user/balance");
} }
/* /*
* 活动状态 * 活动状态
* */ * */
export function getActivityStatus() { export function getActivityStatus() {
return request.get("/user/activity", {}, { login: false }); return request.get("/user/activity", {}, {
login: false
});
} }
/* /*
* 活动状态 * 活动状态
* */ * */
export function getSpreadImg() { export function getSpreadImg(data) {
return request.get("/spread/banner");
return request.get("/spread/banner", data);
} }
/* /*
* 用户修改信息 * 用户修改信息
* */ * */
export function postUserEdit(data) { export function postUserEdit(data) {
return request.post("/user/edit", data); return request.post("/user/edit", data);
} }
/* /*
* 用户修改信息 * 用户修改信息
* */ * */
export function getChatRecord(to_uid, data) { export function getChatRecord(to_uid, data) {
return request.get("user/service/record/" + to_uid, data); return request.get("user/service/record/" + to_uid, data);
} }
/* /*
* 用户修改信息 * 用户修改信息
* */ * */
export function serviceList() { export function serviceList() {
return request.get("user/service/list"); return request.get("user/service/list");
} }
/* /*
* 公众号充值 * 公众号充值
* */ * */
export function rechargeWechat(data) { export function rechargeWechat(data) {
return request.post("/recharge/wechat", data); return request.post("/recharge/wechat", data);
} }
/* /*
* 退出登录 * 退出登录
* */ * */
export function getLogout() { export function getLogout() {
return request.post("/auth/logout"); return request.post("/auth/logout");
} }
/* /*
* 绑定手机号 * 绑定手机号
* */ * */
export function bindingPhone(data) { export function bindingPhone(data) {
return request.post("wxapp/binding", data); return request.post("wxapp/binding", data);
} }
/* /*
* h5切换公众号登陆 * h5切换公众号登陆
* */ * */
export function switchH5Login() { export function switchH5Login() {
return request.post("switch_h5", { from: "wechat" }); return request.post("switch_h5", {
from: "wechat"
});
} }
/* /*
* 获取推广人排行 * 获取推广人排行
* */ * */
export function getRankList(q) { export function getRankList(q) {
return request.get("rank", q); return request.get("rank", q);
} }
/* /*
* 获取佣金排名 * 获取佣金排名
* */ * */
export function getBrokerageRank(q) { export function getBrokerageRank(q) {
return request.get("brokerage_rank", q); return request.get("brokerage_rank", q);
} }
/** /**
* 检测会员等级 * 检测会员等级
*/ */
export function setDetection() { export function setDetection() {
return request.get("user/level/detection"); return request.get("user/level/detection");
} }

11
assets/css/style.less

@ -1665,9 +1665,10 @@
.index .wrapper .newProducts {} .index .wrapper .newProducts {}
.index .wrapper.hot .newProducts .newProductsItem { .index .wrapper.hot .newProducts .newProductsItem {
width: 2.4*100rpx; width: 2.4*100rpx;
min-width: 2.4*100rpx;
margin-right: 0.2*100rpx; margin-right: 0.2*100rpx;
flex: 0 2.4*100rpx;
} }
.index .wrapper .newProducts .newProductsScroll { .index .wrapper .newProducts .newProductsScroll {
@ -1682,10 +1683,12 @@
.index .wrapper .newProducts .newProductsItem { .index .wrapper .newProducts .newProductsItem {
border: 1rpx solid #eee; border: 1rpx solid #eee;
width: 2.4*100rpx; width: 2.4*100rpx;
min-width: 2.4*100rpx;
border-radius: 0.12*100rpx; border-radius: 0.12*100rpx;
overflow: hidden; overflow: hidden;
margin-right: .2*100rpx; margin-right: .2*100rpx;
flex: 0 2.4*100rpx;
} }
.index .wrapper .newProducts:nth-last-child(1) {} .index .wrapper .newProducts:nth-last-child(1) {}

2
components/CouponListWindow.vue

@ -21,7 +21,7 @@
<view class="condition line1">{{ coupon.couponTitle }}</view> <view class="condition line1">{{ coupon.couponTitle }}</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="coupon.endTime === 0">不限时</view> <view v-if="coupon.endTime === 0">不限时</view>
<view v-else><data-format-t :data="coupon.addTime"></data-format-t> - <data-format-t :data="coupon.endTime"></data-format-t></view> <view v-else><data-format-t :date="coupon.addTime"></data-format-t> - <data-format-t :date="coupon.endTime"></data-format-t></view>
<view <view
class="iconfont icon-xuanzhong1 font-color-red" class="iconfont icon-xuanzhong1 font-color-red"
v-if="checked === coupon.id" v-if="checked === coupon.id"

8
components/DataFormat.vue

@ -6,18 +6,18 @@ import { dataFormat } from "@/utils";
export default { export default {
name: "DataFormat", name: "DataFormat",
props: ["data"], props: ["date"],
data: function() { data: function() {
return { return {
time: "" time: ""
}; };
}, },
mounted() { mounted() {
this.time = dataFormat(this.data); this.time = dataFormat(this.date);
}, },
watch: { watch: {
"$props.data"(props) { "$props.date"(props) {
this.time = dataFormat(this.data); this.time = dataFormat(this.date);
} }
} }
}; };

10
components/DataFormatT.vue

@ -2,22 +2,22 @@
<text>{{time}}</text> <text>{{time}}</text>
</template> </template>
<script> <script>
import { dataFormatT } from "@/utils"; import { dateFormatT } from "@/utils";
export default { export default {
name: "DataFormatT", name: "DataFormatT",
props: ["data"], props: ["date"],
data: function() { data: function() {
return { return {
time: "" time: ""
}; };
}, },
mounted() { mounted() {
this.time = dataFormatT(this.data); this.time = dateFormatT(this.date);
}, },
watch: { watch: {
"$props.data"(props) { "$props.date"(props) {
this.time = dataFormatT(this.data); this.time = dateFormatT(this.date);
} }
} }
}; };

3
libs/wechat.js

@ -1,7 +1,8 @@
// 支付模块 // 支付模块
export const weappPay = (option) => { export const weappPay = (option) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 吊起微信支付 // 吊起微信支付
console.log(option,9999)
uni.requestPayment({ uni.requestPayment({
...option, ...option,
timeStamp: option.timeStamp + '', timeStamp: option.timeStamp + '',

10
main.js

@ -3,7 +3,6 @@ import App from './App'
// import router from "./router"; // import router from "./router";
import store from "./store"; import store from "./store";
import animate from "animate.css";
import schema from "async-validator"; import schema from "async-validator";
import dialog from "./utils/dialog"; import dialog from "./utils/dialog";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
@ -25,7 +24,6 @@ import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from "@/config";
Vue.use(animate);
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.config.devtools = process.env.NODE_ENV !== "production"; Vue.config.devtools = process.env.NODE_ENV !== "production";
@ -82,24 +80,24 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
// #ifdef H5 // #ifdef H5
// H5编译的代码 // H5编译的代码
Vue.prototype.$deviceType = 'H5' Vue.prototype.$deviceType = 'h5'
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
// App平台编译的代码 // App平台编译的代码
Vue.prototype.$deviceType = 'App' Vue.prototype.$deviceType = 'app'
Vue.prototype.$platform = uni.getSystemInfoSync().platform Vue.prototype.$platform = uni.getSystemInfoSync().platform
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// 微信小程序编译的代码 // 微信小程序编译的代码
Vue.prototype.$deviceType = 'Weixin' Vue.prototype.$deviceType = 'weixin'
// #endif // #endif
console.log(wx,121212) console.log(wx,121212)
console.log(Vue.prototype.$deviceType) console.log(Vue.prototype.$deviceType)
// if(wx){ // if(wx){
// Vue.prototype.$deviceType = 'Weixin' // Vue.prototype.$deviceType = 'weixin'
// } // }
app.$mount() app.$mount()

22
manifest.json

@ -54,7 +54,27 @@
/* ios */ /* ios */
"ios" : {}, "ios" : {},
/* SDK */ /* SDK */
"sdkConfigs" : {} "sdkConfigs" : {
"oauth" : {
"weixin" : {
"appid" : "",
"appsecret" : "",
"UniversalLinks" : ""
}
},
"payment" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
},
"share" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
}
}
} }
}, },
/* */ /* */

2
pages/Loading/index.vue

@ -45,7 +45,7 @@ export default {
console.log(this.$store.getters.userInfo, '获取store里面的 userInfo'); console.log(this.$store.getters.userInfo, '获取store里面的 userInfo');
cookie.get("spread"); cookie.get("spread");
// this.toLaunch(); // this.toLaunch();
if (this.$deviceType == 'App') { if (this.$deviceType == 'app') {
// this.toLaunch(); // this.toLaunch();
this.$yrouter.switchTab({ this.$yrouter.switchTab({
path: '/pages/home/index', path: '/pages/home/index',

7
pages/authorization/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<view v-if="!$store.getters.token&&$deviceType=='Weixin'"> <view v-if="!$store.getters.token&&$deviceType=='weixin'">
<view class="getUserInfo"> <view class="getUserInfo">
<text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text> <text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text>
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button> <button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button>
@ -8,7 +8,7 @@
<button @click="back">取消微信登录授权</button> <button @click="back">取消微信登录授权</button>
</view> </view>
</view> </view>
<view v-if="!$store.getters.token&&$deviceType!='Weixin'"> <view v-if="!$store.getters.token&&$deviceType!='weixin'&&$deviceType=='app'">
<view class="getUserInfo"> <view class="getUserInfo">
<text>请先登录</text> <text>请先登录</text>
<button type="primary" @click="this.toLogin">去登录</button> <button type="primary" @click="this.toLogin">去登录</button>
@ -42,7 +42,8 @@
computed: { computed: {
...mapState(["isAuthorization"]) ...mapState(["isAuthorization"])
}, },
onShow() { onShow() {
this.UPDATE_AUTHORIZATIONPAGE(true); this.UPDATE_AUTHORIZATIONPAGE(true);
}, },
onHide() { onHide() {

3
pages/home/index.vue

@ -289,7 +289,8 @@ export default {
query: { type } query: { type }
}); });
}, },
goGoodsCon(item) { goGoodsCon(item) {
console.log(item)
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/shop/GoodsCon/index", path: "/pages/shop/GoodsCon/index",
query: { id: item.id } query: { id: item.id }

4
pages/order/MyOrder/index.vue

@ -44,7 +44,7 @@
>拼团</text> >拼团</text>
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.seckillId > 0">秒杀</text> <text class="sign cart-color acea-row row-center-wrapper" v-if="order.seckillId > 0">秒杀</text>
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.bargainId > 0">砍价</text> <text class="sign cart-color acea-row row-center-wrapper" v-if="order.bargainId > 0">砍价</text>
<data-format :data="order.addTime"></data-format> <data-format :date="order.addTime"></data-format>
</view> </view>
<view class="font-color-red">{{ getStatus(order) }}</view> <view class="font-color-red">{{ getStatus(order) }}</view>
</view> </view>
@ -209,7 +209,7 @@ export default {
orderList: [], orderList: [],
pay: false, pay: false,
payType: ["yue", "weixin"], payType: ["yue", "weixin"],
from: isWeixin() ? "weixin" : "weixinh5" from: this.$deviceType
}; };
}, },
components: { components: {

4
pages/order/OrderDetails/index.vue

@ -5,7 +5,7 @@
<view class="data" :class="refundOrder ? 'on' : ''"> <view class="data" :class="refundOrder ? 'on' : ''">
<view class="state">{{ orderInfo._status._msg }}</view> <view class="state">{{ orderInfo._status._msg }}</view>
<view> <view>
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
</view> </view>
@ -144,7 +144,7 @@
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>下单时间</view> <view>下单时间</view>
<view class="conter"> <view class="conter">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">

31
pages/order/OrderSubmission/index.vue

@ -481,6 +481,26 @@
uni.showLoading({ uni.showLoading({
title: "生成订单中" title: "生成订单中"
}); });
let form = {}
if (this.$deviceType == 'app') {
form.form = 'app'
}
console.log(this.orderGroupInfo.orderKey, {
realName: this.contacts,
phone: this.contactsTel,
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.usableCoupon.id || 0,
payType: this.active,
pinkId: this.pinkId,
seckillId: this.orderGroupInfo.seckill_id,
combinationId: this.orderGroupInfo.combination_id,
bargainId: this.orderGroupInfo.bargain_id,
from: this.from,
mark: this.mark || "",
shippingType: parseInt(shipping_type) + 1,
...form
})
createOrder(this.orderGroupInfo.orderKey, { createOrder(this.orderGroupInfo.orderKey, {
realName: this.contacts, realName: this.contacts,
phone: this.contactsTel, phone: this.contactsTel,
@ -494,9 +514,11 @@
bargainId: this.orderGroupInfo.bargain_id, bargainId: this.orderGroupInfo.bargain_id,
from: this.from, from: this.from,
mark: this.mark || "", mark: this.mark || "",
shippingType: parseInt(shipping_type) + 1 shippingType: parseInt(shipping_type) + 1,
...form
}) })
.then(res => { .then(res => {
console.log(res)
uni.hideLoading(); uni.hideLoading();
const data = res.data; const data = res.data;
switch (data.status) { switch (data.status) {
@ -541,7 +563,8 @@
}, 100); }, 100);
break; break;
case "WECHAT_PAY": case "WECHAT_PAY":
weappPay(data.result.jsConfig).then(res => { weappPay(data.result.jsConfig).then(res => {
console.log(res)
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/OrderDetails/index", path: "/pages/order/OrderDetails/index",
query: { query: {
@ -569,4 +592,4 @@
} }
} }
}; };
</script> </script>

4
pages/orderAdmin/AdminOrder/index.vue

@ -6,7 +6,7 @@
<view class="order-num">订单{{ orderInfo.orderId }}</view> <view class="order-num">订单{{ orderInfo.orderId }}</view>
<view> <view>
<text class="time"> <text class="time">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</text> </text>
</view> </view>
</view> </view>
@ -67,7 +67,7 @@
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>下单时间</view> <view>下单时间</view>
<view class="conter"> <view class="conter">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">

2
pages/orderAdmin/AdminOrderList/index.vue

@ -14,7 +14,7 @@
<text>订单号{{ item.orderId }}</text> <text>订单号{{ item.orderId }}</text>
<text class="time"> <text class="time">
<text>下单时间</text> <text>下单时间</text>
<data-format :data="item.addTime"></data-format> <data-format :date="item.addTime"></data-format>
</text> </text>
</view> </view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key"> <view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">

1
pages/shop/GoodsClass/index.vue

@ -47,7 +47,6 @@
</view> </view>
</template> </template>
<script> <script>
import debounce from "lodash.debounce";
import { getCategory } from "@/api/store"; import { getCategory } from "@/api/store";
import { trim } from "@/utils"; import { trim } from "@/utils";

1691
pages/shop/GoodsCon/index.vue

File diff suppressed because it is too large Load Diff

1
pages/shop/GoodsList/index.vue

@ -79,7 +79,6 @@
<script> <script>
import Recommend from "@/components/Recommend"; import Recommend from "@/components/Recommend";
import { getProducts } from "@/api/store"; import { getProducts } from "@/api/store";
import debounce from "lodash.debounce";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
export default { export default {

1
pages/shop/ShoppingCart/index.vue

@ -177,7 +177,6 @@ import {
import { postCollectAll } from "@/api/user"; import { postCollectAll } from "@/api/user";
import { mul, add } from "@/utils/bc"; import { mul, add } from "@/utils/bc";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
import debounce from "lodash.debounce";
const CHECKED_IDS = "cart_checked"; const CHECKED_IDS = "cart_checked";

28
pages/user/Login/index.vue

@ -84,6 +84,14 @@
<input type="password" placeholder="填写您的登录密码" v-model="password" /> <input type="password" placeholder="填写您的登录密码" v-model="password" />
</view> </view>
</view> </view>
<view class="item">
<view>
<!-- <svg class="icon" aria-hidden="true">
<use xlink:href="#icon-phone_" />
</svg> -->
<input type="text" placeholder="输入邀请码" v-model="inviteCode" />
</view>
</view>
</view> </view>
<view class="logon" @click="register">注册</view> <view class="logon" @click="register">注册</view>
<view class="tip"> <view class="tip">
@ -112,8 +120,10 @@
} from "@/utils/dialog"; } from "@/utils/dialog";
import dayjs from "dayjs"; import dayjs from "dayjs";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
import {handleGetUserInfo} from '@/utils' import {
handleGetUserInfo
} from '@/utils'
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
@ -126,7 +136,8 @@ import {handleGetUserInfo} from '@/utils'
current: 0, current: 0,
account: "", account: "",
password: "", password: "",
captcha: "", captcha: "",
inviteCode:"",
formItem: 1, formItem: 1,
type: "login" type: "login"
}; };
@ -211,6 +222,7 @@ import {handleGetUserInfo} from '@/utils'
account: that.account, account: that.account,
captcha: that.captcha, captcha: that.captcha,
password: that.password, password: that.password,
inviteCode: that.inviteCode,
spread: cookie.get("spread") spread: cookie.get("spread")
}) })
.then(res => { .then(res => {
@ -306,11 +318,11 @@ import {handleGetUserInfo} from '@/utils'
.then(({ .then(({
data data
}) => { }) => {
this.$store.commit("LOGIN", data.token, dayjs(data.expires_time)); this.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
handleGetUserInfo() handleGetUserInfo()
// let replace=this.$yroute.query.replace // let replace=this.$yroute.query.replace
// if(replace){ // if(replace){
// } // }
// this.$yrouter.replace({ // this.$yrouter.replace({
// path: this.$yroute.query.replace || '/pages/home/index' // path: this.$yroute.query.replace || '/pages/home/index'

11
pages/user/User/index.vue

@ -118,6 +118,14 @@
</view> </view>
<view class="by"> <view class="by">
<text class="by-text">By@意象</text> <text class="by-text">By@意象</text>
</view>
<view class="by">
<view>
<text class="by-text">Copyright © 2020</text>
</view>
<view>
<text class="by-text">漯河市大有前途网络科技有限公司</text>
</view>
</view> </view>
<view class="footer-line-height"></view> <view class="footer-line-height"></view>
<!-- <SwitchWindow <!-- <SwitchWindow
@ -295,7 +303,8 @@
this.MenuUser(); this.MenuUser();
} }
}, },
onShow() { onShow() {
console.log(this.$store.getters.token)
console.log(this.userInfo); console.log(this.userInfo);
if (this.$store.getters.token) { if (this.$store.getters.token) {
this.User(); this.User();

4
pages/user/coupon/GetCoupon/index.vue

@ -14,8 +14,8 @@
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view> <view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="item.endTime !== 0"> <view v-if="item.endTime !== 0">
<data-format-t :data="item.startTime"></data-format-t>- <data-format-t :date="item.startTime"></data-format-t>-
<data-format-t :data="item.endTime"></data-format-t> <data-format-t :date="item.endTime"></data-format-t>
</view> </view>
<view v-else>不限时</view> <view v-else>不限时</view>
<view class="bnt gray" v-if="item.isUse === true">已领取</view> <view class="bnt gray" v-if="item.isUse === true">已领取</view>

2
pages/user/coupon/UserCoupon/index.vue

@ -13,7 +13,7 @@
<view class="condition line1">{{ item.couponTitle }}</view> <view class="condition line1">{{ item.couponTitle }}</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="item.endTime === 0">不限时</view> <view v-if="item.endTime === 0">不限时</view>
<view v-else><data-format-t :data="item.addTime"></data-format-t> - <data-format-t :data="item.endTime"></data-format-t></view> <view v-else><data-format-t :date="item.addTime"></data-format-t> - <data-format-t :date="item.endTime"></data-format-t></view>
<view class="bnt gray" v-if="item._type === 0">{{ item._msg }}</view> <view class="bnt gray" v-if="item._type === 0">{{ item._msg }}</view>
<view class="bnt bg-color-red" v-else>{{ item._msg }}</view> <view class="bnt bg-color-red" v-else>{{ item._msg }}</view>
</view> </view>

276
pages/user/promotion/Poster/index.vue

@ -1,145 +1,153 @@
<template> <template>
<view class="distribution-posters"> <view class="distribution-posters">
<view class="slider-banner banner"> <view class="slider-banner banner">
<swiper indicatorDots="true"> <swiper indicatorDots="true">
<block v-for="(item, infoIndex) in info" :key="infoIndex"> <block v-for="(item, infoIndex) in info" :key="infoIndex">
<swiper-item> <swiper-item>
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress /> <image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
</view> </view>
<view class="keep bg-color-red" @click="saveImg">保存海报</view> <view class="keep bg-color-red" @click="saveImg">保存海报</view>
</view> </view>
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import { getSpreadImg } from "@/api/user"; import {
getSpreadImg
} from "@/api/user";
export default { export default {
name: "Poster", name: "Poster",
components: { components: {
// swiper, // swiper,
// swiperSlide // swiperSlide
}, },
props: {}, props: {},
data: function() { data: function() {
return { return {
swiperPosters: { swiperPosters: {
speed: 1000, speed: 1000,
effect: "coverflow", effect: "coverflow",
slidesPerView: "auto", slidesPerView: "auto",
centeredSlides: true, centeredSlides: true,
coverflowEffect: { coverflowEffect: {
rotate: 0, // rotate: 0, //
stretch: -20, // stretch: -20, //
depth: 100, // depth: 100, //
modifier: 3, // modifier: 3, //
slideShadows: false // slideShadows: false //
}, },
observer: true, observer: true,
observeParents: true observeParents: true
}, },
info: [], info: [],
activeIndex: 0 activeIndex: 0
}; };
}, },
mounted: function() { mounted: function() {
this.getIndex(); this.getIndex();
let that = this; let that = this;
// this.swiper.on("slideChange", function() { // this.swiper.on("slideChange", function() {
// that.activeIndex = that.swiper.activeIndex; // that.activeIndex = that.swiper.activeIndex;
// }); // });
}, },
computed: { computed: {
swiper() { swiper() {
// return this.$refs.mySwiper.swiper; // return this.$refs.mySwiper.swiper;
} }
}, },
methods: { methods: {
getIndex: function() { getIndex: function() {
let that = this; let that = this;
getSpreadImg().then( let form = {}
res => { if (this.$deviceType == 'app') {
that.info = res.data; form.form = 'app'
}, }
err => { getSpreadImg(form).then(
uni.showToast({ res => {
title: err.msg || err.response.data.msg, that.info = res.data;
icon: 'none', },
duration: 2000 err => {
}); uni.showToast({
} title: err.msg || err.response.data.msg,
); icon: 'none',
}, duration: 2000
downloadIamge: function(imgsrc, name) { });
var that = this; }
this.isDown = true; );
var downloadUrl = imgsrc; },
downloadIamge: function(imgsrc, name) {
var that = this;
this.isDown = true;
var downloadUrl = imgsrc;
if (!wx.saveImageToPhotosAlbum) { if (!wx.saveImageToPhotosAlbum) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。" });
}); that.openDialogVisible = true;
that.openDialogVisible = true;
return; return;
} }
// wx.getSetting "scope.writePhotosAlbum" scope // wx.getSetting "scope.writePhotosAlbum" scope
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting["scope.writePhotosAlbum"]) { if (!res.authSetting["scope.writePhotosAlbum"]) {
that.openDialogVisible = true; that.openDialogVisible = true;
// //
wx.authorize({ wx.authorize({
scope: "scope.writePhotosAlbum", scope: "scope.writePhotosAlbum",
success() { success() {
that.downloadImage(downloadUrl); that.downloadImage(downloadUrl);
}, },
fail() { fail() {
// //
// //
wx.openSetting({ wx.openSetting({
success: function(data) {}, success: function(data) {},
fail: function(data) {} fail: function(data) {}
}); });
} }
}); });
} else { } else {
that.downloadImage(downloadUrl); that.downloadImage(downloadUrl);
} }
}, },
fail(res) { fail(res) {
that.openDialogVisible = true; that.openDialogVisible = true;
} }
}); });
}, },
saveImg: function() { saveImg: function() {
this.downloadIamge( this.downloadIamge(
this.info[this.activeIndex].wap_poster, this.info[this.activeIndex].wap_poster,
"poster" + this.activeIndex "poster" + this.activeIndex
); );
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.distribution-posters { .distribution-posters {
height: 100%; height: 100%;
} }
.banenr {
height: 100%; .banenr {
} height: 100%;
.banner swiper { }
height: 100%;
} .banner swiper {
.banner .slide-image { height: 100%;
width: 100%; }
height: auto;
} .banner .slide-image {
</style> width: 100%;
height: auto;
}
</style>

2
pages/user/signIn/Integral/index.vue

@ -45,7 +45,7 @@
<view> <view>
<view class="state">{{ item.title }}</view> <view class="state">{{ item.title }}</view>
<view> <view>
<data-format :data="item.addTime"></data-format> <data-format :date="item.addTime"></data-format>
</view> </view>
</view> </view>
<view class="num" v-if="item.pm == 1">+{{ item.number }}</view> <view class="num" v-if="item.pm == 1">+{{ item.number }}</view>

6
utils/index.js

@ -35,7 +35,7 @@ export function dataFormat(time, option) {
} }
} }
export function dataFormatT(time) { export function dateFormatT(time) {
time = +time * 1000; time = +time * 1000;
const d = new Date(time); const d = new Date(time);
@ -121,7 +121,7 @@ export const replaceLogin = (msg) => {
// 这里代表已经失去登录状态以及401强制推出登录了 // 这里代表已经失去登录状态以及401强制推出登录了
store.commit('LOGOUT') store.commit('LOGOUT')
console.log(uni, 989) console.log(uni, 989)
if (Vue.prototype.$deviceType == 'Weixin') { if (Vue.prototype.$deviceType == 'weixin') {
// 如果是微信小程序,跳转到授权页 // 如果是微信小程序,跳转到授权页
replace({ replace({
path: '/pages/authorization/index', path: '/pages/authorization/index',
@ -199,7 +199,7 @@ export const login = (option) => {
console.log(user) console.log(user)
console.log(`用户昵称为 | ${user.userInfo.nickName}`); console.log(`用户昵称为 | ${user.userInfo.nickName}`);
console.log(`当前的环境 | ${Vue.prototype.$deviceType}`) console.log(`当前的环境 | ${Vue.prototype.$deviceType}`)
if (Vue.prototype.$deviceType == 'Weixin') { if (Vue.prototype.$deviceType == 'weixin') {
wxappAuth({ wxappAuth({
encryptedData: user.encryptedData, encryptedData: user.encryptedData,
iv: user.iv, iv: user.iv,

4
utils/request.js

@ -43,7 +43,9 @@ function baseRequest(options) {
const { url, params, data, login, ...option } = options const { url, params, data, login, ...option } = options
return fly.request(url, params || data, { return fly.request(url, params || data, {
...option ...option
}).then(res => { }).then(res => {
console.log(res)
console.log(url,params,data, ...option)
const data = res.data || {}; const data = res.data || {};
if (res.status !== 200) if (res.status !== 200)
return Promise.reject({ msg: "请求失败", res, data }); return Promise.reject({ msg: "请求失败", res, data });

Loading…
Cancel
Save