Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65a9110ada | ||
|
|
fc9b7bac16 | ||
|
|
3171fddd7b | ||
|
|
2df8be328f | ||
|
|
8f942bf01e | ||
|
|
346eb13d50 | ||
|
|
b8e0ddcb5a | ||
|
|
10d8f25ddf | ||
|
|
96d42cdab8 | ||
|
|
3294f12268 | ||
|
|
29630a8495 | ||
|
|
9f48cc7110 | ||
|
|
efb2a7963e | ||
|
|
8ecc85a21c | ||
|
|
765ad65b8f | ||
|
|
8500fb4087 | ||
|
|
ef51049ed4 | ||
|
|
ef5941de00 | ||
|
|
4599b02a41 | ||
|
|
73c307173b | ||
|
|
8239aad928 | ||
|
|
5612636b29 | ||
|
|
6f162b6d15 | ||
|
|
ca1cfb7575 | ||
|
|
8005cc6c1c | ||
|
|
20c751a7b5 | ||
|
|
60a8fe7361 | ||
|
|
1489deb618 | ||
|
|
2f180d5178 | ||
|
|
e9739cacf5 | ||
|
|
c8c531db17 | ||
|
|
5c67c608bc | ||
|
|
ebe6595f81 | ||
|
|
0408cb3ef6 | ||
|
|
fe26033a9f | ||
|
|
4499e0b816 | ||
|
|
c6dd5eac67 | ||
|
|
c65df5c741 | ||
|
|
073c80e781 | ||
|
|
6b0edf0752 | ||
|
|
cd909ede83 | ||
|
|
eb070953c0 | ||
|
|
2995383d63 | ||
|
|
983dbda3e6 | ||
|
|
240f2d227d | ||
|
|
2052b189f2 | ||
|
|
d37a6a865a | ||
|
|
a2a949be8f | ||
|
|
305f05bade | ||
|
|
ec2e110bd7 | ||
|
|
7cbb226416 | ||
|
|
1e53287927 | ||
|
|
3cc2f1e019 | ||
|
|
db63ace4b0 | ||
|
|
b80b7205e9 | ||
|
|
61273b78b9 | ||
|
|
de639c808c | ||
|
|
8fa58c7010 | ||
|
|
bd6db202ab | ||
|
|
b7fb67d975 | ||
|
|
9c5bf7f854 | ||
|
|
fcb5d20ef1 | ||
|
|
87d767d4ff | ||
|
|
23cc635971 | ||
|
|
b5722c27b6 | ||
|
|
f56acf5a76 |
63
App.vue
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* vuex管理登录状态,具体可以参考官方登录模板示例
|
* vuex管理登录状态,具体可以参考官方登录模板示例
|
||||||
@@ -15,6 +16,35 @@ export default {
|
|||||||
config,
|
config,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听返回
|
||||||
|
*/
|
||||||
|
onBackPress(e) {
|
||||||
|
if (e.from == "backbutton") {
|
||||||
|
let routes = getCurrentPages();
|
||||||
|
let curRoute = routes[routes.length - 1].options;
|
||||||
|
routes.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.route == "pages/tabbar/cart/cartList" ||
|
||||||
|
item.route.indexOf("pages/product/goods") != -1
|
||||||
|
) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: item.route,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (curRoute.addId) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/tabbar/cart/cartList",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
return true; //阻止默认返回行为
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(["login"]),
|
...mapMutations(["login"]),
|
||||||
},
|
},
|
||||||
@@ -22,11 +52,16 @@ export default {
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
APPUpdate();
|
APPUpdate();
|
||||||
|
|
||||||
// 重点是以下: 一定要监听后台恢复 !一定要
|
// 重点是以下: 一定要监听后台恢复 !一定要
|
||||||
plus.globalEvent.addEventListener("newintent", (e) => {
|
plus.globalEvent.addEventListener("newintent", (e) => {
|
||||||
this.checkArguments(); // 检测启动参数
|
this.checkArguments(); // 检测启动参数
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.applyUpdateWeChat();
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -34,8 +69,34 @@ export default {
|
|||||||
this.getClipboard();
|
this.getClipboard();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 微信小程序版本提交更新版本 解决缓存问题
|
||||||
|
*/
|
||||||
|
applyUpdateWeChat() {
|
||||||
|
const updateManager = uni.getUpdateManager();
|
||||||
|
|
||||||
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
});
|
||||||
|
|
||||||
|
updateManager.onUpdateReady(function (res) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "更新提示",
|
||||||
|
content: "发现新版本,是否重启应用?",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
updateManager.onUpdateFailed(function (res) {
|
||||||
|
// 新的版本下载失败
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// TODO 开屏广告 后续优化添加
|
// TODO 开屏广告 后续优化添加
|
||||||
launch() {
|
launch() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,25 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* 公共API
|
* 公共API
|
||||||
*/
|
*/
|
||||||
import storage from "@/utils/storage.js"
|
|
||||||
import {http, Method} from '@/utils/request.js';
|
import {http, Method} from '@/utils/request.js';
|
||||||
import api from '@/config/api.js';
|
import api from '@/config/api.js';
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取图片验证码URL
|
|
||||||
* @param type
|
|
||||||
* @param uuid
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
export function getValidateCodeUrl(type, uuid) {
|
|
||||||
if (!type) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if (!uuid) {
|
|
||||||
uuid = storage.getUuid()
|
|
||||||
}
|
|
||||||
return `${api.base}/captchas/${uuid}/${type}?r=${new Date().getTime()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -197,10 +197,11 @@ export function distributionGoods(params) {
|
|||||||
/**
|
/**
|
||||||
* 选择分销商品 分销商品id
|
* 选择分销商品 分销商品id
|
||||||
*/
|
*/
|
||||||
export function checkedDistributionGoods(id) {
|
export function checkedDistributionGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/distributionGoods/checked/${id}`,
|
url: `/distributionGoods/checked/${params.id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
21
api/login.js
@@ -1,11 +1,6 @@
|
|||||||
import {
|
import { http } from "@/utils/request.js";
|
||||||
http
|
|
||||||
} from "@/utils/request.js";
|
|
||||||
|
|
||||||
|
|
||||||
import api from '@/config/api.js'
|
|
||||||
|
|
||||||
|
|
||||||
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过短信重置密码
|
* 通过短信重置密码
|
||||||
@@ -15,11 +10,10 @@ export function resetByMobile(params) {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/resetByMobile`,
|
url: `/members/resetByMobile`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
params
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送验证码
|
* 发送验证码
|
||||||
* @param mobile
|
* @param mobile
|
||||||
@@ -43,20 +37,18 @@ export function smsLogin(params, clientType) {
|
|||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
"clientType": clientType
|
clientType: clientType,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改密码
|
* 修改密码
|
||||||
* @param newPassword
|
* @param newPassword
|
||||||
* @param password
|
* @param password
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function modifyPass(params) {
|
export function modifyPass(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/modifyPass`,
|
url: `/members/modifyPass`,
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
@@ -68,7 +60,6 @@ export function smsLogin(params, clientType) {
|
|||||||
* 刷新token
|
* 刷新token
|
||||||
*/
|
*/
|
||||||
export function refreshTokenFn(refresh_token) {
|
export function refreshTokenFn(refresh_token) {
|
||||||
|
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/members/refresh/${refresh_token}`,
|
url: `/members/refresh/${refresh_token}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|||||||
133
api/members.js
@@ -1,28 +1,55 @@
|
|||||||
import storage from "@/utils/storage"
|
import storage from "@/utils/storage";
|
||||||
import {http, Method} from '@/utils/request.js';
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 意见反馈
|
* 意见反馈
|
||||||
*/
|
*/
|
||||||
export function feedBack(params) {
|
export function feedBack(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/feedback',
|
url: "/feedback",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提现
|
||||||
|
export function withdrawalApply(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/members/wallet/withdrawal",
|
||||||
|
method: Method.POST,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付结果查询
|
||||||
|
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE
|
||||||
|
* @param sn 订单编号
|
||||||
|
*/
|
||||||
|
export function payCallback(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/cashier/result`,
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 在线充值
|
||||||
|
export function recharge(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/trade/recharge",
|
||||||
|
method: Method.POST,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取预存款充值记录
|
* 分页获取预存款充值记录
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getUserRecharge(params) {
|
export function getUserRecharge(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/member/recharge",
|
url: "/member/recharge",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -35,7 +62,7 @@ import {http, Method} from '@/utils/request.js';
|
|||||||
* 分页获取预存款充值记录
|
* 分页获取预存款充值记录
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getWalletLog(params) {
|
export function getWalletLog(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/wallet/log",
|
url: "/wallet/log",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -44,16 +71,13 @@ import {http, Method} from '@/utils/request.js';
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取优惠券列表
|
* 获取优惠券列表
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function getCoupons(params) {
|
export function getCoupons(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/coupon/getCoupons',
|
url: "/promotion/coupon/getCoupons",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -79,14 +103,13 @@ export function receiveCoupons(couponId) {
|
|||||||
*/
|
*/
|
||||||
export function getPointsData(params) {
|
export function getPointsData(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'member/memberPointsHistory/getByPage',
|
url: "member/memberPointsHistory/getByPage",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取我的评论列表
|
* 获取我的评论列表
|
||||||
* @param params
|
* @param params
|
||||||
@@ -94,7 +117,7 @@ export function getPointsData(params) {
|
|||||||
*/
|
*/
|
||||||
export function getComments(params) {
|
export function getComments(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/memberEvaluation',
|
url: "/memberEvaluation",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
@@ -108,26 +131,23 @@ export function getComments(params) {
|
|||||||
*/
|
*/
|
||||||
export function getFootprintNum(params) {
|
export function getFootprintNum(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/footprint/getFootprintNum',
|
url: "/footprint/getFootprintNum",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单评论
|
* 订单评论
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function commentsMemberOrder(params) {
|
export function commentsMemberOrder(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/memberEvaluation',
|
url: "/memberEvaluation",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -138,10 +158,10 @@ export function commentsMemberOrder(params) {
|
|||||||
*/
|
*/
|
||||||
export function AppendCommentsOrder(params) {
|
export function AppendCommentsOrder(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/comments/additional',
|
url: "members/comments/additional",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -152,16 +172,16 @@ export function AppendCommentsOrder(params) {
|
|||||||
* @param goods_id
|
* @param goods_id
|
||||||
* @param ask_content
|
* @param ask_content
|
||||||
*/
|
*/
|
||||||
export function consultating(goods_id, ask_content,anonymous) {
|
export function consultating(goods_id, ask_content, anonymous) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/asks',
|
url: "members/asks",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: {
|
data: {
|
||||||
goods_id,
|
goods_id,
|
||||||
ask_content,
|
ask_content,
|
||||||
anonymous
|
anonymous,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -171,7 +191,7 @@ export function consultating(goods_id, ask_content,anonymous) {
|
|||||||
* @param params
|
* @param params
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function getGoodsCollection(params,type) {
|
export function getGoodsCollection(params, type) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/${type}`,
|
url: `/member/collection/${type}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -182,23 +202,18 @@ export function getGoodsCollection(params,type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏商品
|
* 收藏商品
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function collectionGoods(id,type) {
|
export function collectionGoods(id, type) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/add/${type}/${id}`,
|
url: `/member/collection/add/${type}/${id}`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品收藏
|
* 删除商品收藏
|
||||||
* @param ids 收藏ID【集合或单个商品ID】
|
* @param ids 收藏ID【集合或单个商品ID】
|
||||||
@@ -206,7 +221,7 @@ export function collectionGoods(id,type) {
|
|||||||
*/
|
*/
|
||||||
export function deleteGoodsCollection(ids) {
|
export function deleteGoodsCollection(ids) {
|
||||||
if (Array.isArray(ids)) {
|
if (Array.isArray(ids)) {
|
||||||
ids = ids.join(',');
|
ids = ids.join(",");
|
||||||
}
|
}
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/delete/GOODS/${ids}`,
|
url: `/member/collection/delete/GOODS/${ids}`,
|
||||||
@@ -219,7 +234,7 @@ export function deleteGoodsCollection(ids) {
|
|||||||
* 获取商品是否被收藏
|
* 获取商品是否被收藏
|
||||||
* @param good_id
|
* @param good_id
|
||||||
*/
|
*/
|
||||||
export function getGoodsIsCollect(good_id,type) {
|
export function getGoodsIsCollect(good_id, type) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/member/collection/isCollection/${type}/${good_id}`,
|
url: `/member/collection/isCollection/${type}/${good_id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
@@ -228,7 +243,6 @@ export function getGoodsIsCollect(good_id,type) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收藏店铺
|
* 收藏店铺
|
||||||
* @param store_id 店铺ID
|
* @param store_id 店铺ID
|
||||||
@@ -236,10 +250,10 @@ export function getGoodsIsCollect(good_id,type) {
|
|||||||
*/
|
*/
|
||||||
export function collectionStore(store_id) {
|
export function collectionStore(store_id) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'members/collection/store',
|
url: "members/collection/store",
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
data: {store_id},
|
data: { store_id },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,14 +269,13 @@ export function deleteStoreCollection(store_id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录的用户信息
|
* 获取当前登录的用户信息
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members',
|
url: "/members",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -274,7 +287,7 @@ export function deleteStoreCollection(store_id) {
|
|||||||
*/
|
*/
|
||||||
export function getUserWallet() {
|
export function getUserWallet() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members/wallet',
|
url: "/members/wallet",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
@@ -287,30 +300,27 @@ export function getUserWallet() {
|
|||||||
*/
|
*/
|
||||||
export function saveUserInfo(params) {
|
export function saveUserInfo(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/members/editOwn',
|
url: "/members/editOwn",
|
||||||
method: Method.PUT,
|
method: Method.PUT,
|
||||||
header:{'content-type':"application/x-www-form-urlencoded"},
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
needToken: true,
|
needToken: true,
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加发票
|
* 添加发票
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export function addReceipt(params) {
|
export function addReceipt(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/trade/receipt',
|
url: "/trade/receipt",
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品评论列表
|
* 获取商品评论列表
|
||||||
* @param goodsId
|
* @param goodsId
|
||||||
@@ -337,7 +347,6 @@ export function getGoodsCommentsCount(goodsId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未读消息数量信息
|
* 获取未读消息数量信息
|
||||||
*/
|
*/
|
||||||
@@ -345,8 +354,8 @@ export function getNoReadMessageNum() {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `members/member-nocice-logs/number`,
|
url: `members/member-nocice-logs/number`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -359,7 +368,7 @@ export function myTrackList(params) {
|
|||||||
url: `/footprint`,
|
url: `/footprint`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,8 +380,8 @@ export function deleteHistoryListId(ids) {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `/footprint/delByIds/${ids}`,
|
url: `/footprint/delByIds/${ids}`,
|
||||||
method: Method.DELETE,
|
method: Method.DELETE,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -384,8 +393,8 @@ export function getMemberCoupons(data) {
|
|||||||
url: `/promotion/coupon/getCoupons`,
|
url: `/promotion/coupon/getCoupons`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params:data
|
params: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -396,8 +405,8 @@ export function getCouponsNum() {
|
|||||||
return http.request({
|
return http.request({
|
||||||
url: `/promotion/coupon/getCouponsNum`,
|
url: `/promotion/coupon/getCouponsNum`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true
|
needToken: true,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -407,6 +416,6 @@ export function getCouponsNum() {
|
|||||||
export function getMemberPointSum() {
|
export function getMemberPointSum() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
|
url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
|
||||||
method: Method.GET
|
method: Method.GET,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,15 +67,28 @@ export function getLogisticsMessages(params) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 获取版本更新信息 暂无此功能。后续会优化更新
|
|
||||||
* @param appType
|
* @param appType
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getAppVersionList(appType) {
|
export function getAppVersion(appType) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/appVersion/${appType}`,
|
url: `/appVersion/${appType}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
type:"manager"
|
type:"manager"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param appType
|
||||||
|
* @returns {AxiosPromise}
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function getAppVersionList(type,data) {
|
||||||
|
return http.request({
|
||||||
|
url: `/appVersion/appVersion/${type}`,
|
||||||
|
method: Method.GET,
|
||||||
|
type:"manager",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
/**
|
/**
|
||||||
* 促销相关API
|
* 促销相关API
|
||||||
*/
|
*/
|
||||||
import {http, Method} from '@/utils/request.js';
|
import { http, Method } from "@/utils/request.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前直播列表
|
||||||
|
*
|
||||||
|
* @param {*}
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getLiveList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `broadcast/studio`,
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前拼团活动的未成团的会员
|
* 获取当前拼团活动的未成团的会员
|
||||||
@@ -14,24 +27,22 @@ export function getPromotionGroupMember(pintuanId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 获取拼团列表 */
|
/** 获取拼团列表 */
|
||||||
export function getAssembleList(params) {
|
export function getAssembleList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'promotion/pintuan',
|
url: "promotion/pintuan",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
loading: false,
|
loading: false,
|
||||||
params
|
params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取积分商城分类
|
* 获取积分商城分类
|
||||||
*/
|
*/
|
||||||
export function getPointsCategory() {
|
export function getPointsCategory() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/pointsGoods/category',
|
url: "/promotion/pointsGoods/category",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -42,7 +53,7 @@ export function getPointsCategory() {
|
|||||||
*/
|
*/
|
||||||
export function getPointsGoods(params) {
|
export function getPointsGoods(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/pointsGoods',
|
url: "/promotion/pointsGoods",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -53,7 +64,7 @@ export function getPointsGoods(params) {
|
|||||||
*/
|
*/
|
||||||
export function getSeckillTimeLine() {
|
export function getSeckillTimeLine() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: 'promotion/seckill',
|
url: "promotion/seckill",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -75,8 +86,77 @@ export function getSeckillTimeGoods(timeline) {
|
|||||||
*/
|
*/
|
||||||
export function getAllCoupons(params) {
|
export function getAllCoupons(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: '/promotion/coupon',
|
url: "/promotion/coupon",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价商品
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainList(params) {
|
||||||
|
return http.request({
|
||||||
|
url: "/promotion/kanjiaGoods",
|
||||||
|
method: Method.GET,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价商品
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainDetail(id) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/${id}`,
|
||||||
|
method: Method.GET,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取砍价活动
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function getBargainActivity(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/getKanjiaActivity`,
|
||||||
|
method: Method.POST,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起砍价活动
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export function openBargain(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods`,
|
||||||
|
method: Method.POST,
|
||||||
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价活动-帮砍记录
|
||||||
|
*/
|
||||||
|
export function getBargainLog(params) {
|
||||||
|
return http.request({
|
||||||
|
url: `/promotion/kanjiaGoods/getKanjiaActivity/logs`,
|
||||||
|
method: Method.GET,
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取砍价活动-帮砍记录
|
||||||
|
*/
|
||||||
|
export function helpBargain(kanJiaActivityId) {
|
||||||
|
return http.request({
|
||||||
|
url: `promotion/kanjiaGoods/help/${kanJiaActivityId}`,
|
||||||
|
method: Method.POST,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
10
components/m-goods-recommend/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
## 商品推荐
|
||||||
|
|
||||||
|
|
||||||
|
### OBJECT 参数说明
|
||||||
|
属性|说明|类型|必填
|
||||||
|
---|---|---|---
|
||||||
|
`title`|标题,用于顶部显示的内容|String|否
|
||||||
|
`pageSize`|显示多少条数据,建议是2的倍数,默认为12条|*|否
|
||||||
|
`categoryId`|分类id|Function|否
|
||||||
|
`storeId`|卖家id,搜索店铺商品的时候使用|String|否
|
||||||
153
components/m-goods-recommend/index.vue
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="goods-recommend">{{title ? `--${title}-- `:''}}</div>
|
||||||
|
<div class="goods-list">
|
||||||
|
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
||||||
|
<div class="goods-img">
|
||||||
|
<u-image :src="item.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
||||||
|
<u-loading slot="loading"></u-loading>
|
||||||
|
</u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-desc">
|
||||||
|
<div class="goods-title">
|
||||||
|
{{ item.goodsName }}
|
||||||
|
</div>
|
||||||
|
<div class="goods-bottom">
|
||||||
|
<div class="goods-price">¥{{ item.price | unitPrice }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getGoodsList } from "@/api/goods.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
goodsList: [],
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
pageSize: {
|
||||||
|
type: null,
|
||||||
|
default: 12,
|
||||||
|
},
|
||||||
|
categoryId: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
storeId: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initGoods();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化商品
|
||||||
|
*/
|
||||||
|
async initGoods() {
|
||||||
|
let submit = JSON.parse(
|
||||||
|
JSON.stringify(
|
||||||
|
Object.assign(this.params, {
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
categoryId: this.categoryId,
|
||||||
|
storeId: this.storeId,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Object.keys(submit).map((key) => {
|
||||||
|
if (!submit[key] || submit[key].length == 0) {
|
||||||
|
delete submit[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let goodsList = await getGoodsList(submit);
|
||||||
|
this.goodsList.push(...goodsList.data.result.content);
|
||||||
|
},
|
||||||
|
handleClick(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/**商品代码 */
|
||||||
|
$w_94: 94%;
|
||||||
|
.goods-recommend {
|
||||||
|
background: #f7f7f7;
|
||||||
|
height: 100rpx;
|
||||||
|
line-height: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.goods-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
.goods-item {
|
||||||
|
width: 50%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: 0.4em;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.goods-img {
|
||||||
|
position: relative;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: $w_94;
|
||||||
|
height: 350rpx;
|
||||||
|
border-top-left-radius: 20rpx;
|
||||||
|
border-top-right-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
> img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-desc {
|
||||||
|
border-bottom-left-radius: 20rpx;
|
||||||
|
border-bottom-right-radius: 20rpx;
|
||||||
|
width: $w_94;
|
||||||
|
background: #fff;
|
||||||
|
padding: 8rpx 0 8rpx 8rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
> .goods-title {
|
||||||
|
font-size: 12px;
|
||||||
|
height: 70rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
font-weight: 500;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .goods-bottom {
|
||||||
|
display: flex;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
> .goods-price {
|
||||||
|
line-height: 2;
|
||||||
|
color: $main-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -72,10 +72,14 @@ export default {
|
|||||||
// h5复制链接
|
// h5复制链接
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
copyLink() {
|
copyLink() {
|
||||||
let content =
|
let content;
|
||||||
|
if (this.link) {
|
||||||
|
content = this.configs.shareLink + this.link;
|
||||||
|
} else {
|
||||||
|
content =
|
||||||
this.configs.shareLink +
|
this.configs.shareLink +
|
||||||
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
||||||
|
}
|
||||||
if (content === null || content === undefined) {
|
if (content === null || content === undefined) {
|
||||||
content = "";
|
content = "";
|
||||||
} else content = content + "";
|
} else content = content + "";
|
||||||
@@ -104,6 +108,8 @@ export default {
|
|||||||
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
|
||||||
} else if (this.type == "pintuan") {
|
} else if (this.type == "pintuan") {
|
||||||
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
|
||||||
|
} else if (this.type == "kanjia") {
|
||||||
|
shareTitle = `请快来帮我砍一刀${this.goodsName}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let scene; // "WXSenceTimeline 朋友圈 WXSceneSession 微信好友"
|
let scene; // "WXSenceTimeline 朋友圈 WXSceneSession 微信好友"
|
||||||
@@ -113,7 +119,7 @@ export default {
|
|||||||
uni.share({
|
uni.share({
|
||||||
provider: "weixin",
|
provider: "weixin",
|
||||||
scene: scene,
|
scene: scene,
|
||||||
href: configs.downloadLink + this.link,
|
href: configs.shareLink + this.link,
|
||||||
imageUrl: this.thumbnail,
|
imageUrl: this.thumbnail,
|
||||||
type: 0,
|
type: 0,
|
||||||
summary: this.goodsName,
|
summary: this.goodsName,
|
||||||
|
|||||||
343
components/popups/popups.vue
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
<template>
|
||||||
|
<view class="shadow" :class="!show?'':'shadow-show'" :style="{backgroundColor:show?maskBg:'rgba(0,0,0,0)'}" @tap="tapMask">
|
||||||
|
<view class="popups" :class="[theme]" :style="{top: popupsTop ,left: popupsLeft,flexDirection:direction}">
|
||||||
|
<text :class="dynPlace" :style="{width:'0px',height:'0px'}" v-if="triangle"></text>
|
||||||
|
<view v-for="(item,index) in popData" :key="index" @tap.stop="tapItem(item)" class="itemChild view" :class="[direction=='row'?'solid-right':'solid-bottom',item.disabled?'disabledColor':'']">
|
||||||
|
<u-icon size="35" :name="item.icon" v-if="item.icon"></u-icon><span class="title">{{item.title}}</span>
|
||||||
|
</view>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
maskBg: {
|
||||||
|
type: String,
|
||||||
|
default: "rgba(0,0,0,0)",
|
||||||
|
},
|
||||||
|
placement: {
|
||||||
|
type: String,
|
||||||
|
default: "default", //default top-start top-end bottom-start bottom-end
|
||||||
|
},
|
||||||
|
direction: {
|
||||||
|
type: String,
|
||||||
|
default: "column", //column row
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
popData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
type: String,
|
||||||
|
default: "light", //light dark
|
||||||
|
},
|
||||||
|
dynamic: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
gap: {
|
||||||
|
type: Number,
|
||||||
|
default: 20,
|
||||||
|
},
|
||||||
|
triangle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
popupsTop: "0rpx",
|
||||||
|
popupsLeft: "0rpx",
|
||||||
|
show: false,
|
||||||
|
dynPlace: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.popupsPosition();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
tapMask() {
|
||||||
|
this.$emit("input", !this.value);
|
||||||
|
},
|
||||||
|
tapItem(item) {
|
||||||
|
if (item.disabled) return;
|
||||||
|
this.$emit("tapPopup", item);
|
||||||
|
this.$emit("input", !this.value);
|
||||||
|
},
|
||||||
|
getStatusBar() {
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: function (e) {
|
||||||
|
let customBar;
|
||||||
|
// #ifdef H5
|
||||||
|
|
||||||
|
customBar = e.statusBarHeight + e.windowTop;
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
resolve(customBar);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
async popupsPosition() {
|
||||||
|
let statusBar = await this.getStatusBar();
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
let popupsDom = uni.createSelectorQuery().in(this).select(".popups");
|
||||||
|
popupsDom
|
||||||
|
.fields(
|
||||||
|
{
|
||||||
|
size: true,
|
||||||
|
},
|
||||||
|
(data) => {
|
||||||
|
let width = data.width;
|
||||||
|
let height = data.height;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let y = this.dynamic
|
||||||
|
? this.dynamicGetY(this.y, this.gap)
|
||||||
|
: this.transformRpx(this.y);
|
||||||
|
|
||||||
|
let x = this.dynamic
|
||||||
|
? this.dynamicGetX(this.x, this.gap)
|
||||||
|
: this.transformRpx(this.x);
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
y = this.dynamic
|
||||||
|
? this.y + statusBar
|
||||||
|
: this.transformRpx(this.y + statusBar);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
this.dynPlace =
|
||||||
|
this.placement == "default"
|
||||||
|
? this.getPlacement(x, y)
|
||||||
|
: this.placement;
|
||||||
|
|
||||||
|
switch (this.dynPlace) {
|
||||||
|
case "top-start":
|
||||||
|
this.popupsTop = `${y + 9}rpx`;
|
||||||
|
this.popupsLeft = `${x - 15}rpx`;
|
||||||
|
break;
|
||||||
|
case "top-end":
|
||||||
|
this.popupsTop = `${y + 9}rpx`;
|
||||||
|
this.popupsLeft = `${x + 15 - width}rpx`;
|
||||||
|
break;
|
||||||
|
case "bottom-start":
|
||||||
|
this.popupsTop = `${y - 18 - height}rpx`;
|
||||||
|
this.popupsLeft = `${x - 15}rpx`;
|
||||||
|
break;
|
||||||
|
case "bottom-end":
|
||||||
|
this.popupsTop = `${y - 9 - height}rpx`;
|
||||||
|
this.popupsLeft = `${x + 15 - width}rpx`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.exec();
|
||||||
|
});
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
getPlacement(x, y) {
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth;
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight;
|
||||||
|
if (x > width / 2 && y > height / 2) {
|
||||||
|
return "bottom-end";
|
||||||
|
} else if (x < width / 2 && y < height / 2) {
|
||||||
|
return "top-start";
|
||||||
|
} else if (x > width / 2 && y < height / 2) {
|
||||||
|
return "top-end";
|
||||||
|
} else if (x < width / 2 && y > height / 2) {
|
||||||
|
return "bottom-start";
|
||||||
|
} else if (x > width / 2) {
|
||||||
|
return "top-end";
|
||||||
|
} else {
|
||||||
|
return "top-start";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dynamicGetY(y, gap) {
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight;
|
||||||
|
y = y < gap ? gap : y;
|
||||||
|
y = height - y < gap ? height - gap : y;
|
||||||
|
|
||||||
|
return y;
|
||||||
|
},
|
||||||
|
dynamicGetX(x, gap) {
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth;
|
||||||
|
x = x < gap ? gap : x;
|
||||||
|
x = width - x < gap ? width - gap : x;
|
||||||
|
return x;
|
||||||
|
},
|
||||||
|
transformRpx(params) {
|
||||||
|
return (params * uni.getSystemInfoSync().screenWidth) / 375;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler: async function (newVal, oldVal) {
|
||||||
|
if (newVal) await this.popupsPosition();
|
||||||
|
this.show = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
placement: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal, oldVal) {
|
||||||
|
this.dynPlace = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.title {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.shadow {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
transition: background 0.3s ease-in-out;
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
&.shadow-show {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popups {
|
||||||
|
position: absolute;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
.view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 15rpx 10rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
.image {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.dark {
|
||||||
|
background-color: #4c4c4c;
|
||||||
|
color: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4c4c4c;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4c4c4c;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4c4c4c transparent transparent;
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4c4c4c transparent transparent;
|
||||||
|
}
|
||||||
|
.disabledColor {
|
||||||
|
color: #c5c8ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
color: #515a6e;
|
||||||
|
box-shadow: 0upx 0upx 30upx rgba(0, 0, 0, 0.2);
|
||||||
|
background: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent;
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent;
|
||||||
|
}
|
||||||
|
.disabledColor {
|
||||||
|
color: #c5c8ce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.solid-bottom {
|
||||||
|
border-bottom: 1px solid #f3f5f7;
|
||||||
|
}
|
||||||
|
.solid-right {
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.popups .itemChild:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -49,38 +49,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view
|
|
||||||
@click="hide"
|
|
||||||
v-show="flage"
|
|
||||||
class="flex-row-around"
|
|
||||||
style="border-radius: 10rpx; background-color: #ebebeb"
|
|
||||||
:style="{
|
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
'margin-left': left,
|
|
||||||
'margin-top': top,
|
|
||||||
}"
|
|
||||||
:class="vsr ? 'border-index' : ''"
|
|
||||||
>
|
|
||||||
<view class="flex-row-center" style="width: 45rpx; height: 45rpx">
|
|
||||||
<view v-show="!vsr" class="dh-wt"> </view>
|
|
||||||
<view
|
|
||||||
v-show="vsr"
|
|
||||||
class="cuIcon-roundcheck"
|
|
||||||
style="font-size: 45rpx; color: #07c160"
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<text :class="vsr ? 'ttcl' : ''" style="color: #5a5a5a">{{ vsrtx }}</text>
|
|
||||||
<view class="cuIcon-safe text-gray"> </view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from "@/config/api.js";
|
import api from "@/config/api.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
import uuid from "@/utils/uuid.modified.js";
|
||||||
const phone = uni.getSystemInfoSync();
|
const phone = uni.getSystemInfoSync();
|
||||||
const l = phone.screenWidth / 750;
|
const l = phone.screenWidth / 750;
|
||||||
export default {
|
export default {
|
||||||
@@ -89,12 +65,7 @@ export default {
|
|||||||
// 可自行调整
|
// 可自行调整
|
||||||
this.scHight = phone.screenHeight / 2 - 200 + "px";
|
this.scHight = phone.screenHeight / 2 - 200 + "px";
|
||||||
this.getCode();
|
this.getCode();
|
||||||
// 监听是否要重新验证
|
|
||||||
uni.$on("vert", (data) => {
|
|
||||||
this.vsr = data;
|
|
||||||
this.vsrtx = "点击进行验证";
|
|
||||||
this.getCode();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
height: {
|
height: {
|
||||||
@@ -160,10 +131,19 @@ export default {
|
|||||||
this.hid = !this.hid;
|
this.hid = !this.hid;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
error() {
|
||||||
|
this.vsr = false;
|
||||||
|
this.hid = false;
|
||||||
|
this.moveX = 0;
|
||||||
|
this.moveCode = 0;
|
||||||
|
},
|
||||||
// 获取验证图片
|
// 获取验证图片
|
||||||
getCode() {
|
getCode() {
|
||||||
this.col = "#b3afae";
|
this.col = "#b3afae";
|
||||||
this.hasImg = "图片加载中...";
|
this.hasImg = "图片加载中...";
|
||||||
|
if (!storage.getUuid()) {
|
||||||
|
storage.setUuid(uuid.v1());
|
||||||
|
}
|
||||||
uni.request({
|
uni.request({
|
||||||
url: api.common + "/slider/" + this.business,
|
url: api.common + "/slider/" + this.business,
|
||||||
header: {
|
header: {
|
||||||
@@ -209,13 +189,12 @@ export default {
|
|||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.endLoad = true;
|
this.endLoad = true;
|
||||||
|
|
||||||
res.data.result == false
|
res.data.result == false
|
||||||
? (res.data.result = false)
|
? (res.data.result = false)
|
||||||
: (res.data.result = true);
|
: (res.data.result = true);
|
||||||
|
|
||||||
if (res.data && res.data.result) {
|
if (res.data && res.data.result) {
|
||||||
// // 验证成功后把key发送出去,后端会把验证信息存在缓存里
|
//验证成功后把key发送出去,后端会把验证信息存在缓存里
|
||||||
this.$emit("send", this.key);
|
this.$emit("send", this.key);
|
||||||
this.hide();
|
this.hide();
|
||||||
this.vsr = true;
|
this.vsr = true;
|
||||||
@@ -389,33 +368,6 @@ export default {
|
|||||||
margin-top: -35rpx;
|
margin-top: -35rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lk-tag {
|
|
||||||
height: 50rpx;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
border: 2rpx solid #24bd9f;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
color: #1c947a;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tb-tag-my {
|
|
||||||
border-radius: 15rpx;
|
|
||||||
font-size: 16rpx;
|
|
||||||
margin-left: 5rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-green {
|
|
||||||
color: #29c7a5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-hui {
|
|
||||||
color: #585858;
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-column-center {
|
.flex-column-center {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -524,76 +476,10 @@ export default {
|
|||||||
bottom: 70rpx;
|
bottom: 70rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-box {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-bottom: 15rpx;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 715rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.green-box {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-bottom: 15rpx;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 715rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
background-image: linear-gradient(#1faf97, #29c7a5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-sm {
|
|
||||||
width: 13rpx;
|
|
||||||
height: 13rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #1fc189;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-normal {
|
|
||||||
width: 14rpx;
|
|
||||||
height: 14rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #159f3c;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-normal-red {
|
|
||||||
width: 14rpx;
|
|
||||||
height: 14rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #bc3c11;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuan-sm-red {
|
|
||||||
width: 13rpx;
|
|
||||||
height: 13rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #de410d;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.white-box-all {
|
|
||||||
margin-top: 5rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moneycolor {
|
.moneycolor {
|
||||||
color: #ea5002;
|
color: #ea5002;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-bold-sm {
|
|
||||||
font-weight: 425;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sm-moneycolor {
|
|
||||||
color: #e3793b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-top {
|
.margin-top {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
@@ -610,72 +496,10 @@ export default {
|
|||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.margin-left-top {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-right {
|
.margin-right {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-absolute {
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-fixed {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-seach {
|
|
||||||
width: 450rpx;
|
|
||||||
height: 55rpx;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
padding-left: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.move-view {
|
|
||||||
width: 48rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background-color: #28ba91;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
margin-left: 100rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.move-view-p {
|
|
||||||
width: 45rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
background-color: #28ba91;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-dh {
|
|
||||||
position: fixed;
|
|
||||||
padding-top: 20rpx;
|
|
||||||
padding-bottom: 15rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-normal {
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-sm {
|
|
||||||
width: 45rpx;
|
|
||||||
height: 45rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tp-big {
|
|
||||||
width: 70rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-color {
|
.main-color {
|
||||||
color: #07d188;
|
color: #07d188;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
const dev = {
|
const dev = {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//默认生产环境
|
//默认生产环境
|
||||||
@@ -22,7 +22,7 @@ if (process.env.NODE_ENV == "development") {
|
|||||||
} else {
|
} else {
|
||||||
api = prod;
|
api = prod;
|
||||||
}
|
}
|
||||||
//微信小程序,app的打包方式只能是生产环境,所以这块直接条件编译赋值
|
//微信小程序,app的打包方式建议为生产环境,所以这块直接条件编译赋值
|
||||||
// #ifdef MP-WEIXIN || APP-PLUS
|
// #ifdef MP-WEIXIN || APP-PLUS
|
||||||
api = prod;
|
api = prod;
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ const name = "lilishop";
|
|||||||
export default {
|
export default {
|
||||||
name: name,
|
name: name,
|
||||||
schemeLink: `${name}://`, //唤起app地址
|
schemeLink: `${name}://`, //唤起app地址
|
||||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址
|
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址,下载app的地址
|
||||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址
|
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址,也就是在h5中默认的复制地址
|
||||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
||||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
||||||
|
scanAuthNavigation:['https://m-b2b2c.pickmall.cn/'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
|
||||||
|
iosAppId:"id1564638363", //AppStore的应用地址id 具体在分享->拷贝链接中查看
|
||||||
|
logo:"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png" //logo地址
|
||||||
};
|
};
|
||||||
|
|||||||
5
main.js
@@ -2,7 +2,6 @@ import Vue from "vue";
|
|||||||
import App from "./App";
|
import App from "./App";
|
||||||
import * as filters from "./utils/filters.js"; // global filter
|
import * as filters from "./utils/filters.js"; // global filter
|
||||||
import uView from "uview-ui";
|
import uView from "uview-ui";
|
||||||
import empty from "./components/empty";
|
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@@ -12,6 +11,8 @@ let btn = Vue.component("airBtn", airBtn); //全局注册
|
|||||||
document.body.appendChild(new btn().$mount().$el);
|
document.body.appendChild(new btn().$mount().$el);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Object.keys(filters).forEach((key) => {
|
Object.keys(filters).forEach((key) => {
|
||||||
Vue.filter(key, filters[key]);
|
Vue.filter(key, filters[key]);
|
||||||
});
|
});
|
||||||
@@ -30,8 +31,6 @@ const msg = (title, duration = 1500, mask = false, icon = "none") => {
|
|||||||
};
|
};
|
||||||
// 引入vuex
|
// 引入vuex
|
||||||
Vue.prototype.$store = store;
|
Vue.prototype.$store = store;
|
||||||
// 全局引入空组件
|
|
||||||
Vue.component("empty", empty);
|
|
||||||
Vue.use(uView);
|
Vue.use(uView);
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
// 主题色
|
// 主题色
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__C100675",
|
"appid" : "__UNI__C100675",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.0.16",
|
"versionName" : "4.0.23",
|
||||||
"versionCode" : 4000016,
|
"versionCode" : 4000023,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ],
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
},
|
},
|
||||||
"alipay" : {
|
"alipay" : {
|
||||||
"__platform__" : [ "ios", "android" ]
|
"__platform__" : [ "ios", "android" ]
|
||||||
@@ -91,15 +91,15 @@
|
|||||||
"ad" : {},
|
"ad" : {},
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth" : {
|
"oauth" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx6cfbe6e0ace12ce8",
|
"appid" : "wx32788b91bdb614c0",
|
||||||
"appsecret" : "6dfbe0c72380dce5d49d65b3c91059b1",
|
"appsecret" : "230233cef7520ee935bbecad372a370e",
|
||||||
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/"
|
"UniversalLinks" : "https://m-b2b2c.pickmall.cn/app/"
|
||||||
},
|
},
|
||||||
"apple" : {},
|
"apple" : {},
|
||||||
"qq" : {
|
"qq" : {
|
||||||
@@ -178,20 +178,30 @@
|
|||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"appid" : "wx6f10f29075dc1b0b",
|
"appid" : "",
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
"subPackages" : true
|
"subPackages" : true
|
||||||
},
|
},
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
"postcss" : true,
|
"postcss" : false,
|
||||||
"es6" : true
|
"es6" : true
|
||||||
},
|
},
|
||||||
"permission" : {
|
"permission" : {
|
||||||
"scope.userLocation" : {
|
"scope.userLocation" : {
|
||||||
"desc" : "位置信息将用于高德地图的效果展示"
|
"desc" : "位置信息将用于高德地图的效果展示"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"plugins" : {
|
||||||
|
"myPlugin" : {
|
||||||
|
"version" : "1.1.0",
|
||||||
|
"provider" : "wx738958e0f4c894f9"
|
||||||
|
},
|
||||||
|
"live-player-plugin" : {
|
||||||
|
"version" : "1.3.0",
|
||||||
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"h5" : {
|
"h5" : {
|
||||||
@@ -210,6 +220,7 @@
|
|||||||
"enable" : true
|
"enable" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title" : "lilishop"
|
"title" : "lilishop",
|
||||||
|
"template" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
86
pages.json
@@ -43,14 +43,6 @@
|
|||||||
"enablePullDownRefresh": true
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/navigation/selectShops",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "精选店铺"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "pages/navigation/search/searchPage",
|
"path": "pages/navigation/search/searchPage",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -176,7 +168,28 @@
|
|||||||
{
|
{
|
||||||
"path": "deposit/index",
|
"path": "deposit/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "预存款列表"
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/operation",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/recharge",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "充值金额"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "deposit/withdrawal",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提现金额"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -189,11 +202,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "aboutUs",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "关于我们"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "address/address",
|
"path": "address/address",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
@@ -212,6 +220,13 @@
|
|||||||
"navigationBarTitleText": "地址管理"
|
"navigationBarTitleText": "地址管理"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "set/versionFunctionList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "功能介绍"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "set/securityCenter/fingerLogin",
|
"path": "set/securityCenter/fingerLogin",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -251,7 +266,7 @@
|
|||||||
{
|
{
|
||||||
"path": "set/editionIntro",
|
"path": "set/editionIntro",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "版本说明"
|
"navigationBarTitleText": "关于我们"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -364,6 +379,17 @@
|
|||||||
//app页面不显示滚动条
|
//app页面不显示滚动条
|
||||||
"scrollIndicator": "none"
|
"scrollIndicator": "none"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{ // 客服
|
||||||
|
"path": "customerservice/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "客服",
|
||||||
|
"usingComponents": {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
"chat": "plugin://myPlugin/chat"
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -403,7 +429,9 @@
|
|||||||
{
|
{
|
||||||
"path": "wechatMPLogin",
|
"path": "wechatMPLogin",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "小程序登录"
|
"navigationBarTitleText": "小程序登录",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -424,7 +452,9 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "限时抢购",
|
"navigationBarTitleText": "限时抢购",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"titleNView": {}
|
"titleNView": {
|
||||||
|
"homeButton":true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -446,6 +476,27 @@
|
|||||||
"navigationBarTitleText": "人气推荐",
|
"navigationBarTitleText": "人气推荐",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "lives",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "black"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "bargain/list",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "bargain/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,6 +617,7 @@
|
|||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_Trade from "@/api/trade";
|
import * as API_Trade from "@/api/trade";
|
||||||
|
import {payCallback} from '@/api/members'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -71,6 +71,7 @@
|
|||||||
walletValue: 0.0,
|
walletValue: 0.0,
|
||||||
// 支付倒计时
|
// 支付倒计时
|
||||||
autoCancel: 0,
|
autoCancel: 0,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(val) {
|
onLoad(val) {
|
||||||
@@ -91,12 +92,23 @@
|
|||||||
// 区别是:h5是通过浏览器外部调用微信app进行支付,而JSAPI则是 在微信浏览器内部,或者小程序 调用微信支付
|
// 区别是:h5是通过浏览器外部调用微信app进行支付,而JSAPI则是 在微信浏览器内部,或者小程序 调用微信支付
|
||||||
this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5";
|
this.paymentClient = this.isWeiXin() ? "JSAPI" : "H5";
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
},
|
},
|
||||||
onBackPress(e) {
|
onBackPress(e) {
|
||||||
if (e.from == "backbutton") {
|
if (e.from == "backbutton") {
|
||||||
|
if(this.routerVal.recharge_sn){
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/tabbar/user/my'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/pages/order/myOrder?status=0",
|
url: "/pages/order/myOrder?status=0",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return true; //阻止默认返回行为
|
return true; //阻止默认返回行为
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -104,16 +116,28 @@
|
|||||||
this.cashierData();
|
this.cashierData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navigateTo(url) {
|
|
||||||
|
/**
|
||||||
|
* 支付成功后跳转
|
||||||
|
*/
|
||||||
|
callback(paymentMethod){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url: "/pages/cart/payment/success?paymentMethod=" +
|
||||||
|
paymentMethod +
|
||||||
|
"&payPrice=" +
|
||||||
|
this.cashierParams.price+
|
||||||
|
"&orderType="+this.orderType
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取收银详情
|
|
||||||
|
/**
|
||||||
|
* 获取收银详情
|
||||||
|
*/
|
||||||
cashierData() {
|
cashierData() {
|
||||||
let parms = {};
|
let parms = {};
|
||||||
|
|
||||||
if (this.routerVal.recharge_sn) {
|
if (this.routerVal.recharge_sn) {
|
||||||
|
// 判断当前是否是充值
|
||||||
this.sn = this.routerVal.recharge_sn;
|
this.sn = this.routerVal.recharge_sn;
|
||||||
this.orderType = "RECHARGE";
|
this.orderType = "RECHARGE";
|
||||||
} else if (this.routerVal.trade_sn) {
|
} else if (this.routerVal.trade_sn) {
|
||||||
@@ -136,8 +160,18 @@
|
|||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
|
if(this.routerVal.recharge_sn){
|
||||||
|
this.payList = res.data.result.support.filter((item) => {
|
||||||
|
return item != "WALLET";
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else{
|
||||||
this.payList = res.data.result.support;
|
this.payList = res.data.result.support;
|
||||||
|
}
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
this.walletValue = res.data.result.walletValue;
|
this.walletValue = res.data.result.walletValue;
|
||||||
this.autoCancel =
|
this.autoCancel =
|
||||||
@@ -147,13 +181,14 @@
|
|||||||
|
|
||||||
|
|
||||||
awaitPay(payment){
|
awaitPay(payment){
|
||||||
|
this.$u.throttle(()=>{
|
||||||
this.$u.debounce(this.pay(payment), 3000)
|
this.pay(payment)
|
||||||
|
}, 2000)
|
||||||
},
|
},
|
||||||
|
|
||||||
//订单支付
|
//订单支付
|
||||||
async pay(payment) {
|
async pay(payment) {
|
||||||
|
|
||||||
// 支付编号
|
// 支付编号
|
||||||
const sn = this.sn;
|
const sn = this.sn;
|
||||||
// 交易类型【交易号|订单号】
|
// 交易类型【交易号|订单号】
|
||||||
@@ -179,16 +214,15 @@
|
|||||||
|
|
||||||
//如果支付异常
|
//如果支付异常
|
||||||
if (!signXml.data.success) {
|
if (!signXml.data.success) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
content: signXml.data.message,
|
title: signXml.data.message,
|
||||||
showCancel: false,
|
duration: 2000
|
||||||
})
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let payForm = signXml.data.result;
|
let payForm = signXml.data.result;
|
||||||
|
|
||||||
console.log(payForm)
|
|
||||||
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
let paymentType = paymentMethod === "WECHAT" ? "wxpay" : "alipay";
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: paymentType,
|
provider: paymentType,
|
||||||
@@ -199,12 +233,10 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/payment/success?paymentType=" +
|
this.callback(paymentMethod)
|
||||||
paymentType +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -225,16 +257,18 @@
|
|||||||
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
await API_Trade.initiatePay(paymentMethod, paymentClient, params).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
let response = res.data;
|
let response = res.data;
|
||||||
|
//如果非支付宝支付才需要进行判定,因为支付宝h5支付是直接输出的,没有返回所谓的消息状态
|
||||||
|
if(paymentMethod !== "ALIPAY"){
|
||||||
//如果支付异常
|
//如果支付异常
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
|
uni.showToast({
|
||||||
uni.showModal({
|
title: response.message,
|
||||||
content: response.message,
|
duration: 2000,
|
||||||
showCancel: false,
|
icon:"none"
|
||||||
})
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (paymentMethod === "ALIPAY") {
|
if (paymentMethod === "ALIPAY") {
|
||||||
document.write(response);
|
document.write(response);
|
||||||
} else if (paymentMethod === "WECHAT") {
|
} else if (paymentMethod === "WECHAT") {
|
||||||
@@ -251,12 +285,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: "支付失败,如果您已支付,请勿反复支付",
|
content: "支付失败,如果您已支付,请勿反复支付",
|
||||||
@@ -274,12 +304,7 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,12 +340,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentType +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -336,12 +357,8 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
title: "支付成功!",
|
title: "支付成功!",
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
this.callback(paymentMethod)
|
||||||
url: "/pages/cart/payment/success?paymentMethod=" +
|
|
||||||
paymentMethod +
|
|
||||||
"&payPrice=" +
|
|
||||||
this.cashierParams.price,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -94,18 +94,11 @@ export default {
|
|||||||
formatList: [],
|
formatList: [],
|
||||||
currentSelceted: [],
|
currentSelceted: [],
|
||||||
skuList: "",
|
skuList: "",
|
||||||
isMask:false, //是否显示遮罩层
|
isMask: false, //是否显示遮罩层
|
||||||
isClose:false, //是否可以点击遮罩关闭
|
isClose: false, //是否可以点击遮罩关闭
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: [
|
props: ["goodsDetail", "buyMask", "selectedSku", "goodsSpec", "addr"],
|
||||||
|
|
||||||
"goodsDetail",
|
|
||||||
"buyMask",
|
|
||||||
"selectedSku",
|
|
||||||
"goodsSpec",
|
|
||||||
"addr",
|
|
||||||
],
|
|
||||||
watch: {
|
watch: {
|
||||||
buyType: {
|
buyType: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@@ -162,7 +155,25 @@ export default {
|
|||||||
};
|
};
|
||||||
this.selectName = specValue.value;
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
this.$emit("handleClickSku", selectedSkuId.skuId,this.goodsDetail.id);
|
this.$emit("handleClickSku", selectedSkuId.skuId, this.goodsDetail.id);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接购买
|
||||||
|
*/
|
||||||
|
buy(data) {
|
||||||
|
|
||||||
|
API_trade.addToCart(data).then((res) => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||||
|
this.addr.id || ""
|
||||||
|
}&parentOrder=${encodeURIComponent(
|
||||||
|
JSON.stringify(this.parentOrder)
|
||||||
|
)}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,19 +219,7 @@ export default {
|
|||||||
data.cartType = "BUY_NOW";
|
data.cartType = "BUY_NOW";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.buy(data);
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
|
||||||
if (res.data.code == 200) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
|
||||||
this.addr.id || ''
|
|
||||||
}&parentOrder=${encodeURIComponent(
|
|
||||||
JSON.stringify(this.parentOrder)
|
|
||||||
)}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formatSku(list) {
|
formatSku(list) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper" v-if="flage">
|
||||||
<div class='goods' v-if="selectedGoods">
|
<div class='goods' v-if="selectedGoods">
|
||||||
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
<image class="goods-image" :src="selectedGoods.thumbnail" alt="">
|
||||||
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
<p class="goodsName">{{selectedGoods.goodsName}}</p>
|
||||||
@@ -72,6 +72,7 @@ import popupGoods from "./popup/goods"; //购物车商品的模块
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
flage:false, //判断接口是否正常请求
|
||||||
addr: {
|
addr: {
|
||||||
id: "",
|
id: "",
|
||||||
},
|
},
|
||||||
@@ -138,7 +139,8 @@ export default {
|
|||||||
// 实例化本页面
|
// 实例化本页面
|
||||||
async init(sn, sku) {
|
async init(sn, sku) {
|
||||||
let res = await getPinTuanShare(sn, sku);
|
let res = await getPinTuanShare(sn, sku);
|
||||||
if (res.data.success) {
|
if (res.data.success && res.data.result.promotionGoods) {
|
||||||
|
this.flage = true
|
||||||
this.data = res.data.result;
|
this.data = res.data.result;
|
||||||
this.selectedGoods = res.data.result.promotionGoods;
|
this.selectedGoods = res.data.result.promotionGoods;
|
||||||
let endTime = Date.parse(
|
let endTime = Date.parse(
|
||||||
@@ -175,12 +177,17 @@ export default {
|
|||||||
|
|
||||||
// 获取当前商品是否已经购买
|
// 获取当前商品是否已经购买
|
||||||
if (storage.getUserInfo().id) {
|
if (storage.getUserInfo().id) {
|
||||||
|
|
||||||
let isBuy = res.data.result.pintuanMemberVOS.filter((item) => {
|
let isBuy = res.data.result.pintuanMemberVOS.filter((item) => {
|
||||||
return item.memberId == storage.getUserInfo().id;
|
return item.memberId == storage.getUserInfo().id;
|
||||||
});
|
});
|
||||||
isBuy.length != 0 ? (this.isBuy = true) : (this.isBuy = false);
|
isBuy.length != 0 ? (this.isBuy = true) : (this.isBuy = false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前拼团单有误!请联系管理员重试',
|
||||||
|
duration: 2000,
|
||||||
|
icon:"none"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="pay-wrapper">
|
<div class="pay-wrapper">
|
||||||
<div class="pay-money">
|
<div class="pay-money">
|
||||||
¥{{ payPrice | unitPrice }}
|
¥{{ Number(payPrice) | unitPrice }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pay-btns">
|
<div class="pay-btns">
|
||||||
<div v-show="!from" @click="navigateTo('/pages/order/myOrder?status=0')">查看订单</div>
|
<div v-show="!from" @click="checkOrder">查看{{this.orderType == "RECHARGE" ? '余额' : '订单'}}</div>
|
||||||
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -31,47 +31,29 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-recommend">--商品推荐--</div>
|
<goodsRecommend />
|
||||||
<div class="goods-list">
|
|
||||||
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
|
|
||||||
<div class="goods-img">
|
|
||||||
<u-image :src="item.thumbnail" mode="aspectFill" height="350rpx" width="100%">
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
</div>
|
|
||||||
<div class="goods-desc">
|
|
||||||
<div class="goods-title">
|
|
||||||
{{ item.goodsName }}
|
|
||||||
</div>
|
|
||||||
<div class="goods-bottom">
|
|
||||||
<div class="goods-price">¥{{ item.price | unitPrice }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getGoodsList } from "@/api/goods.js";
|
|
||||||
import { getWeChatMpMessage } from "@/api/message.js";
|
import { getWeChatMpMessage } from "@/api/message.js";
|
||||||
|
import goodsRecommend from "@/components/m-goods-recommend";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checked: false,
|
checked: false,
|
||||||
paymentMethod: "",
|
paymentMethod: "",
|
||||||
|
|
||||||
from: "",
|
from: "",
|
||||||
payPrice: 0,
|
payPrice: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
activeColor:this.$mainColor,
|
activeColor: this.$mainColor,
|
||||||
params: {
|
|
||||||
pageSize: 12,
|
|
||||||
pageNumber: 0,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
goodsRecommend,
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
paymentTypeFilter(val) {
|
paymentTypeFilter(val) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
@@ -89,20 +71,30 @@ export default {
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.paymentMethod = options.paymentMethod || "";
|
this.paymentMethod = options.paymentMethod || "";
|
||||||
this.from = options.from || "";
|
this.from = options.from || "";
|
||||||
this.payPrice = parseInt(options.payPrice) || 0;
|
this.payPrice = options.payPrice || 0;
|
||||||
//搜索商品
|
this.orderType = options.orderType;
|
||||||
this.initGoods();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkOrder() {
|
||||||
|
/**
|
||||||
|
* 查看订单
|
||||||
|
* 1.充值跳转到明细里面
|
||||||
|
* 2.支付跳转到订单详情
|
||||||
|
*/
|
||||||
|
if (this.orderType == "RECHARGE") {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: `/pages/mine/deposit/operation`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.navigateTo("/pages/order/myOrder?status=0");
|
||||||
|
}
|
||||||
|
},
|
||||||
changeStatus(val) {
|
changeStatus(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.sendMessage();
|
this.sendMessage();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async initGoods() {
|
|
||||||
let goodsList = await getGoodsList(this.params);
|
|
||||||
this.goodsList.push(...goodsList.data.result.content);
|
|
||||||
},
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
//订阅消息
|
//订阅消息
|
||||||
//#ifdef MP-WEIXIN
|
//#ifdef MP-WEIXIN
|
||||||
@@ -112,12 +104,11 @@ export default {
|
|||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: templateid,
|
tmplIds: templateid,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
for(let key in res){
|
for (let key in res) {
|
||||||
if(res[key] == "reject"){
|
if (res[key] == "reject") {
|
||||||
this.checked = false;
|
this.checked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
uni.removeStorageSync("acceptSubscribeMessage");
|
uni.removeStorageSync("acceptSubscribeMessage");
|
||||||
@@ -128,12 +119,6 @@ export default {
|
|||||||
//#endif
|
//#endif
|
||||||
},
|
},
|
||||||
|
|
||||||
handleClick(item) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
navigateTo(url, type) {
|
navigateTo(url, type) {
|
||||||
if (type === "switch") {
|
if (type === "switch") {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
@@ -155,7 +140,6 @@ export default {
|
|||||||
margin: 0 auto 40rpx auto;
|
margin: 0 auto 40rpx auto;
|
||||||
padding: 0 20rpx 20rpx;
|
padding: 0 20rpx 20rpx;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
||||||
}
|
}
|
||||||
.pay-btns {
|
.pay-btns {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -221,84 +205,4 @@ export default {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border-top-right-radius: 100rpx;
|
border-top-right-radius: 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**商品代码 */
|
|
||||||
$w_94: 94%;
|
|
||||||
|
|
||||||
.goods-recommend {
|
|
||||||
background: #f7f7f7;
|
|
||||||
height: 100rpx;
|
|
||||||
line-height: 100rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-list {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-wrap: wrap;
|
|
||||||
background: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-item {
|
|
||||||
width: 50%;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border-radius: 0.4em;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-img {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 auto;
|
|
||||||
// width: 158px;
|
|
||||||
width: $w_94;
|
|
||||||
height: 350rpx;
|
|
||||||
border-top-left-radius: 20rpx;
|
|
||||||
border-top-right-radius: 20rpx;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
> img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-desc {
|
|
||||||
border-bottom-left-radius: 20rpx;
|
|
||||||
border-bottom-right-radius: 20rpx;
|
|
||||||
width: $w_94;
|
|
||||||
background: #fff;
|
|
||||||
padding: 8rpx 0 8rpx 8rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
> .goods-title {
|
|
||||||
font-size: 12px;
|
|
||||||
height: 70rpx;
|
|
||||||
display: -webkit-box;
|
|
||||||
font-weight: 500;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .goods-bottom {
|
|
||||||
display: flex;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
> .goods-price {
|
|
||||||
line-height: 2;
|
|
||||||
color: $main-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-icon {
|
|
||||||
right: 10rpx;
|
|
||||||
top: 10rpx;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="about-us">
|
|
||||||
<view class="box flex-center">
|
|
||||||
<image src="/static/logo.png" mode="scaleToFill"></image>
|
|
||||||
<view>{{config.name}}</view>
|
|
||||||
</view>
|
|
||||||
<u-cell-group :border="false">
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
|
||||||
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
|
||||||
<!-- #endif -->
|
|
||||||
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
|
||||||
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
|
||||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
|
||||||
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
|
||||||
</u-cell-group>
|
|
||||||
<view class="intro flex-center c-content">
|
|
||||||
<view>客服热线:13161366885</view>
|
|
||||||
<view>客服邮箱:lili@lili.com</view>
|
|
||||||
</view>
|
|
||||||
<view class="bottom flex-center">
|
|
||||||
<view @click="navigateTo('/pages/help/tips?type=user')">《lili商城用户协议》</view>
|
|
||||||
<view>CopyRight @ {{config.name}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
import APPUpdate, { getCurrentNo, getServerNo } from "@/plugins/APPUpdate";
|
|
||||||
import { getAppVersionList } from "@/api/message.js";
|
|
||||||
// #endif
|
|
||||||
import config from "@/config/config";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
config,
|
|
||||||
showUpdate: false,
|
|
||||||
version: "",
|
|
||||||
currentNo: 0,
|
|
||||||
params: {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 5,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
/**
|
|
||||||
* 根据当前app系统判断
|
|
||||||
*/
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let _this = this;
|
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
|
||||||
var wgtVer = inf.version;
|
|
||||||
_this.currentVersion = wgtVer;
|
|
||||||
});
|
|
||||||
if (uni.getSystemInfoSync().platform === "android") {
|
|
||||||
this.params.type = 0;
|
|
||||||
} else {
|
|
||||||
this.params.type = 1;
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 点击查看更新
|
|
||||||
*/
|
|
||||||
async checkUpdate() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let needUpdate = false;
|
|
||||||
getCurrentNo((res) => {
|
|
||||||
this.currentNo = res.versionCode;
|
|
||||||
});
|
|
||||||
let res = await getAppVersionList(this.params);
|
|
||||||
res.data.data.forEach((ele) => {
|
|
||||||
let versionDetail = ele.version.replace(/\./g, "");
|
|
||||||
if (versionDetail.length < this.currentNo.length) {
|
|
||||||
versionDetail = versionDetail.padEnd(this.currentNo.length, "0");
|
|
||||||
}
|
|
||||||
if (versionDetail > this.currentNo) {
|
|
||||||
needUpdate = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (needUpdate) {
|
|
||||||
APPUpdate(true);
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "已是最新版本!",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
navigateTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box {
|
|
||||||
width: 100%;
|
|
||||||
height: 242rpx;
|
|
||||||
image {
|
|
||||||
transform: scale(2.5);
|
|
||||||
width: 94rpx;
|
|
||||||
height: 94rpx;
|
|
||||||
}
|
|
||||||
view {
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin-top: 25rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.u-cell {
|
|
||||||
padding: 35rpx 20rpx;
|
|
||||||
height: 110rpx;
|
|
||||||
}
|
|
||||||
.intro {
|
|
||||||
color: #999999;
|
|
||||||
font-size: $font-sm;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
border: none;
|
|
||||||
padding: 45rpx 0;
|
|
||||||
line-height: 2em;
|
|
||||||
}
|
|
||||||
.bottom {
|
|
||||||
:nth-child(1) {
|
|
||||||
color: $main-color;
|
|
||||||
font-size: 22rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
:last-child {
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: $font-color-light;
|
|
||||||
}
|
|
||||||
margin-top: 110rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wap">
|
<view class="wap">
|
||||||
|
<u-navbar back-text="" title="预存款列表">
|
||||||
|
</u-navbar>
|
||||||
<view class="wrapper-show-money">
|
<view class="wrapper-show-money">
|
||||||
<view class="money-view">
|
<view class="money-view">
|
||||||
<h3>预存款金额 </h3>
|
<h3>预存款金额 </h3>
|
||||||
<view class="money">¥{{walletNum | unitPrice }}</view>
|
<view class="money">¥{{walletNum | unitPrice }}</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper-tabs">
|
<view class="wrapper-tabs">
|
||||||
|
|
||||||
<swiper class="swiper-box" @change="changeSwiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
<swiper class="swiper-box" :current="swiperCurrent">
|
||||||
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
|
||||||
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
||||||
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
<view v-if="datas.length!=0" class="view-item" v-for="(logItem, logIndex) in datas" :key="logIndex">
|
||||||
@@ -37,12 +40,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getUserRecharge, getWalletLog } from "@/api/members";
|
import { getUserRecharge, getWalletLog } from "@/api/members";
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import { getUserWallet } from "@/api/members";
|
import { getUserWallet } from "@/api/members";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
walletNum:0,
|
walletNum: 0,
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
@@ -77,6 +79,7 @@ export default {
|
|||||||
this.walletNum = result.data.result.memberWallet;
|
this.walletNum = result.data.result.memberWallet;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/**分页获取预存款充值记录 */
|
/**分页获取预存款充值记录 */
|
||||||
getRecharge() {
|
getRecharge() {
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
@@ -105,10 +108,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击swiper的时候清空数据
|
|
||||||
changeSwiper() {
|
|
||||||
this.groupBuy = [];
|
|
||||||
},
|
|
||||||
changed(index) {
|
changed(index) {
|
||||||
this.datas = [];
|
this.datas = [];
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
@@ -121,19 +121,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
||||||
transition({ detail: { dx } }) {
|
|
||||||
this.$refs.tabs.setDx(dx);
|
|
||||||
},
|
|
||||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
||||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
||||||
animationfinish(e) {
|
|
||||||
// this.groupBuy = []
|
|
||||||
let current = e.detail.current;
|
|
||||||
this.$refs.tabs.setFinishCurrent(current);
|
|
||||||
this.swiperCurrent = current;
|
|
||||||
this.current = current;
|
|
||||||
},
|
|
||||||
loadMore() {
|
loadMore() {
|
||||||
this.params.pageNumber++;
|
this.params.pageNumber++;
|
||||||
this.getWallet();
|
this.getWallet();
|
||||||
@@ -145,14 +132,14 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.green {
|
.green {
|
||||||
color: $aider-color-green !important;
|
color: $aider-color-green !important;
|
||||||
}
|
}
|
||||||
.view-item {
|
.view-item {
|
||||||
padding: 32rpx;
|
padding: 32rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.view-item-change {
|
.view-item-change {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
> .-money {
|
> .-money {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
@@ -163,8 +150,8 @@ export default {
|
|||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.view-item-detail {
|
.view-item-detail {
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
> .-title {
|
> .-title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@@ -173,8 +160,8 @@ export default {
|
|||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
@@ -183,16 +170,19 @@ export default {
|
|||||||
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
}
|
}
|
||||||
.wap {
|
|
||||||
}
|
|
||||||
|
|
||||||
.money {
|
.operation {
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
color: rgb(96, 98, 102);
|
||||||
|
}
|
||||||
|
.money {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.money-view {
|
.money-view {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
@@ -207,14 +197,14 @@ export default {
|
|||||||
$light-color,
|
$light-color,
|
||||||
$aider-light-color
|
$aider-light-color
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper-item,
|
.swiper-item,
|
||||||
.scroll-v {
|
.scroll-v {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper-box {
|
.swiper-box {
|
||||||
/* #ifndef H5 */
|
/* #ifndef H5 */
|
||||||
height: calc(100vh - 200rpx);
|
height: calc(100vh - 200rpx);
|
||||||
/* #endif */
|
/* #endif */
|
||||||
@@ -222,15 +212,15 @@ export default {
|
|||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
height: calc(100vh - 288rpx);
|
height: calc(100vh - 288rpx);
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
.wap {
|
.wap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 44px);
|
height: calc(100vh - 44px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper-show-money {
|
.wrapper-show-money {
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
// background-image: url('/static/img/main-bg.jpg');
|
// background-image: url('/static/img/main-bg.jpg');
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
121
pages/mine/deposit/operation.vue
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<u-navbar :custom-back="back" title="余额"></u-navbar>
|
||||||
|
<div class="box">
|
||||||
|
<div class="deposit">预存款金额</div>
|
||||||
|
<div class="money">¥{{walletNum | unitPrice }}</div>
|
||||||
|
<div class="operation-btns">
|
||||||
|
<div class="operation-btn light" @click="navgition('/pages/mine/deposit/withdrawal')">提现</div>
|
||||||
|
<div class="operation-btn" @click="navgition('/pages/mine/deposit/recharge')">充值</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box list" @click="navgition('/pages/mine/deposit/index')">
|
||||||
|
<div class="list-left">预存款明细</div>
|
||||||
|
<div class="list-right">
|
||||||
|
<u-icon name="arrow-right"></u-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getUserWallet } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
walletNum: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
|
let result = await getUserWallet(); //预存款
|
||||||
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
duration: 3000,
|
||||||
|
title: "请先登录!",
|
||||||
|
});
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/pages/passport/login",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/tabbar/user/my",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 跳转
|
||||||
|
*/
|
||||||
|
navgition(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.list-left {
|
||||||
|
flex: 8;
|
||||||
|
}
|
||||||
|
.list-right {
|
||||||
|
flex: 2;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 3%;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
.operation-btns {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
font-size: 50rpx;
|
||||||
|
margin: 20rpx 0 40rpx 0;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.deposit {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.operation-btn {
|
||||||
|
background: #ee6d41;
|
||||||
|
color: #fff;
|
||||||
|
height: 90rpx;
|
||||||
|
width: 240rpx;
|
||||||
|
margin: 0 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
background: #fdf2ee;
|
||||||
|
color: #ee6d41;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
50
pages/mine/deposit/recharge.vue
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">充值金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="submit" :class="{'light':flag}" @click="handlerRecharge">充值</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { recharge } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
price: 0,
|
||||||
|
flag: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
price(val) {
|
||||||
|
val <= 0 ? (this.flag = true) : (this.flag = false);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
// 充值
|
||||||
|
async handlerRecharge() {
|
||||||
|
if (this.price > 0) {
|
||||||
|
|
||||||
|
let res = await recharge({ price: this.price });
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './style.scss';
|
||||||
|
</style>
|
||||||
46
pages/mine/deposit/style.scss
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/deep/ .u-input__input,
|
||||||
|
.u-input {
|
||||||
|
font-size: 80rpx !important;
|
||||||
|
height: 102rpx !important;
|
||||||
|
}
|
||||||
|
/deep/ .u-input__input {
|
||||||
|
height: 100%;
|
||||||
|
font-size: 80rpx;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
> .price {
|
||||||
|
width: 60%;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
font-size: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
> .all {
|
||||||
|
justify-content: center;
|
||||||
|
width: 40%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.-list {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
background: #fff;
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 35rpx;
|
||||||
|
}
|
||||||
|
.light {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
margin: 80rpx auto;
|
||||||
|
width: 94%;
|
||||||
|
background: $light-color;
|
||||||
|
height: 90rpx;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
}
|
||||||
70
pages/mine/deposit/withdrawal.vue
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="-list">
|
||||||
|
<view class="title">提现金额</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price">
|
||||||
|
<span> ¥</span>
|
||||||
|
<u-input v-model="price" placeholder="" type="number" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="all">
|
||||||
|
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
|
||||||
|
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{ walletNum | unitPrice }}</span>元</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="submit" @click="cashd">提现</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getUserWallet,withdrawalApply } from "@/api/members";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
price: 0,
|
||||||
|
walletNum: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
let result = await getUserWallet(); //预存款
|
||||||
|
this.walletNum = result.data.result.memberWallet;
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
cashd() {
|
||||||
|
this.price = this.price + "";
|
||||||
|
|
||||||
|
if (this.$u.test.amount(parseInt(this.price))) {
|
||||||
|
withdrawalApply({ price: this.price }).then((res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "提现成功!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确金额",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleAll() {
|
||||||
|
this.price = this.walletNum;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./style.scss";
|
||||||
|
</style>
|
||||||
@@ -8,10 +8,16 @@
|
|||||||
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
|
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="身份证" prop="idNumber">
|
<u-form-item label="身份证" prop="idNumber">
|
||||||
<u-input
|
<u-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
|
||||||
v-model="ruleForm.idNumber"
|
</u-form-item>
|
||||||
placeholder="请输入身份证号码"
|
<u-form-item label="银行开户行" prop="settlementBankBranchName">
|
||||||
/>
|
<u-input v-model="ruleForm.settlementBankBranchName" type="text" placeholder="请输入银行开户行" />
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="银行开户名" prop="settlementBankAccountName">
|
||||||
|
<u-input v-model="ruleForm.settlementBankAccountName" type="text" placeholder="请输入银行开户名" />
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="银行账号" prop="settlementBankAccountNum">
|
||||||
|
<u-input v-model="ruleForm.settlementBankAccountNum" type="text" placeholder="请输入银行账号" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<!-- <u-form-item label="身份证正面照" prop="name">
|
<!-- <u-form-item label="身份证正面照" prop="name">
|
||||||
<u-upload></u-upload>
|
<u-upload></u-upload>
|
||||||
@@ -35,12 +41,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { applyDistribution } from "@/api/goods";
|
import { applyDistribution } from "@/api/goods";
|
||||||
|
import { checkBankno } from "@/utils/Foundation";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
name: "",
|
name: "",
|
||||||
idNumber: "",
|
idNumber: "",
|
||||||
|
settlementBankBranchName: "", // 银行开户行
|
||||||
|
settlementBankAccountName: "", //银行开户名
|
||||||
|
settlementBankAccountNum: "", //银行账号
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
@@ -62,6 +72,50 @@ export default {
|
|||||||
trigger: ["change", "blur"],
|
trigger: ["change", "blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// 银行开户行
|
||||||
|
settlementBankBranchName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行开户行",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.chinese(value);
|
||||||
|
},
|
||||||
|
message: "银行开户行不正确",
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ["change", "blur"],
|
||||||
|
},
|
||||||
|
], //银行开户名
|
||||||
|
settlementBankAccountName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行开户名",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
//银行账号
|
||||||
|
settlementBankAccountNum: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "银行账号不正确",
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return checkBankno(value);
|
||||||
|
},
|
||||||
|
message: "银行账号不正确",
|
||||||
|
},
|
||||||
|
],
|
||||||
idNumber: [
|
idNumber: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -96,16 +150,14 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
},500)
|
}, 500);
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data.message,
|
title: res.data.message,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon:"none"
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="log-list">
|
<view class="log-list">
|
||||||
<view class="log-way" v-for="(item, index) in datas" :key="index">
|
<!-- 提现记录 -->
|
||||||
|
<view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
|
||||||
<view class="log-item">
|
<view class="log-item">
|
||||||
<view class="log-item-view">
|
<view class="log-item-view">
|
||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
@@ -18,10 +19,22 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 分销业绩 -->
|
||||||
|
<view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
|
||||||
|
<view class="log-item">
|
||||||
|
<view class="log-item-view">
|
||||||
|
<view class="title">{{item.goodsName}}</view>
|
||||||
|
<view class="price">+{{ item.rebate | unitPrice }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="log-item-view">
|
||||||
|
<view>{{ item.createTime }}</view>
|
||||||
|
<view>{{item.storeName}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="empty" v-if="empty">
|
<view class="empty" v-if="empty">
|
||||||
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
|
||||||
|
|
||||||
<!-- <u-empty text="暂无更多提现历史" mode="order"></u-empty> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -30,7 +43,8 @@ import { cashLog, distributionOrderList } from "@/api/goods";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
datas: "", //数据集合
|
cashLogData: [], //提现记录数据集合
|
||||||
|
achievementData: [], //分销业绩数据合集,
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
iconType: "flower",
|
iconType: "flower",
|
||||||
empty: false,
|
empty: false,
|
||||||
@@ -71,7 +85,18 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 业绩
|
// 业绩
|
||||||
achievement() {
|
achievement() {
|
||||||
distributionOrderList(this.achParams).then((res) => {});
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
});
|
||||||
|
distributionOrderList(this.achParams).then((res) => {
|
||||||
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
|
this.achievementData = res.data.result.records;
|
||||||
|
} else {
|
||||||
|
this.status = "nomore";
|
||||||
|
this.empty = true;
|
||||||
|
}
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 初始化提现历史
|
// 初始化提现历史
|
||||||
history() {
|
history() {
|
||||||
@@ -80,7 +105,7 @@ export default {
|
|||||||
});
|
});
|
||||||
cashLog(this.params).then((res) => {
|
cashLog(this.params).then((res) => {
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
this.datas = res.data.result.records;
|
this.cashLogData = res.data.result.records;
|
||||||
} else {
|
} else {
|
||||||
this.status = "nomore";
|
this.status = "nomore";
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
|
|||||||
@@ -40,10 +40,7 @@
|
|||||||
<view>提现</view>
|
<view>提现</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="nav-item" @click="handleClick('/pages/mine/distribution/list')">
|
|
||||||
<u-icon size="50" color="#1e9ff2" name="home-fill"></u-icon>
|
|
||||||
<view>选品库</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -85,7 +82,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
onShow() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -93,21 +90,15 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.nav {
|
.nav {
|
||||||
// height: 176rpx;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
// border-radius: 20rpx;
|
|
||||||
// transform: translateY(-20rpx);
|
|
||||||
// box-shadow: 4rpx 10rpx 22rpx rgba(0, 0, 0, 0.1);
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
.nav-list {
|
.nav-list {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 40rpx 0;
|
padding: 40rpx 0;
|
||||||
background: $aider-light-color;
|
background: $aider-light-color;
|
||||||
// border-bottom-left-radius: 100rpx;
|
|
||||||
// border-bottom-right-radius: 100rpx;
|
|
||||||
}
|
}
|
||||||
.total {
|
.total {
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<!-- 筛选弹出层 -->
|
<!-- 筛选弹出层 TODO后续版本更新 -->
|
||||||
<u-popup width="90%" v-model="popup" mode="right">
|
<!-- <u-popup width="90%" v-model="popup" mode="right">
|
||||||
<view class="screen-title">商品筛选</view>
|
<view class="screen-title">商品筛选</view>
|
||||||
|
|
||||||
<view class="screen-view">
|
<view class="screen-view">
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<view class="screen-clear"> 重置 </view>
|
<view class="screen-clear"> 重置 </view>
|
||||||
<view class="screen-submit"> 确定 </view>
|
<view class="screen-submit"> 确定 </view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup> -->
|
||||||
|
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<view class="nav">
|
<view class="nav">
|
||||||
@@ -66,7 +66,10 @@
|
|||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
|
|
||||||
<view class="goods-list">
|
<view class="goods-list">
|
||||||
<view class="goods-item" v-for="(item, index) in goodsList" :key="index">
|
<u-swipe-action v-for="(item, index) in goodsList" :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :index="index" :options="options" bg-color="#fff"
|
||||||
|
ref="swiperAction" :key="item.id" @click="changeActionTab(item)">
|
||||||
|
|
||||||
|
<div class="goods-item">
|
||||||
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
<view class="goods-item-img" @click="handleNavgationGoods(item)">
|
||||||
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -97,13 +100,16 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</div>
|
||||||
|
</u-swipe-action>
|
||||||
|
|
||||||
<view class="empty">
|
<view class="empty">
|
||||||
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<canvas class="canvas-hide" canvas-id="qrcode" />
|
<canvas class="canvas-hide" canvas-id="qrcode" />
|
||||||
<drawCanvas ref="drawCanvas" v-if="showFlag" :res="res" />
|
<drawCanvas ref="drawCanvas" v-if="showFlag" :res="res" />
|
||||||
|
<u-modal v-model="deleteShow" :confirm-style="{'color':lightColor}" @confirm="delectConfirm" show-cancel-button :content="deleteContent" :async-close="true"></u-modal>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -118,6 +124,17 @@ import drawCanvas from "@/components/m-canvas";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
lightColor: this.$lightColor,
|
||||||
|
deleteContent: "解绑该商品?", //删除显示的信息
|
||||||
|
// 商品栏右侧滑动按钮
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
text: "解绑",
|
||||||
|
style: {
|
||||||
|
backgroundColor: this.$lightColor, //高亮颜色
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
showFlag: false, //分销分享开关
|
showFlag: false, //分销分享开关
|
||||||
empty: false,
|
empty: false,
|
||||||
popup: false, //弹出层开关
|
popup: false, //弹出层开关
|
||||||
@@ -147,6 +164,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
routers: "",
|
routers: "",
|
||||||
|
deleteShow: false, //删除模态框
|
||||||
|
goodsVal: false, //分销商铺信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -156,15 +175,53 @@ export default {
|
|||||||
this.routers = options;
|
this.routers = options;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
showFlag(val) {
|
showFlag(val) {},
|
||||||
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 滑动删除
|
||||||
|
*/
|
||||||
|
changeActionTab(val) {
|
||||||
|
this.deleteShow = true;
|
||||||
|
this.goodsVal = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击解绑商品
|
||||||
|
*/
|
||||||
|
delectConfirm() {
|
||||||
|
checkedDistributionGoods({ id: this.goodsVal.id, checked: false }).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.data.success) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "此商品解绑成功",
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
this.deleteShow = false;
|
||||||
|
this.goodsList = [];
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 左滑打开删除
|
||||||
|
*/
|
||||||
|
openAction(val) {
|
||||||
|
this.goodsList.forEach((item) => {
|
||||||
|
this.$set(item, "___selected", false);
|
||||||
|
});
|
||||||
|
this.$set(val, "___selected", true);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看图片
|
||||||
|
*/
|
||||||
handleNavgationGoods(val) {
|
handleNavgationGoods(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.id}`,
|
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.id}`,
|
||||||
@@ -172,14 +229,22 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async handleLink(goods) {
|
async handleLink(goods) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请请按住保存图片",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
let page = `pages/product/goods`;
|
let page = `pages/product/goods`;
|
||||||
let scene = `${goods.skuId},${goods.id},${this.routers.id}`;
|
let scene = `${goods.skuId},${goods.goodsId},${this.routers.id}`;
|
||||||
let result = await getMpCode({ page, scene });
|
let result = await getMpCode({ page, scene });
|
||||||
if(result.data.success){
|
if (result.data.success) {
|
||||||
let callback = result.data.result;
|
let callback = result.data.result;
|
||||||
this.res.container.title = `${goods.goodsName}`;
|
this.res.container.title = `${goods.goodsName}`;
|
||||||
this.res.bottom.code = `data:image/png;base64,${callback}`;
|
this.res.bottom.code = `data:image/png;base64,${callback}`;
|
||||||
this.res.bottom.price = this.$options.filters.unitPrice(goods.price, "¥");
|
this.res.bottom.price = this.$options.filters.unitPrice(
|
||||||
|
goods.price,
|
||||||
|
"¥"
|
||||||
|
);
|
||||||
this.res.bottom.desc = `${goods.goodsName}`;
|
this.res.bottom.desc = `${goods.goodsName}`;
|
||||||
this.res.bottom.img = `${goods.thumbnail}`;
|
this.res.bottom.img = `${goods.thumbnail}`;
|
||||||
|
|
||||||
@@ -187,12 +252,11 @@ export default {
|
|||||||
this.$refs.drawCanvas.init();
|
this.$refs.drawCanvas.init();
|
||||||
}
|
}
|
||||||
this.showFlag = true;
|
this.showFlag = true;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `制作二维码失败!请稍后重试`,
|
title: `制作二维码失败!请稍后重试`,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon:"none"
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -213,7 +277,7 @@ export default {
|
|||||||
title: "加载中",
|
title: "加载中",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
checkedDistributionGoods(val.id).then((res) => {
|
checkedDistributionGoods({ id: val.id, checked: true }).then((res) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -238,6 +302,9 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
if (res.data.success && res.data.result.records.length >= 1) {
|
if (res.data.success && res.data.result.records.length >= 1) {
|
||||||
|
res.data.result.records.forEach((item) => {
|
||||||
|
this.$set(item, "___selected", false);
|
||||||
|
});
|
||||||
this.goodsList.push(...res.data.result.records);
|
this.goodsList.push(...res.data.result.records);
|
||||||
}
|
}
|
||||||
if (this.goodsList.length == 0) {
|
if (this.goodsList.length == 0) {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="myTracks">
|
<view class="myTracks">
|
||||||
<empty v-if="whetherEmpty"></empty>
|
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
|
||||||
<view v-else v-for="(item, index) in trackList" :key="index">
|
<div v-else>
|
||||||
|
<view v-for="(item, index) in trackList" :key="index">
|
||||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||||
<view class="myTracks-items">
|
<view class="myTracks-items">
|
||||||
<view class="myTracks-item">
|
<view class="myTracks-item">
|
||||||
@@ -23,8 +24,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="myTracks-divider"></view>
|
<view class="myTracks-divider"></view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||||
|
</div>
|
||||||
<view v-if="editFlag">
|
<view v-if="editFlag">
|
||||||
<view class="myTracks-action-placeholder"></view>
|
<view class="myTracks-action-placeholder"></view>
|
||||||
<view class="myTracks-action">
|
<view class="myTracks-action">
|
||||||
|
|||||||
@@ -1,122 +1,158 @@
|
|||||||
// TODO 第一版本暂无此功能 后续优化以及更新
|
|
||||||
<template>
|
<template>
|
||||||
<view class="edition-intro">
|
<view class="edition-intro">
|
||||||
<view class="logo c-content">
|
<image src="https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png" class="logo" />
|
||||||
|
<h1> {{config.name}}</h1>
|
||||||
|
<view class='version'>
|
||||||
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
Version {{localVersion.version}}
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- {{localVersion}} -->
|
||||||
|
<u-cell-group class="cell" :border="false">
|
||||||
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<u-cell-item v-if="IosWhether" @click="checkStar" title="去评分"></u-cell-item>
|
||||||
|
<u-cell-item title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell-item>
|
||||||
|
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
||||||
|
<!-- #endif -->
|
||||||
|
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
||||||
|
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
||||||
|
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
||||||
|
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
||||||
|
|
||||||
|
</u-cell-group>
|
||||||
|
|
||||||
|
<view class="intro">
|
||||||
|
<view>客服热线:13161366885</view>
|
||||||
|
<view style="margin:20rpx 0 0 0;">客服邮箱:lili@lili.com</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<image src="/static/img/edition.png" mode=""></image>
|
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=user')">《lili商城用户协议》</view>
|
||||||
|
<view>CopyRight @{{config.name}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view>版本不息 优化不止</view>
|
|
||||||
</view>
|
|
||||||
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
|
|
||||||
<view class="level">
|
|
||||||
<text style="color: #1ABC9C;">{{item.version}}</text>
|
|
||||||
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="detail" v-html="item.content"></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Message from "@/api/message.js";
|
import APPUpdate from "@/plugins/APPUpdate";
|
||||||
|
import config from "@/config/config";
|
||||||
|
import { getAppVersion } from "@/api/message.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
config,
|
||||||
|
IosWhether: false, //是否是ios
|
||||||
editionHistory: [], //版本历史
|
editionHistory: [], //版本历史
|
||||||
|
versionData: {}, //版本信息
|
||||||
|
localVersion: "", //当前版本信息
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
},
|
},
|
||||||
loadStatus: "more",
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
if (uni.getSystemInfoSync().platform === "android") {
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
|
/**
|
||||||
|
* 获取是否是安卓
|
||||||
|
*/
|
||||||
|
if (platform === "android") {
|
||||||
this.params.type = 0;
|
this.params.type = 0;
|
||||||
} else {
|
} else {
|
||||||
|
this.IosWhether = true;
|
||||||
this.params.type = 1;
|
this.params.type = 1;
|
||||||
}
|
}
|
||||||
this.GET_AppVersionList(true);
|
this.getVersion(platform);
|
||||||
},
|
|
||||||
onReachBottom() {
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
if (this.loadStatus != "noMore") {
|
this.localVersion = {
|
||||||
this.params.pageNumber++;
|
versionCode: inf.version.replace(/\./g, ""),
|
||||||
this.GET_AppVersionList(false);
|
version: inf.version,
|
||||||
}
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
GET_AppVersionList(reset) {
|
async getVersion(platform) {
|
||||||
if (reset) {
|
let type;
|
||||||
this.params.pageNumber = 1;
|
platform == "android" ? (type = "ANDROID") : (type = "IOS");
|
||||||
|
|
||||||
|
let res = await getAppVersion(type);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.versionData = res.data.result;
|
||||||
}
|
}
|
||||||
uni.showLoading({
|
},
|
||||||
title: "加载中",
|
|
||||||
|
navigateTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
});
|
});
|
||||||
API_Message.getAppVersionList(this.params).then((response) => {
|
},
|
||||||
uni.hideLoading();
|
|
||||||
if (response.statusCode == 200) {
|
/**
|
||||||
const { data } = response;
|
* ios点击评分
|
||||||
if (data.data.length < 10) {
|
*/
|
||||||
this.loadStatus = "noMore";
|
checkStar() {
|
||||||
}
|
plus.runtime.launchApplication({
|
||||||
this.editionHistory.push(...data.data);
|
action: `itms-apps://itunes.apple.com/app/${config.iosAppId}?action=write-review`,
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查更新
|
||||||
|
*/
|
||||||
|
checkUpdate() {
|
||||||
|
if (
|
||||||
|
this.versionData.version.replace(/\./g, "") <
|
||||||
|
this.localVersion.versionCode
|
||||||
|
) {
|
||||||
|
APPUpdate();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前版本已是最新版",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
.cell {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
.edition-intro {
|
.edition-intro {
|
||||||
.logo {
|
min-height: 100vh;
|
||||||
|
background: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
|
||||||
font-size: $font-lg;
|
> h1 {
|
||||||
color: $font-color-light;
|
margin: 20rpx 0 20rpx 0;
|
||||||
height: 330rpx;
|
letter-spacing: 2rpx;
|
||||||
margin-bottom: 20rpx;
|
|
||||||
> view:nth-child(1) {
|
|
||||||
width: 144rpx;
|
|
||||||
height: 144rpx;
|
|
||||||
border: 1px solid #ffc71c;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
image {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 113rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.edition {
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
color: $font-color-light;
|
|
||||||
font-size: $font-sm;
|
|
||||||
.level {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx 30rpx;
|
|
||||||
border-bottom: 2rpx solid $border-color-light;
|
|
||||||
text:nth-child(1) {
|
|
||||||
font-size: $font-base;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.detail {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
line-height: 2em;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
}
|
}
|
||||||
|
> .version {
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-bottom: 100rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.intro {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
.logo {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="notify">
|
|
||||||
<u-cell-group>
|
|
||||||
<u-cell-item title="账户通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.account"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="物流通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.logistics"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="优惠促销" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.cheap"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
<u-cell-item title="服务通知" :arrow="false">
|
|
||||||
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="setting.service"></u-switch>
|
|
||||||
</u-cell-item>
|
|
||||||
</u-cell-group>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
setting:{
|
|
||||||
account:false,
|
|
||||||
logistics:false,
|
|
||||||
cheap:false,
|
|
||||||
service:false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
uni-view{
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -98,23 +98,14 @@ export default {
|
|||||||
* 提交保存
|
* 提交保存
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
if (this.form.regionId.length != 0 && this.birthday) {
|
|
||||||
delete this.form.___path;
|
delete this.form.___path;
|
||||||
let params = JSON.parse(JSON.stringify(this.form));
|
let params = JSON.parse(JSON.stringify(this.form));
|
||||||
saveUserInfo(params).then((res) => {
|
saveUserInfo(params).then((res) => {
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
storage.setUserInfo(res.data.result);
|
storage.setUserInfo(res.data.result);
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "请填写生日和城市!",
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode=""></u-image>
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode=""></u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
<view>{{ userInfo.id ? userInfo.username || '' : '暂未登录' }}</view>
|
|
||||||
|
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
|
||||||
</view>
|
</view>
|
||||||
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
<u-icon color="#ccc" name="arrow-right"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -17,10 +18,8 @@
|
|||||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<u-cell-item title="版本说明" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- <u-cell-item title="好评鼓励"></u-cell-item> -->
|
<u-cell-item :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell-item>
|
||||||
<u-cell-item title="关于我们" @click="navigateTo('/pages/mine/aboutUs')"></u-cell-item>
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
<view class="submit" @click="showModalDialog">{{userInfo.id ?'退出登录':'返回登录'}}</view>
|
||||||
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true" :content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
<u-modal show-cancel-button v-model="quitShow" @confirm="confirm" :confirm-color="lightColor" :async-close="true" :content="userInfo.id ? '确定要退出登录么?' : '确定要返回登录么?'"></u-modal>
|
||||||
@@ -29,9 +28,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
config,
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
quitShow: false,
|
quitShow: false,
|
||||||
isCertificate: false,
|
isCertificate: false,
|
||||||
@@ -136,9 +137,7 @@ export default {
|
|||||||
});
|
});
|
||||||
that.getCacheSize(); // 重新计算缓存
|
that.getCacheSize(); // 重新计算缓存
|
||||||
},
|
},
|
||||||
function (e) {
|
function (e) {}
|
||||||
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
entry.remove();
|
entry.remove();
|
||||||
@@ -195,7 +194,12 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
.user-name {
|
.user-name {
|
||||||
flex: 1;
|
width: 500rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
|
|||||||
58
pages/mine/set/versionFunctionList.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<u-collapse v-if="versionData.length !=0">
|
||||||
|
<u-collapse-item class="version-item" :title="item.versionName" v-for="(item, index) in versionData" :key="index">
|
||||||
|
<!-- {{item.body}} -->
|
||||||
|
|
||||||
|
{{item.content}}
|
||||||
|
</u-collapse-item>
|
||||||
|
|
||||||
|
</u-collapse>
|
||||||
|
<u-empty class="empty" v-else text="暂无版本信息" mode="list"></u-empty>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAppVersionList } from "@/api/message";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
versionData: [],
|
||||||
|
appType: "",
|
||||||
|
params: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
|
/**
|
||||||
|
* 获取是否是安卓
|
||||||
|
*/
|
||||||
|
if (platform === "android") {
|
||||||
|
this.appType = "ANDROID";
|
||||||
|
} else {
|
||||||
|
this.IosWhether = true;
|
||||||
|
this.appType = "IOS";
|
||||||
|
}
|
||||||
|
this.getVersionList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getVersionList() {
|
||||||
|
let res = await getAppVersionList(this.appType, this.params);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.versionData = res.data.result.records;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.version-item{
|
||||||
|
padding: 10rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -97,7 +97,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async onShow() {
|
||||||
//获取顶级分类
|
//获取顶级分类
|
||||||
let response = await getPointsCategory();
|
let response = await getPointsCategory();
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
|
|||||||
@@ -179,7 +179,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="storeSellerName">
|
<div class="storeSellerName">
|
||||||
<div class="textHidden">
|
<div class="textHidden">
|
||||||
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated == 1" text="自营" type="error" />
|
<u-tag style="margin-right: 10rpx" size="mini" mode="dark" v-if="item.selfOperated" text="自营" type="error" />
|
||||||
<span>{{ item.storeName || "暂无" }}</span>
|
<span>{{ item.storeName || "暂无" }}</span>
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
@@ -314,7 +314,7 @@ export default {
|
|||||||
isSWitch: false,
|
isSWitch: false,
|
||||||
|
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
// sort: 'grade_asc',
|
// sort: 'grade_asc',
|
||||||
sort: "releaseTime",
|
sort: "releaseTime",
|
||||||
@@ -324,7 +324,7 @@ export default {
|
|||||||
minPrice: "",
|
minPrice: "",
|
||||||
maxPrice: "",
|
maxPrice: "",
|
||||||
sortParams: {
|
sortParams: {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
||||||
// price: "", //价格,示例值(10_30)
|
// price: "", //价格,示例值(10_30)
|
||||||
@@ -474,7 +474,7 @@ export default {
|
|||||||
this.minPrice = "";
|
this.minPrice = "";
|
||||||
this.maxPrice = "";
|
this.maxPrice = "";
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNumber: 0,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
};
|
};
|
||||||
this.loadData();
|
this.loadData();
|
||||||
@@ -545,7 +545,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
tabClick(index, type) {
|
tabClick(index, type) {
|
||||||
this.params.pageNumber = 0;
|
this.params.pageNumber = 1;
|
||||||
this.params.pageSize = 10;
|
this.params.pageSize = 10;
|
||||||
// this.params.order = "desc";
|
// this.params.order = "desc";
|
||||||
if (this.params.sort == type) {
|
if (this.params.sort == type) {
|
||||||
@@ -687,7 +687,7 @@ export default {
|
|||||||
this.isShowSeachGoods = true;
|
this.isShowSeachGoods = true;
|
||||||
this.$refs.mSearch.isShowSeachGoods = true;
|
this.$refs.mSearch.isShowSeachGoods = true;
|
||||||
this.params.keyword = keyword;
|
this.params.keyword = keyword;
|
||||||
this.params.pageNumber = 0;
|
this.params.pageNumber = 1;
|
||||||
this.$set(this.sortParams, "keyword", keyword);
|
this.$set(this.sortParams, "keyword", keyword);
|
||||||
|
|
||||||
this.loadData("refresh", 1);
|
this.loadData("refresh", 1);
|
||||||
|
|||||||
@@ -1,325 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="selected-store">
|
|
||||||
<!-- 点击搜索出现搜索框 -->
|
|
||||||
<!-- <div v-show="searchHandle" class="searchBox">
|
|
||||||
<u-search placeholder="请输入关键字" :clearabled="true" :show-action="false" v-model="pageParams.name" @blur="searchStore()" @clear="clearSearch()" @confirm="searchStore()" ></u-search>
|
|
||||||
</div> -->
|
|
||||||
<div>
|
|
||||||
<empty v-if="nomsg"></empty>
|
|
||||||
<div class="swiper-item">
|
|
||||||
<scroll-view class="scroll-v" enableBackToTop="true" scroll-with-animation scroll-y>
|
|
||||||
<view class="index-item" v-for="(store,storeIndex) in stores" :key="storeIndex" @click.prevent="storeDetail(store.id)">
|
|
||||||
<div class="item-goods">
|
|
||||||
<u-image width="51px" height="51px" class="item-title-img" :src="store.storeLogo || noLogo">
|
|
||||||
<u-loading slot="loading"></u-loading>
|
|
||||||
</u-image>
|
|
||||||
<view class="item-content">
|
|
||||||
<view>
|
|
||||||
<span>{{ store.storeName }}</span><span class="self-store" v-if="store.selfOperated">自营</span>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<u-rate size="24" :count="5" :disabled="true" v-model="store.descriptionScore"></u-rate>
|
|
||||||
</view>
|
|
||||||
<view>{{ store.store_collect }} 关注</view>
|
|
||||||
<button v-if="store.is_connect==0" @click.stop="collectstore(store.id)" class="collect btn-mini">
|
|
||||||
<u-icon name="plus"></u-icon>关注
|
|
||||||
</button>
|
|
||||||
<button v-if="store.is_connect==1" @click.stop="collectstore(store.id)" class="collect btn-mini"></u-icon>已关注</button>
|
|
||||||
</view>
|
|
||||||
<view class="store-num">
|
|
||||||
<!-- <view> {{store.goods_num}}</view> -->
|
|
||||||
<view>进店逛逛</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
||||||
</scroll-view>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { collectionStore } from "@/api/members.js";
|
|
||||||
import { getstoreList } from "@/api/store.js";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tabIndex: 0,
|
|
||||||
currentLeft: 0,
|
|
||||||
stores: [],
|
|
||||||
pageParams: {
|
|
||||||
pageNumber: 1, //页码
|
|
||||||
pageSize: 10, //分页大小
|
|
||||||
category_id: 0, //分类
|
|
||||||
key_words: "", //搜索关键字
|
|
||||||
name: "", //店铺名字
|
|
||||||
},
|
|
||||||
loadStatus: "more",
|
|
||||||
nomsg: false,
|
|
||||||
noLogo: require("@/static/logo.png"),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
tabIndex(val) {
|
|
||||||
this.pageParams.pageNumber = 1;
|
|
||||||
this.stores = [];
|
|
||||||
this.loadStatus = "more";
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
this.pageParams.pageNumber++;
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 清空店铺
|
|
||||||
clearSearch() {
|
|
||||||
(this.pageParams = {
|
|
||||||
pageNumber: 1, //页码
|
|
||||||
pageSize: 10, //分页大小
|
|
||||||
category_id: 0, //分类
|
|
||||||
key_words: "", //搜索关键字
|
|
||||||
name: "", //店铺名字
|
|
||||||
}),
|
|
||||||
this.searchStore();
|
|
||||||
},
|
|
||||||
|
|
||||||
async searchStore() {
|
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
});
|
|
||||||
|
|
||||||
//获取商品数据
|
|
||||||
let response = await getstoreList(this.pageParams);
|
|
||||||
uni.hideLoading();
|
|
||||||
if (this.pageParams.name) {
|
|
||||||
this.stores = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.stores = this.stores.concat(response.data.result.records);
|
|
||||||
uni.hideLoading();
|
|
||||||
if (
|
|
||||||
response.data.result.total <=
|
|
||||||
response.data.result.current * response.data.result.size
|
|
||||||
) {
|
|
||||||
this.loadStatus = "noMore";
|
|
||||||
} else {
|
|
||||||
this.loadStatus = "loadmore";
|
|
||||||
}
|
|
||||||
if (this.stores.length == 0) {
|
|
||||||
this.nomsg = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
collectstore(id) {
|
|
||||||
//收藏店铺
|
|
||||||
collectionStore(id).then((res) => {
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
this.$api.msg("收藏成功");
|
|
||||||
this.pageParams.pageNumber = 1;
|
|
||||||
this.stores = [];
|
|
||||||
this.searchStore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
storeDetail(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/product/shopPage?id=" + id,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
page {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.searchBox {
|
|
||||||
margin: 20rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-store {
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.list-scroll-content {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
white-space: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background-color: #fff;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
.tab-item {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
text-align: center;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
border-bottom: 2px solid #ffffff;
|
|
||||||
broder-width: 60rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
padding-bottom: 4rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-box {
|
|
||||||
height: calc(100% - 80rpx);
|
|
||||||
|
|
||||||
.scroll-v {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.index-item {
|
|
||||||
// height: 535rpx;
|
|
||||||
margin: 20rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 14rpx;
|
|
||||||
|
|
||||||
.item-goods {
|
|
||||||
height: 170rpx;
|
|
||||||
margin: 0 20rpx;
|
|
||||||
padding: 30rpx 0;
|
|
||||||
// border-bottom: 1px solid #eeeeee;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 102rpx;
|
|
||||||
height: 102rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
.item-title-img {
|
|
||||||
width: 102rpx !important;
|
|
||||||
height: 102rpx !important;
|
|
||||||
border-radius: 50% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-content {
|
|
||||||
flex: 1;
|
|
||||||
line-height: 2em;
|
|
||||||
font-size: $font-sm;
|
|
||||||
position: relative;
|
|
||||||
.collect {
|
|
||||||
position: absolute;
|
|
||||||
width: 100rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
bottom: 20rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 40rpx;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 14rpx;
|
|
||||||
.u-icon {
|
|
||||||
font-size: 26rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 7rpx;
|
|
||||||
left: 10rpx;
|
|
||||||
margin-right: 5rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
> view:first-child {
|
|
||||||
font-size: $font-base;
|
|
||||||
color: #333333;
|
|
||||||
font-weight: 700;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
span:nth-child(2) {
|
|
||||||
position: absolute;
|
|
||||||
font-weight: 400;
|
|
||||||
top: 12rpx;
|
|
||||||
font-size: 18rpx;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
height: 26rpx;
|
|
||||||
width: 50rpx;
|
|
||||||
line-height: 26rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
background-color: #ff6262;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
color: #999;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.store-num {
|
|
||||||
width: 150rpx;
|
|
||||||
text-align: center;
|
|
||||||
border-left: 1px solid #eeeeee;
|
|
||||||
|
|
||||||
:nth-child(1) {
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
:nth-child(2) {
|
|
||||||
font-size: 18rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-in-store {
|
|
||||||
height: 364rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
padding: 20rpx 0 20rpx 20rpx;
|
|
||||||
|
|
||||||
.goods-item {
|
|
||||||
width: 195rpx;
|
|
||||||
display: inline-block;
|
|
||||||
white-space: normal;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
font-size: $font-sm;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 195rpx;
|
|
||||||
height: 195rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
> view {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
.goods-item-img {
|
|
||||||
width: 195rpx !important;
|
|
||||||
height: 195rpx !important;
|
|
||||||
border-radius: 8rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
> view:nth-child(2) {
|
|
||||||
color: #ff5a10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-name {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -3,6 +3,9 @@
|
|||||||
<view class="u-tabs-box">
|
<view class="u-tabs-box">
|
||||||
<u-tabs bg-color="#fff" :list="list" :is-scroll="false" :current="current" @change="change" :active-color="$lightColor"></u-tabs>
|
<u-tabs bg-color="#fff" :list="list" :is-scroll="false" :current="current" @change="change" :active-color="$lightColor"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
|
<div class="u-tabs-search">
|
||||||
|
<u-search placeholder="请输入订单编号" @search="handleGetOrderList(current)" @clear="handleGetOrderList(current)" @custom="handleGetOrderList(current)" v-model="params.orderSn"></u-search>
|
||||||
|
</div>
|
||||||
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
|
||||||
<view class="seller-view" v-for="(order, orderIndex) in orderList" :key="orderIndex">
|
<view class="seller-view" v-for="(order, orderIndex) in orderList" :key="orderIndex">
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
@@ -126,6 +129,8 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
sort: 'createTime',
|
||||||
|
order: 'desc'
|
||||||
},
|
},
|
||||||
|
|
||||||
logParams: {
|
logParams: {
|
||||||
@@ -135,15 +140,20 @@ export default {
|
|||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
this.params.pageNumber = 1;
|
this.params.pageNumber = 1;
|
||||||
|
if (options.orderSn) this.params.orderSn = options.orderSn;
|
||||||
this.getOrderList(this.current);
|
this.getOrderList(this.current);
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.change(this.current);
|
this.change(this.current);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleGetOrderList(current) {
|
||||||
|
this.orderList = [];
|
||||||
|
this.getOrderList(current);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 切换tab页时,初始化数据
|
* 切换tab页时,初始化数据
|
||||||
*/
|
*/
|
||||||
@@ -220,7 +230,6 @@ export default {
|
|||||||
price: item.flowPrice,
|
price: item.flowPrice,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.orderList = this.orderList.concat(afterSaleLogList);
|
this.orderList = this.orderList.concat(afterSaleLogList);
|
||||||
@@ -296,9 +305,12 @@ page,
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.body-view {
|
.body-view {
|
||||||
// height: calc(100vh - 44px -40px);
|
overflow-y: auto;
|
||||||
// overflow-y: auto;
|
height: calc(100vh - 44px - 80rpx - 104rpx);
|
||||||
height: 100%;
|
}
|
||||||
|
.u-tabs-search {
|
||||||
|
padding: 20rpx;
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
.countMoney {
|
.countMoney {
|
||||||
margin-left: 7rpx;
|
margin-left: 7rpx;
|
||||||
|
|||||||
@@ -59,8 +59,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view v-if="
|
<view v-if="
|
||||||
applyInfo.accountType === 'BANK_TRANSFER' &&
|
applyInfo.accountType === 'BANK_TRANSFER' &&
|
||||||
applyInfo.applyRefundPrice != 0
|
applyInfo.applyRefundPrice != 0">
|
||||||
">
|
|
||||||
<u-form-item label="银行开户行" :label-width="150">
|
<u-form-item label="银行开户行" :label-width="150">
|
||||||
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
|
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -100,7 +99,7 @@ import {
|
|||||||
|
|
||||||
import city from "@/components/m-city/m-city";
|
import city from "@/components/m-city/m-city";
|
||||||
import { upload } from "@/api/common.js";
|
import { upload } from "@/api/common.js";
|
||||||
|
import { checkBankno } from "@/utils/Foundation";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
export default {
|
export default {
|
||||||
component: {
|
component: {
|
||||||
@@ -191,7 +190,7 @@ export default {
|
|||||||
this.sn = options.sn;
|
this.sn = options.sn;
|
||||||
let dsku = decodeURIComponent(options.sku);
|
let dsku = decodeURIComponent(options.sku);
|
||||||
let newSku = JSON.parse(dsku);
|
let newSku = JSON.parse(dsku);
|
||||||
this.sku = newSku
|
this.sku = newSku;
|
||||||
|
|
||||||
this.form.orderItemSn = options.sn;
|
this.form.orderItemSn = options.sn;
|
||||||
this.form.skuId = this.sku.skuId;
|
this.form.skuId = this.sku.skuId;
|
||||||
@@ -254,9 +253,7 @@ export default {
|
|||||||
this.form.accountType_label = e[0].label;
|
this.form.accountType_label = e[0].label;
|
||||||
},
|
},
|
||||||
//返回方式
|
//返回方式
|
||||||
returnSelectConfirm(e) {
|
returnSelectConfirm(e) {},
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
//修改申请数量
|
//修改申请数量
|
||||||
valChange(e) {
|
valChange(e) {
|
||||||
@@ -264,7 +261,6 @@ export default {
|
|||||||
},
|
},
|
||||||
//图片上传
|
//图片上传
|
||||||
onUploaded(lists) {
|
onUploaded(lists) {
|
||||||
|
|
||||||
let images = [];
|
let images = [];
|
||||||
|
|
||||||
lists.forEach((item) => {
|
lists.forEach((item) => {
|
||||||
@@ -278,6 +274,7 @@ export default {
|
|||||||
if (!this.handleCheckParams()) {
|
if (!this.handleCheckParams()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: "加载中",
|
||||||
});
|
});
|
||||||
@@ -297,74 +294,8 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证银行卡号
|
|
||||||
*/
|
|
||||||
checkBankno(bankno) {
|
|
||||||
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
|
|
||||||
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
|
|
||||||
var newArr = [];
|
|
||||||
|
|
||||||
for (var i = first15Num.length - 1; i > -1; i--) {
|
|
||||||
//前15或18位倒序存进数组
|
|
||||||
newArr.push(first15Num.substr(i, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
var arrJiShu = []; //奇数位*2的积 <9
|
|
||||||
var arrJiShu2 = []; //奇数位*2的积 >9
|
|
||||||
var arrOuShu = []; //偶数位数组
|
|
||||||
for (var j = 0; j < newArr.length; j++) {
|
|
||||||
if ((j + 1) % 2 == 1) {
|
|
||||||
//奇数位
|
|
||||||
if (parseInt(newArr[j]) * 2 < 9)
|
|
||||||
arrJiShu.push(parseInt(newArr[j]) * 2);
|
|
||||||
else arrJiShu2.push(parseInt(newArr[j]) * 2);
|
|
||||||
} //偶数位
|
|
||||||
else arrOuShu.push(newArr[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
|
|
||||||
var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
|
|
||||||
for (var h = 0; h < arrJiShu2.length; h++) {
|
|
||||||
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
|
|
||||||
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
var sumJiShu = 0; //奇数位*2 < 9 的数组之和
|
|
||||||
var sumOuShu = 0; //偶数位数组之和
|
|
||||||
var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
|
|
||||||
var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
|
|
||||||
var sumTotal = 0;
|
|
||||||
for (var m = 0; m < arrJiShu.length; m++) {
|
|
||||||
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
|
|
||||||
}
|
|
||||||
for (var n = 0; n < arrOuShu.length; n++) {
|
|
||||||
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
|
|
||||||
}
|
|
||||||
for (var p = 0; p < jishu_child1.length; p++) {
|
|
||||||
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
|
|
||||||
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
|
|
||||||
}
|
|
||||||
//计算总和
|
|
||||||
sumTotal =
|
|
||||||
parseInt(sumJiShu) +
|
|
||||||
parseInt(sumOuShu) +
|
|
||||||
parseInt(sumJiShuChild1) +
|
|
||||||
parseInt(sumJiShuChild2);
|
|
||||||
//计算Luhm值
|
|
||||||
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
|
|
||||||
var luhm = 10 - k;
|
|
||||||
if (lastNum == luhm) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
//检测提交参数
|
//检测提交参数
|
||||||
handleCheckParams() {
|
handleCheckParams() {
|
||||||
|
|
||||||
if (this.$u.test.isEmpty(this.form.reason)) {
|
if (this.$u.test.isEmpty(this.form.reason)) {
|
||||||
this.$refs.uToast.show({ title: "请选择 退款原因", type: "error" });
|
this.$refs.uToast.show({ title: "请选择 退款原因", type: "error" });
|
||||||
return false;
|
return false;
|
||||||
@@ -398,7 +329,7 @@ export default {
|
|||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
} else if (this.checkBankno(this.form.bankAccountNumber) === false) {
|
} else if (checkBankno(this.form.bankAccountNumber) === false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: "银行卡卡号不正确",
|
title: "银行卡卡号不正确",
|
||||||
type: "error",
|
type: "error",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="select-view">
|
<view class="select-view">
|
||||||
<view class="select-cell" @click="onSelect(1)">
|
<view class="select-cell" v-if="applyInfo.returnGoods" @click="onSelect(1)">
|
||||||
<view class="select-image">
|
<view class="select-image">
|
||||||
<image style="height: 51rpx; width: 51rpx" src="/static/order/t1.png"></image>
|
<image style="height: 51rpx; width: 51rpx" src="/static/order/t1.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="select-cell" @click="onSelect(3)">
|
<view class="select-cell" v-if="applyInfo.returnMoney" @click="onSelect(3)">
|
||||||
<view class="select-image">
|
<view class="select-image">
|
||||||
<image style="height: 51rpx; width: 51rpx" src="/static/order/t3.png"></image>
|
<image style="height: 51rpx; width: 51rpx" src="/static/order/t3.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -56,6 +56,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
import UniIcons from "@/components/uni-icons/uni-icons.vue";
|
||||||
|
|
||||||
|
import { getAfterSaleInfo } from "@/api/after-sale";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
UniIcons,
|
UniIcons,
|
||||||
@@ -64,6 +66,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
sn: "",
|
sn: "",
|
||||||
sku: {}, //sku
|
sku: {}, //sku
|
||||||
|
applyInfo:""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@@ -71,8 +74,20 @@ export default {
|
|||||||
let dData = decodeURIComponent(options.sku);
|
let dData = decodeURIComponent(options.sku);
|
||||||
let newData = JSON.parse(dData);
|
let newData = JSON.parse(dData);
|
||||||
this.sku = newData;
|
this.sku = newData;
|
||||||
|
|
||||||
|
// 查看当前商品是否支持退款退货
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
getAfterSaleInfo(this.sn).then((response) => {
|
||||||
|
if (response.data.success) {
|
||||||
|
this.applyInfo = response.data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择退货流程
|
* 选择退货流程
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,7 +25,16 @@
|
|||||||
{{ comment.goodsName }}
|
{{ comment.goodsName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-subtitle"></view>
|
<view class="goods-subtitle"></view>
|
||||||
|
<view class="commentStyle" v-if="comment.reply">
|
||||||
|
商家回复:
|
||||||
|
<span class="addCommentSpan">{{ comment.reply }}</span>
|
||||||
|
<view class="img">
|
||||||
|
<!-- 循环出商家回复评价的图片 -->
|
||||||
|
<u-image width="140rpx" height="140rpx" v-if="comment.replyImage" v-for="(replyImg, replyIndex) in splitImg(comment.replyImage)" :src="replyImg" :key="replyIndex"
|
||||||
|
@click="preview(splitImg( comment.replyImage), index)">
|
||||||
|
</u-image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -49,6 +58,18 @@ export default {
|
|||||||
this.comment = JSON.parse(decodeURIComponent(options.comment));
|
this.comment = JSON.parse(decodeURIComponent(options.comment));
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 切割图像
|
||||||
|
*/
|
||||||
|
splitImg(val) {
|
||||||
|
if (val && val.split(",")) {
|
||||||
|
return val.split(",");
|
||||||
|
} else if (val) {
|
||||||
|
return val;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 点击图片放大或保存
|
* 点击图片放大或保存
|
||||||
*/
|
*/
|
||||||
@@ -68,6 +89,38 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.commentStyle {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
padding: 14rpx 26rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.img {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
/* height: 140rpx; */
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 166rpx;
|
||||||
|
height: 166rpx;
|
||||||
|
margin: 0 15rpx 15rpx 0;
|
||||||
|
|
||||||
|
&:nth-of-type(3n + 0) {
|
||||||
|
margin: 0 0 15rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addCommentSpan {
|
||||||
|
color: $u-tips-color !important;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
}
|
||||||
.memName {
|
.memName {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,13 +114,13 @@
|
|||||||
|
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
|
<invoices :res="receiptList" @callbackInvoice="callbackInvoice" v-if="invoiceFlag" />
|
||||||
<u-select v-model="shippingFlag" :list="shippingMethod" @confirm="checkedshipMethod"></u-select>
|
<u-select v-model="shippingFlag" :list="shippingMethod"></u-select>
|
||||||
|
|
||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
<div class="box box4">
|
<div class="box box4">
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :offset="0" :span="9" @click="shippingFlag = true">配送方式</u-col>
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :offset="0" :span="9" @click="shippingFlag = true">配送方式</u-col>
|
||||||
<u-col :span="3" textAlign="right" @click="shippingFlag = true">
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="3" textAlign="right" @click="shippingFlag = true">
|
||||||
{{ shippingMethod.find(e=>{ return e.value == shippingText; }).label }}
|
{{ shippingMethod.find(e=>{ return e.value == shippingText; }).label }}
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
@@ -150,8 +150,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<u-row>
|
<u-row>
|
||||||
<u-col :span="7">运费</u-col>
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="7">运费</u-col>
|
||||||
<u-col :span="5" class="tr tipsColor" textAlign="right">
|
<u-col v-if="orderMessage.cartTypeEnum != 'VIRTUAL'" :span="5" class="tr tipsColor" textAlign="right">
|
||||||
<u-tag v-if="orderMessage.priceDetailDTO.freightPrice == 0" style="margin-right: 20rpx" color="#FF6262" text="包邮" type="warning" size="mini" mode="plain" shape="circle" />
|
<u-tag v-if="orderMessage.priceDetailDTO.freightPrice == 0" style="margin-right: 20rpx" color="#FF6262" text="包邮" type="warning" size="mini" mode="plain" shape="circle" />
|
||||||
<span>¥{{
|
<span>¥{{
|
||||||
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
orderMessage.priceDetailDTO.freightPrice | unitPrice
|
||||||
@@ -180,9 +180,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 配送地区没有提示 -->
|
||||||
|
<div class="notSupportFreight" v-if="notSupportFreight.length !=0">
|
||||||
|
<u-notice-bar style="width:100%" :volume-icon="false" mode="horizontal" :list="notSupportFreightGoodsList"></u-notice-bar>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 结账 -->
|
<!-- 结账 -->
|
||||||
<div class="box box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO">
|
<div class="box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO">
|
||||||
<div class="navL">
|
<div class="tabbar-left">
|
||||||
合计:
|
合计:
|
||||||
<span class="number">
|
<span class="number">
|
||||||
¥
|
¥
|
||||||
@@ -191,10 +196,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="navRiv" @click="createTradeFun()">
|
<div class="navRiv" @click="createTradeFun()">
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<div class="navR">提交订单</div>
|
<div class="tabbar-right">提交订单</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<div class="navR">微信支付</div>
|
<div class="tabbar-right">微信支付</div>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -249,10 +254,11 @@ export default {
|
|||||||
endWay: "", //最后一个参团人
|
endWay: "", //最后一个参团人
|
||||||
masterWay: "", //团长信息
|
masterWay: "", //团长信息
|
||||||
pintuanFlage: true, //是开团还是拼团
|
pintuanFlage: true, //是开团还是拼团
|
||||||
|
notSupportFreight: [], //不支持运费
|
||||||
|
notSupportFreightGoodsList: ["以下商品超出配送范围:"],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发票收据类型
|
* 发票收据类型
|
||||||
*/
|
*/
|
||||||
@@ -403,7 +409,11 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 提交订单准备支付
|
* 提交订单准备支付
|
||||||
*/
|
*/
|
||||||
submit() {
|
|
||||||
|
// 创建订单
|
||||||
|
createTradeFun() {
|
||||||
|
// 防抖
|
||||||
|
this.$u.throttle(() => {
|
||||||
if (!this.address.id) {
|
if (!this.address.id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择地址",
|
title: "请选择地址",
|
||||||
@@ -445,7 +455,12 @@ export default {
|
|||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
// 如果当前价格为0跳转到订单列表
|
||||||
|
if (this.orderMessage.priceDetailDTO.billPrice == 0) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/pages/order/myOrder?status=0",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 微信小程序中点击创建订单直接开始支付
|
// 微信小程序中点击创建订单直接开始支付
|
||||||
this.pay(res.data.result.sn);
|
this.pay(res.data.result.sn);
|
||||||
@@ -456,20 +471,16 @@ export default {
|
|||||||
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
|
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
|
||||||
);
|
);
|
||||||
// #endif
|
// #endif
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "创建订单有误!请稍后重试",
|
title: res.data.message,
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}, 3000);
|
||||||
|
|
||||||
// 创建订单
|
|
||||||
createTradeFun() {
|
|
||||||
// 防抖
|
|
||||||
this.$u.debounce(this.submit(), 3000);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -489,9 +500,8 @@ export default {
|
|||||||
// 如果没有商品选择地址的话 则选择 默认地址
|
// 如果没有商品选择地址的话 则选择 默认地址
|
||||||
API_Address.getAddressDefault().then((res) => {
|
API_Address.getAddressDefault().then((res) => {
|
||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
res.data.result.consigneeAddressPath = res.data.result.consigneeAddressPath.split(
|
res.data.result.consigneeAddressPath =
|
||||||
","
|
res.data.result.consigneeAddressPath.split(",");
|
||||||
);
|
|
||||||
this.address = res.data.result;
|
this.address = res.data.result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -516,9 +526,19 @@ export default {
|
|||||||
this.getUserAddress();
|
this.getUserAddress();
|
||||||
} else {
|
} else {
|
||||||
this.address = res.data.result.memberAddress;
|
this.address = res.data.result.memberAddress;
|
||||||
res.data.result.memberAddress.consigneeAddressPath = res.data.result.memberAddress.consigneeAddressPath.split(
|
res.data.result.memberAddress.consigneeAddressPath =
|
||||||
","
|
res.data.result.memberAddress.consigneeAddressPath.split(",");
|
||||||
);
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
res.data.result.notSupportFreight &&
|
||||||
|
res.data.result.notSupportFreight.length != 0
|
||||||
|
) {
|
||||||
|
this.notSupportFreight = res.data.result.notSupportFreight;
|
||||||
|
|
||||||
|
res.data.result.notSupportFreight.forEach((item) => {
|
||||||
|
this.notSupportFreightGoodsList[0] += item.goodsSku.goodsName;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -570,6 +590,9 @@ export default {
|
|||||||
width: 143rpx;
|
width: 143rpx;
|
||||||
border-bottom: 2px dotted #999;
|
border-bottom: 2px dotted #999;
|
||||||
}
|
}
|
||||||
|
.tabbar-left {
|
||||||
|
margin-left: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-one,
|
.btn-one,
|
||||||
.wait {
|
.wait {
|
||||||
@@ -645,9 +668,7 @@ export default {
|
|||||||
.tabC {
|
.tabC {
|
||||||
> p {
|
> p {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -655,6 +676,28 @@ export default {
|
|||||||
.box2 {
|
.box2 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
.notSupportFreight {
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
|
bottom: calc(100rpx + env(safe-area-inset-bottom));
|
||||||
|
// #ifdef H5
|
||||||
|
bottom: 100rpx;
|
||||||
|
// #endif
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
left: 0;
|
||||||
|
background: #fdf6ec;
|
||||||
|
height: 100rpx;
|
||||||
|
width: 100%;
|
||||||
|
transition: 0.35s;
|
||||||
|
|
||||||
|
> .tips {
|
||||||
|
margin: 0 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/ .u-notice-bar-wrap {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.userClass {
|
.userClass {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -675,26 +718,18 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
margin: 0;
|
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #333;
|
color: #333;
|
||||||
width: 100%;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
> .navL {
|
|
||||||
width: 65%;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .navRiv {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navR {
|
.tabbar-right {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -703,6 +738,7 @@ export default {
|
|||||||
padding: 0 44rpx;
|
padding: 0 44rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 400px;
|
border-radius: 400px;
|
||||||
|
margin-right: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sp_tag {
|
.sp_tag {
|
||||||
@@ -788,11 +824,6 @@ export default {
|
|||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navL,
|
|
||||||
.navR {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
height: auto;
|
height: auto;
|
||||||
@@ -800,9 +831,6 @@ export default {
|
|||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab1 {
|
|
||||||
}
|
|
||||||
|
|
||||||
.ybname {
|
.ybname {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty>
|
||||||
<!-- 订单列表 -->
|
<!-- 订单列表 -->
|
||||||
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList">
|
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList">
|
||||||
<!-- 店铺名称 -->
|
<!-- 店铺名称 -->
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
<view class="btn-view u-flex u-row-between">
|
<view class="btn-view u-flex u-row-between">
|
||||||
<view class="description">
|
<view class="description">
|
||||||
<!-- 等待付款 -->
|
<!-- 等待付款 -->
|
||||||
<text v-if="order.payStatus === 'PAID'">已付金额:</text>
|
<div v-if="order.payStatus === 'PAID'">已付金额:</div>
|
||||||
<text v-else>应付金额:</text>
|
<div v-else>应付金额:</div>
|
||||||
<text class="price">¥{{ order.flowPrice | unitPrice }}</text>
|
<div class="price">¥{{ order.flowPrice | unitPrice }}</div>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<!-- 全部 -->
|
<!-- 全部 -->
|
||||||
@@ -57,20 +57,20 @@
|
|||||||
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
|
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)">
|
||||||
确认收货
|
确认收货
|
||||||
</u-button>
|
</u-button>
|
||||||
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
|
<u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus=='NOT_APPLIED'" @click="applyService(order)">
|
||||||
|
退款/售后
|
||||||
|
</u-button>
|
||||||
|
<!-- TODO 后续完善 -->
|
||||||
|
<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
|
||||||
order.orderStatus === 'CANCELLED' ||
|
order.orderStatus === 'CANCELLED' ||
|
||||||
order.orderStatus === 'COMPLETE'
|
order.orderStatus === 'COMPLETE'
|
||||||
" @click="reBuy(order)">
|
" @click="reBuy(order)">
|
||||||
再次购买
|
再次购买
|
||||||
</u-button>
|
</u-button> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="nodata" v-if="tabItem.loadStatus === 'noMore'">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<uni-load-more :status="tabItem.loadStatus"></uni-load-more>
|
<uni-load-more :status="tabItem.loadStatus"></uni-load-more>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -100,18 +100,16 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
|
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
|
||||||
import empty from "@/components/empty";
|
|
||||||
import { getOrderList, cancelOrder, confirmReceipt } from "@/api/order.js";
|
import { getOrderList, cancelOrder, confirmReceipt } from "@/api/order.js";
|
||||||
import { getClearReason } from "@/api/after-sale.js";
|
import { getClearReason } from "@/api/after-sale.js";
|
||||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
uniLoadMore,
|
uniLoadMore,
|
||||||
empty,
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor:this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
tabCurrentIndex: 0, //导航栏索引
|
tabCurrentIndex: 0, //导航栏索引
|
||||||
navList: [
|
navList: [
|
||||||
//导航栏list
|
//导航栏list
|
||||||
@@ -208,6 +206,8 @@ export default {
|
|||||||
this.loadData(this.status);
|
this.loadData(this.status);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
/**
|
/**
|
||||||
* 修复app端点击除全部订单外的按钮进入时不加载数据的问题
|
* 修复app端点击除全部订单外的按钮进入时不加载数据的问题
|
||||||
@@ -235,6 +235,18 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
// 售后
|
||||||
|
applyService(order){
|
||||||
|
|
||||||
|
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// 店铺详情
|
// 店铺详情
|
||||||
navigateToStore(val) {
|
navigateToStore(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -314,9 +326,8 @@ export default {
|
|||||||
this.navList[index].loadStatus = "noMore";
|
this.navList[index].loadStatus = "noMore";
|
||||||
}
|
}
|
||||||
if (orderList.length > 0) {
|
if (orderList.length > 0) {
|
||||||
this.navList[index].orderList = this.navList[index].orderList.concat(
|
this.navList[index].orderList =
|
||||||
orderList
|
this.navList[index].orderList.concat(orderList);
|
||||||
);
|
|
||||||
this.navList[index].pageNumber += 1;
|
this.navList[index].pageNumber += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -463,12 +474,11 @@ export default {
|
|||||||
* 重新购买
|
* 重新购买
|
||||||
*/
|
*/
|
||||||
reBuy(order) {
|
reBuy(order) {
|
||||||
|
console.log(order);
|
||||||
|
return;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
"/pages/product/goods?id=" +
|
"/pages/product/goods?id=" + order.id + "&goodsId=" + order.goodsId,
|
||||||
order.groupSkuId +
|
|
||||||
"&goodsId=" +
|
|
||||||
order.goodsId,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -613,9 +623,10 @@ page,
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
|
display: flex;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
size: 25rpx;
|
size: 24rpx;
|
||||||
|
flex: 1;
|
||||||
.price {
|
.price {
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
}
|
}
|
||||||
@@ -676,15 +687,4 @@ page,
|
|||||||
margin-left: 15rpx;
|
margin-left: 15rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodata {
|
|
||||||
// padding-top: 300rpx;
|
|
||||||
color: #999999;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 346rpx;
|
|
||||||
height: 304rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,8 +20,11 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="logi-List" v-else>
|
<view class="logi-List" v-else>
|
||||||
<view class="logi-List-title">
|
<view class="verificationCode" v-if="order.verificationCode ">
|
||||||
暂无物流信息
|
券码: {{order.verificationCode}}
|
||||||
|
</view>
|
||||||
|
<view v-else class="logi-List-title">
|
||||||
|
{{'暂无物流信息'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -101,7 +104,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
<!-- 客户服务, 售后,取消订单,查看物流,投诉等 -->
|
||||||
<view class="info-view" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true || order.orderStatus == 'DELIVERED' || order.orderStatus != 'UNPAID' && order.orderType =='PINTUAN'">
|
<view class="info-view"
|
||||||
|
v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true || order.orderStatus == 'DELIVERED' || order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN'">
|
||||||
<view style="width: 100%">
|
<view style="width: 100%">
|
||||||
<view class="order-info-view">
|
<view class="order-info-view">
|
||||||
<view class="title">服务</view>
|
<view class="title">服务</view>
|
||||||
@@ -109,7 +113,7 @@
|
|||||||
<view class="customer-list">
|
<view class="customer-list">
|
||||||
<view class="customer-service" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true" @click="onCancel(order.sn)">取消订单</view>
|
<view class="customer-service" v-if="orderDetail.allowOperationVO && orderDetail.allowOperationVO.cancel == true" @click="onCancel(order.sn)">取消订单</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
<view class="customer-service" v-if="order.orderStatus == 'DELIVERED'" @click="onLogistics(order)">查看物流</view>
|
||||||
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderType =='PINTUAN' " @click="ByUserMessage(order)">查看拼团信息</view>
|
<view class="customer-service" v-if="order.orderStatus != 'UNPAID' && order.orderPromotionType =='PINTUAN' " @click="ByUserMessage(order)">查看拼团信息</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -200,7 +204,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
|
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor" @confirm="confirmRog"></u-modal>
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares v-if="shareFlage " :thumbnail="orderDetail.orderItems[0].image" :goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
|
<shares v-if="shareFlage " :thumbnail="orderDetail.orderItems[0].image" :goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
|
||||||
@@ -212,7 +216,7 @@
|
|||||||
import { getExpress } from "@/api/trade.js";
|
import { getExpress } from "@/api/trade.js";
|
||||||
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
||||||
|
|
||||||
import {h5Copy} from "@/js_sdk/h5-copy/h5-copy.js";
|
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
|
|
||||||
import { getClearReason } from "@/api/after-sale.js";
|
import { getClearReason } from "@/api/after-sale.js";
|
||||||
@@ -252,7 +256,7 @@ export default {
|
|||||||
value: "订单已完成,祝您生活愉快",
|
value: "订单已完成,祝您生活愉快",
|
||||||
},
|
},
|
||||||
TAKE: {
|
TAKE: {
|
||||||
title: "带核验",
|
title: "待核验",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
order: {},
|
order: {},
|
||||||
@@ -359,7 +363,6 @@ export default {
|
|||||||
* 投诉
|
* 投诉
|
||||||
*/
|
*/
|
||||||
complaint(sku) {
|
complaint(sku) {
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
"/pages/order/complain/complain?sn=" +
|
"/pages/order/complain/complain?sn=" +
|
||||||
@@ -378,7 +381,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 去支付
|
// 去支付
|
||||||
toPay(val) {
|
toPay(val) {
|
||||||
|
|
||||||
val.sn
|
val.sn
|
||||||
? uni.navigateTo({
|
? uni.navigateTo({
|
||||||
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
url: "/pages/cart/payment/payOrder?order_sn=" + val.sn,
|
||||||
@@ -445,12 +447,13 @@ export default {
|
|||||||
confirmRog() {
|
confirmRog() {
|
||||||
confirmReceipt(this.orderSn).then((res) => {
|
confirmReceipt(this.orderSn).then((res) => {
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.$refs.uToast.show({
|
uni.showToast({
|
||||||
title: "已确认收货",
|
title: "已确认收货",
|
||||||
type: "success",
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
});
|
});
|
||||||
this.rogShow = false;
|
this.rogShow = false;
|
||||||
this.loadData(options.sn);
|
this.loadData(this.sn);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -651,7 +654,10 @@ page,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.verificationCode {
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
.bottom_view {
|
.bottom_view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 必须要在onReady生命周期setRules,因为onLoad生命周期组件可能尚未创建完毕
|
// 必须要在onReady生命周期setRules,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// whetherNavigate();
|
||||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||||
/**
|
/**
|
||||||
* 条件编译判断当前客户端类型
|
* 条件编译判断当前客户端类型
|
||||||
@@ -83,14 +84,16 @@ export default {
|
|||||||
//#endif
|
//#endif
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
flage(val) {
|
async flage(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (this.$refs.uCode.canGetCode) {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
// 向后端请求验证码
|
// 向后端请求验证码
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "正在获取验证码",
|
title: "正在获取验证码",
|
||||||
});
|
});
|
||||||
sendMobile(this.codeForm.mobile).then((res) => {
|
|
||||||
|
let res = await sendMobile(this.codeForm.mobile);
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
@@ -101,11 +104,13 @@ export default {
|
|||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
this.flage = false;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast("请倒计时结束后再发送");
|
this.$u.toast("请倒计时结束后再发送");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.$refs.verification.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -205,15 +210,17 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
if (!this.$u.test.mobile(this.codeForm.mobile)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请输入正确手机号",
|
title: "请输入正确手机号",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.flage) {
|
if (!this.flage) {
|
||||||
this.$refs.verification.hide();
|
this.$refs.verification.error();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<!-- 循环出当前可使用的第三方登录模式 -->
|
<!-- 循环出当前可使用的第三方登录模式 -->
|
||||||
<div class="login-item" v-for="(item,index) in loginList" :key="index">
|
<div class="login-item" v-for="(item,index) in loginList" :key="index">
|
||||||
<u-icon :color="item.color" size="80" :name="item.icon" @click="navigateLogin(item)"></u-icon>
|
<u-icon :color="item.color" size="80" :name="item.icon" @click="navigateLogin(item)"></u-icon>
|
||||||
<div>{{item.title}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<view class="text-tips cell" @click="clickCodeLogin">账号密码登录</view>
|
<view class="text-tips cell" @click="clickCodeLogin">账号密码登录</view>
|
||||||
@@ -14,10 +13,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { webConnect, openIdLogin } from "@/api/connect.js";
|
import { openIdLogin } from "@/api/connect.js";
|
||||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||||
import { getUserInfo } from "@/api/members";
|
import { getUserInfo } from "@/api/members";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
import api from "@/config/api.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -117,23 +117,23 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/** 根据参数显示登录模块 */
|
/** 根据参数显示登录模块 */
|
||||||
methodFilter(code) {
|
methodFilter(code) {
|
||||||
let way = [];
|
// let way = [];
|
||||||
this.loginList.forEach((item) => {
|
// this.loginList.forEach((item) => {
|
||||||
if (code.length != 0) {
|
// if (code.length != 0) {
|
||||||
code.forEach((val) => {
|
// code.forEach((val) => {
|
||||||
if (item.code == val) {
|
// if (item.code == val) {
|
||||||
way.push(item);
|
// way.push(item);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '配置有误请联系管理员',
|
// title: '配置有误请联系管理员',
|
||||||
duration: 2000,
|
// duration: 2000,
|
||||||
icon:"none"
|
// icon:"none"
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
this.loginList = way;
|
// this.loginList = way;
|
||||||
},
|
},
|
||||||
/**跳转到登录页面 */
|
/**跳转到登录页面 */
|
||||||
navigateLogin(connectLogin) {
|
navigateLogin(connectLogin) {
|
||||||
@@ -148,12 +148,8 @@ export default {
|
|||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
let code = connectLogin.code;
|
let code = connectLogin.code;
|
||||||
webConnect(code).then((res) => {
|
let buyer = api.buyer;
|
||||||
let data = res.data;
|
window.open(buyer+`/connect/login/web/`+code, "_self");
|
||||||
if (data.success) {
|
|
||||||
window.location = data.result;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.nonH5OpenId(connectLogin);
|
this.nonH5OpenId(connectLogin);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<u-modal v-model="phoneAuthPopup" :title="projectName+'商城'" :show-confirm-button="false">
|
<u-navbar :custom-back="back" title="小程序登录"></u-navbar>
|
||||||
|
<u-modal v-model="phoneAuthPopup" :mask-close-able="true" :title="projectName+'商城'" :show-confirm-button="false">
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
为了更好地用户体验,需要您授权手机号
|
为了更好地用户体验,需要您授权手机号
|
||||||
</div>
|
</div>
|
||||||
@@ -18,8 +19,7 @@
|
|||||||
<view>您的公开信息(昵称、头像)</view>
|
<view>您的公开信息(昵称、头像)</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<button type="primary" bindtap="getUserProfile" @click="getUserProfile()"
|
<button type="primary" bindtap="getUserProfile" @click="getUserProfile()" class="btn-auth">确认微信授权</button>
|
||||||
class="btn-auth">确认微信授权</button>
|
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
@@ -27,15 +27,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { mpAutoLogin } from "@/api/connect.js";
|
||||||
mpAutoLogin
|
|
||||||
} from "@/api/connect.js";
|
|
||||||
|
|
||||||
import {
|
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||||
getUserInfo
|
import { getUserInfo } from "@/api/members";
|
||||||
} from "@/api/members";
|
import storage from "@/utils/storage.js";
|
||||||
import storage from "@/utils/storage.js";
|
export default {
|
||||||
export default {
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
// 是否展示手机号码授权弹窗,默认第一步不展示,要先获取用户基础信息
|
||||||
@@ -43,15 +40,20 @@
|
|||||||
// 授权信息展示,商城名称
|
// 授权信息展示,商城名称
|
||||||
projectName: "LiLi",
|
projectName: "LiLi",
|
||||||
//微信返回信息,用于揭秘信息,获取sessionkey
|
//微信返回信息,用于揭秘信息,获取sessionkey
|
||||||
code: '',
|
code: "",
|
||||||
//微信昵称
|
//微信昵称
|
||||||
nickName: '',
|
nickName: "",
|
||||||
//微信头像
|
//微信头像
|
||||||
image: '',
|
image: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
//微信小程序进入页面,先获取code,否则几率出现code和后续交互数据不对应情况
|
//微信小程序进入页面,先获取code,否则几率出现code和后续交互数据不对应情况
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
//获取code
|
//获取code
|
||||||
uni.login({
|
uni.login({
|
||||||
@@ -61,12 +63,24 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* TODO 此方法不一定是最优解,如果有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 中提出
|
||||||
|
* 小程序返回bug
|
||||||
|
* 1.介于微信登录是在login.vue的基础上作为判断跳转来
|
||||||
|
* 所以在页面栈中会自动记录回退路径,所以导致每次微信小程序点击回退就会自动返回login页面
|
||||||
|
* 当然login页面的判断就是 没有登录就会跳转到微信小程序页面 导致了无法回退到之前页面
|
||||||
|
* 2.解决方法: 尝试在回退的时候判断地址,让回退多一级这样就避免了
|
||||||
|
*/
|
||||||
|
|
||||||
|
back() {
|
||||||
|
whetherNavigate('wx');
|
||||||
|
},
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
getUserProfile(e) {
|
getUserProfile(e) {
|
||||||
let that = this;
|
let that = this;
|
||||||
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
|
||||||
uni.getUserProfile({
|
uni.getUserProfile({
|
||||||
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
that.nickName = res.userInfo.nickName;
|
that.nickName = res.userInfo.nickName;
|
||||||
that.image = res.userInfo.avatarUrl;
|
that.image = res.userInfo.avatarUrl;
|
||||||
@@ -79,13 +93,11 @@
|
|||||||
"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132";
|
"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132";
|
||||||
//展示手机号获取授权
|
//展示手机号获取授权
|
||||||
this.phoneAuthPopup = true;
|
this.phoneAuthPopup = true;
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//获取手机号授权
|
//获取手机号授权
|
||||||
getPhoneNumber(e) {
|
getPhoneNumber(e) {
|
||||||
|
|
||||||
let that = this;
|
|
||||||
let iv = e.detail.iv;
|
let iv = e.detail.iv;
|
||||||
let encryptedData = e.detail.encryptedData;
|
let encryptedData = e.detail.encryptedData;
|
||||||
if (!e.detail.encryptedData) {
|
if (!e.detail.encryptedData) {
|
||||||
@@ -123,25 +135,23 @@
|
|||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
/*微信授权*/
|
/*微信授权*/
|
||||||
page {
|
page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wx-auth-container {
|
.wx-auth-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20%;
|
margin-top: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-info {
|
.logo-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
@@ -151,84 +161,84 @@
|
|||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-webkit-transform: scale(2.5);
|
-webkit-transform: scale(2.5);
|
||||||
transform: scale(2.5);
|
transform: scale(2.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-info-img {
|
.logo-info-img {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
text.title,
|
text.title,
|
||||||
text.shop {
|
text.shop {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 60rpx;
|
font-size: 60rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
text.shop {
|
text.shop {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 55rpx;
|
font-size: 55rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 文字提示*/
|
/* 文字提示*/
|
||||||
.small-tips {
|
.small-tips {
|
||||||
width: 94%;
|
width: 94%;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin: 0 0 20rpx;
|
margin: 0 0 20rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-button {
|
.auth-button {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
width: calc(100% - 20 * 4rpx);
|
width: calc(100% - 20 * 4rpx);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: 6% 10%;
|
margin: 6% 10%;
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register {
|
.register {
|
||||||
color: #00a327 !important;
|
color: #00a327 !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-auth {
|
.btn-auth {
|
||||||
width: 92%;
|
width: 92%;
|
||||||
margin: 0 auto 100rpx;
|
margin: 0 auto 100rpx;
|
||||||
|
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btns {
|
.btns {
|
||||||
margin-top: 100rpx;
|
margin-top: 100rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -359,26 +359,7 @@ page {
|
|||||||
color: $font-color-light;
|
color: $font-color-light;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
.good {
|
|
||||||
color: #333;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: "";
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
background: url(/static/search/delete.png);
|
|
||||||
background-size: 100%;
|
|
||||||
position: absolute;
|
|
||||||
left: -50rpx;
|
|
||||||
top: -6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.cur:before {
|
|
||||||
background: url(/static/global/selected.png);
|
|
||||||
background-size: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
79
pages/product/customerservice/index.vue
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<chat></chat>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
var chat = requirePlugin('myPlugin')
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad (e) {
|
||||||
|
const params = JSON.parse((decodeURIComponent(e.params)))
|
||||||
|
chat.init({
|
||||||
|
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取
|
||||||
|
token: params.token, //非必填
|
||||||
|
uid: params.uuid, //用户唯一标识,如果没有则不填写,默认为空
|
||||||
|
title: params.storageName, //非必填,如果未填写,默认获取配置标题
|
||||||
|
isRMB: '', //商品是否显示人民币¥,默认显示,false不显示
|
||||||
|
data: { //参数c1,c2,c3,c4,c5用于传递用户信息,参数d1,d2,d3,d4,d5,d6用于传递商品信息,默认为空
|
||||||
|
c1: '',
|
||||||
|
c2: '',
|
||||||
|
c3: '',
|
||||||
|
c4: '',
|
||||||
|
c5: '',
|
||||||
|
d1: params.goodsName, //商品描述
|
||||||
|
d2: params.price, //价格
|
||||||
|
d3: '', //原价格
|
||||||
|
d4: params.goodsImg, //展示商品图片链接
|
||||||
|
d5: '', //商品跳转链接
|
||||||
|
d6: params.goodsId, //商品id
|
||||||
|
data: ''//加密串,非必填
|
||||||
|
},
|
||||||
|
viewUrl(res){ //需要跳转外部链接,则需要配置一个web-view
|
||||||
|
if (res) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/webview/index?href=' + res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setTitle(res){ //设置标题
|
||||||
|
if (res) {
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setBarColor(res) { //设置导航栏背景色
|
||||||
|
if (res) {
|
||||||
|
wx.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
success(res){ //初始化成功时调用
|
||||||
|
if (res.data == 'success') {
|
||||||
|
console.log('success');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail(res){ //初始化失败时调用
|
||||||
|
if (res.data == 'initError') {
|
||||||
|
console.log(res.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
leave(res){ //离开会话页面
|
||||||
|
if (res) {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -9,42 +9,40 @@
|
|||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
|
||||||
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
|
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
|
||||||
|
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX" :y="navbarListY" placement="top-start" />
|
||||||
<view class="index">
|
<view class="index">
|
||||||
<u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scoll-hide'">
|
|
||||||
|
<!-- topBar -->
|
||||||
|
<u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div class="backs" @click="back()">
|
<div class="backs">
|
||||||
<u-icon name="arrow-left" color="#8e8e8e"></u-icon>
|
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
|
|
||||||
|
<u-icon name="list" @click="popupsSwitch = !popupsSwitch" class="icon-list"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scoll-hide'">
|
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
|
||||||
<div class="headerRow">
|
<div class="headerRow">
|
||||||
<div style="text-align: center" :span="3" v-for="header in headerList" :key="header.id" :class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
<div class="nav-item" v-for="header in headerList" :key="header.id" :class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
|
||||||
{{ header.text }}
|
{{ header.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="share" @click="shareChange()">
|
|
||||||
<image class="shareImg" src="/static/share.png" alt=""></image>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
|
|
||||||
<view class="showBack" v-show="!headerFlag">
|
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack" :is-back="false">
|
||||||
<u-row>
|
<div>
|
||||||
<u-col :span="2" @click="back()">
|
<div class="bg-back">
|
||||||
<div class="iconBag" style="text-align: center">
|
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
|
||||||
<image class="headerImg" src="/static/bagBack.png" alt=""></image>
|
<u-icon size="40" @click="popupsSwitch = !popupsSwitch" name="list" class="icon-list"></u-icon>
|
||||||
</div>
|
|
||||||
</u-col>
|
|
||||||
<u-col :span="8"></u-col>
|
|
||||||
|
|
||||||
<u-col :span="2" class="share" style="text-align: center" @click="shareChange()">
|
</div>
|
||||||
<image class="headerImg" src="/static/bagShare.png" alt=""></image>
|
</div>
|
||||||
</u-col>
|
</u-navbar>
|
||||||
</u-row>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
|
||||||
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scoll-page" :scroll-top="tabScrollTop" @scroll="pageScroll">
|
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page" :scroll-top="tabScrollTop" @scroll="pageScroll">
|
||||||
<view>
|
<view>
|
||||||
<!-- 轮播图 -->
|
<!-- 轮播图 -->
|
||||||
<GoodsSwiper id="main1" :res="imgList" />
|
<GoodsSwiper id="main1" :res="imgList" />
|
||||||
@@ -54,9 +52,9 @@
|
|||||||
|
|
||||||
<view class="card-box top-radius-0" id="main2">
|
<view class="card-box top-radius-0" id="main2">
|
||||||
<!-- 活动不显示价钱 -->
|
<!-- 活动不显示价钱 -->
|
||||||
<view v-if="!is_promotion" class="desc-blod -goods-msg">
|
<view v-if="!isPromotion" class="desc-bold -goods-msg">
|
||||||
<view class="-goods-flex">
|
<view class="-goods-flex">
|
||||||
<view class="desc-blod">
|
<view class="desc-bold">
|
||||||
{{ goodsDetail.goodsName || "" }}
|
{{ goodsDetail.goodsName || "" }}
|
||||||
</view>
|
</view>
|
||||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
||||||
@@ -84,12 +82,17 @@
|
|||||||
}} </span>
|
}} </span>
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-price" v-else> ¥<span class="price">0 </span>.00 </view>
|
<view class="-goods-price" v-else> ¥<span class="price">0 </span>.00 </view>
|
||||||
<view class="favorite" @click="clickFavorite(goodsDetail.id)">
|
|
||||||
|
<view class="icons share" @click="shareChange()">
|
||||||
|
<u-icon size="30" name="share-fill"></u-icon>
|
||||||
|
<view>分享</view>
|
||||||
|
</view>
|
||||||
|
<view class="icons" @click="clickFavorite(goodsDetail.id)">
|
||||||
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
|
||||||
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-name desc-blod">
|
<view class="-goods-name desc-bold">
|
||||||
{{ goodsDetail.goodsName || "" }}
|
{{ goodsDetail.goodsName || "" }}
|
||||||
</view>
|
</view>
|
||||||
<view class="-goods-desc">
|
<view class="-goods-desc">
|
||||||
@@ -115,7 +118,8 @@
|
|||||||
<!-- 拼团用户列表 -->
|
<!-- 拼团用户列表 -->
|
||||||
<PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
|
<PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
|
||||||
|
|
||||||
<view class="card-box">
|
<!-- 配置地址 如果是虚拟产品的时候不展示 -->
|
||||||
|
<view class="card-box" v-if="goodsDetail.goodsType !='VIRTUAL_GOODS'">
|
||||||
<view class="card-flex" @click="shutMask(4)">
|
<view class="card-flex" @click="shutMask(4)">
|
||||||
<view class="card-title"> 已选 </view>
|
<view class="card-title"> 已选 </view>
|
||||||
<view class="card-content">
|
<view class="card-content">
|
||||||
@@ -143,13 +147,13 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 评价 -->
|
<!-- 评价 -->
|
||||||
<Evaluation id="main5" :goodsDetail="goodsDetail" v-if="goodsDetail.id" />
|
<Evaluation id="main5" :goodsDetail="goodsDetail" />
|
||||||
|
|
||||||
<!-- 店铺推荐 -->
|
<!-- 店铺推荐 -->
|
||||||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||||
|
|
||||||
<!-- 宝贝详情 -->
|
<!-- 宝贝详情 -->
|
||||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" />
|
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" />
|
||||||
|
|
||||||
<!-- 宝贝推荐 -->
|
<!-- 宝贝推荐 -->
|
||||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||||
@@ -162,10 +166,10 @@
|
|||||||
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
<u-icon size="34" class="red" name="home-fill"></u-icon>
|
||||||
<view class="red icon-btn-name">店铺</view>
|
<view class="red icon-btn-name">店铺</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="icon-btn-item" @click="linkMsgDetail()">
|
<view class="icon-btn-item" @click="linkMsgDetail()">
|
||||||
<u-icon size="34" name="kefu-ermai"></u-icon>
|
<u-icon size="34" name="kefu-ermai"></u-icon>
|
||||||
<view class="icon-btn-name">客服</view>
|
<view class="icon-btn-name">客服</view>
|
||||||
</view> -->
|
</view>
|
||||||
<view class="icon-btn-item" @click="reluchToCart()">
|
<view class="icon-btn-item" @click="reluchToCart()">
|
||||||
<u-icon size="34" name="storeping-cart"></u-icon>
|
<u-icon size="34" name="storeping-cart"></u-icon>
|
||||||
<view class="icon-btn-name">购物车</view>
|
<view class="icon-btn-name">购物车</view>
|
||||||
@@ -174,7 +178,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 正常结算页面 -->
|
<!-- 正常结算页面 -->
|
||||||
<view class="detail-btn" v-if="!isGroup">
|
<view class="detail-btn" v-if="!isGroup">
|
||||||
<view class="to-store-car to-store-btn" @click="shutMask(4)">加入购物车</view>
|
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">加入购物车</view>
|
||||||
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
|
||||||
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
<view class="to-store-car to-store-btn" v-if="startTimer">暂未开始</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -215,7 +219,7 @@
|
|||||||
|
|
||||||
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
<!-- 商品规格 商品详情,以及默认参与活动的id-->
|
||||||
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy" @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy" @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
|
||||||
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="init" :buyMask="buyMask" />
|
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</div>
|
</div>
|
||||||
@@ -232,7 +236,7 @@ import {
|
|||||||
import * as API_trade from "@/api/trade.js";
|
import * as API_trade from "@/api/trade.js";
|
||||||
import * as API_Members from "@/api/members.js";
|
import * as API_Members from "@/api/members.js";
|
||||||
import * as API_store from "@/api/store.js";
|
import * as API_store from "@/api/store.js";
|
||||||
|
import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js";
|
||||||
/************请求存储***************/
|
/************请求存储***************/
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
|
|
||||||
@@ -250,8 +254,10 @@ import GoodsSwiper from "./product/goods/-goods-swiper"; //轮播图组件
|
|||||||
import popupGoods from "./product/popup/goods"; //购物车商品的模块
|
import popupGoods from "./product/popup/goods"; //购物车商品的模块
|
||||||
import popupAddress from "./product/popup/address"; //地址选择模块
|
import popupAddress from "./product/popup/address"; //地址选择模块
|
||||||
import shares from "@/components/m-share/index"; //分享
|
import shares from "@/components/m-share/index"; //分享
|
||||||
|
import popups from "@/components/popups/popups"; //气泡框
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
popups,
|
||||||
shares,
|
shares,
|
||||||
PromotionLayout,
|
PromotionLayout,
|
||||||
PromotionDetailsLayout,
|
PromotionDetailsLayout,
|
||||||
@@ -268,13 +274,51 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// #ifdef H5
|
||||||
|
navbarListX: 110, //导航栏列表栏x轴
|
||||||
|
navbarListY: 80, //导航栏列表栏y轴
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
navbarListX: 100, //导航栏列表栏x轴
|
||||||
|
navbarListY: 140, //导航栏列表栏y轴
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
navbarListX: 120, //导航栏列表栏x轴
|
||||||
|
navbarListY: 170, //导航栏列表栏y轴
|
||||||
|
// #endif
|
||||||
|
navbarListData: [
|
||||||
|
//导航栏列表栏数据
|
||||||
|
{
|
||||||
|
title: "首页",
|
||||||
|
icon: "home-fill",
|
||||||
|
___type: "other",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "购物车",
|
||||||
|
icon: "bag-fill",
|
||||||
|
___type: "other",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "搜索",
|
||||||
|
icon: "search",
|
||||||
|
___type: "category",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "个人中心",
|
||||||
|
icon: "account-fill",
|
||||||
|
___type: "other",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
popupsSwitch: false, //导航栏列表栏开关
|
||||||
shareFlage: false,
|
shareFlage: false,
|
||||||
selectedGoods: "", //选择的商品规格昵称
|
selectedGoods: "", //选择的商品规格昵称
|
||||||
is_promotion: true, //判断显示拼团活动文字
|
isPromotion: true, //判断显示拼团活动文字
|
||||||
isGroup: false, // 是否是拼团活动
|
isGroup: false, // 是否是拼团活动
|
||||||
pointDetail: "", // 是否是积分商品
|
pointDetail: "", // 是否是积分商品
|
||||||
assemble: "", //拼团的sku
|
assemble: "", //拼团的sku
|
||||||
scroll_mask_height: 0, //促销活动的高度
|
navbarOnlyBack: {
|
||||||
|
background: "transparent",
|
||||||
|
},
|
||||||
navbar: {
|
navbar: {
|
||||||
background: "#fff",
|
background: "#fff",
|
||||||
},
|
},
|
||||||
@@ -284,9 +328,10 @@ export default {
|
|||||||
top: 0,
|
top: 0,
|
||||||
height: 50,
|
height: 50,
|
||||||
},
|
},
|
||||||
|
goodsParams: [], // 商品参数
|
||||||
headerFlag: false, //顶部导航显示与否
|
headerFlag: false, //顶部导航显示与否
|
||||||
headerList: [
|
headerList: [
|
||||||
//顶部导航文字
|
//顶部导航文字按照规则来 详情全局搜索
|
||||||
{
|
{
|
||||||
text: "商品",
|
text: "商品",
|
||||||
id: "1",
|
id: "1",
|
||||||
@@ -350,18 +395,28 @@ export default {
|
|||||||
routerVal: "",
|
routerVal: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
// #ifdef MP-WEIXNI
|
||||||
|
shareAppMessage() {
|
||||||
|
return {
|
||||||
|
title: this.goodsDetail.goodsName,
|
||||||
|
type: 0,
|
||||||
|
query: `id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`,
|
||||||
|
path: `/pages/product/goods`,
|
||||||
|
imageUrl: this.goodsDetail.goodsGalleryList[0],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
watch: {
|
watch: {
|
||||||
isGroup(val) {
|
isGroup(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
this.$refs.popupGoods.buyType = "PINTUAN";
|
this.$refs.popupGoods.buyType = "PINTUAN";
|
||||||
|
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
this.is_promotion = false;
|
this.isPromotion = false;
|
||||||
} else {
|
} else {
|
||||||
this.is_promotion = true;
|
this.isPromotion = true;
|
||||||
this.$refs.popupGoods.buyType = "";
|
this.$refs.popupGoods.buyType = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -398,6 +453,13 @@ export default {
|
|||||||
},
|
},
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
this.routerVal = options;
|
this.routerVal = options;
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
menus: ["shareAppMessage", "shareTimeline"],
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
this.goodsDetail = {};
|
this.goodsDetail = {};
|
||||||
@@ -419,7 +481,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 循环出当前促销是否为空
|
/**
|
||||||
|
* 导航栏列表栏
|
||||||
|
*/
|
||||||
|
handleNavbarList(val) {
|
||||||
|
modelNavigateTo({ url: val });
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 循环出当前促销是否为空
|
||||||
|
*/
|
||||||
emptyPromotion() {
|
emptyPromotion() {
|
||||||
if (
|
if (
|
||||||
this.PromotionList == "" ||
|
this.PromotionList == "" ||
|
||||||
@@ -429,8 +500,14 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**初始化信息 */
|
selectSku(idObj) {
|
||||||
|
this.init(idObj.skuId, idObj.goodsId);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 初始化信息
|
||||||
|
*/
|
||||||
async init(id, goodsId, distributionId) {
|
async init(id, goodsId, distributionId) {
|
||||||
|
console.log(id, goodsId);
|
||||||
this.isGroup = false; //初始化拼团
|
this.isGroup = false; //初始化拼团
|
||||||
this.productId = id; // skuId
|
this.productId = id; // skuId
|
||||||
// 这里请求获取到页面数据 解析数据
|
// 这里请求获取到页面数据 解析数据
|
||||||
@@ -440,6 +517,10 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let response = await getGoods(id, goodsId);
|
let response = await getGoods(id, goodsId);
|
||||||
|
if (!response.data.success) {
|
||||||
|
uni.navigateBack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 这里是绑定分销员
|
// 这里是绑定分销员
|
||||||
if (distributionId || this.$store.state.distributionId) {
|
if (distributionId || this.$store.state.distributionId) {
|
||||||
@@ -453,6 +534,7 @@ export default {
|
|||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
|
this.goodsParams = response.data.result.goodsParamsDTOList || []
|
||||||
|
|
||||||
// 判断是否拼团活动或者积分商品 如果有则显示拼团活动信息
|
// 判断是否拼团活动或者积分商品 如果有则显示拼团活动信息
|
||||||
this.PromotionList &&
|
this.PromotionList &&
|
||||||
@@ -486,7 +568,37 @@ export default {
|
|||||||
this.getGoodsCollectionFun(this.goodsDetail.id);
|
this.getGoodsCollectionFun(this.goodsDetail.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
linkMsgDetail() {
|
||||||
|
// 客服
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
storeName: this.storeDetail.storeName,
|
||||||
|
goodsName: this.goodsDetail.goodsName,
|
||||||
|
goodsId: this.goodsDetail.goodsId,
|
||||||
|
goodsImg: this.goodsDetail.thumbnail,
|
||||||
|
price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
|
||||||
|
// originalPrice: this.goodsDetail.original || this.goodsDetail.price,
|
||||||
|
uuid: storage.getUuid(),
|
||||||
|
token: storage.getAccessToken(),
|
||||||
|
sign: this.storeDetail.yzfSign,
|
||||||
|
mpSign: this.storeDetail.yzfMpSign,
|
||||||
|
};
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"/pages/product/customerservice/index?params=" +
|
||||||
|
encodeURIComponent(JSON.stringify(params)),
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
const sign = this.storeDetail.yzfSign;
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
|
||||||
|
sign,
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
// 格式化金钱 1999 --> [1999,00]
|
||||||
formatPrice(val) {
|
formatPrice(val) {
|
||||||
if (typeof val == "undefined") {
|
if (typeof val == "undefined") {
|
||||||
@@ -523,7 +635,6 @@ export default {
|
|||||||
toAssembleBuyNow(order) {
|
toAssembleBuyNow(order) {
|
||||||
this.shutMask(4, "PINTUAN", order);
|
this.shutMask(4, "PINTUAN", order);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看购物车
|
* 查看购物车
|
||||||
*/
|
*/
|
||||||
@@ -624,6 +735,7 @@ export default {
|
|||||||
keyword: this.goodsDetail.name,
|
keyword: this.goodsDetail.name,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.likeGoodsList = res.data.result.content;
|
this.likeGoodsList = res.data.result.content;
|
||||||
|
console.warn(this.likeGoodsList);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<view class="evaluate-title">评价</view>
|
<view class="evaluate-title">评价</view>
|
||||||
<text class="evaluate-num">{{ commDetail.total || '0' }}+</text>
|
<text class="evaluate-num">{{ commDetail.total || '0' }}+</text>
|
||||||
<text class="tip">好评率 {{ goodsDetail.grade || '100' }}%</text>
|
<text class="tip">好评率 {{ grade || '100' }}%</text>
|
||||||
</view>
|
</view>
|
||||||
<div v-if="commDetail && commDetail.records && commDetail.records.length > 0">
|
<div v-if="commDetail && commDetail.records && commDetail.records.length > 0">
|
||||||
<view class="eva-box" v-for="(commItem,commIndex) in commDetail.records.slice(0,2)" :key="commIndex">
|
<view class="eva-box" v-for="(commItem,commIndex) in commDetail.records.slice(0,2)" :key="commIndex">
|
||||||
@@ -51,6 +51,7 @@ export default {
|
|||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
// 评论集合
|
// 评论集合
|
||||||
commDetail: [],
|
commDetail: [],
|
||||||
|
grade: "",
|
||||||
// 评论分页提交数据
|
// 评论分页提交数据
|
||||||
params: {
|
params: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
@@ -59,10 +60,26 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["goodsDetail"],
|
props: {
|
||||||
mounted() {
|
goodsDetail: {
|
||||||
|
default: {},
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
goodsDetail: {
|
||||||
|
handler(val) {
|
||||||
|
this.grade = val.grade;
|
||||||
this.getGoodsComments();
|
this.getGoodsComments();
|
||||||
},
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.getGoodsComments();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseLoaded() {
|
parseLoaded() {
|
||||||
this.$refs.uReadMore.init();
|
this.$refs.uReadMore.init();
|
||||||
|
|||||||
@@ -18,20 +18,19 @@
|
|||||||
<div class="goods-detail-box">
|
<div class="goods-detail-box">
|
||||||
<div class="goods-detail-item goods-active">商品参数</div>
|
<div class="goods-detail-item goods-active">商品参数</div>
|
||||||
</div>
|
</div>
|
||||||
<u-divider>商品参数</u-divider>
|
<!-- <u-divider>商品参数</u-divider> -->
|
||||||
<div class="param-list" v-if="!goodsDetail.goodsParamsList || goodsDetail.goodsParamsList.length == 0">
|
<div class="param-list" v-if="goodsParams.length == 0">
|
||||||
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
||||||
</div>
|
</div>
|
||||||
<div class="param-list" v-if="goodsDetail.goodsParamsList && goodsDetail.goodsParamsList.length != 0">
|
<div class="params-group" v-for="(group,groupIndex) in goodsParams" :key="groupIndex">
|
||||||
<div class="param-item" v-for="(param,index) in goodsDetail.goodsParamsList" :key="index">
|
<view style="font-weight: bold;margin-left: 10px;">{{group.groupName}}</view>
|
||||||
<div class="param-left">
|
<div class="param-list">
|
||||||
{{param.paramName}}
|
<div class="param-item" v-for="(param,index) in group.goodsParamsItemDTOList" :key="index">
|
||||||
</div>
|
<div class="param-left">{{param.paramName}}</div>
|
||||||
<div class="param-right">
|
<div class="param-right">{{param.paramValue}}</div>
|
||||||
{{param.paramValue}}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -43,11 +42,12 @@ import { getGoodsMessage } from "@/api/goods";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsDetail: "",
|
goodsDetail: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res", "goodsId"],
|
props: ["res", "goodsId", "goodsParams"],
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
console.log(this.res)
|
||||||
let res = await getGoodsMessage(this.goodsId);
|
let res = await getGoodsMessage(this.goodsId);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.goodsDetail = res.data.result;
|
this.goodsDetail = res.data.result;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.carousel {
|
.carousel {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
margin-top: var(--status-bar-height);
|
margin-top: 44px;
|
||||||
// #endif
|
// #endif
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
height: 750rpx;
|
height: 750rpx;
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
<view class="goods-price " v-if="goodsDetail.promotionPrice">
|
||||||
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
<span v-if="goodsDetail.promotionPrice && !pointDetail">
|
||||||
¥
|
¥
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow" >{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ formatPrice(goodsDetail.promotionPrice)[0] }}</span>
|
||||||
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
.{{ formatPrice(goodsDetail.promotionPrice)[1] }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="pointDetail.points">
|
<span v-if="pointDetail.points">
|
||||||
|
|
||||||
<span class="goods-price-promotionShow goods-price-bigshow" >{{ pointDetail.points }}</span>
|
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
|
||||||
积分
|
积分
|
||||||
</span>
|
</span>
|
||||||
<div class="promotion-box">
|
<div class="promotion-box">
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
<view class="goods-skus-view" :key="specIndex" v-for="(spec, specIndex) in formatList">
|
||||||
<view class="skus-view-list">
|
<view class="skus-view-list">
|
||||||
<view class="view-class-title">{{ spec.name }}</view>
|
<view class="view-class-title">{{ spec.name }}</view>
|
||||||
<view :class="{ active: spec_val.id == currentSelceted[specIndex] }" class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
<view :class="{ active: spec_val.value == currentSelceted[specIndex] }" class="skus-view-item" v-for="(spec_val, spec_index) in spec.values" :key="spec_index"
|
||||||
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}</view>
|
@click="handleClickSpec(spec, specIndex, spec_val)">{{ spec_val.value }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -69,7 +69,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="box-btn card" v-if="buyType !='PINTUAN'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
|
||||||
|
<view class="box-btn card" v-if="buyType != 'PINTUAN' && goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="addToCartOrBuy('cart')">加入购物车</view>
|
||||||
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
<view class="box-btn buy" @click="addToCartOrBuy('buy')">立即购买</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -100,8 +101,8 @@ export default {
|
|||||||
formatList: [],
|
formatList: [],
|
||||||
currentSelceted: [],
|
currentSelceted: [],
|
||||||
skuList: "",
|
skuList: "",
|
||||||
isMask:false, //是否显示遮罩层
|
isMask: false, //是否显示遮罩层
|
||||||
isClose:false, //是否可以点击遮罩关闭
|
isClose: false, //是否可以点击遮罩关闭
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
@@ -110,7 +111,7 @@ export default {
|
|||||||
"selectedSku",
|
"selectedSku",
|
||||||
"goodsSpec",
|
"goodsSpec",
|
||||||
"addr",
|
"addr",
|
||||||
"pointDetail" // 积分详情
|
"pointDetail", // 积分详情
|
||||||
],
|
],
|
||||||
watch: {
|
watch: {
|
||||||
buyType: {
|
buyType: {
|
||||||
@@ -128,6 +129,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
// 格式化金钱 1999 --> [1999,00]
|
// 格式化金钱 1999 --> [1999,00]
|
||||||
formatPrice(val) {
|
formatPrice(val) {
|
||||||
if (typeof val == "undefined") {
|
if (typeof val == "undefined") {
|
||||||
@@ -142,14 +145,12 @@ export default {
|
|||||||
|
|
||||||
/**点击规格 */
|
/**点击规格 */
|
||||||
handleClickSpec(val, index, specValue) {
|
handleClickSpec(val, index, specValue) {
|
||||||
this.$set(this.currentSelceted, index, specValue.id);
|
this.$set(this.currentSelceted, index, specValue.value);
|
||||||
|
|
||||||
let selectedSkuId = this.goodsSpec.find((i) => {
|
let selectedSkuId = this.goodsSpec.find((i) => {
|
||||||
let matched = true;
|
let matched = true;
|
||||||
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
let specValues = i.specValues.filter((j) => j.specName !== "images");
|
||||||
|
|
||||||
for (let n = 0; n < specValues.length; n++) {
|
for (let n = 0; n < specValues.length; n++) {
|
||||||
if (specValues[n].specValueId !== this.currentSelceted[n]) {
|
if (specValues[n].specValue !== this.currentSelceted[n]) {
|
||||||
matched = false;
|
matched = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -158,7 +159,6 @@ export default {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.selectSkuList = {
|
this.selectSkuList = {
|
||||||
spec: {
|
spec: {
|
||||||
specName: val.name,
|
specName: val.name,
|
||||||
@@ -168,7 +168,7 @@ export default {
|
|||||||
};
|
};
|
||||||
this.selectName = specValue.value;
|
this.selectName = specValue.value;
|
||||||
|
|
||||||
this.$emit("handleClickSku", selectedSkuId.skuId,this.goodsDetail.id);
|
this.$emit("handleClickSku", {skuId: selectedSkuId.skuId, goodsId: this.goodsDetail.goodsId});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,42 +197,30 @@ export default {
|
|||||||
|
|
||||||
this.$emit("queryCart");
|
this.$emit("queryCart");
|
||||||
this.closeMask();
|
this.closeMask();
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 判断是否拼团商品
|
// 判断是否拼团商品
|
||||||
if (this.buyType) {
|
if (this.buyType) {
|
||||||
data.cartType = "PINTUAN";
|
data.cartType = "PINTUAN";
|
||||||
} else {
|
}
|
||||||
|
else if(this.goodsDetail.goodsType == 'VIRTUAL_GOODS'){
|
||||||
|
data.cartType = "VIRTUAL";
|
||||||
|
}
|
||||||
|
else {
|
||||||
data.cartType = "BUY_NOW";
|
data.cartType = "BUY_NOW";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
API_trade.addToCart(data).then((res) => {
|
API_trade.addToCart(data).then((res) => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
|
||||||
this.addr.id || ''
|
this.addr.id || ""
|
||||||
}&parentOrder=${encodeURIComponent(
|
}&parentOrder=${encodeURIComponent(
|
||||||
JSON.stringify(this.parentOrder)
|
JSON.stringify(this.parentOrder)
|
||||||
)}`,
|
)}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
uni.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -242,10 +230,8 @@ export default {
|
|||||||
let arr = [{}];
|
let arr = [{}];
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
item.specValues.forEach((spec, specIndex) => {
|
item.specValues.forEach((spec, specIndex) => {
|
||||||
let id = spec.specNameId;
|
|
||||||
let name = spec.specName;
|
let name = spec.specName;
|
||||||
let values = {
|
let values = {
|
||||||
id: spec.specValueId,
|
|
||||||
value: spec.specValue,
|
value: spec.specValue,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
};
|
};
|
||||||
@@ -257,7 +243,7 @@ export default {
|
|||||||
if (
|
if (
|
||||||
arrItem.name == name &&
|
arrItem.name == name &&
|
||||||
arrItem.values &&
|
arrItem.values &&
|
||||||
!arrItem.values.find((i) => i.id === values.id)
|
!arrItem.values.find((i) => i.value === values.value)
|
||||||
) {
|
) {
|
||||||
arrItem.values.push(values);
|
arrItem.values.push(values);
|
||||||
}
|
}
|
||||||
@@ -267,7 +253,6 @@ export default {
|
|||||||
});
|
});
|
||||||
if (!keys.includes(name)) {
|
if (!keys.includes(name)) {
|
||||||
arr.push({
|
arr.push({
|
||||||
id: id,
|
|
||||||
name: name,
|
name: name,
|
||||||
values: [values],
|
values: [values],
|
||||||
});
|
});
|
||||||
@@ -284,7 +269,7 @@ export default {
|
|||||||
item.specValues
|
item.specValues
|
||||||
.filter((i) => i.specName !== "images")
|
.filter((i) => i.specName !== "images")
|
||||||
.forEach((value, _index) => {
|
.forEach((value, _index) => {
|
||||||
this.currentSelceted[_index] = value.specValueId;
|
this.currentSelceted[_index] = value.specValue;
|
||||||
|
|
||||||
this.selectName = value.specValue;
|
this.selectName = value.specValue;
|
||||||
|
|
||||||
@@ -301,8 +286,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
this.formatSku(this.goodsSpec);
|
this.formatSku(this.goodsSpec);
|
||||||
|
|
||||||
|
console.log(this.goodsDetail);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="storeDetail">
|
<view v-if="storeDetail">
|
||||||
<!-- 商店信息 -->
|
<!-- 商店信息 -->
|
||||||
<view class="store-info" >
|
<view class="store-info">
|
||||||
<view class="logo">
|
<view class="logo">
|
||||||
<u-image width="120rpx" mode="aspectFit" height="120rpx" :src="storeDetail.storeLogo"></u-image>
|
<u-image width="120rpx" mode="aspectFit" height="120rpx" :src="storeDetail.storeLogo"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="name-star star-con">
|
<view class="name-star star-con">
|
||||||
<text class="name">{{ storeDetail.storeName }}</text>
|
<div class="name">
|
||||||
<view>
|
{{ storeDetail.storeName }}
|
||||||
<text :class="{ star: storeDetail.store_service_credit > 0 }"></text>
|
<span v-if="storeDetail.selfOperated == 1" class="shopTag">自营</span>
|
||||||
<text :class="{ star: storeDetail.store_service_credit > 1 }"></text>
|
</div>
|
||||||
<text :class="{ star: storeDetail.store_service_credit > 2 }"></text>
|
<div class="store-row">
|
||||||
<text :class="{ star: storeDetail.store_service_credit > 3 }"></text>
|
<div class="collectionNum">{{ storeDetail.collectionNum || 0 }}人关注</div>
|
||||||
<text :class="{ star: storeDetail.store_service_credit > 4 }"></text>
|
<div class="goodsNum">{{ storeDetail.goodsNum || 0 }}件商品</div>
|
||||||
</view>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
<view class="to-store-btn" @click="tostorePage(goodsDetail)">
|
<view class="to-store-btn" @click="tostorePage(goodsDetail)">
|
||||||
<view>进店逛逛</view>
|
<view>进店逛逛</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="store-recommend" >
|
<view class="store-recommend">
|
||||||
<view class="store-recommend-title">商品推荐</view>
|
<view class="store-recommend-title">商品推荐</view>
|
||||||
<view class="recommend-list">
|
<view class="recommend-list">
|
||||||
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||||
@@ -58,9 +58,8 @@ export default {
|
|||||||
// 点击商品
|
// 点击商品
|
||||||
clickGoods(val) {
|
clickGoods(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`
|
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tostorePage(val) {
|
tostorePage(val) {
|
||||||
@@ -73,7 +72,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
@import "../product.scss";
|
@import "../product.scss";
|
||||||
.recommend-item-name {
|
.recommend-item-name {
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
@@ -108,6 +106,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shopTag{
|
||||||
|
background: $main-color;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 0 12rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
font-weight: normal;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.recommend-list-view {
|
.recommend-list-view {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -135,15 +143,26 @@ export default {
|
|||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
margin-left: 10px;
|
||||||
|
text{
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.to-store-btn {
|
.to-store-btn {
|
||||||
padding: 20rpx 0;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
> view {
|
> view {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@@ -164,7 +183,6 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
@@ -215,4 +233,16 @@ export default {
|
|||||||
|
|
||||||
margin: 20rpx 0 0 0;
|
margin: 20rpx 0 0 0;
|
||||||
}
|
}
|
||||||
|
.goodsNum,
|
||||||
|
.collectionNum {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.store-row {
|
||||||
|
display: flex;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
> div {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.red {
|
.red {
|
||||||
color: $jd-color;
|
color: $jd-color;
|
||||||
}
|
}
|
||||||
page{
|
page {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
.num-icon {
|
.num-icon {
|
||||||
@@ -48,7 +48,7 @@ page{
|
|||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.desc-blod {
|
.desc-bold {
|
||||||
flex: 8;
|
flex: 8;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #262626;
|
color: #262626;
|
||||||
@@ -72,7 +72,7 @@ page{
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.favorite {
|
.icons,.favorite {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #262626;
|
color: #262626;
|
||||||
@@ -127,45 +127,81 @@ page{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.headerRow {
|
.headerRow {
|
||||||
|
height: 44px; //默认uni navbar就是44px
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #fff !important;
|
// background: #fff !important;
|
||||||
> div {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
> .headerList {
|
> .headerList {
|
||||||
flex: 8;
|
flex: 8;
|
||||||
}
|
}
|
||||||
|
// > div:nth-child(2) {
|
||||||
|
// flex: 1;
|
||||||
|
// .headerList{
|
||||||
|
// display: flex;
|
||||||
|
// div{
|
||||||
|
// flex: 1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// > div:nth-child(3) {
|
||||||
|
// width: 100rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scoll-hide {
|
.scroll-hide {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
.cur {
|
.cur {
|
||||||
color: #333;
|
color: $main-color;
|
||||||
|
|
||||||
border-bottom: 6rpx solid $main-color;
|
|
||||||
}
|
}
|
||||||
.header {
|
.cur::after {
|
||||||
|
content: "";
|
||||||
|
height: 6rpx;
|
||||||
|
|
||||||
|
background: $main-color;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-only-back {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.header,
|
||||||
|
.header-only-back {
|
||||||
|
padding-left: 10rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: var(--status-bar-height);
|
top: var(--status-bar-height);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
line-height: 90rpx;
|
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
|
}
|
||||||
|
/deep/ .u-navbar {
|
||||||
|
padding-left: 10rpx;
|
||||||
|
}
|
||||||
|
.nav-item {
|
||||||
|
flex: 2;
|
||||||
|
position: relative;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.tab-bar {
|
.tab-bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: #666;
|
color: #666;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
@@ -214,14 +250,32 @@ page{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-page {
|
.main-page {
|
||||||
height: calc(100% - var(--status-bar-height)) ;
|
height: calc(100% - var(--status-bar-height));
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.icon-back {
|
||||||
|
padding-right: 10rpx;
|
||||||
|
}
|
||||||
|
.icon-list {
|
||||||
|
border-left: 2rpx solid rgb(194, 194, 194);
|
||||||
|
padding-left: 10rpx;
|
||||||
|
}
|
||||||
|
.backs,
|
||||||
|
.bg-back {
|
||||||
|
width: 150rpx;
|
||||||
|
border: 2rpx solid #e8e8e8;
|
||||||
|
border-radius: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8rpx 0;
|
||||||
|
}
|
||||||
|
.bg-back {
|
||||||
|
background: rgba($color: #fff, $alpha: 0.8);
|
||||||
|
}
|
||||||
.backs {
|
.backs {
|
||||||
// width: 150rpx;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 42rpx;
|
font-size: 42rpx;
|
||||||
line-height: 90rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerImg {
|
.headerImg {
|
||||||
@@ -253,8 +307,6 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.product-container {
|
.product-container {
|
||||||
// background: #f0f0f0;
|
|
||||||
|
|
||||||
.header-line {
|
.header-line {
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
@@ -265,12 +317,12 @@ page {
|
|||||||
z-index: 999;
|
z-index: 999;
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
|
|
||||||
&.scoll-hide {
|
&.scroll-hide {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scoll-page {
|
.scroll-page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
@@ -328,7 +380,7 @@ page {
|
|||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
margin-top: calc( 10px);
|
margin-top: calc(10px);
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@@ -337,12 +389,6 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-mode-light-error {
|
|
||||||
background: #ffebec !important;
|
|
||||||
padding: 8rpx 16rpx;
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.showBox {
|
.showBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
@@ -363,7 +409,7 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.status_bar{
|
.status_bar {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
height: var(--status-bar-height);
|
height: var(--status-bar-height);
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,12 @@ export default {
|
|||||||
this.storeId = options.id;
|
this.storeId = options.id;
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 点击分享
|
// 点击分享
|
||||||
|
|||||||
@@ -221,36 +221,6 @@ export default {
|
|||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
|
||||||
.back {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
background: url(/static/global/select.png) center no-repeat;
|
|
||||||
background-size: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-wrap {
|
|
||||||
width: 600rpx;
|
|
||||||
height: 58rpx;
|
|
||||||
padding: 10rpx 30rpx 10rpx 100rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid #29bb9c;
|
|
||||||
background: url(/static/global/select.png) center left no-repeat;
|
|
||||||
background-position: 40rpx;
|
|
||||||
input {
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.share {
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
background: url(/static/global/select.png) center no-repeat;
|
|
||||||
background-size: 50%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.tab-header {
|
.tab-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
499
pages/promotion/bargain/detail.vue
Normal file
@@ -0,0 +1,499 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page">
|
||||||
|
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
|
||||||
|
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- 砍价列表 -->
|
||||||
|
<div class="box box1">
|
||||||
|
<div class="bargain">
|
||||||
|
<div class="flex bargain-item">
|
||||||
|
<div class="goods-img">
|
||||||
|
<u-image width="200" height="200" :src="bargainDetail.thumbnail"></u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-config">
|
||||||
|
<div class="goods-title wes-2">
|
||||||
|
{{bargainDetail.goodsName}}
|
||||||
|
</div>
|
||||||
|
<div class="flex price-box">
|
||||||
|
<div class="purchase-price">当前:<span>¥{{ activityData.surplusPrice == 0 ? this.bargains.purchasePrice : activityData.surplusPrice | unitPrice}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="max-price">原价:<span>¥{{ bargainDetail.price | unitPrice}}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tips">{{bargainDetail.sellingPoint}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 砍价进度 -->
|
||||||
|
<div class="bargain-progress">
|
||||||
|
<u-line-progress class="line" :active-color="lightColor" striped striped-active :percent="totalPercent"></u-line-progress>
|
||||||
|
<div class="flex tips">
|
||||||
|
<div>已砍{{cutPrice}}元</div>
|
||||||
|
<div>还剩{{activityData.surplusPrice}}元</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 参与砍价 -->
|
||||||
|
<div class="bargaining" v-if="!activityData.pass" @click="shareBargain">
|
||||||
|
邀请砍价
|
||||||
|
</div>
|
||||||
|
<!-- 立即购买 -->
|
||||||
|
|
||||||
|
<div class="buy" v-else @click="getGoodsDetail">
|
||||||
|
立即购买
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 帮砍列表 -->
|
||||||
|
<div class="box box2">
|
||||||
|
<div class="bargain">
|
||||||
|
<div class="bargain-title">帮忙砍</div>
|
||||||
|
<div class="user-item flex" v-if="logData.length !=0 " v-for="(item,index) in logData" :key="index">
|
||||||
|
<div>
|
||||||
|
<u-image width="75" shape="circle" height="75" :src="item.kanjiaMemberFace"></u-image>
|
||||||
|
</div>
|
||||||
|
<div class="user-config flex">
|
||||||
|
<div class="user-name">
|
||||||
|
<div>{{item.kanjiaMemberName | noPassByName}}</div>
|
||||||
|
<div>使出吃的奶劲儿</div>
|
||||||
|
</div>
|
||||||
|
<div class="save">砍掉:<span>¥{{item.kanjiaPrice | unitPrice}}</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 产品详情 -->
|
||||||
|
<div class="box box3">
|
||||||
|
<div class="bargain">
|
||||||
|
<div class="bargain-title">商品详情</div>
|
||||||
|
<view class="u-content">
|
||||||
|
<u-parse :html="bargainDetail.mobileIntro"></u-parse>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 砍价 -->
|
||||||
|
<u-modal title="恭喜您砍掉了" v-model="Bargaining" mask-close-able :show-confirm-button="false" :title-style="{color: lightColor}">
|
||||||
|
<view class="slot-content">
|
||||||
|
<u-count-to :start-val="0" ref="uCountTo" font-size="100" :color="lightColor" :end-val="kanjiaPrice" :decimals="2" :autoplay="autoplay"></u-count-to><span class="price">元</span>
|
||||||
|
</view>
|
||||||
|
</u-modal>
|
||||||
|
<!-- 帮砍 -->
|
||||||
|
|
||||||
|
<u-modal :show-title="false" v-model="helpBargainFlage" :show-confirm-button="false">
|
||||||
|
<view class="help-bargain" @click="handleClickHelpBargain">
|
||||||
|
<u-image width="100%" height="600rpx" src="/pages/promotion/static/bargain.jpeg"></u-image>
|
||||||
|
<u-image class="help" width="300rpx" height="80rpx" src="/pages/promotion/static/help-bargain.png"></u-image>
|
||||||
|
</view>
|
||||||
|
</u-modal>
|
||||||
|
|
||||||
|
<!-- 分享 -->
|
||||||
|
<shares @close="closeShare" :link="'/pages/promotion/bargain/detail?id='+routerVal.id+'&activityId='+activityData.id" type="kanjia" :thumbnail="bargainDetail.thumbnail"
|
||||||
|
:goodsName="bargainDetail.goodsName" v-if="shareFlage " />
|
||||||
|
|
||||||
|
<!-- 购买 -->
|
||||||
|
|
||||||
|
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="bargainDetail" :goodsSpec="goodsSpec" v-if="bargainDetail.id "
|
||||||
|
@handleClickSku="getGoodsDetail" />
|
||||||
|
|
||||||
|
<!-- 产品详情 -->
|
||||||
|
<div class=" box4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import popupGoods from "@/pages/cart/payment/popup/goods"; //购物车商品的模块
|
||||||
|
import {
|
||||||
|
getBargainDetail,
|
||||||
|
getBargainActivity,
|
||||||
|
openBargain,
|
||||||
|
getBargainLog,
|
||||||
|
helpBargain,
|
||||||
|
} from "@/api/promotions";
|
||||||
|
import { getGoods } from "@/api/goods.js";
|
||||||
|
import shares from "@/components/m-share/index";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
shares,
|
||||||
|
popupGoods,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
background: {
|
||||||
|
backgroundColor: "transparent",
|
||||||
|
},
|
||||||
|
maskFlag: false, //商品弹框
|
||||||
|
shareFlage: false,
|
||||||
|
lightColor: this.$lightColor,
|
||||||
|
bargains: {},
|
||||||
|
bargainDetail: {}, //砍价商品详情
|
||||||
|
Bargaining: false, //砍价弹出框
|
||||||
|
helpBargainFlage: false, //帮砍弹出框
|
||||||
|
autoplay: false, //砍价金额滚动
|
||||||
|
kanjiaPrice: 0, //砍价金额
|
||||||
|
totalPercent: 0, //砍价半分比
|
||||||
|
activityData: "", //砍价活动
|
||||||
|
cutPrice: 0, //已砍金额
|
||||||
|
params: {
|
||||||
|
// id: "", //砍价活动ID
|
||||||
|
// kanjiaActivityGoodsId: "", //砍价商品SkuID
|
||||||
|
// kanjiaActivityId: "", //邀请活动ID,有值说明是被邀请人
|
||||||
|
// status: "", //状态
|
||||||
|
},
|
||||||
|
|
||||||
|
logData: [], // 帮砍记录
|
||||||
|
//获取帮砍记录参数
|
||||||
|
logParams: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
kanJiaActivityId: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
goodsDetail: {}, //商品详情
|
||||||
|
goodsSpec: {}, //商品规格
|
||||||
|
selectedGoods: "", //选择的商品
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.routerVal = options;
|
||||||
|
if (options.activityId) {
|
||||||
|
this.params.kanjiaActivityId = options.activityId;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 砍价弹窗
|
||||||
|
Bargaining(val) {
|
||||||
|
if (val) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.uCountTo.start();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听砍价活动金额
|
||||||
|
activityData: {
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
// 计算砍价百分比
|
||||||
|
this.totalPercent =
|
||||||
|
100 -
|
||||||
|
Math.floor((val.surplusPrice / this.bargainDetail.price) * 100);
|
||||||
|
this.cutPrice = (
|
||||||
|
this.bargainDetail.price - this.activityData.surplusPrice
|
||||||
|
).toFixed(2);
|
||||||
|
// 获取砍价日志
|
||||||
|
this.logParams.kanJiaActivityId = val.id;
|
||||||
|
|
||||||
|
// 判断是否是帮砍
|
||||||
|
if (this.params.kanjiaActivityId && val.help) {
|
||||||
|
this.helpBargainFlage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getBargainLogList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
closePopupBuy(val) {
|
||||||
|
this.maskFlag = false;
|
||||||
|
},
|
||||||
|
closeShare() {
|
||||||
|
this.shareFlage = false;
|
||||||
|
},
|
||||||
|
// 邀请砍价
|
||||||
|
shareBargain() {
|
||||||
|
this.shareFlage = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取商品详情
|
||||||
|
getGoodsDetail() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "加载中",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$refs.popupGoods.buy({
|
||||||
|
skuId: this.bargainDetail.id,
|
||||||
|
num: 1,
|
||||||
|
cartType: "KANJIA",
|
||||||
|
});
|
||||||
|
// getGoods(this.bargainDetail.id, this.bargainDetail.goodsId).then(
|
||||||
|
// (response) => {
|
||||||
|
// this.goodsDetail = response.data.result.data;
|
||||||
|
// this.selectedGoods = response.data.result.data;
|
||||||
|
// this.goodsSpec = response.data.result.specs;
|
||||||
|
// uni.hideLoading();
|
||||||
|
|
||||||
|
// // this.maskFlag = true;
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
|
||||||
|
// 初始化商品以及砍价活动
|
||||||
|
async init() {
|
||||||
|
// 获取商品
|
||||||
|
let res = await getBargainDetail(this.routerVal.id);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.bargainDetail = res.data.result.goodsSku;
|
||||||
|
this.bargains = res.data.result;
|
||||||
|
// 被邀请活动id
|
||||||
|
if (this.params.kanjiaActivityId) {
|
||||||
|
} else {
|
||||||
|
this.params.kanjiaActivityGoodsId = this.routerVal.id;
|
||||||
|
}
|
||||||
|
// 获取砍价活动
|
||||||
|
this.activity();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取砍价活动
|
||||||
|
async activity() {
|
||||||
|
let res = await getBargainActivity(this.params);
|
||||||
|
// 判断当前是否是第一次进入,如果是第一次进入默认砍一刀
|
||||||
|
res.data.success
|
||||||
|
? res.data.result
|
||||||
|
? (this.activityData = res.data.result)
|
||||||
|
: this.openActivity()
|
||||||
|
: "";
|
||||||
|
},
|
||||||
|
// 分页获取砍价活动-帮砍记录
|
||||||
|
async getBargainLogList() {
|
||||||
|
let res = await getBargainLog(this.logParams);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.logData = res.data.result.records;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 帮忙砍一刀
|
||||||
|
async handleClickHelpBargain() {
|
||||||
|
let res = await helpBargain(this.params.kanjiaActivityId);
|
||||||
|
if (res.data.success) {
|
||||||
|
this.helpBargainFlage = false;
|
||||||
|
this.kanjiaPrice = res.data.result.kanjiaPrice;
|
||||||
|
this.Bargaining = true;
|
||||||
|
// 帮砍完成之后查询帮砍记录
|
||||||
|
this.init();
|
||||||
|
} else {
|
||||||
|
this.helpBargainFlage = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 发起砍价活动
|
||||||
|
async openActivity(data) {
|
||||||
|
let res = await openBargain({ id: this.routerVal.id });
|
||||||
|
if (res.data.success) {
|
||||||
|
this.kanjiaPrice = res.data.result.kanjiaPrice;
|
||||||
|
this.Bargaining = true;
|
||||||
|
// 查询帮砍记录
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: $light-color !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.slot-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 20rpx 0 80rpx 0;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
color: $light-color;
|
||||||
|
}
|
||||||
|
.price-box {
|
||||||
|
align-items: center;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
background: url("../static/Bargaining.png");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
height: 700rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 auto;
|
||||||
|
> .bargain {
|
||||||
|
padding: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.box1 {
|
||||||
|
top: 750rpx;
|
||||||
|
}
|
||||||
|
.box2 {
|
||||||
|
top: 770rpx;
|
||||||
|
}
|
||||||
|
.box3 {
|
||||||
|
top: 790rpx;
|
||||||
|
}
|
||||||
|
.box4 {
|
||||||
|
top: 810rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
|
.bargain-item {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.goods-config {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
> .goods-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.max-price,
|
||||||
|
.purchase-price {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.max-price {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
.purchase-price {
|
||||||
|
color: $main-color;
|
||||||
|
> span {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargaining,
|
||||||
|
.buy {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
width: 80%;
|
||||||
|
margin: 50rpx auto 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
background-image: linear-gradient(
|
||||||
|
25deg,
|
||||||
|
$main-color,
|
||||||
|
$light-color,
|
||||||
|
$aider-light-color
|
||||||
|
);
|
||||||
|
|
||||||
|
padding: 18rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
animation: mymove 5s infinite;
|
||||||
|
-webkit-animation: mymove 5s infinite; /*Safari and Chrome*/
|
||||||
|
animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
|
animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
|
/* Safari 和 Chrome */
|
||||||
|
-webkit-animation: mymove 5s infinite;
|
||||||
|
-webkit-animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
|
-webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes mymove {
|
||||||
|
0% {
|
||||||
|
transform: scale(1); /*开始为原始大小*/
|
||||||
|
}
|
||||||
|
25% {
|
||||||
|
transform: scale(1.1); /*放大1.1倍*/
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
75% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.line {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.bargain-progress {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.bargain-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $light-color;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.user-item {
|
||||||
|
margin: 40rpx 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.user-config {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
flex: 8;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
> .user-name {
|
||||||
|
> div:nth-of-type(1) {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
> div:nth-last-of-type(1) {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.save {
|
||||||
|
color: $light-color;
|
||||||
|
> span {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mobile-intro {
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fontMove {
|
||||||
|
0% {
|
||||||
|
transform: scale(1); /*开始为原始大小*/
|
||||||
|
}
|
||||||
|
25% {
|
||||||
|
transform: scale(1.1); /*放大1.1倍*/
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
75% {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.help-bargain {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
> .help {
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
margin-top: 40rpx;
|
||||||
|
animation: fontMove 5s infinite;
|
||||||
|
-webkit-animation: fontMove 5s infinite; /*Safari and Chrome*/
|
||||||
|
animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
|
animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
|
/* Safari 和 Chrome */
|
||||||
|
-webkit-animation: fontMove 5s infinite;
|
||||||
|
-webkit-animation-direction: alternate; /*轮流反向播放动画。*/
|
||||||
|
-webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
133
pages/promotion/bargain/list.vue
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page">
|
||||||
|
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- 砍价列表 -->
|
||||||
|
<div class="box">
|
||||||
|
<div class="bargain" v-if="bargainList.length!=0">
|
||||||
|
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
|
||||||
|
<div class="goods-img">
|
||||||
|
<u-image width="150" height="150" :src="item.thumbnail"></u-image>
|
||||||
|
</div>
|
||||||
|
<div class="goods-config">
|
||||||
|
<div class="goods-title wes-2">
|
||||||
|
{{item.goodsName}}
|
||||||
|
</div>
|
||||||
|
<div class="flex goods-buy">
|
||||||
|
<div class="max-price">最低:<span>¥{{item.purchasePrice | unitPrice}}</span></div>
|
||||||
|
<div class="bargaining" @click="navigateToBargainDetail(item)">参与砍价</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bargain empty" v-else>
|
||||||
|
<u-empty text="暂无活动" mode="list"></u-empty>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getBargainList } from "@/api/promotions";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
background: {
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
promotionStatus: "START", //开始/上架
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
},
|
||||||
|
bargainList: [], //砍价活动列表
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化砍价列表
|
||||||
|
*/
|
||||||
|
async init() {
|
||||||
|
let res = await getBargainList(this.params); //砍价列表
|
||||||
|
if (res.data.success) {
|
||||||
|
this.bargainList = res.data.result.records;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 跳转到砍价详情
|
||||||
|
navigateToBargainDetail(val) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/promotion/bargain/detail?id=${val.id}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
page{
|
||||||
|
background-color: $light-color !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
background: url("../static/Bargaining.png");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
height: 700rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
top: 750rpx;
|
||||||
|
width: 94%;
|
||||||
|
margin: 0 auto;
|
||||||
|
> .bargain {
|
||||||
|
padding: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bargain-item {
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
border-bottom: 1rpx solid #f6f6f6;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
}
|
||||||
|
.goods-config {
|
||||||
|
flex: 8;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
> .goods-title {
|
||||||
|
height: 80rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.max-price {
|
||||||
|
color: $main-color;
|
||||||
|
font-size: 24rpx;
|
||||||
|
> span {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-buy {
|
||||||
|
margin: 10rpx 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.bargaining {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
background: $light-color;
|
||||||
|
padding: 10rpx 24rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
}
|
||||||
|
.empty {
|
||||||
|
height: 400rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<!-- 商品栏 -->
|
<!-- 商品栏 -->
|
||||||
<div class="swiper">
|
<div class="swiper">
|
||||||
|
|
||||||
|
<div v-if="groupBuy.length !=0">
|
||||||
<view class="view-item" v-for="(groupItem, groupIndex) in groupBuy" :key="groupIndex">
|
<view class="view-item" v-for="(groupItem, groupIndex) in groupBuy" :key="groupIndex">
|
||||||
<view class="view-left">
|
<view class="view-left">
|
||||||
<u-image border-radius="10" shape="square" :src="groupItem.goodsImage" width="186rpx" height="186rpx">
|
<u-image border-radius="10" shape="square" :src="groupItem.goodsImage" width="186rpx" height="186rpx">
|
||||||
@@ -54,7 +54,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-loadmore bg-color='#f8f8f8' :status="status" />
|
<u-loadmore bg-color='#f8f8f8' :status="status" />
|
||||||
|
</div>
|
||||||
|
<u-empty v-else style="margin-top:20%" text="暂无拼团活动" mode="data"></u-empty>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -91,8 +92,8 @@ export default {
|
|||||||
val ? (this.title = "") : (this.title = "拼团活动");
|
val ? (this.title = "") : (this.title = "拼团活动");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onReachBottom(){
|
onReachBottom() {
|
||||||
this.loadMore()
|
this.loadMore();
|
||||||
},
|
},
|
||||||
// 点击搜索按钮
|
// 点击搜索按钮
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
@@ -151,5 +152,4 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./style.scss";
|
@import "./style.scss";
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
379
pages/promotion/lives.vue
Normal file
@@ -0,0 +1,379 @@
|
|||||||
|
<template>
|
||||||
|
<div class="box">
|
||||||
|
<u-navbar class="navbar">
|
||||||
|
<view class="slot-wrap">
|
||||||
|
<u-search placeholder="搜索直播间" @custom="searchLive" @clear="clear" @search="searchLive" v-model="keyword"></u-search>
|
||||||
|
</view>
|
||||||
|
</u-navbar>
|
||||||
|
<!-- 轮播图 -->
|
||||||
|
<u-swiper @click="clickSwiper" class="swiper" :effect3d="true" :list="swiperImg">
|
||||||
|
|
||||||
|
</u-swiper>
|
||||||
|
<u-tabs :is-scroll="false" @change="changeTabs" :current="current" :active-color="activeColor" inactive-color="#606266" ref="tabs" :list="tabs"></u-tabs>
|
||||||
|
|
||||||
|
<div class="wrapper">
|
||||||
|
<!-- 直播中 全部 直播回放 -->
|
||||||
|
<div class="live-item" :class="{'invalid':item.status == 'END'}" v-for="(item,index) in liveList" :key="index" @click="handleLivePlayer(item)">
|
||||||
|
<div class="live-cover-img">
|
||||||
|
<div class="tips">
|
||||||
|
<div class="live-box">
|
||||||
|
<image class="live-gif" src="./static/live.gif"></image>
|
||||||
|
</div>
|
||||||
|
<span>{{item.status == 'END' ? '已结束' : item.status =='NEW' ? '未开始' : '直播中'}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="bg"></div>
|
||||||
|
<u-image width="326" height="354" :src="item.shareImg" />
|
||||||
|
</div>
|
||||||
|
<div class="live-goods">
|
||||||
|
<div class="live-goods-name">
|
||||||
|
{{item.name}}
|
||||||
|
</div>
|
||||||
|
<div class="live-store">
|
||||||
|
<span class="wes">lilishop</span>
|
||||||
|
</div>
|
||||||
|
<div class="live-goods-list">
|
||||||
|
<div class="live-goods-item">
|
||||||
|
<u-image border-radius="20" :src="item.roomGoodsList ? item.roomGoodsList[0] : ''" height="140"></u-image>
|
||||||
|
</div>
|
||||||
|
<div class="live-goods-item">
|
||||||
|
<u-image border-radius="20" :src="item.roomGoodsList ? item.roomGoodsList[1] : ''" height="140"></u-image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<u-loadmore v-if="liveList.length > 10" bg-color="#f8f8f8" :status="status" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getLiveList } from "@/api/promotions.js";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: "loadmore",
|
||||||
|
activeColor: this.$lightColor,
|
||||||
|
current: 0, // 当前tabs索引
|
||||||
|
keyword: "", //搜索直播间
|
||||||
|
// 标签栏
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
name: "直播中",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "全部",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 导航栏的配置
|
||||||
|
background: {
|
||||||
|
background: "#ff9f28",
|
||||||
|
},
|
||||||
|
// 直播间params
|
||||||
|
params: [
|
||||||
|
{
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
status: "START",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 4,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 推荐直播间Params
|
||||||
|
recommendParams: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 3,
|
||||||
|
recommend: 0,
|
||||||
|
},
|
||||||
|
// 直播间列表
|
||||||
|
liveList: [],
|
||||||
|
// 推荐直播间列表
|
||||||
|
recommendLiveList: [],
|
||||||
|
|
||||||
|
//轮播图滚动的图片
|
||||||
|
swiperImg: [
|
||||||
|
{
|
||||||
|
image:
|
||||||
|
"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/48d789cb9c864b7b87c1c0f70996c3e8.jpeg",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.params[this.current].pageNumber = 1;
|
||||||
|
this.liveList = [];
|
||||||
|
this.getLives();
|
||||||
|
this.getRecommendLives();
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.params[this.current].pageNumber++;
|
||||||
|
this.getLives();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 点击标签栏切换
|
||||||
|
*/
|
||||||
|
changeTabs(index) {
|
||||||
|
this.current = index;
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化直播间
|
||||||
|
*/
|
||||||
|
init() {
|
||||||
|
this.liveList = [];
|
||||||
|
this.status = "loadmore";
|
||||||
|
this.getLives();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除搜索内容
|
||||||
|
*/
|
||||||
|
clear() {
|
||||||
|
delete this.params[this.current].name;
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 点击顶部推荐直播间
|
||||||
|
*/
|
||||||
|
clickSwiper(val) {
|
||||||
|
console.log(this.swiperImg[val]);
|
||||||
|
this.handleLivePlayer(this.swiperImg[val]);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索直播间
|
||||||
|
*/
|
||||||
|
searchLive(val) {
|
||||||
|
this.params[this.current].pageNumber = 1;
|
||||||
|
this.params[this.current].name = val;
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取推荐直播间
|
||||||
|
*/
|
||||||
|
async getRecommendLives() {
|
||||||
|
this.status = "loading";
|
||||||
|
let recommendLives = await getLiveList(this.recommendParams);
|
||||||
|
if (recommendLives.data.success) {
|
||||||
|
// 推荐直播间
|
||||||
|
if (recommendLives.data.result.records.length != 0) {
|
||||||
|
this.status = "loadmore";
|
||||||
|
this.recommendLives = recommendLives.data.result.records;
|
||||||
|
} else {
|
||||||
|
this.status = "noMore";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果推荐直播间没有的情况下
|
||||||
|
* 1.获取直播间第一个图片
|
||||||
|
* 2.如果没有直播间设置一个默认图片
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (this.recommendLives.length == 0) {
|
||||||
|
if (this.liveList[0].shareImg) {
|
||||||
|
this.$set(this, "swiperImg", [
|
||||||
|
{
|
||||||
|
image: this.liveList[0].shareImg,
|
||||||
|
roomId: this.liveList[0].roomId,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.recommendLives.forEach((item) => {
|
||||||
|
this.$set(this, "swiperImg", [
|
||||||
|
{ image: item.shareImg, roomId: item.roomId },
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取直播间
|
||||||
|
*/
|
||||||
|
async getLives() {
|
||||||
|
this.status = "loading";
|
||||||
|
let res = await getLiveList(this.params[this.current]);
|
||||||
|
// 直播间
|
||||||
|
if (res.data.success) {
|
||||||
|
if (res.data.result.records.length != 0) {
|
||||||
|
this.status = "loadmore";
|
||||||
|
this.liveList.push(...res.data.result.records);
|
||||||
|
} else {
|
||||||
|
this.status = "noMore";
|
||||||
|
}
|
||||||
|
res.data.result.total >
|
||||||
|
this.params[this.current].pageNumber *
|
||||||
|
this.params[this.current].pageSize
|
||||||
|
? (this.status = "loadmore")
|
||||||
|
: (this.status = "noMore");
|
||||||
|
|
||||||
|
console.log(this.status);
|
||||||
|
this.liveList.forEach((item) => {
|
||||||
|
if (item.roomGoodsList) {
|
||||||
|
item.roomGoodsList = JSON.parse(item.roomGoodsList);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进入直播间
|
||||||
|
*/
|
||||||
|
handleLivePlayer(val) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
let roomId = val.roomId; // 填写具体的房间号,可通过下面【获取直播房间列表】 API 获取
|
||||||
|
let customParams = encodeURIComponent(
|
||||||
|
JSON.stringify({ path: "pages/index/index", pid: 1 })
|
||||||
|
); // 开发者在直播间页面路径上携带自定义参数,后续可以在分享卡片链接和跳转至商详页时获取,详见【获取自定义参数】、【直播间到商详页面携带参数】章节(上限600个字符,超过部分会被截断)
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
"plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" +
|
||||||
|
roomId +
|
||||||
|
"&custom_params=" +
|
||||||
|
customParams,
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
uni.showToast({
|
||||||
|
title: "请从微信小程序中预览直播功能",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.slot-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
/* 如果您想让slot内容占满整个导航栏的宽度 */
|
||||||
|
flex: 1;
|
||||||
|
/* 如果您想让slot内容与导航栏左右有空隙 */
|
||||||
|
/* padding: 0 30rpx; */
|
||||||
|
}
|
||||||
|
.invalid {
|
||||||
|
filter: grayscale(1);
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 24rpx;
|
||||||
|
}
|
||||||
|
.live-item {
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
.live-cover-img {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.swiper {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.live-goods {
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
padding: 16rpx 24rpx 24rpx;
|
||||||
|
}
|
||||||
|
.live-goods-name {
|
||||||
|
height: 84rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.live-store {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
overflow: hidden;
|
||||||
|
width: calc(100% - 50rpx);
|
||||||
|
}
|
||||||
|
.live-gif {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
}
|
||||||
|
.live-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 40rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background: linear-gradient(90deg, #ff6b35, #ff9f28, #ffcc03);
|
||||||
|
}
|
||||||
|
.live-goods-list {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
> .live-goods-item {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
> .live-goods-item:nth-of-type(1) {
|
||||||
|
padding-right: 38rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.live-icon,
|
||||||
|
.zan {
|
||||||
|
position: absolute;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
.tips {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 0;
|
||||||
|
padding: 4rpx 12rpx 4rpx 0;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
color: #fff;
|
||||||
|
background: rgba(0, 0, 0, 0.46);
|
||||||
|
}
|
||||||
|
.live-icon {
|
||||||
|
right: 0;
|
||||||
|
top: 104rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zan {
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
.bg {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 4rpx;
|
||||||
|
width: 100%;
|
||||||
|
height: 100rpx;
|
||||||
|
z-index: 8;
|
||||||
|
background-image: -webkit-gradient(
|
||||||
|
linear,
|
||||||
|
left bottom,
|
||||||
|
left top,
|
||||||
|
from(rgba(0, 0, 0, 0.25)),
|
||||||
|
color-stop(82%, transparent)
|
||||||
|
);
|
||||||
|
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.25), transparent 82%);
|
||||||
|
border-bottom-left-radius: 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -69,22 +69,7 @@
|
|||||||
this.goods = response.data;
|
this.goods = response.data;
|
||||||
},
|
},
|
||||||
onBackPress() {
|
onBackPress() {
|
||||||
// uni.preloadPage({
|
|
||||||
// url: '/pages/tabbar/home/index',
|
|
||||||
// success: function(res) {
|
|
||||||
// // 通过eventChannel向被打开页面传送数据
|
|
||||||
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// //莫名其妙的,无法后退,尝试追加参数解决缓存问题
|
|
||||||
// uni.switchTab({
|
|
||||||
// url: '/pages/tabbar/home/index?' + new Date().getTime(),
|
|
||||||
// success: function(res) {
|
|
||||||
// // 通过eventChannel向被打开页面传送数据
|
|
||||||
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 跳转
|
// 跳转
|
||||||
|
|||||||
BIN
pages/promotion/static/Bargaining.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
pages/promotion/static/bargain.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
pages/promotion/static/help-bargain.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
pages/promotion/static/live.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
pages/promotion/static/live.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
pages/promotion/static/zan.gif
Normal file
|
After Width: | Height: | Size: 18 KiB |
@@ -3,7 +3,7 @@
|
|||||||
<u-navbar :isBack="false" title="购物车"></u-navbar>
|
<u-navbar :isBack="false" title="购物车"></u-navbar>
|
||||||
<!-- 空白页-->
|
<!-- 空白页-->
|
||||||
<view v-if="cartDetail.cartList == '' || cartDetail.cartList == [] || !cartDetail" class="empty">
|
<view v-if="cartDetail.cartList == '' || cartDetail.cartList == [] || !cartDetail" class="empty">
|
||||||
<image src="/static/emptyCart.jpg" mode="aspectFit"></image>
|
<image src="/static/emptyCart.png" mode="aspectFit"></image>
|
||||||
<view class="empty-tips">
|
<view class="empty-tips">
|
||||||
空空如也
|
空空如也
|
||||||
<navigator class="navigator" url="/pages/tabbar/home/index" open-type="switchTab">随便逛逛></navigator>
|
<navigator class="navigator" url="/pages/tabbar/home/index" open-type="switchTab">随便逛逛></navigator>
|
||||||
@@ -100,13 +100,12 @@
|
|||||||
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
|
<span>.{{ formatPrice(skuItem.priceDetailDTO.flowPrice)[1] }} </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</p>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-swipe-action>
|
</u-swipe-action>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<u-modal v-model="deleteShow" @delectConfirm="delectConfirm" show-cancel-button :content="deleteContent" :async-close="true"></u-modal>
|
<u-modal v-model="deleteShow" :confirm-style="{'color':lightColor}" @confirm="delectConfirm" show-cancel-button :content="deleteContent" :async-close="true"></u-modal>
|
||||||
<!-- 结账 -->
|
<!-- 结账 -->
|
||||||
<div class="box box6">
|
<div class="box box6">
|
||||||
<view class="navL">
|
<view class="navL">
|
||||||
@@ -164,7 +163,7 @@ import * as API_Trade from "@/api/trade";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lightColor:this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
discountDetailsFlag: false, //优惠明细开关
|
discountDetailsFlag: false, //优惠明细开关
|
||||||
// 商品栏右侧滑动按钮
|
// 商品栏右侧滑动按钮
|
||||||
options: [
|
options: [
|
||||||
@@ -192,6 +191,12 @@ export default {
|
|||||||
WEIXIN_num: "", //购物车兼容微信步进器
|
WEIXIN_num: "", //购物车兼容微信步进器
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化信息
|
* 初始化信息
|
||||||
*/
|
*/
|
||||||
@@ -473,7 +478,7 @@ export default {
|
|||||||
getCardData() {
|
getCardData() {
|
||||||
if (this.$options.filters.isLogin("auth")) {
|
if (this.$options.filters.isLogin("auth")) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
mask: true,
|
title: "加载中",
|
||||||
});
|
});
|
||||||
API_Trade.getCarts()
|
API_Trade.getCarts()
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
@@ -498,19 +503,10 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
uni.hideLoading();
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: result.data.message,
|
|
||||||
duration: 2000,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +116,7 @@ uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
.s-list{
|
.s-list {
|
||||||
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
.nav-search {
|
.nav-search {
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import tpl from "@/pages/tabbar/home/views.vue";
|
import tpl from "@/pages/tabbar/home/views.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
background: {
|
background: {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/** 配置楼层模块的跳转 */
|
/** 配置楼层模块的跳转 */
|
||||||
export function modelNavigateTo(item) {
|
export function modelNavigateTo(item) {
|
||||||
|
|
||||||
let val = item.url;
|
let val = item.url;
|
||||||
switch (val.___type) {
|
switch (val.___type) {
|
||||||
case "goods":
|
case "goods":
|
||||||
@@ -9,9 +8,15 @@ export function modelNavigateTo(item) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "category":
|
case "category":
|
||||||
|
if (val.id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/navigation/search/searchPage?category=${val.id}`,
|
url: `/pages/navigation/search/searchPage?category=${val.id}`,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/navigation/search/searchPage`,
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "stores":
|
case "stores":
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -33,7 +38,7 @@ export function modelNavigateTo(item) {
|
|||||||
switch (val.title) {
|
switch (val.title) {
|
||||||
case "首页":
|
case "首页":
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: `/`,
|
url: `/pages/tabbar/home/index`,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "购物车":
|
case "购物车":
|
||||||
@@ -76,6 +81,16 @@ export function modelNavigateTo(item) {
|
|||||||
url: `/pages/promotion/joinGroup`,
|
url: `/pages/promotion/joinGroup`,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "小程序直播":
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/promotion/lives`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "砍价":
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/promotion/bargain/list`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "积分商城":
|
case "积分商城":
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: `/pages/navigation/point/point-mall`,
|
url: `/pages/navigation/point/point-mall`,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.image-mode {
|
.image-mode {
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 2rpx;
|
padding: 2rpx;
|
||||||
}
|
}
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.view-height-75 {
|
.view-height-75 {
|
||||||
height: 150rpx;
|
// height: 150rpx;
|
||||||
}
|
}
|
||||||
.view-height-150 {
|
.view-height-150 {
|
||||||
height: 300rpx;
|
// height: 300rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,3 +29,4 @@
|
|||||||
height: 170rpx;
|
height: 170rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<u-image width="140rpx" height="140rpx" @click="modelNavigateTo(item)" class="image-mode" v-for="(item,index) in res.list" :key="index" :src="item.img" alt="">
|
<u-image width="140rpx" mode="aspectFit" height="140rpx" @click="modelNavigateTo(item)" class="image-mode" v-for="(item,index) in res.list" :key="index" :src="item.img" alt="">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<u-image height="175rpx" width="175rpx" @click="modelNavigateTo(item)" class="image-mode" :src="item.img" v-for="(item,index) in res.list" :key="index">
|
<u-image height="175rpx" mode="aspectFit" width="175rpx" @click="modelNavigateTo(item)" class="image-mode" :src="item.img" v-for="(item,index) in res.list" :key="index">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
height: 84px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div class="flex-one" @click="modelNavigateTo(res.list[0])">
|
<div class="flex-one" @click="modelNavigateTo(res.list[0])">
|
||||||
<u-image width="100%" height="280rpx" :src="res.list[0].img" alt=""></u-image>
|
<u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
import { modelNavigateTo } from "./tpl";
|
import { modelNavigateTo } from "./tpl";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title:"单行图片模块",
|
title: "单行图片模块",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modelNavigateTo,
|
modelNavigateTo,
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
height: 110px;
|
padding: 0;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div class="flex-two">
|
<div class="flex-two">
|
||||||
<div class="flex-item" @click="modelNavigateTo(res.list[0])">
|
<div class="flex-item" @click="modelNavigateTo(res.list[0])">
|
||||||
<u-image height="325rpx" width="100%" mode="scaleToFill" :src="res.list[0].img" alt>
|
<u-image height="250rpx" width="100%" mode="scaleToFill" :src="res.list[0].img" alt>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-item" @click="modelNavigateTo(res.list[1])">
|
<div class="flex-item" @click="modelNavigateTo(res.list[1])">
|
||||||
<u-image height="325rpx" width="100%" mode="scaleToFill" :src="res.list[1].img" alt>
|
<u-image height="250rpx" width="100%" mode="scaleToFill" :src="res.list[1].img" alt>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,10 +27,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import uImage from "@/uview-ui/components/u-image/u-image.vue";
|
|
||||||
export default {
|
export default {
|
||||||
title: "商品分类以及商品",
|
title: "商品分类以及商品",
|
||||||
components: { uImage },
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selected: {
|
selected: {
|
||||||
@@ -116,12 +114,9 @@ $w_94: 94%;
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
// width: 158px;
|
// width: 158px;
|
||||||
width: $w_94;
|
width: $w_94;
|
||||||
|
|
||||||
border-top-left-radius: 20rpx;
|
border-top-left-radius: 20rpx;
|
||||||
border-top-right-radius: 20rpx;
|
border-top-right-radius: 20rpx;
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
> img {
|
> img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -135,23 +130,19 @@ $w_94: 94%;
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 8rpx 0 8rpx 8rpx;
|
padding: 8rpx 0 8rpx 8rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|
||||||
> .goods-title {
|
> .goods-title {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .goods-bottom {
|
> .goods-bottom {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
> .goods-price {
|
> .goods-price {
|
||||||
line-height: 2;
|
line-height: 2;
|
||||||
color: $main-color;
|
color: $main-color;
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div class="view-height-150" @click="modelNavigateTo(res.list[0])">
|
<div class="view-height-150" @click="modelNavigateTo(res.list[0])">
|
||||||
<u-image width="100%" height="300rpx" class="image-mode" :src="res.list[0].img" >
|
<u-image width="100%" height="340rpx" class="image-mode" :src="res.list[0].img">
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="view-height-150">
|
<div class="view-height-150">
|
||||||
<div class="view-height-75" @click="modelNavigateTo(res.list[1])">
|
<div class="view-height-75" @click="modelNavigateTo(res.list[1])">
|
||||||
<u-image width="100%" height="150rpx" class="image-mode" :src="res.list[1].img" alt >
|
<u-image width="100%" height="170rpx" class="image-mode" :src="res.list[1].img" alt>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="view-height-75" @click="modelNavigateTo(res.list[2])">
|
<div class="view-height-75" @click="modelNavigateTo(res.list[2])">
|
||||||
<u-image width="100%" height="150rpx" class="image-mode" :src="res.list[2].img" alt >
|
<u-image width="100%" height="170rpx" class="image-mode" :src="res.list[2].img" alt>
|
||||||
<u-loading slot="loading"></u-loading>
|
<u-loading slot="loading"></u-loading>
|
||||||
</u-image>
|
</u-image>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,18 +21,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {modelNavigateTo} from './tpl'
|
|
||||||
|
import { modelNavigateTo } from "./tpl";
|
||||||
export default {
|
export default {
|
||||||
title: "左一右二",
|
title: "左一右二",
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
modelNavigateTo,
|
modelNavigateTo,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -44,5 +43,4 @@ export default {
|
|||||||
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
height: 167px;
|
height: 300rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类
|
|||||||
// 结束引用组件
|
// 结束引用组件
|
||||||
import { getFloorData } from "@/api/home"; //获取楼层装修接口
|
import { getFloorData } from "@/api/home"; //获取楼层装修接口
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
||||||
|
import config from "@/config/config";
|
||||||
// TODO 后续开发
|
// TODO 后续开发
|
||||||
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
// import tpl_join_group from "@/pages/tabbar/home/template/tpl_join_group";
|
||||||
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
// import tpl_integral from "@/pages/tabbar/home/template/tpl_integral";
|
||||||
@@ -66,7 +66,9 @@ import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
config,
|
||||||
pageData: "", //楼层页面数据
|
pageData: "", //楼层页面数据
|
||||||
|
isIos: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -92,8 +94,15 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
// 小程序默认分享
|
||||||
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 实例化首页数据楼层
|
* 实例化首页数据楼层
|
||||||
@@ -107,35 +116,87 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 唤醒客户端扫码
|
* TODO 扫码功能后续还会后续增加
|
||||||
* 没权限去申请权限,有权限获取扫码功能
|
* 应该实现的功能目前计划有:
|
||||||
|
* 扫描商品跳转商品页面
|
||||||
|
* 扫描活动跳转活动页面
|
||||||
|
* 扫描二维码登录
|
||||||
|
* 扫描其他站信息 弹出提示,返回首页。
|
||||||
*/
|
*/
|
||||||
scan() {
|
seacnCode() {
|
||||||
if (permision.judgeIosPermission("camera")) {
|
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
let path = encodeURIComponent(res.result);
|
let path = encodeURIComponent(res.result);
|
||||||
// TODO 扫码功能后续还会后续增加
|
config.scanAuthNavigation.forEach((src) => {
|
||||||
// 扫码成功后跳转到webview页面
|
if (res.result.indexOf(src) != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/${res.result.substring(src.length)}`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/tabbar/home/web-view?src=" + path,
|
url: "/pages/tabbar/home/web-view?src=" + path,
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
},
|
||||||
// 没有权限提醒是否去申请权限
|
|
||||||
|
/**
|
||||||
|
* 提示获取权限
|
||||||
|
*/
|
||||||
|
tipsGetSettings() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "您已经关闭相机权限,去设置",
|
content: "您已经关闭相机权限,去设置",
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
if (this.isIos) {
|
||||||
plus.runtime.openURL("app-settings:");
|
plus.runtime.openURL("app-settings:");
|
||||||
|
} else {
|
||||||
|
permision.gotoAppPermissionSetting();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唤醒客户端扫码
|
||||||
|
* 没权限去申请权限,有权限获取扫码功能
|
||||||
|
*/
|
||||||
|
async scan() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.isIos = plus.os.name == "iOS";
|
||||||
|
// 判断是否是Ios
|
||||||
|
if (this.isIos) {
|
||||||
|
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //是不是第一次开启相机
|
||||||
|
if (iosFirstCamera !== "false") {
|
||||||
|
uni.setStorageSync("iosFirstCamera", "false"); //设为false就代表不是第一次开启相机
|
||||||
|
this.seacnCode();
|
||||||
|
} else {
|
||||||
|
if (permision.judgeIosPermission("camera")) {
|
||||||
|
this.seacnCode();
|
||||||
|
} else {
|
||||||
|
// 没有权限提醒是否去申请权限
|
||||||
|
this.tipsGetSettings();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* TODO 安卓 权限已经授权了,调用api总是显示用户已永久拒绝申请。人傻了
|
||||||
|
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues 提下谢谢
|
||||||
|
*/
|
||||||
|
this.seacnCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.seacnCode();
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,13 +14,12 @@
|
|||||||
<view class="head-2" v-else>
|
<view class="head-2" v-else>
|
||||||
<view class="user-name">登录/注册</view>
|
<view class="user-name">登录/注册</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-icon style="display: flex;align-items: flex-start;" name="arrow-right"></u-icon>
|
||||||
<u-icon name="arrow-right"></u-icon>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 积分,优惠券,关注, -->
|
<!-- 积分,优惠券,关注, -->
|
||||||
<div class="pointBox">
|
<div class="pointBox box">
|
||||||
<u-row text-align="center" gutter="16" class="point">
|
<u-row text-align="center" gutter="16" class="point">
|
||||||
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/index')">
|
<u-col text-align="center" span="4" @click="navigateTo('/pages/mine/deposit/operation')">
|
||||||
<view>预存款</view>
|
<view>预存款</view>
|
||||||
<view class="money">{{ walletNum | unitPrice}}</view>
|
<view class="money">{{ walletNum | unitPrice}}</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
@@ -35,7 +34,6 @@
|
|||||||
<view>{{ footNum || 0 }}</view>
|
<view>{{ footNum || 0 }}</view>
|
||||||
</u-col>
|
</u-col>
|
||||||
</u-row>
|
</u-row>
|
||||||
</div>
|
|
||||||
<!-- 我的订单,代付款 -->
|
<!-- 我的订单,代付款 -->
|
||||||
<view class="order">
|
<view class="order">
|
||||||
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
|
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=0')">
|
||||||
@@ -48,32 +46,28 @@
|
|||||||
<div class="bag bag2">
|
<div class="bag bag2">
|
||||||
<u-icon name="bag-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="bag-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<view>待付款</view>
|
<view>待付款</view>
|
||||||
<!-- <view class="corner" v-if="cornerForm.stay_pay_order > 0">{{ cornerForm.stay_pay_order}}</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')">
|
<view class="order-item" @click="navigateTo('/pages/order/myOrder?status=3')">
|
||||||
<div class="bag bag3">
|
<div class="bag bag3">
|
||||||
<u-icon name="car-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="car-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>待收货</view>
|
<view>待收货</view>
|
||||||
<!-- <view class="corner" v-if="cornerForm.stay_receiving_order > 0">{{ cornerForm.stay_receiving_order}}</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
<view class="order-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
|
||||||
<div class="bag bag4">
|
<div class="bag bag4">
|
||||||
<u-icon name="star-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="star-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>待评价</view>
|
<view>待评价</view>
|
||||||
<!-- <view class="corner" v-if="cornerForm.pending_comment_count > 0">{{ cornerForm.pending_comment_count}}</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')">
|
<view class="order-item" @click="navigateTo('/pages/order/afterSales/afterSales')">
|
||||||
<div class="bag bag5">
|
<div class="bag bag5">
|
||||||
<u-icon name="server-fill" size="35" color="#fff"></u-icon>
|
<u-icon name="server-fill" size="35" color="#fff"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
<view>售后服务</view>
|
<view>售后服务</view>
|
||||||
<!-- <view class="corner" v-if="cornerForm.after_order > 0">{{ cornerForm.after_order}}</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 常用工具 -->
|
<!-- 常用工具 -->
|
||||||
|
|
||||||
@@ -82,10 +76,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import storage from "@/utils/storage.js";
|
|
||||||
import tool from "@/pages/tabbar/user/utils/tool.vue";
|
import tool from "@/pages/tabbar/user/utils/tool.vue";
|
||||||
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
|
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
|
||||||
import { getUserInfo, getUserWallet } from "@/api/members";
|
import { getUserWallet } from "@/api/members";
|
||||||
let startY = 0,
|
let startY = 0,
|
||||||
moveY = 0,
|
moveY = 0,
|
||||||
pageAtTop = true;
|
pageAtTop = true;
|
||||||
@@ -203,42 +196,19 @@ body {
|
|||||||
}
|
}
|
||||||
.money {
|
.money {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.uiconRed {
|
|
||||||
position: relative;
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
background: red;
|
|
||||||
width: 10rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.user {
|
.user {
|
||||||
.status_WEIXIN {
|
|
||||||
background: $light-color;
|
|
||||||
overflow: hidden;
|
|
||||||
> .status_WEIXIN_R {
|
|
||||||
float: right;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
|
||||||
> .status_WEIXIN_L {
|
|
||||||
float: left;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.header {
|
.header {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: calc(50rpx + var(--status-bar-height)) 30rpx 0 115rpx;
|
padding: calc(50rpx + var(--status-bar-height)) 30rpx 0 6%;
|
||||||
height: calc(var(--status-bar-height) + 360rpx);
|
height: calc(var(--status-bar-height) + 360rpx);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
border-bottom-left-radius: 20rpx;
|
border-bottom-left-radius: 30rpx;
|
||||||
border-bottom-right-radius: 20rpx;
|
border-bottom-right-radius: 30rpx;
|
||||||
background-image: url("/static/img/main-bg.png");
|
background-image: url("/static/img/main-bg.png");
|
||||||
background-position: bottom;
|
background-position: bottom;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
@@ -247,11 +217,12 @@ body {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.head-1 {
|
.head-1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 144rpx;
|
width: 152rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 40rpx;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
image {
|
image {
|
||||||
width: 144rpx;
|
width: 152rpx;
|
||||||
height: 144rpx;
|
height: 144rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
@@ -270,45 +241,35 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.certificate {
|
|
||||||
font-size: 20rpx;
|
|
||||||
border: 1px solid #ffffff;
|
|
||||||
border-radius: 1em;
|
|
||||||
width: 91rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.head-2 {
|
.head-2 {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
line-height: 2em;
|
margin-top: 100rpx;
|
||||||
margin-top: 60rpx;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
/deep/ .u-icon,
|
||||||
.u-icon {
|
.u-icon {
|
||||||
margin-top: -120rpx;
|
margin-top: 106rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.pointBox {
|
.pointBox {
|
||||||
transform: translateY(-30rpx);
|
|
||||||
width: 94%;
|
width: 94%;
|
||||||
margin: 0 3%;
|
margin: 0 3%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 0.4em;
|
border-radius: 20rpx;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
|
||||||
height: 160rpx;
|
|
||||||
}
|
}
|
||||||
.point {
|
.point {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
border-bottom: 1px solid $border-color-light;
|
|
||||||
color: #999;
|
|
||||||
font-size: $font-sm;
|
font-size: $font-sm;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
padding: 24rpx;
|
padding: 24rpx;
|
||||||
// #endif
|
// #endif
|
||||||
.u-col {
|
.u-col {
|
||||||
line-height: 1.5em view {
|
view {
|
||||||
color: $u-main-color;
|
color: $u-main-color;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
@@ -336,29 +297,17 @@ body {
|
|||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
.corner {
|
|
||||||
position: absolute;
|
|
||||||
right: 14rpx;
|
|
||||||
top: -6rpx;
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
background-color: red;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 50%;
|
|
||||||
line-height: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
transform: translateY(-30rpx);
|
||||||
|
}
|
||||||
.user-name {
|
.user-name {
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nickname {
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bag {
|
.bag {
|
||||||
width: 56rpx;
|
width: 56rpx;
|
||||||
height: 56rpx;
|
height: 56rpx;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 常用工具 -->
|
<!-- 常用工具 -->
|
||||||
<view class="interact-tools" style="margin-bottom: 15px">
|
<view class="interact-tools" style="margin-bottom: 15px">
|
||||||
<view class="interact-title">常用工具</view>
|
|
||||||
<div class="paddingBox">
|
<div class="paddingBox">
|
||||||
<view class="interact-container">
|
<view class="interact-container">
|
||||||
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
|
<view class="interact-item" @click="navigateTo('/pages/mine/signIn')">
|
||||||
@@ -73,15 +73,20 @@ export default {
|
|||||||
distribution().then((res) => {
|
distribution().then((res) => {
|
||||||
if (res.data.result) {
|
if (res.data.result) {
|
||||||
let type = res.data.result.distributionStatus;
|
let type = res.data.result.distributionStatus;
|
||||||
|
|
||||||
if (type == "PASS") {
|
if (type == "PASS") {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/mine/distribution/home",
|
url: "/pages/mine/distribution/home",
|
||||||
});
|
});
|
||||||
} else if (type == "RETREAT" || type == "REFUSE") {
|
} else if (type == "REFUSE") {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/mine/distribution/auth",
|
url: "/pages/mine/distribution/auth",
|
||||||
});
|
});
|
||||||
|
} else if (type == "RETREAT") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "您的分销资格已被清退。请联系管理员!",
|
||||||
|
duration: 2000,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "您的信息正在审核",
|
title: "您的信息正在审核",
|
||||||
@@ -91,7 +96,7 @@ export default {
|
|||||||
}
|
}
|
||||||
} else if (!res.data.success && res.data.code == 22000) {
|
} else if (!res.data.success && res.data.code == 22000) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '分销功能暂未开启',
|
title: "分销功能暂未开启",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
@@ -111,25 +116,16 @@ export default {
|
|||||||
.interact-tools {
|
.interact-tools {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
margin-top: 30rpx;
|
|
||||||
.interact-title {
|
|
||||||
background: #f2f2f2;
|
|
||||||
height: 96rpx;
|
|
||||||
line-height: 96rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
font-weight: bold;
|
|
||||||
padding-left: 30rpx;
|
|
||||||
margin: 0 20rpx;
|
|
||||||
border-radius: 14rpx 14rpx 0 0;
|
|
||||||
}
|
|
||||||
.interactBox {
|
.interactBox {
|
||||||
height: 156rpx;
|
height: 156rpx;
|
||||||
}
|
}
|
||||||
.interact-container {
|
.interact-container {
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 0 0 14rpx 14rpx;
|
border-radius: 20rpx;
|
||||||
|
box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1);
|
||||||
.interact-item-img {
|
.interact-item-img {
|
||||||
width: 52rpx !important;
|
width: 52rpx !important;
|
||||||
height: 52rpx !important;
|
height: 52rpx !important;
|
||||||
|
|||||||
@@ -2,57 +2,51 @@
|
|||||||
/**** 此文件说明请看注释 *****/
|
/**** 此文件说明请看注释 *****/
|
||||||
// 可以用自己项目的请求方法
|
// 可以用自己项目的请求方法
|
||||||
// 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822
|
// 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822
|
||||||
import http from '@/utils/request.js';
|
import { getAppVersion } from "@/api/message.js";
|
||||||
/**** 结束 *****/
|
|
||||||
import {
|
|
||||||
getAppVersionList
|
|
||||||
} from '@/api/message.js'
|
|
||||||
|
|
||||||
const platform = uni.getSystemInfoSync().platform;
|
const platform = uni.getSystemInfoSync().platform;
|
||||||
// 主颜色
|
// 主颜色
|
||||||
const $mainColor = "#1ABC9C";
|
const $mainColor = "#1ABC9C";
|
||||||
// 弹窗图标url
|
// 弹窗图标url
|
||||||
const $iconUrl = "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/app/upgrade.png";
|
const $iconUrl =
|
||||||
|
"https://lilishop-oss.oss-cn-beijing.aliyuncs.com/app/upgrade.png";
|
||||||
|
|
||||||
// 获取当前应用的版本号
|
// 获取当前应用的版本号
|
||||||
export const getCurrentNo = function (callback) {
|
export const getCurrentNo = function (callback) {
|
||||||
// 获取本地应用资源版本号
|
// 获取本地应用资源版本号
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
||||||
|
callback &&
|
||||||
callback && callback({
|
callback({
|
||||||
versionCode: inf.version.replace(/\./g, ""),
|
versionCode: inf.version.replace(/\./g, ""),
|
||||||
version: inf.version
|
version: inf.version,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 发起ajax请求获取服务端版本号
|
// 发起ajax请求获取服务端版本号
|
||||||
export const getServerNo = function (callback) {
|
export const getServerNo = function (callback) {
|
||||||
let type;
|
let type;
|
||||||
|
|
||||||
platform == "android" ? type = "ANDROID" : type = "IOS"
|
platform == "android" ? (type = "ANDROID") : (type = "IOS");
|
||||||
|
|
||||||
getAppVersionList(type).then(res => {
|
getAppVersion(type).then((res) => {
|
||||||
|
if (res.data.success && res.data.result.downloadUrl) {
|
||||||
if(res.data.success && res.data.result.downloadUrl){
|
let response = res.data.result;
|
||||||
let response = res.data.result
|
let result = {};
|
||||||
let result ={}
|
|
||||||
result.versionCode = response.version;
|
result.versionCode = response.version;
|
||||||
result.versionName = response.versionName;
|
result.versionName = response.versionName;
|
||||||
result.versionInfo = response.content || '暂无';
|
result.versionInfo = response.content || "暂无";
|
||||||
result.forceUpdate = response.forceUpdate;
|
result.forceUpdate = response.forceUpdate;
|
||||||
result.downloadUrl = response.downloadUrl;
|
result.downloadUrl = response.downloadUrl;
|
||||||
|
|
||||||
console.log(result,response)
|
|
||||||
callback && callback(result);
|
callback && callback(result);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
};
|
||||||
}
|
|
||||||
// 从服务器下载应用资源包(wgt文件)
|
// 从服务器下载应用资源包(wgt文件)
|
||||||
export const getDownload = function (data) {
|
export const getDownload = function (data) {
|
||||||
let popupData = {
|
let popupData = {
|
||||||
progress: true,
|
progress: true,
|
||||||
buttonNum: 2
|
buttonNum: 2,
|
||||||
};
|
};
|
||||||
if (data.forceUpdate) {
|
if (data.forceUpdate) {
|
||||||
popupData.buttonNum = 0;
|
popupData.buttonNum = 0;
|
||||||
@@ -60,35 +54,48 @@ export const getDownload = function (data) {
|
|||||||
}
|
}
|
||||||
let dtask;
|
let dtask;
|
||||||
let lastProgressValue = 0;
|
let lastProgressValue = 0;
|
||||||
downloadPopup(popupData, function (res) {
|
downloadPopup(
|
||||||
dtask = plus.downloader.createDownload(data.downloadUrl, {
|
popupData,
|
||||||
filename: "_doc/update/"
|
function (res) {
|
||||||
}, function (download, status) {
|
dtask = plus.downloader.createDownload(
|
||||||
|
data.downloadUrl,
|
||||||
|
{
|
||||||
|
filename: "_doc/update/",
|
||||||
|
},
|
||||||
|
function (download, status) {
|
||||||
if (status == 200) {
|
if (status == 200) {
|
||||||
res.change({
|
res.change({
|
||||||
progressValue: 100,
|
progressValue: 100,
|
||||||
progressTip: "正在安装文件...",
|
progressTip: "正在安装文件...",
|
||||||
progress: true,
|
progress: true,
|
||||||
buttonNum: 0
|
buttonNum: 0,
|
||||||
});
|
});
|
||||||
plus.runtime.install(download.filename, {}, function () {
|
plus.runtime.install(
|
||||||
|
download.filename,
|
||||||
|
{},
|
||||||
|
function () {
|
||||||
res.change({
|
res.change({
|
||||||
contentText: "应用资源更新完成!",
|
contentText: "应用资源更新完成!",
|
||||||
buttonNum: 1,
|
buttonNum: 1,
|
||||||
progress: false
|
progress: false,
|
||||||
});
|
});
|
||||||
}, function (e) {
|
},
|
||||||
|
function (e) {
|
||||||
res.cancel();
|
res.cancel();
|
||||||
plus.nativeUI.alert("安装文件失败[" + e.code + "]:" + e.message);
|
plus.nativeUI.alert(
|
||||||
});
|
"安装文件失败[" + e.code + "]:" + e.message
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
res.change({
|
res.change({
|
||||||
contentText: "文件下载失败...",
|
contentText: "文件下载失败...",
|
||||||
buttonNum: 1,
|
buttonNum: 1,
|
||||||
progress: false
|
progress: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
dtask.start();
|
dtask.start();
|
||||||
dtask.addEventListener("statechanged", function (task, status) {
|
dtask.addEventListener("statechanged", function (task, status) {
|
||||||
switch (task.state) {
|
switch (task.state) {
|
||||||
@@ -96,42 +103,46 @@ export const getDownload = function (data) {
|
|||||||
res.change({
|
res.change({
|
||||||
progressValue: 0,
|
progressValue: 0,
|
||||||
progressTip: "准备下载...",
|
progressTip: "准备下载...",
|
||||||
progress: true
|
progress: true,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 2: // 已连接到服务器
|
case 2: // 已连接到服务器
|
||||||
res.change({
|
res.change({
|
||||||
progressValue: 0,
|
progressValue: 0,
|
||||||
progressTip: "开始下载...",
|
progressTip: "开始下载...",
|
||||||
progress: true
|
progress: true,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
const progress = parseInt(task.downloadedSize / task.totalSize * 100);
|
const progress = parseInt(
|
||||||
|
(task.downloadedSize / task.totalSize) * 100
|
||||||
|
);
|
||||||
if (progress - lastProgressValue >= 2) {
|
if (progress - lastProgressValue >= 2) {
|
||||||
lastProgressValue = progress;
|
lastProgressValue = progress;
|
||||||
res.change({
|
res.change({
|
||||||
progressValue: progress,
|
progressValue: progress,
|
||||||
progressTip: "已下载" + progress + "%",
|
progressTip: "已下载" + progress + "%",
|
||||||
progress: true
|
progress: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, function () {
|
},
|
||||||
|
function () {
|
||||||
// 取消下载
|
// 取消下载
|
||||||
dtask && dtask.abort();
|
dtask && dtask.abort();
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "已取消下载",
|
title: "已取消下载",
|
||||||
icon: "none"
|
icon: "none",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
// 重启APP
|
// 重启APP
|
||||||
plus.runtime.restart();
|
plus.runtime.restart();
|
||||||
});
|
}
|
||||||
}
|
);
|
||||||
|
};
|
||||||
// 文字换行
|
// 文字换行
|
||||||
function drawtext(text, maxWidth) {
|
function drawtext(text, maxWidth) {
|
||||||
let textArr = text.split("");
|
let textArr = text.split("");
|
||||||
@@ -144,8 +155,6 @@ function drawtext(text, maxWidth) {
|
|||||||
// 文本换行数组
|
// 文本换行数组
|
||||||
let rowText = [];
|
let rowText = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 如果是字母,侧保存长度
|
// 如果是字母,侧保存长度
|
||||||
let letterWidth = 0;
|
let letterWidth = 0;
|
||||||
// 汉字宽度
|
// 汉字宽度
|
||||||
@@ -158,7 +167,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth) {
|
if (nodeWidth + chineseWidth + letterWidth * otherWidth > maxWidth) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
content: text.substring(previousNode, i)
|
content: text.substring(previousNode, i),
|
||||||
});
|
});
|
||||||
previousNode = i;
|
previousNode = i;
|
||||||
nodeWidth = chineseWidth;
|
nodeWidth = chineseWidth;
|
||||||
@@ -171,7 +180,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (nodeWidth + chineseWidth > maxWidth) {
|
if (nodeWidth + chineseWidth > maxWidth) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
content: text.substring(previousNode, i)
|
content: text.substring(previousNode, i),
|
||||||
});
|
});
|
||||||
previousNode = i;
|
previousNode = i;
|
||||||
nodeWidth = chineseWidth;
|
nodeWidth = chineseWidth;
|
||||||
@@ -183,7 +192,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (/\n/g.test(textArr[i])) {
|
if (/\n/g.test(textArr[i])) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "break",
|
type: "break",
|
||||||
content: text.substring(previousNode, i)
|
content: text.substring(previousNode, i),
|
||||||
});
|
});
|
||||||
previousNode = i + 1;
|
previousNode = i + 1;
|
||||||
nodeWidth = 0;
|
nodeWidth = 0;
|
||||||
@@ -191,7 +200,7 @@ function drawtext(text, maxWidth) {
|
|||||||
} else if (textArr[i] == "\\" && textArr[i + 1] == "n") {
|
} else if (textArr[i] == "\\" && textArr[i + 1] == "n") {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "break",
|
type: "break",
|
||||||
content: text.substring(previousNode, i)
|
content: text.substring(previousNode, i),
|
||||||
});
|
});
|
||||||
previousNode = i + 2;
|
previousNode = i + 2;
|
||||||
nodeWidth = 0;
|
nodeWidth = 0;
|
||||||
@@ -201,7 +210,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (nodeWidth + letterWidth * otherWidth > maxWidth) {
|
if (nodeWidth + letterWidth * otherWidth > maxWidth) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
content: text.substring(previousNode, i + 1 - letterWidth)
|
content: text.substring(previousNode, i + 1 - letterWidth),
|
||||||
});
|
});
|
||||||
previousNode = i + 1 - letterWidth;
|
previousNode = i + 1 - letterWidth;
|
||||||
nodeWidth = letterWidth * otherWidth;
|
nodeWidth = letterWidth * otherWidth;
|
||||||
@@ -211,7 +220,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (nodeWidth + otherWidth > maxWidth) {
|
if (nodeWidth + otherWidth > maxWidth) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
content: text.substring(previousNode, i)
|
content: text.substring(previousNode, i),
|
||||||
});
|
});
|
||||||
previousNode = i;
|
previousNode = i;
|
||||||
nodeWidth = otherWidth;
|
nodeWidth = otherWidth;
|
||||||
@@ -224,7 +233,7 @@ function drawtext(text, maxWidth) {
|
|||||||
if (previousNode < len) {
|
if (previousNode < len) {
|
||||||
rowText.push({
|
rowText.push({
|
||||||
type: "text",
|
type: "text",
|
||||||
content: text.substring(previousNode, len)
|
content: text.substring(previousNode, len),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,12 +242,13 @@ function drawtext(text, maxWidth) {
|
|||||||
// 是否更新弹窗
|
// 是否更新弹窗
|
||||||
function updatePopup(data, callback) {
|
function updatePopup(data, callback) {
|
||||||
// 弹窗遮罩层
|
// 弹窗遮罩层
|
||||||
let maskLayer = new plus.nativeObj.View("maskLayer", { //先创建遮罩层
|
let maskLayer = new plus.nativeObj.View("maskLayer", {
|
||||||
top: '0px',
|
//先创建遮罩层
|
||||||
left: '0px',
|
top: "0px",
|
||||||
height: '100%',
|
left: "0px",
|
||||||
width: '100%',
|
height: "100%",
|
||||||
backgroundColor: 'rgba(0,0,0,0.5)'
|
width: "100%",
|
||||||
|
backgroundColor: "rgba(0,0,0,0.5)",
|
||||||
});
|
});
|
||||||
let downloadUrl = data.downloadUrl;
|
let downloadUrl = data.downloadUrl;
|
||||||
// 以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
|
// 以下为计算菜单的nview绘制布局,为固定算法,使用者无关关心
|
||||||
@@ -249,87 +259,91 @@ function updatePopup(data, callback) {
|
|||||||
// 弹窗容器的Padding
|
// 弹窗容器的Padding
|
||||||
const viewContentPadding = 20;
|
const viewContentPadding = 20;
|
||||||
// 弹窗容器的宽度
|
// 弹窗容器的宽度
|
||||||
const viewContentWidth = parseInt(popupViewWidth - (viewContentPadding * 5));
|
const viewContentWidth = parseInt(popupViewWidth - viewContentPadding * 5);
|
||||||
// 描述的列表
|
// 描述的列表
|
||||||
const descriptionList = drawtext(data.versionInfo, viewContentWidth);
|
const descriptionList = drawtext(data.versionInfo, viewContentWidth);
|
||||||
|
|
||||||
// 弹窗容器高度
|
// 弹窗容器高度
|
||||||
let popupViewHeight = 400;
|
let popupViewHeight = 400;
|
||||||
let popupViewContentList = [{
|
let popupViewContentList = [
|
||||||
|
{
|
||||||
src: $iconUrl,
|
src: $iconUrl,
|
||||||
id: "logo",
|
id: "logo",
|
||||||
tag: "img"
|
tag: "img",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'title',
|
id: "title",
|
||||||
text: 'V' + data.versionCode,
|
text: "V" + data.versionCode,
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '26px',
|
size: "26px",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
weight: "700"
|
weight: "700",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: '60px',
|
top: "60px",
|
||||||
left: "64px",
|
left: "64px",
|
||||||
height: "20px",
|
height: "20px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'welcome',
|
id: "welcome",
|
||||||
text: '欢迎体验',
|
text: "欢迎体验",
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '16px',
|
size: "16px",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
weight: "400"
|
weight: "400",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: '85px',
|
top: "85px",
|
||||||
left: "64px",
|
left: "64px",
|
||||||
height: "20px",
|
height: "20px",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
const textHeight = 18;
|
const textHeight = 18;
|
||||||
let contentTop = popupViewHeight / 2 + 8;
|
let contentTop = popupViewHeight / 2 + 16;
|
||||||
|
|
||||||
popupViewContentList.push({
|
popupViewContentList.push({
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'content-title',
|
id: "content-title",
|
||||||
text: '新版本特性:',
|
text: "新版本特性:",
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '20px',
|
size: "20px",
|
||||||
lineSpacing: "50%",
|
lineSpacing: "50%",
|
||||||
align: "left"
|
align: "left",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: (popupViewHeight / 2) - 24 + "px",
|
top: popupViewHeight / 2 - 24 + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: viewContentWidth + "px",
|
width: viewContentWidth + "px",
|
||||||
height: textHeight + "px",
|
height: textHeight + "px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
descriptionList.forEach((item, index) => {
|
descriptionList.forEach((item, index) => {
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
popupViewHeight += textHeight;
|
popupViewHeight += textHeight;
|
||||||
contentTop += textHeight;
|
contentTop += textHeight;
|
||||||
}
|
}
|
||||||
let content = item.content.replace('<p>', '<font>');
|
|
||||||
content = content.replace('</p>', '</font>');
|
|
||||||
|
|
||||||
popupViewContentList.push({
|
popupViewContentList.push({
|
||||||
tag: 'richtext',
|
tag: "font",
|
||||||
id: 'content' + index + 1,
|
id: "content" + index + 1,
|
||||||
text: content,
|
text: item.content,
|
||||||
richTextStyles: {
|
|
||||||
align: "left"
|
textStyles: {
|
||||||
|
size: "14px",
|
||||||
|
color: "#666",
|
||||||
|
lineSpacing: "50%",
|
||||||
|
align: "left",
|
||||||
},
|
},
|
||||||
|
|
||||||
position: {
|
position: {
|
||||||
top: contentTop + "px",
|
top: contentTop + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: viewContentWidth + "px",
|
width: viewContentWidth + "px",
|
||||||
height: textHeight + "px",
|
height: textHeight + "px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
if (item.type == "break") {
|
if (item.type == "break") {
|
||||||
contentTop += 10;
|
contentTop += 10;
|
||||||
@@ -337,73 +351,86 @@ function updatePopup(data, callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 弹窗内容
|
// 弹窗内容
|
||||||
let popupView = new plus.nativeObj.View("popupView", { //创建底部图标菜单
|
let popupView = new plus.nativeObj.View("popupView", {
|
||||||
|
//创建底部图标菜单
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
top: (screenHeight - popupViewHeight) / 2 + "px",
|
top: (screenHeight - popupViewHeight) / 2 + "px",
|
||||||
left: '10%',
|
left: "10%",
|
||||||
height: popupViewHeight + "px",
|
height: popupViewHeight + "px",
|
||||||
width: "80%"
|
width: "80%",
|
||||||
});
|
});
|
||||||
// 绘制白色背景
|
// 绘制白色背景
|
||||||
popupView.drawRect({
|
popupView.drawRect(
|
||||||
|
{
|
||||||
color: "#FFFFFF",
|
color: "#FFFFFF",
|
||||||
radius: "8px"
|
radius: "8px",
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
top: "40px",
|
top: "40px",
|
||||||
height: popupViewHeight - 40 + "px",
|
height: popupViewHeight - 40 + "px",
|
||||||
});
|
}
|
||||||
|
);
|
||||||
// 绘制底边按钮
|
// 绘制底边按钮
|
||||||
popupView.drawRect({
|
popupView.drawRect(
|
||||||
|
{
|
||||||
radius: "3px",
|
radius: "3px",
|
||||||
borderColor: "#f1f1f1",
|
borderColor: "#f1f1f1",
|
||||||
borderWidth: "1px",
|
borderWidth: "1px",
|
||||||
}, {
|
},
|
||||||
bottom: viewContentPadding + 'px',
|
{
|
||||||
|
bottom: viewContentPadding + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
});
|
}
|
||||||
|
);
|
||||||
// 绘制底边按钮
|
// 绘制底边按钮
|
||||||
popupView.drawRect({
|
popupView.drawRect(
|
||||||
|
{
|
||||||
radius: "3px",
|
radius: "3px",
|
||||||
color: $mainColor,
|
color: $mainColor,
|
||||||
borderColor: $mainColor
|
borderColor: $mainColor,
|
||||||
}, {
|
},
|
||||||
bottom: viewContentPadding + 'px',
|
{
|
||||||
left: ((viewContentWidth - viewContentPadding) / 2 + viewContentPadding * 2) + "px",
|
bottom: viewContentPadding + "px",
|
||||||
|
left:
|
||||||
|
(viewContentWidth - viewContentPadding) / 2 +
|
||||||
|
viewContentPadding * 2 +
|
||||||
|
"px",
|
||||||
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
width: (viewContentWidth - viewContentPadding) / 2 + "px",
|
||||||
height: "30px"
|
height: "30px",
|
||||||
});
|
}
|
||||||
|
);
|
||||||
popupViewContentList.push({
|
popupViewContentList.push({
|
||||||
tag: 'rect',
|
tag: "rect",
|
||||||
id: 'confimBtn',
|
id: "confimBtn",
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
color: $mainColor,
|
color: $mainColor,
|
||||||
radius: "3px"
|
radius: "3px",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
bottom: viewContentPadding + 'px',
|
bottom: viewContentPadding + "px",
|
||||||
left: (viewContentWidth - viewContentPadding) / 3 + "px",
|
left: (viewContentWidth - viewContentPadding) / 3 + "px",
|
||||||
width: (viewContentWidth - viewContentPadding) + "px",
|
width: viewContentWidth - viewContentPadding + "px",
|
||||||
height: "40px",
|
height: "40px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
popupViewContentList.push({
|
popupViewContentList.push({
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'confirmText',
|
id: "confirmText",
|
||||||
text: "立即更新",
|
text: "立即更新",
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '18px',
|
size: "18px",
|
||||||
color: '#fff',
|
color: "#fff",
|
||||||
lineSpacing: "0%",
|
lineSpacing: "0%",
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
bottom: viewContentPadding + 'px',
|
bottom: viewContentPadding + "px",
|
||||||
left: (viewContentWidth - viewContentPadding) / 3 + "px",
|
left: (viewContentWidth - viewContentPadding) / 3 + "px",
|
||||||
width: (viewContentWidth - viewContentPadding) + "px",
|
width: viewContentWidth - viewContentPadding + "px",
|
||||||
height: "40px",
|
height: "40px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
popupView.draw(popupViewContentList);
|
popupView.draw(popupViewContentList);
|
||||||
popupView.addEventListener("click", function (e) {
|
popupView.addEventListener("click", function (e) {
|
||||||
@@ -412,7 +439,10 @@ function updatePopup(data, callback) {
|
|||||||
let buttonWidth = (viewContentWidth - viewContentPadding) / 2;
|
let buttonWidth = (viewContentWidth - viewContentPadding) / 2;
|
||||||
if (e.clientY > maxTop - 30 && e.clientY < maxTop) {
|
if (e.clientY > maxTop - 30 && e.clientY < maxTop) {
|
||||||
// 暂不升级
|
// 暂不升级
|
||||||
if (e.clientX > viewContentPadding && e.clientX < maxLeft - buttonWidth - viewContentPadding) {
|
if (
|
||||||
|
e.clientX > viewContentPadding &&
|
||||||
|
e.clientX < maxLeft - buttonWidth - viewContentPadding
|
||||||
|
) {
|
||||||
// 立即升级
|
// 立即升级
|
||||||
if (platform == "android") {
|
if (platform == "android") {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
@@ -438,12 +468,12 @@ function updatePopup(data, callback) {
|
|||||||
}
|
}
|
||||||
plus.runtime.openURL(downloadUrl);
|
plus.runtime.openURL(downloadUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 点击遮罩层
|
// 点击遮罩层
|
||||||
maskLayer.addEventListener("click", function () { //处理遮罩层点击
|
maskLayer.addEventListener("click", function () {
|
||||||
|
//处理遮罩层点击
|
||||||
if (!data.forceUpdate) {
|
if (!data.forceUpdate) {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
popupView.hide();
|
popupView.hide();
|
||||||
@@ -463,81 +493,83 @@ function downloadPopupDrawing(data) {
|
|||||||
// 弹窗容器的Padding
|
// 弹窗容器的Padding
|
||||||
const viewContentPadding = 20;
|
const viewContentPadding = 20;
|
||||||
// 弹窗容器的宽度
|
// 弹窗容器的宽度
|
||||||
const viewContentWidth = popupViewWidth - (viewContentPadding * 2);
|
const viewContentWidth = popupViewWidth - viewContentPadding * 2;
|
||||||
// 弹窗容器高度
|
// 弹窗容器高度
|
||||||
let popupViewHeight = viewContentPadding * 3 + 60;
|
let popupViewHeight = viewContentPadding * 3 + 60;
|
||||||
let progressTip = data.progressTip || "准备下载...";
|
let progressTip = data.progressTip || "准备下载...";
|
||||||
let contentText = data.contentText || "正在为您更新,请耐心等待";
|
let contentText = data.contentText || "正在为您更新,请耐心等待";
|
||||||
let elementList = [{
|
let elementList = [
|
||||||
tag: 'rect', //背景色
|
{
|
||||||
color: '#FFFFFF',
|
tag: "rect", //背景色
|
||||||
|
color: "#FFFFFF",
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
radius: "8px"
|
radius: "8px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'title',
|
id: "title",
|
||||||
text: "升级APP",
|
text: "升级APP",
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '16px',
|
size: "16px",
|
||||||
color: "#333",
|
color: "#333",
|
||||||
weight: "bold",
|
weight: "bold",
|
||||||
verticalAlign: "middle",
|
verticalAlign: "middle",
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: viewContentPadding + 'px',
|
top: viewContentPadding + "px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'content',
|
id: "content",
|
||||||
text: contentText,
|
text: contentText,
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '14px',
|
size: "14px",
|
||||||
color: "#333",
|
color: "#333",
|
||||||
verticalAlign: "middle",
|
verticalAlign: "middle",
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: viewContentPadding * 2 + 30 + 'px',
|
top: viewContentPadding * 2 + 30 + "px",
|
||||||
height: "20px",
|
height: "20px",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
// 是否有进度条
|
// 是否有进度条
|
||||||
if (data.progress) {
|
if (data.progress) {
|
||||||
popupViewHeight += viewContentPadding + 40;
|
popupViewHeight += viewContentPadding + 40;
|
||||||
elementList = elementList.concat([{
|
elementList = elementList.concat([
|
||||||
tag: 'font',
|
{
|
||||||
id: 'progressValue',
|
tag: "font",
|
||||||
|
id: "progressValue",
|
||||||
text: progressTip,
|
text: progressTip,
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '14px',
|
size: "14px",
|
||||||
color: $mainColor,
|
color: $mainColor,
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: viewContentPadding * 4 + 20 + 'px',
|
top: viewContentPadding * 4 + 20 + "px",
|
||||||
height: "30px"
|
height: "30px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'rect', //绘制进度条背景
|
tag: "rect", //绘制进度条背景
|
||||||
id: 'progressBg',
|
id: "progressBg",
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
radius: "4px",
|
radius: "4px",
|
||||||
borderColor: "#f1f1f1",
|
borderColor: "#f1f1f1",
|
||||||
borderWidth: "1px",
|
borderWidth: "1px",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: viewContentPadding * 4 + 60 + 'px',
|
top: viewContentPadding * 4 + 60 + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: viewContentWidth + "px",
|
width: viewContentWidth + "px",
|
||||||
height: "8px"
|
height: "8px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -605,39 +637,39 @@ function downloadPopupDrawing(data) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (data.buttonNum == 1) {
|
if (data.buttonNum == 1) {
|
||||||
popupViewHeight += viewContentPadding + 40;
|
popupViewHeight += viewContentPadding + 40;
|
||||||
elementList = elementList.concat([{
|
elementList = elementList.concat([
|
||||||
tag: 'rect', //绘制底边按钮
|
{
|
||||||
|
tag: "rect", //绘制底边按钮
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
radius: "6px",
|
radius: "6px",
|
||||||
color: $mainColor
|
color: $mainColor,
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
bottom: viewContentPadding + 'px',
|
bottom: viewContentPadding + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: viewContentWidth + "px",
|
width: viewContentWidth + "px",
|
||||||
height: "40px"
|
height: "40px",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'confirmText',
|
id: "confirmText",
|
||||||
text: "关闭",
|
text: "关闭",
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '14px',
|
size: "14px",
|
||||||
color: "#FFF",
|
color: "#FFF",
|
||||||
lineSpacing: "0%",
|
lineSpacing: "0%",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
bottom: viewContentPadding + 'px',
|
bottom: viewContentPadding + "px",
|
||||||
left: viewContentPadding + "px",
|
left: viewContentPadding + "px",
|
||||||
width: viewContentWidth + "px",
|
width: viewContentWidth + "px",
|
||||||
height: "40px"
|
height: "40px",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@@ -646,25 +678,28 @@ function downloadPopupDrawing(data) {
|
|||||||
screenHeight: screenHeight,
|
screenHeight: screenHeight,
|
||||||
viewContentWidth: viewContentWidth,
|
viewContentWidth: viewContentWidth,
|
||||||
viewContentPadding: viewContentPadding,
|
viewContentPadding: viewContentPadding,
|
||||||
elementList: elementList
|
elementList: elementList,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// 文件下载的弹窗
|
// 文件下载的弹窗
|
||||||
function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
||||||
// 弹窗遮罩层
|
// 弹窗遮罩层
|
||||||
let maskLayer = new plus.nativeObj.View("maskLayer", { //先创建遮罩层
|
let maskLayer = new plus.nativeObj.View("maskLayer", {
|
||||||
top: '0px',
|
//先创建遮罩层
|
||||||
left: '0px',
|
top: "0px",
|
||||||
height: '100%',
|
left: "0px",
|
||||||
width: '100%',
|
height: "100%",
|
||||||
backgroundColor: 'rgba(0,0,0,0.5)'
|
width: "100%",
|
||||||
|
backgroundColor: "rgba(0,0,0,0.5)",
|
||||||
});
|
});
|
||||||
let popupViewData = downloadPopupDrawing(data);
|
let popupViewData = downloadPopupDrawing(data);
|
||||||
// 弹窗内容
|
// 弹窗内容
|
||||||
let popupView = new plus.nativeObj.View("popupView", { //创建底部图标菜单
|
let popupView = new plus.nativeObj.View("popupView", {
|
||||||
|
//创建底部图标菜单
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
top: (popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 + "px",
|
top:
|
||||||
left: '15%',
|
(popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 + "px",
|
||||||
|
left: "15%",
|
||||||
height: popupViewData.popupViewHeight + "px",
|
height: popupViewData.popupViewHeight + "px",
|
||||||
width: "70%",
|
width: "70%",
|
||||||
});
|
});
|
||||||
@@ -678,26 +713,35 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
}
|
}
|
||||||
popupView.draw(popupViewData.elementList);
|
popupView.draw(popupViewData.elementList);
|
||||||
popupView.addEventListener("click", function (e) {
|
popupView.addEventListener("click", function (e) {
|
||||||
let maxTop = popupViewData.popupViewHeight - popupViewData.viewContentPadding;
|
let maxTop =
|
||||||
let maxLeft = popupViewData.popupViewWidth - popupViewData.viewContentPadding;
|
popupViewData.popupViewHeight - popupViewData.viewContentPadding;
|
||||||
|
let maxLeft =
|
||||||
|
popupViewData.popupViewWidth - popupViewData.viewContentPadding;
|
||||||
if (e.clientY > maxTop - 40 && e.clientY < maxTop) {
|
if (e.clientY > maxTop - 40 && e.clientY < maxTop) {
|
||||||
if (buttonNum == 1) {
|
if (buttonNum == 1) {
|
||||||
// 单按钮
|
// 单按钮
|
||||||
if (e.clientX > popupViewData.viewContentPadding && e.clientX < maxLeft) {
|
if (
|
||||||
|
e.clientX > popupViewData.viewContentPadding &&
|
||||||
|
e.clientX < maxLeft
|
||||||
|
) {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
popupView.hide();
|
popupView.hide();
|
||||||
}
|
}
|
||||||
} else if (buttonNum == 2) {
|
} else if (buttonNum == 2) {
|
||||||
// 双按钮
|
// 双按钮
|
||||||
let buttonWidth = (popupViewData.viewContentWidth - popupViewData.viewContentPadding) / 2;
|
let buttonWidth =
|
||||||
if (e.clientX > popupViewData.viewContentPadding && e.clientX < maxLeft - buttonWidth - popupViewData.viewContentPadding) {
|
(popupViewData.viewContentWidth - popupViewData.viewContentPadding) /
|
||||||
|
2;
|
||||||
|
if (
|
||||||
|
e.clientX > popupViewData.viewContentPadding &&
|
||||||
|
e.clientX < maxLeft - buttonWidth - popupViewData.viewContentPadding
|
||||||
|
) {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
popupView.hide();
|
popupView.hide();
|
||||||
//cancelCallback && cancelCallback();
|
//cancelCallback && cancelCallback();
|
||||||
} else if (e.clientX > maxLeft - buttonWidth && e.clientX < maxLeft) {
|
} else if (e.clientX > maxLeft - buttonWidth && e.clientX < maxLeft) {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
popupView.hide();
|
popupView.hide();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -713,62 +757,68 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
progressValue = res.progressValue;
|
progressValue = res.progressValue;
|
||||||
// 绘制进度条
|
// 绘制进度条
|
||||||
progressElement.push({
|
progressElement.push({
|
||||||
tag: 'rect', //绘制进度条背景
|
tag: "rect", //绘制进度条背景
|
||||||
id: 'progressValueBg',
|
id: "progressValueBg",
|
||||||
rectStyles: {
|
rectStyles: {
|
||||||
radius: "4px",
|
radius: "4px",
|
||||||
color: $mainColor
|
color: $mainColor,
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: popupViewData.viewContentPadding * 4 + 60 + 'px',
|
top: popupViewData.viewContentPadding * 4 + 60 + "px",
|
||||||
left: popupViewData.viewContentPadding + "px",
|
left: popupViewData.viewContentPadding + "px",
|
||||||
width: popupViewData.viewContentWidth * (res.progressValue / 100) + "px",
|
width:
|
||||||
height: "8px"
|
popupViewData.viewContentWidth * (res.progressValue / 100) + "px",
|
||||||
}
|
height: "8px",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (res.progressTip) {
|
if (res.progressTip) {
|
||||||
progressTip = res.progressTip;
|
progressTip = res.progressTip;
|
||||||
progressElement.push({
|
progressElement.push({
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'progressValue',
|
id: "progressValue",
|
||||||
text: res.progressTip,
|
text: res.progressTip,
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '14px',
|
size: "14px",
|
||||||
color: $mainColor,
|
color: $mainColor,
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: popupViewData.viewContentPadding * 4 + 20 + 'px',
|
top: popupViewData.viewContentPadding * 4 + 20 + "px",
|
||||||
height: "30px"
|
height: "30px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (res.contentText) {
|
if (res.contentText) {
|
||||||
contentText = res.contentText;
|
contentText = res.contentText;
|
||||||
progressElement.push({
|
progressElement.push({
|
||||||
tag: 'font',
|
tag: "font",
|
||||||
id: 'content',
|
id: "content",
|
||||||
text: res.contentText,
|
text: res.contentText,
|
||||||
textStyles: {
|
textStyles: {
|
||||||
size: '16px',
|
size: "16px",
|
||||||
color: "#333",
|
color: "#333",
|
||||||
whiteSpace: "normal"
|
whiteSpace: "normal",
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
top: popupViewData.viewContentPadding * 2 + 30 + 'px',
|
top: popupViewData.viewContentPadding * 2 + 30 + "px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (res.buttonNum >= 0 && buttonNum != res.buttonNum) {
|
if (res.buttonNum >= 0 && buttonNum != res.buttonNum) {
|
||||||
buttonNum = res.buttonNum;
|
buttonNum = res.buttonNum;
|
||||||
popupView.reset();
|
popupView.reset();
|
||||||
popupViewData = downloadPopupDrawing(Object.assign({
|
popupViewData = downloadPopupDrawing(
|
||||||
|
Object.assign(
|
||||||
|
{
|
||||||
progressValue: progressValue,
|
progressValue: progressValue,
|
||||||
progressTip: progressTip,
|
progressTip: progressTip,
|
||||||
contentText: contentText,
|
contentText: contentText,
|
||||||
}, res));
|
},
|
||||||
|
res
|
||||||
|
)
|
||||||
|
);
|
||||||
let newElement = [];
|
let newElement = [];
|
||||||
popupViewData.elementList.map((item, index) => {
|
popupViewData.elementList.map((item, index) => {
|
||||||
let have = false;
|
let have = false;
|
||||||
@@ -784,8 +834,10 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
progressElement = newElement.concat(progressElement);
|
progressElement = newElement.concat(progressElement);
|
||||||
popupView.setStyle({
|
popupView.setStyle({
|
||||||
tag: "rect",
|
tag: "rect",
|
||||||
top: (popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 + "px",
|
top:
|
||||||
left: '15%',
|
(popupViewData.screenHeight - popupViewData.popupViewHeight) / 2 +
|
||||||
|
"px",
|
||||||
|
left: "15%",
|
||||||
height: popupViewData.popupViewHeight + "px",
|
height: popupViewData.popupViewHeight + "px",
|
||||||
width: "70%",
|
width: "70%",
|
||||||
});
|
});
|
||||||
@@ -797,14 +849,15 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
|
|||||||
cancel: function () {
|
cancel: function () {
|
||||||
maskLayer.hide();
|
maskLayer.hide();
|
||||||
popupView.hide();
|
popupView.hide();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export default function (isPrompt = false) {
|
export default function (isPrompt = false) {
|
||||||
getCurrentNo(version => {
|
getCurrentNo((version) => {
|
||||||
getServerNo( res => {
|
getServerNo((res) => {
|
||||||
|
if (res.versionCode.replace(/\./g, "") < version.versionCode) {
|
||||||
if( res.version.replace(/\./g, "") > version.versionCode){return false}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (res.forceUpdate) {
|
if (res.forceUpdate) {
|
||||||
if (/\.wgt$/i.test(res.downloadUrl)) {
|
if (/\.wgt$/i.test(res.downloadUrl)) {
|
||||||
@@ -817,7 +870,7 @@ export default function (isPrompt = false) {
|
|||||||
} else {
|
} else {
|
||||||
updatePopup(res, function () {
|
updatePopup(res, function () {
|
||||||
plus.runtime.openURL(res.downloadUrl);
|
plus.runtime.openURL(res.downloadUrl);
|
||||||
})
|
});
|
||||||
// uni.showLoading({
|
// uni.showLoading({
|
||||||
// title: "升级中......",
|
// title: "升级中......",
|
||||||
// mask: true
|
// mask: true
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1493289309071" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20064" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M282.692267 1002.530133c-4.369067 0-8.738133-1.672533-12.0832-4.983467-6.656-6.656-6.656-17.476267 0-24.132267l446.532267-446.532267L270.6432 80.349867c-6.656-6.656-6.656-17.476267 0-24.132267s17.476267-6.656 24.132267 0l458.615467 458.581333c3.208533 3.208533 4.983467 7.543467 4.983467 12.0832s-1.809067 8.874667-4.983467 12.0832L294.775467 997.546667C291.4304 1000.8576 287.061333 1002.530133 282.692267 1002.530133z" p-id="20065" fill="#ffffff"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 847 B |
|
Before Width: | Height: | Size: 634 B |
|
Before Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
BIN
static/emptyCart.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 489 B |