修改小程序与app的兼容文件
This commit is contained in:
1
App.vue
1
App.vue
@ -16,6 +16,7 @@
|
||||
|
||||
<style lang="less">
|
||||
/*每个页面公共css */
|
||||
@import "animate.css";
|
||||
@import "./assets/iconfont/iconfont.css";
|
||||
@import "./assets/css/base.less";
|
||||
@import "./assets/css/reset.less";
|
||||
|
47
api/order.js
47
api/order.js
@ -9,7 +9,9 @@ import request from "@/utils/request";
|
||||
* @returns {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
export function getOrderData() {
|
||||
return request.get("/order/data");
|
||||
return request.get("/order/data");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +56,7 @@ export function getOrderData() {
|
||||
* @returns {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
export function getRefundReason() {
|
||||
return request.get("/order/refund/reason");
|
||||
return request.get("/order/refund/reason");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +90,7 @@ export function getRefundReason() {
|
||||
* @returns {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
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 {*}
|
||||
*/
|
||||
export function payOrder(uni, paytype, from) {
|
||||
return request.post("order/pay", { uni, paytype, from });
|
||||
return request.post("order/pay", {
|
||||
uni,
|
||||
paytype,
|
||||
from
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 订单核销
|
||||
* @returns {*}
|
||||
*/
|
||||
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
78
api/store.js
@ -4,128 +4,158 @@ import request from "@/utils/request";
|
||||
* 商品分类
|
||||
* */
|
||||
export function getCategory() {
|
||||
return request.get("/category", {}, { login: false });
|
||||
return request.get("/category", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品详情
|
||||
* */
|
||||
export function getProductDetail(id) {
|
||||
return request.get("/product/detail/" + id, {}, { login: true });
|
||||
export function getProductDetail(id, data) {
|
||||
return request.get("/product/detail/" + id, data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品分销二维码
|
||||
* */
|
||||
export function getProductCode(id) {
|
||||
return request.get("/product/code/" + id, {}, { login: true });
|
||||
return request.get("/product/code/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品列表
|
||||
* */
|
||||
export function getProducts(q) {
|
||||
return request.get("/products", q, { login: false });
|
||||
return request.get("/products", q, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车数量
|
||||
* */
|
||||
export function getCartNum() {
|
||||
return request.get("/cart/count");
|
||||
return request.get("/cart/count");
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加收藏
|
||||
* */
|
||||
export function toCollect(id, category) {
|
||||
return request.get("/collect/add/" + id + "/" + category);
|
||||
return request.get("/collect/add/" + id + "/" + category);
|
||||
}
|
||||
|
||||
/*
|
||||
* 为你推荐
|
||||
* */
|
||||
export function getHostProducts(page, limit) {
|
||||
return request.get(
|
||||
"/product/hot",
|
||||
{ page: page, limit: limit },
|
||||
{ login: false }
|
||||
);
|
||||
return request.get(
|
||||
"/product/hot", {
|
||||
page: page,
|
||||
limit: limit
|
||||
}, {
|
||||
login: false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* 精品、热门、首发列表
|
||||
* */
|
||||
export function getGroomList(type) {
|
||||
return request.get("/groom/list/" + type, {}, { login: false });
|
||||
return request.get("/groom/list/" + type, {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 添加
|
||||
* */
|
||||
export function postCartAdd(data) {
|
||||
return request.post("/cart/add", data);
|
||||
return request.post("/cart/add", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车列表
|
||||
* */
|
||||
export function getCartList() {
|
||||
return request.get("/cart/list");
|
||||
return request.get("/cart/list");
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 删除
|
||||
* */
|
||||
export function postCartDel(ids) {
|
||||
return request.post("/cart/del", { ids });
|
||||
return request.post("/cart/del", {
|
||||
ids
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 获取数量
|
||||
* */
|
||||
export function getCartCount(data) {
|
||||
return request.get("/cart/count", data);
|
||||
return request.get("/cart/count", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 修改商品数量
|
||||
* */
|
||||
export function changeCartNum(id, number) {
|
||||
return request.post("/cart/num", { id, number });
|
||||
return request.post("/cart/num", {
|
||||
id,
|
||||
number
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索推荐关键字
|
||||
*/
|
||||
export function getSearchKeyword() {
|
||||
return request.get("/search/keyword", {}, { login: false });
|
||||
return request.get("/search/keyword", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评论列表
|
||||
*/
|
||||
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) {
|
||||
return request.get("/reply/config/" + id, {}, { login: true });
|
||||
return request.get("/reply/config/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 评价页面获取单个产品详情
|
||||
*/
|
||||
export function postOrderProduct(unique) {
|
||||
return request.post("/order/product", { unique }, { login: true });
|
||||
return request.post("/order/product", {
|
||||
unique
|
||||
}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交评价页面;
|
||||
*/
|
||||
export function postOrderComment(data) {
|
||||
return request.post("/order/comment", data, { login: true });
|
||||
}
|
||||
return request.post("/order/comment", data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
154
api/user.js
154
api/user.js
@ -4,7 +4,9 @@ import request from "@/utils/request";
|
||||
* 省市区
|
||||
*/
|
||||
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 用户账号密码
|
||||
*/
|
||||
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 用户手机号 也只能
|
||||
*/
|
||||
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 用户手机号
|
||||
*/
|
||||
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 用户手机号 验证码 密码
|
||||
*/
|
||||
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 用户手机号 验证码 密码
|
||||
*/
|
||||
export function registerReset(data) {
|
||||
return request.post("/register/reset", data, { login: false });
|
||||
return request.post("/register/reset", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 领取优惠券列表
|
||||
* */
|
||||
export function getCoupon(q) {
|
||||
return request.get("/coupons", q, { login: true });
|
||||
return request.get("/coupons", q, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 点击领取优惠券
|
||||
* */
|
||||
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) {
|
||||
return request.post("/coupon/receive/batch", { couponId });
|
||||
return request.post("/coupon/receive/batch", {
|
||||
couponId
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 我的优惠券
|
||||
* */
|
||||
export function getCouponsUser(type) {
|
||||
return request.get("/coupons/user/" + type);
|
||||
return request.get("/coupons/user/" + type);
|
||||
}
|
||||
|
||||
/*
|
||||
* 个人中心
|
||||
* */
|
||||
export function getUser() {
|
||||
return request.get("/user");
|
||||
return request.get("/user");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -87,7 +107,9 @@ export function getUser() {
|
||||
* */
|
||||
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) {
|
||||
|
||||
return request.post("/wxapp/auth", data, { login: false });
|
||||
return request.post("/wxapp/auth", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 个人中心(功能列表)
|
||||
* */
|
||||
export function getMenuUser() {
|
||||
return request.get("/menu/user");
|
||||
return request.get("/menu/user");
|
||||
}
|
||||
|
||||
/*
|
||||
* 地址列表
|
||||
* */
|
||||
export function getAddressList(data) {
|
||||
return request.get("/address/list", data || {});
|
||||
return request.get("/address/list", data || {});
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除地址
|
||||
* */
|
||||
export function getAddressRemove(id) {
|
||||
return request.post("/address/del", { id: id });
|
||||
return request.post("/address/del", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 设置默认地址
|
||||
* */
|
||||
export function getAddressDefaultSet(id) {
|
||||
return request.post("/address/default/set", { id: id });
|
||||
return request.post("/address/default/set", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取默认地址
|
||||
* */
|
||||
export function getAddressDefault() {
|
||||
return request.get("/address/default");
|
||||
return request.get("/address/default");
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取单个地址
|
||||
* */
|
||||
export function getAddress(id) {
|
||||
return request.get("/address/detail/" + id);
|
||||
return request.get("/address/detail/" + id);
|
||||
}
|
||||
|
||||
/*
|
||||
* 修改 添加地址
|
||||
* */
|
||||
export function postAddress(data) {
|
||||
return request.post("/address/edit", data);
|
||||
return request.post("/address/edit", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取收藏产品
|
||||
* */
|
||||
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) {
|
||||
return request.post("/collect/del", { id: id, category: category });
|
||||
return request.post("/collect/del", {
|
||||
id: id,
|
||||
category: category
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 批量收藏产品
|
||||
* */
|
||||
export function postCollectAll(data) {
|
||||
return request.post("/collect/all", data);
|
||||
return request.post("/collect/all", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加收藏产品
|
||||
* */
|
||||
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() {
|
||||
return request.get("/sign/config");
|
||||
return request.get("/sign/config");
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到里的签到列表
|
||||
* */
|
||||
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) {
|
||||
return request.get("/sign/month", { page: page, limit: limit });
|
||||
return request.get("/sign/month", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到用户信息
|
||||
* */
|
||||
export function postSignUser(sign) {
|
||||
return request.post("/sign/user", sign);
|
||||
return request.post("/sign/user", sign);
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到
|
||||
* */
|
||||
export function postSignIntegral(sign) {
|
||||
return request.post("/sign/integral", sign);
|
||||
return request.post("/sign/integral", sign);
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广数据
|
||||
* */
|
||||
export function getSpreadInfo() {
|
||||
return request.get("/commission");
|
||||
return request.get("/commission");
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广人列表
|
||||
* */
|
||||
export function getSpreadUser(screen) {
|
||||
return request.post("/spread/people", screen);
|
||||
return request.post("/spread/people", screen);
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广人订单
|
||||
* */
|
||||
export function getSpreadOrder(where) {
|
||||
return request.post("/spread/order", where);
|
||||
return request.post("/spread/order", where);
|
||||
}
|
||||
|
||||
/*
|
||||
* 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
|
||||
* */
|
||||
export function getCommissionInfo(q, types) {
|
||||
return request.get("/spread/commission/" + types, q);
|
||||
return request.get("/spread/commission/" + types, q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分记录
|
||||
* */
|
||||
export function getIntegralList(q) {
|
||||
return request.get("/integral/list", q);
|
||||
return request.get("/integral/list", q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现银行
|
||||
* */
|
||||
export function getBank() {
|
||||
return request.get("/extract/bank");
|
||||
return request.get("/extract/bank");
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现申请
|
||||
* */
|
||||
export function postCashInfo(cash) {
|
||||
return request.post("/extract/cash", cash);
|
||||
return request.post("/extract/cash", cash);
|
||||
}
|
||||
|
||||
/*
|
||||
* 会员中心
|
||||
* */
|
||||
export function getVipInfo() {
|
||||
return request.get("/user/level/grade");
|
||||
return request.get("/user/level/grade");
|
||||
}
|
||||
|
||||
/*
|
||||
* 会员等级任务
|
||||
* */
|
||||
export function getVipTask(id) {
|
||||
return request.get("/user/level/task/" + id);
|
||||
return request.get("/user/level/task/" + id);
|
||||
}
|
||||
|
||||
/*
|
||||
* 资金统计
|
||||
* */
|
||||
export function getBalance() {
|
||||
return request.get("/user/balance");
|
||||
return request.get("/user/balance");
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动状态
|
||||
* */
|
||||
export function getActivityStatus() {
|
||||
return request.get("/user/activity", {}, { login: false });
|
||||
return request.get("/user/activity", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动状态
|
||||
* */
|
||||
export function getSpreadImg() {
|
||||
return request.get("/spread/banner");
|
||||
export function getSpreadImg(data) {
|
||||
|
||||
return request.get("/spread/banner", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 用户修改信息
|
||||
* */
|
||||
export function postUserEdit(data) {
|
||||
return request.post("/user/edit", data);
|
||||
return request.post("/user/edit", 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() {
|
||||
return request.get("user/service/list");
|
||||
return request.get("user/service/list");
|
||||
}
|
||||
|
||||
/*
|
||||
* 公众号充值
|
||||
* */
|
||||
export function rechargeWechat(data) {
|
||||
return request.post("/recharge/wechat", data);
|
||||
return request.post("/recharge/wechat", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 退出登录
|
||||
* */
|
||||
export function getLogout() {
|
||||
return request.post("/auth/logout");
|
||||
return request.post("/auth/logout");
|
||||
}
|
||||
|
||||
/*
|
||||
* 绑定手机号
|
||||
* */
|
||||
export function bindingPhone(data) {
|
||||
return request.post("wxapp/binding", data);
|
||||
return request.post("wxapp/binding", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* h5切换公众号登陆
|
||||
* */
|
||||
export function switchH5Login() {
|
||||
return request.post("switch_h5", { from: "wechat" });
|
||||
return request.post("switch_h5", {
|
||||
from: "wechat"
|
||||
});
|
||||
}
|
||||
/*
|
||||
* 获取推广人排行
|
||||
* */
|
||||
export function getRankList(q) {
|
||||
return request.get("rank", q);
|
||||
return request.get("rank", q);
|
||||
}
|
||||
/*
|
||||
* 获取佣金排名
|
||||
* */
|
||||
export function getBrokerageRank(q) {
|
||||
return request.get("brokerage_rank", q);
|
||||
return request.get("brokerage_rank", q);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测会员等级
|
||||
*/
|
||||
export function setDetection() {
|
||||
return request.get("user/level/detection");
|
||||
}
|
||||
return request.get("user/level/detection");
|
||||
}
|
||||
|
@ -1665,9 +1665,10 @@
|
||||
.index .wrapper .newProducts {}
|
||||
|
||||
.index .wrapper.hot .newProducts .newProductsItem {
|
||||
width: 2.4*100rpx;
|
||||
width: 2.4*100rpx;
|
||||
min-width: 2.4*100rpx;
|
||||
margin-right: 0.2*100rpx;
|
||||
|
||||
flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.index .wrapper .newProducts .newProductsScroll {
|
||||
@ -1682,10 +1683,12 @@
|
||||
|
||||
.index .wrapper .newProducts .newProductsItem {
|
||||
border: 1rpx solid #eee;
|
||||
width: 2.4*100rpx;
|
||||
width: 2.4*100rpx;
|
||||
min-width: 2.4*100rpx;
|
||||
border-radius: 0.12*100rpx;
|
||||
overflow: hidden;
|
||||
margin-right: .2*100rpx;
|
||||
margin-right: .2*100rpx;
|
||||
flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.index .wrapper .newProducts:nth-last-child(1) {}
|
||||
|
@ -21,7 +21,7 @@
|
||||
<view class="condition line1">{{ coupon.couponTitle }}</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<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
|
||||
class="iconfont icon-xuanzhong1 font-color-red"
|
||||
v-if="checked === coupon.id"
|
||||
|
@ -6,18 +6,18 @@ import { dataFormat } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DataFormat",
|
||||
props: ["data"],
|
||||
props: ["date"],
|
||||
data: function() {
|
||||
return {
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.time = dataFormat(this.data);
|
||||
this.time = dataFormat(this.date);
|
||||
},
|
||||
watch: {
|
||||
"$props.data"(props) {
|
||||
this.time = dataFormat(this.data);
|
||||
"$props.date"(props) {
|
||||
this.time = dataFormat(this.date);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,22 +2,22 @@
|
||||
<text>{{time}}</text>
|
||||
</template>
|
||||
<script>
|
||||
import { dataFormatT } from "@/utils";
|
||||
import { dateFormatT } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DataFormatT",
|
||||
props: ["data"],
|
||||
props: ["date"],
|
||||
data: function() {
|
||||
return {
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.time = dataFormatT(this.data);
|
||||
this.time = dateFormatT(this.date);
|
||||
},
|
||||
watch: {
|
||||
"$props.data"(props) {
|
||||
this.time = dataFormatT(this.data);
|
||||
"$props.date"(props) {
|
||||
this.time = dateFormatT(this.date);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,7 +1,8 @@
|
||||
// 支付模块
|
||||
export const weappPay = (option) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 吊起微信支付
|
||||
// 吊起微信支付
|
||||
console.log(option,9999)
|
||||
uni.requestPayment({
|
||||
...option,
|
||||
timeStamp: option.timeStamp + '',
|
||||
|
10
main.js
10
main.js
@ -3,7 +3,6 @@ import App from './App'
|
||||
|
||||
// import router from "./router";
|
||||
import store from "./store";
|
||||
import animate from "animate.css";
|
||||
import schema from "async-validator";
|
||||
import dialog from "./utils/dialog";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
@ -25,7 +24,6 @@ import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/config";
|
||||
|
||||
Vue.use(animate);
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.devtools = process.env.NODE_ENV !== "production";
|
||||
|
||||
@ -82,24 +80,24 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
|
||||
|
||||
// #ifdef H5
|
||||
// H5编译的代码
|
||||
Vue.prototype.$deviceType = 'H5'
|
||||
Vue.prototype.$deviceType = 'h5'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// App平台编译的代码
|
||||
Vue.prototype.$deviceType = 'App'
|
||||
Vue.prototype.$deviceType = 'app'
|
||||
Vue.prototype.$platform = uni.getSystemInfoSync().platform
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序编译的代码
|
||||
Vue.prototype.$deviceType = 'Weixin'
|
||||
Vue.prototype.$deviceType = 'weixin'
|
||||
// #endif
|
||||
|
||||
console.log(wx,121212)
|
||||
console.log(Vue.prototype.$deviceType)
|
||||
// if(wx){
|
||||
// Vue.prototype.$deviceType = 'Weixin'
|
||||
// Vue.prototype.$deviceType = 'weixin'
|
||||
// }
|
||||
|
||||
app.$mount()
|
||||
|
@ -54,7 +54,27 @@
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
"sdkConfigs" : {
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appsecret" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
|
@ -45,7 +45,7 @@ export default {
|
||||
console.log(this.$store.getters.userInfo, '获取store里面的 userInfo');
|
||||
cookie.get("spread");
|
||||
// this.toLaunch();
|
||||
if (this.$deviceType == 'App') {
|
||||
if (this.$deviceType == 'app') {
|
||||
// this.toLaunch();
|
||||
this.$yrouter.switchTab({
|
||||
path: '/pages/home/index',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view v-if="!$store.getters.token&&$deviceType=='Weixin'">
|
||||
<view v-if="!$store.getters.token&&$deviceType=='weixin'">
|
||||
<view class="getUserInfo">
|
||||
<text>您还未允许微信登录授权,请点击下方按钮允许微信授权登录。</text>
|
||||
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button>
|
||||
@ -8,7 +8,7 @@
|
||||
<button @click="back">取消微信登录授权</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!$store.getters.token&&$deviceType!='Weixin'">
|
||||
<view v-if="!$store.getters.token&&$deviceType!='weixin'&&$deviceType=='app'">
|
||||
<view class="getUserInfo">
|
||||
<text>请先登录</text>
|
||||
<button type="primary" @click="this.toLogin">去登录</button>
|
||||
@ -42,7 +42,8 @@
|
||||
computed: {
|
||||
...mapState(["isAuthorization"])
|
||||
},
|
||||
onShow() {
|
||||
onShow() {
|
||||
|
||||
this.UPDATE_AUTHORIZATIONPAGE(true);
|
||||
},
|
||||
onHide() {
|
||||
|
@ -289,7 +289,8 @@ export default {
|
||||
query: { type }
|
||||
});
|
||||
},
|
||||
goGoodsCon(item) {
|
||||
goGoodsCon(item) {
|
||||
console.log(item)
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: { id: item.id }
|
||||
|
@ -44,7 +44,7 @@
|
||||
>拼团</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>
|
||||
<data-format :data="order.addTime"></data-format>
|
||||
<data-format :date="order.addTime"></data-format>
|
||||
</view>
|
||||
<view class="font-color-red">{{ getStatus(order) }}</view>
|
||||
</view>
|
||||
@ -209,7 +209,7 @@ export default {
|
||||
orderList: [],
|
||||
pay: false,
|
||||
payType: ["yue", "weixin"],
|
||||
from: isWeixin() ? "weixin" : "weixinh5"
|
||||
from: this.$deviceType
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
@ -5,7 +5,7 @@
|
||||
<view class="data" :class="refundOrder ? 'on' : ''">
|
||||
<view class="state">{{ orderInfo._status._msg }}</view>
|
||||
<view>
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -144,7 +144,7 @@
|
||||
<view class="item acea-row row-between">
|
||||
<view>下单时间:</view>
|
||||
<view class="conter">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
|
@ -481,6 +481,26 @@
|
||||
uni.showLoading({
|
||||
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, {
|
||||
realName: this.contacts,
|
||||
phone: this.contactsTel,
|
||||
@ -494,9 +514,11 @@
|
||||
bargainId: this.orderGroupInfo.bargain_id,
|
||||
from: this.from,
|
||||
mark: this.mark || "",
|
||||
shippingType: parseInt(shipping_type) + 1
|
||||
shippingType: parseInt(shipping_type) + 1,
|
||||
...form
|
||||
})
|
||||
.then(res => {
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
uni.hideLoading();
|
||||
const data = res.data;
|
||||
switch (data.status) {
|
||||
@ -541,7 +563,8 @@
|
||||
}, 100);
|
||||
break;
|
||||
case "WECHAT_PAY":
|
||||
weappPay(data.result.jsConfig).then(res => {
|
||||
weappPay(data.result.jsConfig).then(res => {
|
||||
console.log(res)
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
@ -569,4 +592,4 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<view class="order-num">订单:{{ orderInfo.orderId }}</view>
|
||||
<view>
|
||||
<text class="time">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -67,7 +67,7 @@
|
||||
<view class="item acea-row row-between">
|
||||
<view>下单时间:</view>
|
||||
<view class="conter">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
|
@ -14,7 +14,7 @@
|
||||
<text>订单号:{{ item.orderId }}</text>
|
||||
<text class="time">
|
||||
<text>下单时间:</text>
|
||||
<data-format :data="item.addTime"></data-format>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</text>
|
||||
</view>
|
||||
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
|
||||
|
@ -47,7 +47,6 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import debounce from "lodash.debounce";
|
||||
import { getCategory } from "@/api/store";
|
||||
import { trim } from "@/utils";
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -79,7 +79,6 @@
|
||||
<script>
|
||||
import Recommend from "@/components/Recommend";
|
||||
import { getProducts } from "@/api/store";
|
||||
import debounce from "lodash.debounce";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
|
@ -177,7 +177,6 @@ import {
|
||||
import { postCollectAll } from "@/api/user";
|
||||
import { mul, add } from "@/utils/bc";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import debounce from "lodash.debounce";
|
||||
|
||||
const CHECKED_IDS = "cart_checked";
|
||||
|
||||
|
@ -84,6 +84,14 @@
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</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 class="logon" @click="register">注册</view>
|
||||
<view class="tip">
|
||||
@ -112,8 +120,10 @@
|
||||
} from "@/utils/dialog";
|
||||
import dayjs from "dayjs";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
|
||||
import {handleGetUserInfo} from '@/utils'
|
||||
|
||||
import {
|
||||
handleGetUserInfo
|
||||
} from '@/utils'
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
@ -126,7 +136,8 @@ import {handleGetUserInfo} from '@/utils'
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
captcha: "",
|
||||
inviteCode:"",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
};
|
||||
@ -211,6 +222,7 @@ import {handleGetUserInfo} from '@/utils'
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
inviteCode: that.inviteCode,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
@ -306,11 +318,11 @@ import {handleGetUserInfo} from '@/utils'
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
this.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
||||
handleGetUserInfo()
|
||||
// let replace=this.$yroute.query.replace
|
||||
// if(replace){
|
||||
|
||||
this.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
||||
handleGetUserInfo()
|
||||
// let replace=this.$yroute.query.replace
|
||||
// if(replace){
|
||||
|
||||
// }
|
||||
// this.$yrouter.replace({
|
||||
// path: this.$yroute.query.replace || '/pages/home/index'
|
||||
|
@ -118,6 +118,14 @@
|
||||
</view>
|
||||
<view class="by">
|
||||
<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 class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
@ -295,7 +303,8 @@
|
||||
this.MenuUser();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
onShow() {
|
||||
console.log(this.$store.getters.token)
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
|
@ -14,8 +14,8 @@
|
||||
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<view v-if="item.endTime !== 0">
|
||||
<data-format-t :data="item.startTime"></data-format-t>-
|
||||
<data-format-t :data="item.endTime"></data-format-t>
|
||||
<data-format-t :date="item.startTime"></data-format-t>-
|
||||
<data-format-t :date="item.endTime"></data-format-t>
|
||||
</view>
|
||||
<view v-else>不限时</view>
|
||||
<view class="bnt gray" v-if="item.isUse === true">已领取</view>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<view class="condition line1">{{ item.couponTitle }}</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<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 bg-color-red" v-else>{{ item._msg }}</view>
|
||||
</view>
|
||||
|
@ -1,145 +1,153 @@
|
||||
<template>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import {
|
||||
getSpreadImg
|
||||
} from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
getSpreadImg().then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
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;
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
let form = {}
|
||||
if (this.$deviceType == 'app') {
|
||||
form.form = 'app'
|
||||
}
|
||||
getSpreadImg(form).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
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;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -45,7 +45,7 @@
|
||||
<view>
|
||||
<view class="state">{{ item.title }}</view>
|
||||
<view>
|
||||
<data-format :data="item.addTime"></data-format>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num" v-if="item.pm == 1">+{{ item.number }}</view>
|
||||
|
@ -35,7 +35,7 @@ export function dataFormat(time, option) {
|
||||
}
|
||||
}
|
||||
|
||||
export function dataFormatT(time) {
|
||||
export function dateFormatT(time) {
|
||||
time = +time * 1000;
|
||||
const d = new Date(time);
|
||||
|
||||
@ -121,7 +121,7 @@ export const replaceLogin = (msg) => {
|
||||
// 这里代表已经失去登录状态以及401强制推出登录了
|
||||
store.commit('LOGOUT')
|
||||
console.log(uni, 989)
|
||||
if (Vue.prototype.$deviceType == 'Weixin') {
|
||||
if (Vue.prototype.$deviceType == 'weixin') {
|
||||
// 如果是微信小程序,跳转到授权页
|
||||
replace({
|
||||
path: '/pages/authorization/index',
|
||||
@ -199,7 +199,7 @@ export const login = (option) => {
|
||||
console.log(user)
|
||||
console.log(`用户昵称为 | ${user.userInfo.nickName}`);
|
||||
console.log(`当前的环境 | ${Vue.prototype.$deviceType}`)
|
||||
if (Vue.prototype.$deviceType == 'Weixin') {
|
||||
if (Vue.prototype.$deviceType == 'weixin') {
|
||||
wxappAuth({
|
||||
encryptedData: user.encryptedData,
|
||||
iv: user.iv,
|
||||
|
@ -43,7 +43,9 @@ function baseRequest(options) {
|
||||
const { url, params, data, login, ...option } = options
|
||||
return fly.request(url, params || data, {
|
||||
...option
|
||||
}).then(res => {
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
console.log(url,params,data, ...option)
|
||||
const data = res.data || {};
|
||||
if (res.status !== 200)
|
||||
return Promise.reject({ msg: "请求失败", res, data });
|
||||
|
Reference in New Issue
Block a user