Commit 8fa0495e authored by 贾慧斌's avatar 贾慧斌

feat: 更新文件

parent 2ad0446d
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
node_modules/*
build/*
config/*
dist/*
lib/*
src/pages/product/goodDetail.vue
static/*
src/lib/*
src/libs/*
src/utils/mpConfig/sensorsdata.min.js
\ No newline at end of file
module.exports = {
root: true,
globals: {
uni: true,
wx: true,
getApp: true,
getCurrentPages: true,
__wxConfig: true,
Page: true
},
env: {
node: true,
browser: true
},
extends: [
"plugin:vue/essential",
"plugin:vue/recommended",
"eslint:recommended",
"@vue/prettier"
],
parserOptions: {
parser: "babel-eslint"
},
rules: {
"prettier/prettier": "error",
"vue/max-attributes-per-line": "off",
"vue/html-self-closing": [
"error",
{
html: {
void: "always",
normal: "always",
component: "always"
},
svg: "always",
math: "always"
}
],
"no-empty": ["error", { allowEmptyCatch: true }],
"vue/no-v-html": "off",
"vue/require-default-prop": "off",
"arrow-parens": "off", // allow paren-less arrow functions
"generator-star-spacing": "off", // allow async-await
"no-unused-vars": "error", // disabled no ununsed var
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", // no use debugger in production
indent: [2, 2, { SwitchCase: 1 }], // 2 space for tab for perttier
"space-before-function-paren": ["error", "never"] // no space in function name for perttier
}
};
// prettier.config.js or .prettierrc.js
module.exports = {
// printWidth: 100, // 设置prettier单行输出(不折行)的(最大)长度
// tabWidth: 2, // 设置工具每一个水平缩进的空格数
// semi: true, // 在语句末尾添加分号
singleQuote: false, // 使用单引号而非双引号
// arrowParens: 'avoid', // 为单行箭头函数的参数添加圆括号,参数个数为1时可以省略圆括号
// rangeStart: 0, // 只格式化某个文件的一部分
// rangeEnd: Infinity, // 只格式化某个文件的一部分
};
# my-project2
# wu-ui
## Project setup
```
yarn install
npm install
```
### Compiles and hot-reloads for development
```
yarn serve
npm run serve
```
### Compiles and minifies for production
```
yarn build
npm run build
```
### 注:api中须上报设备id的,请在接口配置加入reportDeviceId: true, 则会上报shumeiDeviceId,例:
```
// 领取优惠券
const pickupCoupon = params => {
return request.post(`${yxmGateway}/api/kdsp/coupon/pickup-batch`, params, {
reportDeviceId: true
});
};
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
const webpack = require('webpack')
const plugins = []
const plugins = [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining"
];
if (process.env.UNI_OPT_TREESHAKINGNG) {
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
plugins.push(
require("@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js")
);
}
if (
(
process.env.UNI_PLATFORM === 'app-plus' &&
process.env.UNI_USING_V8
) ||
(
process.env.UNI_PLATFORM === 'h5' &&
process.env.UNI_H5_BROWSER === 'builtin'
)
(process.env.UNI_PLATFORM === "app-plus" && process.env.UNI_USING_V8) ||
(process.env.UNI_PLATFORM === "h5" && process.env.UNI_H5_BROWSER === "builtin")
) {
const path = require('path')
const path = require("path");
const isWin = /^win/.test(process.platform)
const isWin = /^win/.test(process.platform);
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
const normalizePath = path => (isWin ? path.replace(/\\/g, "/") : path);
const input = normalizePath(process.env.UNI_INPUT_DIR)
const input = normalizePath(process.env.UNI_INPUT_DIR);
try {
plugins.push([
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
require("@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console"),
{
file (file) {
file = normalizePath(file)
file(file) {
file = normalizePath(file);
if (file.indexOf(input) === 0) {
return path.relative(input, file)
return path.relative(input, file);
}
return false
return false;
}
}
])
} catch (e) { }
]);
} catch (e) {}
}
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ["@dcloudio/uni-ui"];
process.UNI_LIBRARIES.forEach(libraryName => {
plugins.push([
'import',
"import",
{
'libraryName': libraryName,
'customName': (name) => {
return `${libraryName}/lib/${name}/${name}`
libraryName: libraryName,
customName: name => {
return `${libraryName}/lib/${name}/${name}`;
}
}
])
})
if (process.env.UNI_PLATFORM !== 'h5') {
plugins.push('@babel/plugin-transform-runtime')
}
const config = {
]);
});
module.exports = {
presets: [
[
'@vue/app',
"@vue/app",
{
modules: webpack.version[0] > 4 ? 'auto' : 'commonjs',
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
modules: "commonjs",
useBuiltIns: process.env.UNI_PLATFORM === "h5" ? "usage" : "entry"
}
]
],
plugins
}
const UNI_H5_TEST = '**/@dcloudio/uni-h5/dist/index.umd.min.js'
if (process.env.NODE_ENV === 'production') {
config.overrides = [{
test: UNI_H5_TEST,
compact: true,
}]
} else {
config.ignore = [UNI_H5_TEST]
}
module.exports = config
};
This diff is collapsed.
.good-del{
::v-deep .cancel .uni-dialog-button-text {
color: $font-color-search !important;
}
::v-deep .confirm .uni-dialog-button-text {
color: $font-color-base !important;
}
}
.shopping{
::v-deep .uni-swipe{
box-sizing: border-box;
// border-right: 1px solid #fff;
border-radius: $border-radius-base;
}
}
.good {
.good-footer-num{
::v-deep .uni-numbox{
width: 96px;
height: 24px;
}
::v-deep .uni-numbox__value{
font-size: 14px;
height: 24px;;
line-height: 24px;
width: 45px;
}
::v-deep .uni-numbox__minus, ::v-deep .uni-numbox__plus{
height: 24px;;
line-height: 24px;
width: 24px;
}
}
}
// 全局设置复选框样式
.global-radio {
.wx-checkbox-input {
width: 28rpx;
height: 28rpx;
}
}
.global-checkbox {
.wx-checkbox-input {
margin-top: 0;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
&.wx-checkbox-input-checked {
background: #ec1500;
border-color: #ec1500;
&::before {
width: 28rpx;
height: 28rpx;
line-height: 28rpx;
text-align: center;
font-size: 20rpx;
color: #fff;
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
}
}
}
.one-hide{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
\ No newline at end of file
// Color Palette
$black: #333333;
$white: #fff;
$gray-1: #f7f8fa;
$gray-2: #dcdcdc;
$gray-3: #c8c9cc;
$gray-4: #999999;
$gray-5: #666666;
$gray-6: #D8D8D8;
$red: #ec1500;
$red-light: #ec3333;
$red-dark: #ee0a24;
$orange: #faab0c;
$pink: #FFECE6;
$grey-border: #f2f3f5;
// Gradient Colors
$gradient-red: linear-gradient(269deg, #ff5d00 12%, #ff1900 86%);
$gradient-red-reverse: linear-gradient(270deg, #FF4B00 0%, #FF7705 100%);;
$gradient-pink: linear-gradient(180deg, #fff7f0 0%, #ffe4dc 100%);
// Component Colors
$text-color: $black;
$text-grey: $gray-4;
$active-opacity: 0.8;
$disabled-opacity: 0.7;
$background-color: $gray-1;
$line-height-sm: 32rpx;
$line-height-md: 44rpx;
$line-height-lg: 48rpx;
// Border
$border-width-base: 1rpx;
$border-radius-sm: 12rpx;
$border-radius-md: 16rpx;
$border-radius-lg: 32rpx;
$border-radius-lx: 40rpx;
$border-radius-max: 999rpx;
// Padding
$padding-unit: 8rpx;
$padding-xs: $padding-unit * 2;
$padding-sm: $padding-unit * 3;
$padding-md: $padding-unit * 4;
$padding-lg: $padding-unit * 5;
$padding-xl: $padding-unit * 8;
// Font
$font-size-list: 10, 11, 12, 13, 14, 16, 17, 18, 20, 26, 28, 30, 52;
@mixin text-size($f) {
$font: $f;
font-size: #{$font}rpx;
line-height: #{($font + 12)}rpx;
};
$font-weight-bold: 600;
$font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
// 页面内边距
$page-padding: $padding-sm;
$page-padding-lg: $padding-lg;
// ios底部防遮挡高度
$ios-bottom-height: 120rpx;
// 页面顶部header高度
$nav-bar-height: 96rpx;
// 多行...
@mixin mx_multline_overwrite($line: 2) {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: $line;
-webkit-box-orient: vertical;
}
module.exports = {
extends: ['@commitlint/config-angular'],
};
{
"compilerOptions": {
"types": [
"@dcloudio/types",
"miniprogram-api-typings",
"mini-types"
]
"target": "es2017",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"],
"~@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
This diff is collapsed.
This diff is collapsed.
const path = require('path')
const webpack = require('webpack')
const config = {
parser: require('postcss-comment'),
const path = require("path");
module.exports = {
parser: require("postcss-comment"),
plugins: [
require('postcss-import')({
resolve (id, basedir, importOptions) {
if (id.startsWith('~@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
} else if (id.startsWith('@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
} else if (id.startsWith('/') && !id.startsWith('//')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
require("postcss-import")({
resolve(id, basedir, importOptions) {
if (id.startsWith("~@/")) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3));
} else if (id.startsWith("@/")) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2));
} else if (id.startsWith("/") && !id.startsWith("//")) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1));
}
return id
return id;
}
}),
require('autoprefixer')({
remove: process.env.UNI_PLATFORM !== 'h5'
require("autoprefixer")({
remove: process.env.UNI_PLATFORM !== "h5"
}),
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
require("@dcloudio/vue-cli-plugin-uni/packages/postcss")
]
}
if (webpack.version[0] > 4) {
delete config.parser
}
module.exports = config
};
import request from "../utils/request";
import config from "@/config";
const { kdspApi } = config;
export default {
saveGDTVID(data) {
return request.post(`${kdspApi}/api/kdsp/minipro/setRedisClick`, data);
},
getGDTVID(data) {
return request.get(`${kdspApi}/api/kdsp/minipro/getRedisClick?wechatOpenId=${data}`);
},
uploadAdData(data) {
return request.post(`${kdspApi}/api/kdsp/minipro/addUserAction`, data);
},
createOrderRecord(data) {
return request.post(`${kdspApi}/api/kdsp/minipro/addClickRequest`, data);
}
};
import request from "../utils/request";
import config from "@/config";
const { yxmGateway } = config;
export default {
addProduct(data) {
return request.post(`${yxmGateway}/api/kdsp/shop-cart/add-update`, data);
}
};
import config from '@/config';
import http from '@/service/httpDecorator';
const { yxmGwHost } = config;
import request from "../utils/request";
import config from "@/config";
import { mpConfig } from "@/utils/mpConfig/types";
const { talosApi, yxmGateway } = config;
export default {
// 提现
cashOut(data) {
return request.get(`${talosApi}/vcc/xyqb/mineMini`, data);
},
// 物流信息
orderLogistics(data) {
// return request.get("http://yapi.quantgroups.com/mock/351/api/kdsp/logistics/packages-list");
return request.get(`${yxmGateway}/api/kdsp/logistics/packages-list`, data);
},
// 用户订单确认收货接口
orderConfirm(data) {
return request.post(`${yxmGateway}/api/kdsp/order-info/receipt/confirm`, data);
},
// 用户订单取消接口【未付款】
orderCancel(data) {
return request.post(`${yxmGateway}/api/kdsp/order-info/cancel`, data);
},
// 用户订单取消接口【已付款】
orderUnfilledCancel(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/unfilled/cancel`, data);
},
// 用户订单取消接口【已付款】
orderUnfilledCancelV2(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/unfilled/cancel/v2`, data);
},
// 订单取消原因查询接口
orderCancelList(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/cancel-reason/query`, data);
},
// 订单取消原因查询接口
orderCancelListV2(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/paid-cancel-props/query`, data, {
hideToast: true
});
},
// 已发货申请退款催办接口
orderRemindCancel(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/remindCancel`, data);
},
// 撤销取消订单申请
cancelRevoke(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/unfilled/cancel-revoke`, data);
},
// 取消/售后,获取是否需要签订合同
orderQueryNote(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/queryNote`, data);
},
// 订单详情查询接口
orderDetail(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/detail/query`, data);
},
// 用户订单列表查询接口
orderList(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/list/query`, data, {
hideLoading: true
});
},
// 获取信用钱包用户信息
xhkInfo(data) {
return request.get(`${yxmGateway}/api/kdsp/profile/vcc/user-account`, data);
},
// 我的 查询各状态订单数量
orderInfo(data) {
return request.get(`${yxmGateway}/api/kdsp/order-info/status-number`, data);
},
// 微信小程序登录
login(data) {
return request.post(`${yxmGateway}${mpConfig.loginUrl}`, data, {
emulateFormData: true
});
},
// 注册
register(data) {
// 登录接口添加utm_source
getCurrentPages().forEach(item => {
if (item.options?.utm_source) {
data.utm_source = item.options?.utm_source;
}
});
return request.post(`${yxmGateway}${mpConfig.registerUrl}`, data);
},
getAvatar(data) {
return request.post(`${yxmGateway}/api/kdsp/wx/mini-app/avatar`, data);
},
loadArea(id = "") {
return request.get(`${yxmGateway}/api/kdsp/addr/query?addrId=${id}`);
},
saveAddress(data) {
return http.post(`${yxmGwHost}/api/kdsp/addr/receiver/add_edit`, data);
return request.post(`${yxmGateway}/api/kdsp/addr/receiver/add_edit`, data);
},
getAddressList() {
return http.get(`${yxmGwHost}/api/kdsp/addr/receiver/list`);
return request.get(`${yxmGateway}/api/kdsp/addr/receiver/list`);
},
deleteAddress(addrReceiverId) {
return http.post(`${yxmGwHost}/api/kdsp/addr/receiver/delete`, {
return request.post(`${yxmGateway}/api/kdsp/addr/receiver/delete`, {
addrReceiverId
});
},
// 地址级联查询
zoneList: params => {
return http.get(`${yxmGwHost}/api/kdsp/addr/query?addrId=${params}`);
apiTest(data) {
return request.get(`${talosApi}/activity/commonly/free-goods/list`, data);
},
// 获取首页活动弹窗
getUserPopup() {
return request.get(
`${yxmGateway}/api/kdsp/app-config-push/profile/popup`,
{
page: "profile"
},
{
hideLoading: true
}
);
},
// 注销登录
logout(data) {
return request.post(`${yxmGateway}/api/kdsp/user/user-logged-off`, data);
},
// 退出登录
logoutUser(data) {
return request.post(`${yxmGateway}/api/kdsp/logout/user`, data);
}
};
import request from "../utils/request";
import config from "@/config";
const { yxmGateway } = config;
const submit = function(data) {
return request.post(`${yxmGateway}/api/kdsp/order-info/apply-refund`, data);
};
export { submit };
import config from '@/config';
import http from '@/service/httpDecorator';
import uiTrack from '@/service/sa.service';
import { dealSmDeviceId } from '@/service/shumei.service';
const { yxmGwHost } = config;
import request from "../utils/request";
import config from "@/config";
const { yxmGateway } = config;
export const getCouponList = async params => {
const scDeviceId = await uiTrack.run('saDeviceId');
return http.get(`${yxmGwHost}/api/kdsp/coupon/user-coupons`, {
params,
customHeader: {
scDeviceId
}
export const getCouponList = params => {
return request.get(`${yxmGateway}/api/kdsp/coupon/user-coupons`, params, {
hideLoading: true
});
};
export const getGiftCardList = data => {
return http.post(`${yxmGwHost}/api/kdsp/card/list`, data);
};
export const getGiftCardDetail = data => {
console.log(data);
return http.post(`${yxmGwHost}/api/kdsp/card/io`, data);
// // 我的礼品卡
export const getGiftCardList = function(data) {
return request.post(`${yxmGateway}/api/kdsp/card/list`, data, {
hideLoading: true
});
};
export const pickupCoupon = async data => {
const smDeviceId = (await dealSmDeviceId()) || '';
data.shumeiDeviceId = smDeviceId;
return http.post(`${yxmGwHost}/api/kdsp/coupon/pickup-batch`, data);
export const exchange = params => {
return request.post(`${yxmGateway}/api/kdsp/coupon/pickup-code`, params, {
reportDeviceId: true
});
};
export const pickupCouponBySkuNo = async data => {
const smDeviceId = (await dealSmDeviceId()) || '';
data.tongdunDeviceId = smDeviceId;
return http.post(`${yxmGwHost}/api/kdsp/coupon/skuInfoPickup`, data);
export const getCouponDesc = () => {
return request.get(`${yxmGateway}/api/kdsp/coupon/getDescriptionOfExchangeCode`);
};
import request from "../utils/request";
import config from "@/config";
const { vccHost, yxmGateway } = config;
// 查询活体认证url
const getFaceUrl = function(token, from, orderNo) {
const callBackUrl = orderNo
? vccHost + token + "&fromXcxPage=" + from + "&orderNo=" + orderNo
: vccHost + token + "&fromXcxPage=" + from;
return request.get(`${yxmGateway}/api/kdsp/face/h5/face-url`, {
callBackUrl: callBackUrl
});
};
// const getNextUrl = function() {
// return request.get(`${talosApi}/vcc/xyqb_mall/credit_url`);
// };
// const getNextUrlKa = function(data) {
// return request.get(`${yxmGateway}/api/kdsp/ka/process/get-next-url`, data);
// };
export { getFaceUrl };
This diff is collapsed.
import request from "../utils/request";
import config from "@/config";
const { yxmGateway } = config;
// 根据id查询优惠券列表
const couponList = function(data) {
return request.get(`${yxmGateway}/api/kdsp/coupon/h5-qb/list`, data);
};
// 用户领取优惠券接口-批量
const couponPickup = function(data) {
return request.post(`${yxmGateway}/api/kdsp/coupon/pickup-batch`, data, {
reportDeviceId: true
});
};
// 搜索接口_result
const searchGoodsList = function(data) {
return request.post(`${yxmGateway}/api/kdsp/search/result`, data);
};
// 用户领取优惠券状态查询
const searchCoupon = function(data) {
return request.get(`${yxmGateway}/api/kdsp/coupon/pickup-status`, data);
};
// KA流程节点
const kaGetNextUrl = function(data) {
let options = {
sonVccChannel: true
};
return request.get(`${yxmGateway}/api/kdsp/ka/process/get-next-url`, data, options);
};
// KA流程节点_查询流程是否走完
const kaFlow = function(data) {
let options = {
sonVccChannel: true
};
return request.get(`${yxmGateway}/api/kdsp/ka/process/get-status`, data, options);
};
// 流程节点_返回商品页面临时支持1个月(高价)
const lableInfoIdsExpensive = function(data) {
return request.get(`${yxmGateway}/api/kdsp/ka/process/get-landing-page-temp`, data);
};
// 获取ka配置
const getKaData = function(data) {
return request.get(`${yxmGateway}/api/kdsp/ka/info/getDetail`, data);
};
// 验证是否是白名单
const getWhiteUser = function(data) {
return request.get(`${yxmGateway}/api/kdsp/ka/user/getWhiteUser`, data);
};
// 根据md5获取百人团url
const getGroupBuyUrl = function(m) {
return request.get(`${yxmGateway}/api/kdsp/playBill/getPlayBillUrl?m=${m}`);
};
export {
searchCoupon,
couponList,
couponPickup,
searchGoodsList,
kaGetNextUrl,
kaFlow,
lableInfoIdsExpensive,
getKaData,
getWhiteUser,
getGroupBuyUrl
};
import http from '@/service/httpDecorator';
import config from '@/config';
const { xinchengHost, yxmGwHost } = config;
// max会员
export const maxMember = {
// max会员邀请页接口 - 基本信息接口
invitaionInfo: () => {
return http.get(`${xinchengHost}/api/kdsp/maxMember/maxMemberInvitaionInfo`);
},
// MAX会员激活页 - 激活信息
activateInfo: params => {
return http.post(`${xinchengHost}/api/kdsp/maxMember/addMaxMember`, params);
},
// max会员详情
memberInfo: () => {
return http.get(`${xinchengHost}/api/kdsp/maxMember/getMaxMemberInfo`);
},
// 优惠券展示
couponList: () => {
return http.get(`${xinchengHost}/api/kdsp/max/member/coupon`);
},
// max会员-商品
goodsList: params => {
return http.get(`${xinchengHost}/api/kdsp/max/member/goods`, { params });
},
// 会员商品品类
categoryList: () => {
return http.get(`${xinchengHost}/api/kdsp/max/member/goods/category`);
},
// 加购接口
addShopCart: params => {
return http.post(`${xinchengHost}/api/kdsp/shop-cart/add-update`, params);
},
// 获取用户max会员和普通会员信息
// http://yapi.quantgroups.com/project/351/interface/api/58329
getUserAndMaxInfo: () => {
return http.get(`${yxmGwHost}/api/kdsp/userBenefits/center/getUserAndMaxInfo`);
import request from "../utils/request";
import config from "@/config";
const { yxmGateway } = config;
// let kdspApi = "http://yapi.quantgroups.com/mock/351";
// 我的页面查询会员、优惠券信息
// 接口存在与app显示不一致情况,该接口提升version
const queryMemberAndCouponInfo = () => {
// return request.get(
// "http://yapi.quantgroups.com/mock/351/api/kdsp/userBenefits/getCurrentLevelInfo"
// );
return request.get(
`${yxmGateway}/api/kdsp/userBenefits/getCurrentLevelInfo`,
{},
{
header: {
version: "8.6.00"
}
}
);
};
// 会员中心查询
const queryMemberCenterInfo = () => {
return request.get(
`${yxmGateway}/api/kdsp/userBenefits/center/getUserCenterInfo`,
{},
{
header: {
version: "8.6.00"
}
}
);
};
// 获取用户会员权益明细
const queryMemberBenefitsDetail = () => {
return request.get(
`${yxmGateway}/api/kdsp/userBenefits/rewardDetail/getBenefitsDetail`,
{},
{
header: {
version: "8.6.00"
}
}
);
};
// 获取用户会员权益值列表
const queryBenefitsDiscountDetail = data => {
return request.get(
`${yxmGateway}/api/kdsp/userBenefitsDiscountDetail/getBenefitsDiscountDetail`,
data,
{
header: {
version: "8.6.00"
}
}
);
// return request.get(
// `http://yapi.quantgroups.com/mock/351/api/kdsp/userBenefitsDiscountDetail/getBenefitsDiscountDetail`,
// data
// );
};
// 获取成长值信息
const queryPointDetail = () => {
return request.get(`${yxmGateway}/api/kdsp/userBenefits/getPointDetail`);
};
// 成长值(积分)列表
const getBenefitsDetail = () => {
return request.get(`${yxmGateway}/api/kdsp/userBenefitsDetail/getBenefitsDetail`);
};
// 获取礼品卡消费记录
const getConsumptions = params => {
return request.post(`${yxmGateway}/api/kdsp/card/io`, params);
};
// 领取优惠券
const pickupCoupon = params => {
return request.post(`${yxmGateway}/api/kdsp/coupon/pickup-batch`, params, {
reportDeviceId: true
});
};
export {
queryMemberAndCouponInfo,
queryMemberBenefitsDetail,
queryPointDetail,
queryMemberCenterInfo,
getConsumptions,
pickupCoupon,
queryBenefitsDiscountDetail,
getBenefitsDetail
};
import config from '@/config';
import http from '@/service/httpDecorator';
const { yxmGwHost } = config;
import request from "../utils/request";
import config from "@/config";
const { yxmGateway, SHARE_CHANNEL } = config;
export default {
// 订单列表
orderList(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/list/query`, { params: data });
},
// 申请退款 是否签合同
queryNote(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/queryNote`, { params: data });
},
// 用户订单确认收货接口
orderConfirm(data) {
return http.post(`${yxmGwHost}/api/kdsp/order-info/receipt/confirm`, data);
},
// 用户订单取消接口【未付款】
orderCancel(data) {
return http.post(`${yxmGwHost}/api/kdsp/order-info/cancel`, data);
},
// 用户订单取消接口【未发货】
orderUnfilledCancel(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/unfilled/cancel`, { params: data });
},
// 用户订单取消接口【未发货】
orderUnfilledCancelV2(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/unfilled/cancel/v2`, { params: data });
},
// 订单取消原因查询接口
orderCancelReason(params) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/cancel-reason/query`, { params });
},
// 订单取消原因查询接口
orderCancelReasonV2(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/paid-cancel-props/query`, { params: data });
},
// 订单详情查询接口
orderDetail(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/detail/query`, { params: data });
},
// 物流详情查询接口
expressDetail(data) {
// return http.get('http://yapi.quantgroups.com/mock/351/api/kdsp/logistics/packages-list');
return http.get(`${yxmGwHost}/api/kdsp/logistics/packages-list`, { params: data });
},
// 我的 查询各状态订单数量
orderInfo() {
return http.get(`${yxmGwHost}/api/kdsp/order-info/status-number`);
},
confirmOrder(data) {
return http.post(`${yxmGwHost}/api/kdsp/shop-cart/order-confirm/page/v3`, data);
},
export const confirmOrder = data => {
return request.post(`${yxmGateway}/api/kdsp/shop-cart/order-confirm/page/v2`, data);
};
// todo 8.8.90 开始接口升级
orderSubmit(data) {
return http.post(`${yxmGwHost}/api/kdsp/order-info/e/submit`, data, {
customHeader: {
version: '8.8.00'
}
});
},
// 物流公司列表
companyList() {
return http.get(`${yxmGwHost}/api/kdsp/logistics/kd100/company-list`);
},
// 物流公司列表
getCompany(data) {
return http.get(`${yxmGwHost}/api/kdsp/logistics/kd100/`, { params: data });
},
// 售后原因查询
applyReason(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/apply-reason`, { params: data });
},
// 售后原因查询V2
applyReasonV2(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/v2/apply-reason`, { params: data });
},
// 售后退款金额试算
refundAmount(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/refund-amount`, { params: data });
},
getOrderSkuDetail(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-sku/detail/query`, { params: data });
},
// 填写售后信息页面的查询接口
applyPageInfo(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/apply-page-info`, { params: data });
},
// 填写售后信息页面的查询v2接口
applyPageInfoV2(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/v2/apply-page-info`, { params: data });
},
// 提交申请售后
applySubmit(data) {
return http.post(`${yxmGwHost}/api/kdsp/after-service/apply`, data);
},
afterV2Detail(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/v2/detail`, { params: data });
},
// 订单申请退款
refundKepler(data) {
return http.post(`${yxmGwHost}/api/kdsp/order-info/apply-refund`, data);
},
// 查看售后详情
afterDetail(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/detail`, { params: data });
},
afterChangeHistory(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/change-history`, { params: data });
},
afterV2ChangeHistory(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/v2/change-history`, { params: data });
},
// 售后取消
applyCancel(data) {
return http.post(`${yxmGwHost}/api/kdsp/after-service/cancel`, data);
},
// 售后退货物流单信息填写 after-service/add-delivery-no
addDeliveryNo(data) {
return http.post(`${yxmGwHost}/api/kdsp/after-service/add-delivery-no`, data);
},
// 售后列表 after-service/list
afterList(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/service/list`, { params: data });
},
// 售后催办 after-service/reminder
afterReminder(data) {
return http.post(`${yxmGwHost}/api/kdsp/after-service/reminder`, data);
},
// 发货中催办取消订单
remindCancel(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/remindCancel`, { params: data });
},
// 撤销取消订单申请
cancelRevoke(data) {
return http.get(`${yxmGwHost}/api/kdsp/order-info/unfilled/cancel-revoke`, {
params: data
});
},
//查询售后是否在有效期
applyExpired(data) {
return http.get(`${yxmGwHost}/api/kdsp/after-service/expired`, { params: data });
},
// 获取七牛token
getQiniuToken(data) {
return http.get(`${yxmGwHost}/api/kdsp/common/upload/token`, { params: data });
},
// 校验手机号是否为 推广员手机号
checkPromoterByMobile(phone) {
return http.get(`${yxmGwHost}/api/kdsp/self-mention/checkPromoterByMobile?phoneNo=${phone}`);
},
// 申请退运费
refundFreight(data) {
return http.post(`${yxmGwHost}/api/kdsp/after-service/apply-freight-fee`, data);
export const orderSubmit = data => {
const options = {
encrypt: true
};
// #ifdef MP-WEIXIN
const sceneList = [1007, 1008, 1011, 1012, 1013, 1036, 1044, 1047, 1048, 1049, 1058];
const currentScene = wx.getEnterOptionsSync().scene;
if (sceneList.indexOf(currentScene) > -1) {
options.customizeChannel = SHARE_CHANNEL;
}
// #endif
return request.post(`${yxmGateway}/api/kdsp/order-info/e/submit`, data, options);
};
// 校验手机号是否为 推广员手机号
export const checkPromoterByMobile = phone => {
return request.get(`${yxmGateway}/api/kdsp/self-mention/checkPromoterByMobile?phoneNo=${phone}`);
};
<template>
<view class="tip-ul">
<view class="tip-li tip-li-bottom">
感谢您选择羊小咩小程序,我们非常重视您的个人信息安全和隐私保护。依据最新法律要求,使用我们的产品前,请仔细阅读并同意
<text class="tip-li-yellow" @click="navTo($config('zhuCeUrl'))"> 《用户注册协议》</text>
<text class="tip-li-yellow" @click="navTo($config('yinSiUrl'))"> 《隐私政策》 </text>
,以便我们向您提供更优质的服务!
</view>
</view>
</template>
<script>
export default {
methods: {
navTo(jumpUrl) {
uni.navigateTo({
url: `/pages/webview/webview?url=${encodeURIComponent(JSON.stringify(jumpUrl))}`
});
}
}
};
</script>
<style scoped lang="scss">
.tip-ul {
.tip-li {
font-size: 28rpx;
line-height: 48rpx;
color: #141414;
}
.tip-li-bottom {
margin-bottom: 12rpx;
}
.tip-li-yellow {
color: #ec1500;
}
}
</style>
<template>
<uni-popup
ref="popup"
:z-index="9999999"
:overlay-style="{ zIndex: 9999999 }"
type="bottom"
:mask-click="false"
@close="close"
@open="open"
>
<view class="Tip" :style="tipHeight">
<view class="Tip__title">{{ title }}</view>
<view class="Tip__content">
<slot name="default" />
</view>
<view class="Tip__button">
<button class="Tip__button--cancel" @click="confirmEvent()">
{{ cancelText }}
</button>
<button class="Tip__button--confirm" @click="confirmEvent()">
{{ confirmText }}
</button>
</view>
</view>
</uni-popup>
</template>
<script>
import { uniPopup } from "@/components/uni-popup/uni-popup";
const CONFIRM_EVENT = "confirm";
export default {
components: {
uniPopup
},
props: {
title: {
type: String,
default: "欢迎使用羊小咩"
},
round: {
type: [Number, String],
default: 10
},
confirmText: {
type: String,
default: "同意"
},
cancelText: {
type: String,
default: "不同意"
},
closeAble: {
type: Boolean,
default: true
},
closeOnClickOverlay: {
type: Boolean,
default: false
}
},
data() {
return {
show: false
};
},
methods: {
open() {
this.show = true;
this.$refs.popup.open();
},
close() {
this.show = false;
this.$refs.popup.close();
},
confirmEvent() {
this.close();
const timer = setTimeout(() => {
this.$emit(CONFIRM_EVENT);
clearTimeout(timer);
}, 200);
}
}
};
</script>
<style scoped lang="scss">
::v-deep .u-popup {
z-index: 9999999999;
}
.uni-popup {
z-index: 9999999;
background: #fff;
}
.Tip {
padding: 20rpx 48rpx;
width: 100%;
height: auto;
padding-bottom: env(safe-area-inset-bottom);
border-radius: 40rpx 40rpx 0px 0px;
box-sizing: border-box;
display: flex;
flex-direction: column;
background: #fff;
&__title {
text-align: center;
line-height: 88rpx;
font-size: 32rpx;
font-weight: 500;
color: #323233;
}
&__content {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding-top: 16rpx;
}
&__button {
display: flex;
margin-bottom: 40rpx;
button {
font-size: 28rpx;
background-color: none;
width: 332rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 200rpx;
margin-top: 50rpx;
&::after {
border: none;
}
}
&--confirm {
color: $white;
background: linear-gradient(270deg, #ff5d00 0%, #ff1900 100%);
}
&--cancel {
background-color: transparent;
color: #141414;
border-radius: 4px;
border: 2rpx solid #999999;
margin-right: 24rpx;
}
}
}
</style>
<template>
<view>
<uni-popup
ref="popup"
type="bottom"
:title="title"
:mask-click="true"
closeable
@change="onChange"
>
<view class="action-sheet">
<!-- #ifdef MP-ALIPAY -->
<slot />
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<slot>
<view class="content" />
</slot>
<!-- #endif -->
<slot name="footer">
<view v-if="actionText" class="footer">
<button class="action-btn" type="default" @click="onConfirm">
{{ actionText }}
</button>
</view>
</slot>
</view>
</uni-popup>
</view>
</template>
<script>
import { uniPopup } from "@/components/uni-popup/uni-popup";
export default {
name: "ActionSheet",
components: {
uniPopup
},
props: {
title: {
type: String,
default: ""
},
showClose: {
type: Boolean,
default: true
},
closeIconSize: {
type: Number,
default: 18
},
actionText: {
type: String,
default: ""
}
},
methods: {
/**
* @exposed-api
*/
open() {
this.$refs.popup.open();
},
/**
* @exposed-api
*/
close() {
this.$refs.popup.close();
},
onChange(e) {
// 点击遮罩关闭时触发
if (e.show === false) {
this.$emit("close");
}
},
onConfirm() {
this.$emit("confirm");
this.close();
},
onClose() {
this.close();
this.$emit("close");
}
}
};
</script>
<style lang="scss" scoped>
.action-sheet {
background-color: $uni-bg-color;
// border-radius: 12rpx 12rpx 0 0;
display: flex;
flex-direction: column;
.header {
padding: 36rpx 36rpx 20rpx 36rpx;
display: flex;
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
.title {
flex: 1;
text-align: center;
font-size: 32rpx;
line-height: 44rpx;
color: #333;
}
.close {
color: #dcdcdc;
}
}
.content {
padding: 0 30rpx;
}
.footer {
padding: 20rpx 30rpx;
.action-btn {
@include primary-bg;
color: white;
font-size: $uni-font-size-base;
font-weight: bold;
border-radius: $uni-border-radius-xl;
}
}
}
</style>
<template>
<view v-if="modalData.img" class="activityModal">
<view class="content">
<image :src="modalData.img" mode="widthFix" @click="goto" />
</view>
<view class="close">
<i class="iconfont icon-close-line" @click="$emit('close')" />
</view>
</view>
</template>
<script>
import { saTrackEvent } from "@/utils/sa.js";
export default {
props: {
modalData: {
type: Object,
default() {
return {};
}
},
pageName: String
},
mounted() {
saTrackEvent("MINI_PagePopupWindowExposure", {
popupwindow_id: this.modalData.uid,
popupwindow_name: this.modalData.componentName,
page_name: this.pageName
});
},
methods: {
goto() {
this.$emit("goto", this.modalData);
}
}
};
</script>
<style scoped lang="scss">
.activityModal {
z-index: 9999;
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
.content {
max-width: 311px;
// max-height: 360px;
// background: $uni-bg-color;
border-radius: $uni-border-radius-sm * 4;
image {
max-width: 100%;
max-height: 100%;
border-radius: $uni-border-radius-sm * 4;
}
}
.close {
margin-top: $uni-spacing-col-md;
i {
font-size: 33px;
color: $white;
}
}
}
</style>
<template>
<view class="home-list">
<!-- <view class="home-list-container"> -->
<view
v-for="(item, index) in goodList"
:key="index"
class="Hl-container-item"
@click="toDetail(item, index)"
>
<view class="Hl-container-item-img">
<image lazy-load class="Hlc-item-img" mode="aspectFit" :src="item.goods.goodsImage" />
</view>
<view class="Hlc-item-title">
<text>{{ item.goods.goodsName }}</text>
</view>
<!-- 猜你喜欢商品标签 -->
<view class="Hlc-item-tag">
<view v-for="(tag, i) in item.goods.tagList" :key="i" class="Hlc-item-tag-wrap">
<span v-if="tag.type == 2" :key="i" class="Hlc-item-tag-normal">{{ tag.name }}</span>
<img
v-if="tag.type == 1"
mode="heightFix"
class="Hlc-item-tag-icon"
:src="tag.icon"
alt=""
/>
</view>
<img
v-if="item.userBenefitsLabelImgUrl"
:src="item.userBenefitsLabelImgUrl"
class="memberImg"
/>
</view>
<!-- 猜你喜欢商品标签 -->
<view class="Hlc-item-info">
<view class="Hlcu-info-left">
<text>¥</text>
<text>{{ item.goods.goodsSalePrice }}</text>
<text v-if="item.goods.saleCount">已售{{ item.goods.saleCount }}</text>
</view>
<view v-if="!noShare" class="Hlcu-info-right" @click.stop="goodsMaskIdx = index">
<view class="Hlcui-right-dot" />
<view class="Hlcui-right-dot" />
<view class="Hlcui-right-dot" />
</view>
</view>
<view
v-if="goodsMaskIdx === index && !noShare"
class="Hlc-item-mask"
@click.stop="goodsMaskIdx = -1"
>
<button
class="Hlci-mask-button"
open-type="share"
:data-shareinfo="item"
:data-goods="item"
@click.stop="toShare(item, index)"
>
<image src="https://img.lkbang.net/xcx/goods_share@2x.png" />
<text>分享好友</text>
</button>
<button v-if="isDelete" class="Hlci-mask-button" @click="delGoods(item, index)">
<image src="https://img.lkbang.net/xcx/no@2x.png" />
<text>不感兴趣</text>
</button>
</view>
</view>
<!-- </view> -->
</view>
</template>
<script>
import { debounce } from "@/utils";
import { saTrackEvent } from "@/utils/sa.js";
export default {
name: "GoodsCard",
props: {
list: {
type: Array,
default: () => []
},
isDelete: {
type: Boolean,
default: true
},
noShare: {
type: Boolean,
default: false
}
},
data() {
return {
goodsMaskIdx: -1,
goodList: []
};
},
watch: {
list: {
deep: true,
immediate: true,
handler(v) {
this.goodList = v;
}
}
},
methods: {
toShare(item, index) {
const currentPage = getCurrentPages();
saTrackEvent("PD_YXMMAEC_UserClickSelectionPageViewMoreBtn", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: item.goods.goodsId,
view_more_selection: "分享好友",
position_number: index
});
uni.reportAnalytics("c_selectionpageviewmorebtn", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: item.goods.goodsId,
view_more_selection: "分享好友",
position_number: index
});
},
delGoods(item, index) {
const currentPage = getCurrentPages();
saTrackEvent("PD_YXMMAEC_UserClickSelectionPageViewMoreBtn", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: item.goods.goodsId,
view_more_selection: "不感兴趣",
position_number: index
});
uni.reportAnalytics("c_selectionpageviewmorebtn", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: item.goods.goodsId,
view_more_selection: "不感兴趣",
position_number: index
});
this.goodList.splice(index, 1);
// this.$emit("update:goodsList", this.goodsList);
this.$api.msg("已减少此类信息推荐");
},
toDetail(good, index) {
const currentPage = getCurrentPages();
uni.reportAnalytics("c_selectionpagecommoditycard", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: good.goods.goodsId,
position_number: index,
uuid: uni.getStorageSync("userAuthInfo").uuid || "",
channel_id: uni.getStorageSync("vccChannel") || ""
});
saTrackEvent("PD_YXMMAEC_UserClickSelectionPageCommodityCard", {
page_id: currentPage[currentPage.length - 1].route,
commodity_id: good.goods.goodsId,
position_number: index
});
debounce(
uni.navigateTo({
url: `/pages/product/goodDetail?skuNo=${
good.goods.goodsId
}&count=1&receiverId=&goodsName=${encodeURIComponent(good.goods.goodsName)}&goodsImage=${
good.goods.goodsImage
}`
// url: `/pages/product/goodDetail?skuNo=144652147824&count=1&receiverId=&goodsName=${good.goods.goodsName}`
}),
300
);
}
}
};
</script>
<style lang="scss" scoped>
.home-list {
// &-container {
// padding-top: 20rpx;
// display: flex;
// justify-content: space-between;
// flex-wrap: wrap;
.Hl-container-item {
position: relative;
margin-bottom: 25rpx;
width: 339rpx;
background: #fff;
border-radius: 12rpx;
&-img {
height: 340rpx;
display: flex;
align-items: center;
}
.Hlc-item-img {
width: 100%;
height: 346rpx;
border-radius: 12rpx;
}
.Hlc-item-title {
height: 76rpx;
margin: 10rpx 20rpx 0rpx 14rpx;
text {
font-size: 26rpx;
line-height: 36rpx;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.Hlc-item-tag {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
margin: -12rpx 0rpx 0rpx 14rpx;
&-normal {
display: inline-block;
font-size: 10px;
box-sizing: border-box;
border: 1rpx solid #ff5a4b;
color: #ff5a4b;
padding: 0px 4px;
border-radius: 3px;
margin-right: 5px;
line-height: 14px;
}
&-icon {
height: 28rpx;
margin-right: 5px;
vertical-align: middle;
}
}
.Hlc-item-info {
margin: 16rpx 20rpx 14rpx;
padding-bottom: 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
.Hlcu-info-left {
display: flex;
align-items: flex-end;
text {
&:nth-child(1) {
font-size: 20rpx;
color: #ec3333;
font-weight: bold;
}
&:nth-child(2) {
margin-right: 4rpx;
font-size: 30rpx;
line-height: 34rpx;
color: #ec3333;
font-weight: bold;
}
&:nth-child(3) {
font-size: 19rpx;
line-height: 26rpx;
color: #999999;
text-align: right;
}
}
}
.Hlcu-info-right {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 6rpx;
// width: 66rpx;
width: 40rpx;
height: 40rpx;
.Hlcui-right-dot {
width: 6rpx;
height: 6rpx;
background: #d8d8d8;
border-radius: 50%;
}
// font-size: 35rpx;
// line-height: 26rpx;
// letter-spacing: -6rpx;
// color: #D8D8D8;
}
}
.Hlc-item-mask {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.4);
border-radius: 12rpx;
.Hlci-mask-button {
padding: 0 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
width: 266rpx;
height: 60rpx;
border-radius: 31rpx;
font-size: 24rpx;
color: #333333;
&:first-child {
margin-bottom: 40rpx;
}
image {
width: 36rpx;
height: 36rpx;
}
}
}
}
// }
}
.memberImg {
width: 132.68rpx;
height: 28rpx;
}
</style>
This diff is collapsed.
<template>
<view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear">
<uni-transition
v-if="maskShow"
:mode-class="['fade']"
:styles="maskClass"
:duration="duration"
:show="showTrans"
@click="onTap"
/>
<uni-transition
:mode-class="ani"
:styles="transClass"
:duration="duration"
:show="showTrans"
@click="onTap"
>
<view class="uni-popup__wrapper-box" @click.stop="clear">
<text class="uni-popup-icon iconfont icon-close-plane" @click="onTap" />
<view v-if="title || desc" class="uni-popup-header">
<text v-if="title" class="uni-popup-title">{{ title }}</text>
<text v-if="desc" class="uni-popup-desc">{{ desc }}</text>
</view>
<slot />
</view>
</uni-transition>
</view>
</template>
<script>
import { uniTransition } from "@dcloudio/uni-ui";
const config = {
// 顶部弹出
top: "top",
// 底部弹出
bottom: "bottom",
// 居中弹出
center: "center",
// 消息提示
message: "top",
// 对话框
dialog: "center",
// 分享
share: "bottom"
};
export default {
name: "UniPopup",
components: {
uniTransition
},
provide() {
return {
popup: this
};
},
props: {
// 开启动画
animation: {
type: Boolean,
default: true
},
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
// message: 消息提示 ; dialog : 对话框
type: {
type: String,
default: "bottom"
},
// maskClick
maskClick: {
type: Boolean,
default: true
},
title: {
type: String,
default: ""
},
desc: {
type: String,
default: ""
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
maskClass: {
position: "fixed",
bottom: 0,
top: 0,
left: 0,
right: 0,
backgroundColor: "rgba(0, 0, 0, 0.4)"
},
transClass: {
position: "fixed",
left: 0,
right: 0
},
maskShow: true,
mkclick: true,
popupstyle: "top",
config
};
},
watch: {
/**
* 监听type类型
*/
type: {
handler: function(newVal) {
this[this.config[newVal]]();
},
immediate: true
},
/**
* 监听遮罩是否可点击
* @param {Object} val
*/
maskClick(val) {
this.mkclick = val;
}
},
created() {
this.mkclick = this.maskClick;
if (this.animation) {
this.duration = 300;
} else {
this.duration = 0;
}
},
methods: {
clear(e) {
// TODO nvue 取消冒泡
e.stopPropagation();
},
open() {
this.showPopup = true;
this.$nextTick(() => {
new Promise(resolve => {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.showTrans = true;
// fixed by mehaotian 兼容 app 端
this.$nextTick(() => {
resolve();
});
}, 50);
}).then(() => {
// 自定义打开事件
clearTimeout(this.msgtimer);
this.msgtimer = setTimeout(() => {
this.customOpen && this.customOpen();
}, 100);
this.$emit("change", {
show: true,
type: this.type
});
});
});
},
close() {
this.showTrans = false;
this.$nextTick(() => {
this.$emit("change", {
show: false,
type: this.type
});
clearTimeout(this.timer);
// 自定义关闭事件
this.customOpen && this.customClose();
this.timer = setTimeout(() => {
this.showPopup = false;
}, 300);
});
},
onTap() {
if (!this.mkclick) return;
this.close();
},
/**
* 顶部弹出样式处理
*/
top() {
this.popupstyle = "top";
this.ani = ["slide-top"];
this.transClass = {
position: "fixed",
left: 0,
right: 0
};
},
/**
* 底部弹出样式处理
*/
bottom() {
this.popupstyle = "bottom";
this.ani = ["slide-bottom"];
this.transClass = {
position: "fixed",
left: 0,
right: 0,
bottom: 0
};
},
/**
* 中间弹出样式处理
*/
center() {
this.popupstyle = "center";
this.ani = ["zoom-out", "fade"];
this.transClass = {
position: "fixed",
/* #ifndef APP-NVUE */
display: "flex",
flexDirection: "column",
/* #endif */
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: "center",
alignItems: "center"
};
}
}
};
</script>
<style lang="scss" scoped>
.uni-popup {
position: fixed;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-popup__mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: $uni-bg-color-mask;
opacity: 0;
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.uni-top-mask {
opacity: 1;
}
.uni-bottom-mask {
opacity: 1;
}
.uni-center-mask {
opacity: 1;
}
.uni-popup__wrapper {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: absolute;
}
.top {
/* #ifdef H5 */
top: var(--window-top);
/* #endif */
/* #ifndef H5 */
top: 0;
/* #endif */
}
.bottom {
bottom: 0;
}
.uni-popup__wrapper-box {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: relative;
/* iphonex 等安全区设置,底部安全区适配 */
/* #ifndef APP-NVUE */
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
padding: 40rpx 40rpx 0;
border-radius: 12rpx 12rpx 0 0;
background-color: #fff;
.uni-popup-icon {
position: absolute;
right: 40rpx;
top: 43rpx;
font-size: 36rpx;
color: #999999;
}
.uni-popup-header {
margin-bottom: 40rpx;
text {
display: inline-block;
width: 100%;
text-align: center;
}
.uni-popup-title {
font-size: 32rpx;
line-height: 44rpx;
font-weight: bold;
color: #333333;
}
.uni-popup-desc {
margin-top: 10rpx;
font-size: 26rpx;
color: #999999;
}
}
}
.content-ani {
// transition: transform 0.3s;
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.uni-top-content {
transform: translateY(0);
}
.uni-bottom-content {
transform: translateY(0);
}
.uni-center-content {
transform: scale(1);
opacity: 1;
}
</style>
This diff is collapsed.
<template>
<view class="home-list">
<view class="home-list-container">
<view v-for="(item, index) in goodsList" :key="index" class="Hl-container-item">
<image
lazy-load
class="Hlc-item-img"
mode="aspectFit"
:src="item.goods.goodsImage"
@click="goDetail(item)"
/>
<view class="Hlc-item-info">
<view class="Hlc-item-info-title" @click="goDetail(item)">
<text>{{ item.goods.goodsName }}</text>
</view>
<view class="Hlc-item-tag" @click="goDetail(item)">
<view v-for="(tag, i) in item.goods.tagList" :key="i" class="Hlc-item-tag-wrap">
<span v-if="tag.type == 2" :key="i" class="Hlc-item-tag-normal">{{ tag.name }}</span>
<img
v-if="tag.type == 1"
mode="heightFix"
class="Hlc-item-tag-icon"
:src="tag.icon"
alt=""
/>
</view>
</view>
<view class="Hlc-item-info-count">
<div @click="goDetail(item)">
<view class="Hlc-item-info-count-left">
<text>¥{{ item.goods.goodsSalePrice }}</text>
<!-- <text v-if="item.goods.goodsPrice">¥{{ item.goods.goodsPrice }}</text> -->
</view>
<view class="Hlc-item-info-count-right">
<text v-if="item.goods.saleCount">已售{{ item.goods.saleCount }}</text>
</view>
</div>
<view class="Hlc-item-info-count-icon">
<text class="iconfont icon-cart" @click="addProduct(item)" />
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { debounce } from "@/utils";
import api from "../api/addProduct.api.js";
export default {
name: "GoodsCard",
props: {
goodsList: {
type: Array,
default: () => []
}
},
data() {
return {};
},
methods: {
goDetail(good) {
debounce(
uni.navigateTo({
url: `/pages/product/goodDetail?skuNo=${
good.goods.goodsId
}&count=1&receiverId=&goodsName=${encodeURIComponent(good.goods.goodsName)}&goodsImage=${
good.goods.goodsImage
}`
}),
300
);
},
async addProduct(good) {
const shopCartBaseList = [
{
skuId: good.goods.goodsId,
skuNum: 1,
skuSource: good.goods.goodsType,
type: 1
}
];
await api.addProduct({ shopCartBaseList, selected: true });
this.$emit("addProduct", good.goods.goodsSalePrice);
uni.showToast({
title: "购物车添加成功",
icon: "none"
});
}
}
};
</script>
<style lang="scss" scoped>
.home-list {
background: $white;
padding: 0 $space-md * 2;
&-container {
.Hl-container-item {
display: flex;
margin: 0 0 40rpx 0;
.Hlc-item-img {
width: 270rpx;
height: 270rpx;
border-radius: 12rpx;
// background: #aaa;
}
.Hlc-item-info {
width: 450rpx;
height: 260rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
&-title {
text {
font-size: 26rpx;
line-height: 36rpx;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
&-count {
display: flex;
justify-content: space-between;
&-left {
color: #ec3333;
margin: 1px;
text {
&:nth-child(1) {
margin-right: 10rpx;
font-size: $uni-font-size-lg;
line-height: 34rpx;
color: #ec3333;
font-weight: bold;
}
&:nth-child(2) {
font-size: $uni-font-size-tiny;
line-height: 24rpx;
color: #999999;
text-align: right;
text-decoration: line-through;
}
}
}
&-right {
font-size: $uni-font-size-tiny;
line-height: 24rpx;
color: #999999;
}
&-icon {
align-items: center;
height: 28px;
width: 28px;
line-height: 28px;
padding-left: 4px;
border: 1px solid #f2f3f5;
background-color: #f2f3f5;
border-radius: 50%;
}
}
}
.Hlc-item-tag {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
height: 60rpx;
margin-top: -40rpx;
&-normal {
// display: inline-block;
// font-size: 22rpx;
// box-sizing: border-box;
// border: 1px solid #ec1500;
// color: #ec1500;
// padding: 0px 4px;
// border-radius: 3px;
// margin-right: 5px;
// // line-height: 14px;
height: 32rpx;
/* #ifdef MP-ALIPAY */
line-height: 30rpx;
/* #endif */
display: flex-inline;
font-size: $uni-font-size-tiny;
justify-content: center;
align-items: center;
margin-top: 8rpx;
border-radius: $uni-border-radius-base;
color: $font-color-search;
padding: 0 $padding-sm;
margin-right: $padding-sm;
border: 1px solid $font-color-search;
::v-deep .uni-tag {
width: 10rpx;
}
}
&-icon {
height: 15px;
margin-right: 5px;
}
}
}
}
}
</style>
<template>
<view class="member-tag">{{ text }}</view>
</template>
<script>
export default {
props: {
text: {
type: String,
default: "会员专享"
}
}
};
</script>
<style lang="scss" scoped>
.member-tag {
display: inline-flex;
justify-content: center;
align-items: center;
min-width: 128rpx;
height: 28rpx;
background: #ffe1b0 url(https://img.lkbang.net/xcx/memberCenter/member_tag_bg.png);
background-size: 124rpx 28rpx;
background-repeat: no-repeat;
border-top-right-radius: 6rpx;
border-bottom-right-radius: 6rpx;
padding-left: 46rpx;
padding-right: 6rpx;
font-size: 20rpx;
color: #252931;
}
</style>
<template>
<view>
<view class="goods-bottom">
<view
url="/pages/cart/cart"
class="goods-bottom-icon"
style="position: relative"
@click="goCart"
>
<view class="goods-bottom-badge">
<uni-badge size="small" :text="cartCount || ''" type="primary" />
</view>
<text class="iconfont icon-cart-line" />
<text>购物车</text>
</view>
<button v-if="noGoods" class="goods-bottom-similar" @click="goSimilar">查看相似</button>
<button v-if="!noGoods" class="goods-bottom-car" @click="addToCart">加入购物车</button>
<button v-if="!noGoods" class="goods-bottom-buy" @click="buy">立即购买</button>
</view>
</view>
</template>
<script>
import { saTrackEvent } from "@/utils/sa.js";
import { uniBadge } from "@dcloudio/uni-ui";
import { getCartCount } from "../api/home.api";
import { setTimeout } from "timers";
import { mapMutations } from "vuex";
export default {
name: "BottomNav",
components: {
uniBadge
},
props: {
noGoods: {
type: Boolean,
default: false
},
shopBtnName: {
type: String,
default: "立即购买" // shoppingCar 购物车;settlement 结算;submitOrder 确认订单
},
info: {
type: Object,
default() {
return {};
}
},
goodsId: {
type: String,
default: ""
}
},
data() {
return {
cartCount: ""
};
},
mounted() {
this.getCartCount();
uni.$on("cartUpdate", () => {
console.log("获取购物车数量");
this.getCartCount();
});
},
beforeDestroy() {
uni.$off("cartUpdate");
},
methods: {
...mapMutations(["saveCartCount"]),
goCart() {
saTrackEvent("MINI_CommodityDetailPageShoppingCartBtnClick");
const token = uni.getStorageSync("token") || "";
if (!token) {
this.$emit("goLogin");
return;
}
setTimeout(() => {
uni.switchTab({
url: "/pages/shopcart/index",
fail: err => {
console.log("失败", err);
}
});
}, 200);
},
async getCartCount() {
const token = uni.getStorageSync("token") || "";
// console.log("token--cart", token);
if (!token) {
return;
}
const [data] = await getCartCount();
this.saveCartCount(data.count);
const count = data && data.count > 99 ? "99+" : data.count ? data.count : "";
this.cartCount = count || "";
},
addToCart() {
this.$emit("addToCart");
},
goSimilar() {
saTrackEvent("MINI_CommodityDetailPageViewSimilarityBtnClick", {
sku_no: this.goodsId
});
setTimeout(() => {
this.$emit("goSimilar");
}, 200);
},
buy() {
this.$emit("buy");
},
goHome() {
const that = this;
// const currentPage = getCurrentPages();
saTrackEvent("PD_YXMMAEC_UserClickCommodityDetailHomePageBtn", {
commodity_id: that.goodsId
});
uni.reportAnalytics("c_commoditydetailhomepagebtn", {
commodity_id: that.goodsId
});
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index"
});
}, 500);
}
}
};
</script>
<style lang="scss" scoped>
@import "@/style/icon.scss";
.goods-bottom {
position: fixed;
left: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: calc(env(safe-area-inset-bottom) + 150rpx);
padding: 30rpx 15rpx 0rpx 30rpx;
background: $white;
border-top: $border-sm solid $bg-color-g1;
padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
overflow: hidden;
box-sizing: border-box;
// safe-area-inset-bottom: 20rpx;
&-badge {
position: absolute;
right: -17rpx;
top: -12rpx;
}
&-radio {
display: flex;
align-items: center;
justify-content: space-around;
padding-top: 8rpx;
width: 140rpx;
radio {
transform: scale(0.7);
}
text {
font-size: 24rpx;
color: #999999;
}
}
&-text {
display: flex;
flex-direction: column;
align-items: flex-end;
flex: 1;
margin: 0 20rpx;
.Gb-text-top {
display: flex;
align-items: center;
text {
&:nth-child(1) {
padding-top: 8rpx;
font-size: 24rpx;
color: #333333;
}
&:nth-child(2) {
padding-top: 8rpx;
font-size: 24rpx;
color: #ec3333;
}
&:nth-child(3) {
font-size: 38rpx;
font-weight: bold;
color: #ec3333;
}
}
}
.Gb-text-bottom {
font-size: 24rpx;
color: #999999;
}
}
&-icon {
display: flex;
align-items: center;
flex-direction: column;
height: 80rpx;
text {
&:first-child {
font-size: $font-2;
}
&:last-child {
font-size: $uni-font-size-tiny;
color: $text-color-n1;
}
}
.iconfont {
font-size: 46rpx;
}
}
button {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
font-size: 32rpx;
// font-weight: bold;
border-radius: $border-radius-2;
&.disabled {
opacity: 0.7;
}
}
&-car {
border: $border-sm solid $border-color-search;
background: $white;
color: $font-color-search;
width: 42%;
}
&-buy {
color: $white;
background-image: $background-primary;
width: 42%;
}
&-similar {
color: $white;
background-image: $background-primary;
width: 85%;
}
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template name="tougdun">
<view>
<canvas canvas-id="tdcanvas" style="visibility: hidden;position: fixed;z-index: -999;" />
</view>
</template>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{"mp":"mp-weixin","yxm":true,"tenantId":560761,"tenantName":"羊小咩","appName":"狼大呜","defaultTitle":"羊小咩","logoImg":"https://img.lkbang.net/xcx/login-logo2.png","yinSiUrl":"https://appsync.lkbang.net/agreement-three.html?contractTemplateId=434","yinSiText":"羊小咩用户隐私协议","zhuCeUrl":"https://appsync.lkbang.net/agreement-three.html?contractTemplateId=433","zhuCeText":"羊小咩注册协议","tuiJianUrl":"https://mall-qa.liangkebang.net/recommend?vccToken={token}","tuiJianText":"个性化推荐管理","similarList":true,"order":{"cancel":true,"refund":true,"afterSale":true},"virtualMsg":"请选择现金券支付!","templateList":{"SELLER_SHIP":"1JhEINnMkdCLfEKkBu_g4kBYBwZ5ttdc8wJCHM3rptQ","ORDER_RECEIPT":"yuTVWlf5mfMJ1OdVepV4lNGNlC0ODsuPRKznTQxPUIY","COUPON_RECEIPT":"7O1W4EdNo1CDe7xLCzV7bzzqX57RCjZoibUkwWHx-BE","GROUP_BUY_REFUND":"BsS1di1gz_fxCrXYYPjQSw9juezCEhklyuJFwrr81EA","GROUP_SUCCESS":"jjQDF-xjFGWif1ePik6NsTnHHLYERMvCUjvgUWhZ2iM","ACTIVITY_START":"YCLxz0TtrymAOOW74pIEht5dMLBlyI84dHgu-RdVjVw","PAY_SUCCESS":"mqriYSvLJO-4QLrQi4h7A00VXp16i1Uyr_1bmkA7POo","RESULT_NOTICE":"GfvGAKzYBotsosAmGF90g_qndPPg_s8X7y31raPDUu4","RECEIPT_OPEN_SUCCESS":"zx4AIHgLWV4Ge-ssmrbMsqpj9Ijha7fQREeX5J48lVc"}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<view class="noneStock">
抱歉,当前商品无库存,可查看相似商品
</view>
</template>
<style lang="scss" scoped>
@import "@/style/var.scss";
.noneStock {
position: fixed;
bottom: calc(env(safe-area-inset-bottom) + 150rpx);
width: 100%;
padding: 20rpx;
background: $pink;
color: $red;
@include text-size(28);
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment