Commit b78d5d00 authored by 郭志伟's avatar 郭志伟

feat: 功能完善

parent 375c57f1
......@@ -1159,9 +1159,9 @@
}
},
"@qg/ui-request": {
"version": "0.0.7",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fui-request/-/ui-request-0.0.7.tgz",
"integrity": "sha512-C6qxG0HMskn0KDc9TDfmYf2ysPcD8ewEGQCpRv505A89oW28qTA8FpGHEVGWEO20ZJ9I6KAmfMkNaPxIZXHgKg==",
"version": "0.0.8",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fui-request/-/ui-request-0.0.8.tgz",
"integrity": "sha512-BeS7fWiTM5uI/FzGpZ5phuU0ZQXWsjX5LDiMq6FhMz5IXQthd3gMn+Q1DyYF6YyQI6rG9eDq18CMvWMdkbtt/Q==",
"requires": {
"axios": "^0.19.2"
}
......@@ -3333,6 +3333,16 @@
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==",
"dev": true
},
"clipboard": {
"version": "2.0.8",
"resolved": "http://npmprivate.quantgroups.com/clipboard/-/clipboard-2.0.8.tgz",
"integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==",
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"clipboardy": {
"version": "2.3.0",
"resolved": "http://npmprivate.quantgroups.com/clipboardy/-/clipboardy-2.3.0.tgz",
......@@ -3962,6 +3972,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "3.1.9-1",
"resolved": "http://npmprivate.quantgroups.com/crypto-js/-/crypto-js-3.1.9-1.tgz",
"integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg="
},
"css": {
"version": "2.2.4",
"resolved": "http://npmprivate.quantgroups.com/css/-/css-2.2.4.tgz",
......@@ -4500,6 +4515,11 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
},
"delegate": {
"version": "3.2.0",
"resolved": "http://npmprivate.quantgroups.com/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"depd": {
"version": "1.1.2",
"resolved": "http://npmprivate.quantgroups.com/depd/-/depd-1.1.2.tgz",
......@@ -5902,6 +5922,14 @@
"slash": "^2.0.0"
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "http://npmprivate.quantgroups.com/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "http://npmprivate.quantgroups.com/graceful-fs/-/graceful-fs-4.2.4.tgz",
......@@ -8462,10 +8490,9 @@
}
},
"node-forge": {
"version": "0.9.0",
"resolved": "http://npmprivate.quantgroups.com/node-forge/-/node-forge-0.9.0.tgz",
"integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==",
"dev": true
"version": "0.10.0",
"resolved": "http://npmprivate.quantgroups.com/node-forge/-/node-forge-0.10.0.tgz",
"integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA=="
},
"node-ipc": {
"version": "9.1.1",
......@@ -10704,6 +10731,11 @@
"ajv-keywords": "^3.4.1"
}
},
"select": {
"version": "1.1.2",
"resolved": "http://npmprivate.quantgroups.com/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
},
"select-hose": {
"version": "2.0.0",
"resolved": "http://npmprivate.quantgroups.com/select-hose/-/select-hose-2.0.0.tgz",
......@@ -10717,6 +10749,14 @@
"dev": true,
"requires": {
"node-forge": "0.9.0"
},
"dependencies": {
"node-forge": {
"version": "0.9.0",
"resolved": "http://npmprivate.quantgroups.com/node-forge/-/node-forge-0.9.0.tgz",
"integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==",
"dev": true
}
}
},
"semver": {
......@@ -11998,6 +12038,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "http://npmprivate.quantgroups.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"tmp": {
"version": "0.0.33",
"resolved": "http://npmprivate.quantgroups.com/tmp/-/tmp-0.0.33.tgz",
......
import config from '@/config';
import { saDeviceId } from '@/service/sa.service';
import http from '@/service/httpDecorator';
const { talosHost } = config;
export default {
// 猜你喜欢-(商品详情页)
recommendLike: async function() {
// return http.get(talosHost + '/vcc/xyqb/recommend/like');
return http.get(`${talosHost}/vcc/xyqb/recommend/goods-list`, {
customHeader: {
scDeviceId: await saDeviceId()
}
});
}
};
......@@ -31,7 +31,9 @@ import {
CountDown,
PwdField,
AuthcodeField,
CouponList
CouponList,
Swipe,
SwipeItem
} from '@qg/cherry-ui';
import DialogFn from '@qg/cherry-ui/src/dialog/func';
// import "@qg/cherry-ui/dist/cherry.css";
......@@ -66,6 +68,8 @@ Vue.use(CountDown);
Vue.use(PwdField);
Vue.use(AuthcodeField);
Vue.use(CouponList);
Vue.use(Swipe);
Vue.use(SwipeItem);
// const _proto = Vue.prototype;
// const proto = Object.create(_proto);
......
This diff is collapsed.
......@@ -2,13 +2,13 @@
* @Description: 数据加密,aes加密数据主体,rsa加密aes密钥,aes密钥前端自己存储
* @Date: 2020-12-08 11:08:28
* @LastEditors: gzw
* @LastEditTime: 2021-01-29 19:06:27
* @LastEditTime: 2021-07-07 17:44:22
*/
import { cipher as AES, util as UTIL, pki as PKI, md as SHA1 } from 'node-forge';
import uuidv1 from 'uuid/v1';
import { parseTime } from './utils.service';
import { APP_ID, PUBLIC_KEY, PRIVATE_KEY } from './encrypt.config';
const CryptoJS = require('./crypto.min');
import { APP_ID, PUBLIC_KEY, PRIVATE_KEY } from '@/config/encrypt.config';
import CryptoJS from 'crypto-js';
import { desSalt } from '@/api/pay.api';
/**
......
......@@ -10,5 +10,5 @@ const http = new HttpRequest(
function(loadingState) {
store.dispatch('change_loading', loadingState);
}
);
).getInstance();
export default http;
......@@ -6,7 +6,13 @@ import { isWechat, isApp } from './validation.service';
import Cookies from './cookieStorage.service';
import localStorage from './localStorage.service';
//formXcxPage:标识是从小程序跳转过来的;
const localStorageParams = ['creditToken', 'vccToken', 'vccChannel', 'formXcxPage'];
const localStorageParams = [
'creditToken',
'vccToken',
'vccChannel',
'sonVccChannel',
'formXcxPage'
];
const cookiesParams = ['h'];
export default {
......
import { isAndroid, isIOS } from './validation.service';
import Clipboard from 'clipboard';
/**
* 替换邮箱字符
......@@ -343,3 +344,37 @@ export function phoneTrim(mobile) {
export function isObject(value) {
return Object.prototype.toString.call(value) === '[object Object]';
}
export function setClipboardData(
options = {
data: '',
success: () => {},
fail: () => {}
}
) {
const fakeEl = document.createElement('button');
const clipboard = new Clipboard(fakeEl, {
text() {
return options.data || '';
},
action() {
return 'copy';
},
container: document.body
});
clipboard.on('success', e => {
clipboard.destroy();
if (options.success) {
options.success(e);
}
});
clipboard.on('error', e => {
clipboard.destroy();
if (options.fail) {
options.fail(e);
}
});
document.body.appendChild(fakeEl);
fakeEl.click();
document.body.removeChild(fakeEl);
}
......@@ -121,7 +121,7 @@
<script>
import ListItem from '../orderList/components/ListItem.vue';
import CancelPopup from '../orderList/components/CancelPopup.vue';
import { setClipboardData } from '@/service/utils.service';
import orderApi from '@/api/order.api';
import img11 from '@/assets/images/order/11.png';
import img21 from '@/assets/images/order/21.png';
......@@ -194,7 +194,9 @@ export default {
this.$toast.success('已通知卖家');
},
copyPwd(item) {
this.$toast.success('已复制');
setClipboardData(`卡号:${item.cardNo},密码:${item.cardPassword}`, () => {
this.$toast.success('已复制');
});
console.log(item);
}
}
......
<template>
<div class="Vl__account">
<cr-field
v-model="accountMask"
:placeholder="`请输入${info.name || ''}账号`"
clearable
@focus="inputBlur = false"
@blur="inputBlur = true"
>
<cr-field v-model="accountMask" :placeholder="`请输入${info.name || ''}账号`" clearable>
<template #button>
<cr-image v-if="info.icon" :src="info.icon" width="0.64rem" height="0.64rem" />
</template>
</cr-field>
<div class="Vl__list" :class="{ show: !inputBlur }">
<!-- <div class="Vl__list" :class="{ show: !inputBlur }">
<div
v-for="(item, index) in list"
:key="index"
......@@ -22,7 +16,7 @@
<span class="phone-home">{{ item.home }}</span>
<span v-if="index === 0" class="current">上次充值</span>
</div>
</div>
</div> -->
</div>
</template>
<script>
......@@ -39,28 +33,20 @@ export default {
},
data: function() {
return {
inputBlur: true,
showList: false,
list: [
{
phone: '17165445433',
home: '北京 移动'
},
{
phone: '17165345433',
home: '北京 移动'
},
{
phone: '17165345435',
home: '北京 移动'
}
]
// inputBlur: true
// showList: false
// list: [
// {
// phone: '17165445433',
// home: '北京 移动'
// }
// ]
};
},
computed: {
accountMask: {
get() {
return this.phoneFormat(this.value);
return this.info.rechargeAccountType !== 3 ? this.phoneFormat(this.value) : this.value;
},
set(val) {
this.$emit('input', val.replace(/\s/g, ''));
......
<template functional>
<template>
<div class="Vl__spu">
<div
v-for="(item, index) in props.list"
v-for="(item, index) in list"
:key="index"
class="Vl__spu-item"
:class="{ 'Vl__spu-item_active': props.info.spuNo === item.spuNo }"
@click="parent.handleSpuSelected(item, index)"
:class="{ 'Vl__spu-item_active': info.spuNo === item.spuNo }"
@click="$parent.handleSpuSelected(item, index)"
>
<cr-image :src="item.icon" height="1.093333rem" width="1.093333rem" class="Vl__spu-icon" />
<div class="Vl__spu-name">{{ item.name }}</div>
......@@ -24,6 +24,34 @@ export default {
type: Object,
default: () => {}
}
},
data() {
return {
scrollWidth: 0,
scrollLeft: 0,
top: 0
};
},
mounted() {
this.getScrollInfo();
// this.$el.addEventListener('scroll', this.handleScoll);
},
// beforeDestroy() {
// this.$el.removeEventListener('scroll', this.handleScoll);
// },
// activated() {
// this.$el.addEventListener('scroll', this.handleScoll);
// },
// deactivated() {
// this.$el.removeEventListener('scroll', this.handleScoll);
// },
updated() {
console.log(111);
},
methods: {
getScrollInfo() {
this.scrollWidth = this.$el.scrollWidth;
}
}
};
</script>
......@@ -34,6 +62,7 @@ export default {
display: flex;
align-items: center;
overflow: auto;
position: relative;
&::before,
&::after {
content: ' ';
......
@bottom-height: 60px;
.Vl {
&__spu {
padding: @padding-sm 0;
display: flex;
align-items: center;
overflow: auto;
&::before, &::after {
content: ' ';
flex-shrink: 0;
display: block;
width: @padding-sm;
height: 97px;
}
&::after {
width: @padding-unit;
}
&-item {
height: 97px;
width: 95px;
border-radius: @border-radius-md;
background-color: @white;
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-right: @padding-xs;
transition: all .2s linear;
&_active {
box-shadow: 0px 2px 12px 0px rgba(100, 101, 102, 0.12);
transform: scale(1.03);
}
}
&-name {
.text-14();
color: @text-grey;
padding: 0 @padding-sm;
margin-top: @padding-xs;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
flex-shrink: 0;
overflow: hidden;
}
}
&__sku {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
position: relative;
z-index: 1;
&.disabled::before {
content: ' ';
z-index: 2;
display: block;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 0.6);
}
&-item {
width: 162px;
height: 72px;
border-radius: @border-radius-sm - 2;
border: 1px solid @grey-border;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-shrink: 0;
position: relative;
margin-bottom: @padding-xs;
transition: all .1s linear;
&.cheap {
.Vl__sku-tag {
display: block;
color: @white;
background: linear-gradient(269deg, #FF5D00 12%, #FF1900 86%);
}
}
&.active {
background: #FFF5F5;
border: 1px solid @red;
.Vl__sku-name {
color: @red;
}
.Vl__sku-price {
color: @red;
}
}
}
&-name {
color: @text-color;
.text-17();
font-weight: @font-weight-bold - 100;
}
&-price {
color: @gray-5;
.text-12();
}
&-tag {
background: @gray-2;
.text-10();
border-radius: 0 @border-radius-sm - 2 0 @border-radius-sm - 2;
padding: 0 @padding-unit;
position: absolute;
top: 0;
right: 0;
display: none;
}
}
&__panel {
background-color: @white;
border-radius: @border-radius-lx @border-radius-lx 0 0;
......
......@@ -3,7 +3,7 @@
<cr-tabs v-model="currentTab" @change="handleTabChange">
<cr-tab v-for="(item, index) in spuData" :key="index" :title="item.name" :name="+item.type" />
</cr-tabs>
<spu-list :list="spuList" :info="spuInfo" />
<spu-list ref="spuList" :list="spuList" :info="spuInfo" />
<div class="Vl__panel">
<account-input v-if="spuInfo.rechargeAccountType !== 2" v-model="account" :info="spuInfo" />
<div v-else class="Vl__panel-placeholder" />
......@@ -65,18 +65,21 @@ export default {
methods: {
handleTabChange(name) {
this.currentTab = name;
this.spuInfo = this.spuData[name].itemList[0];
this.updateSpuInfo(this.spuData[this.currentTab - 1].itemList[0]);
this.getSkuList();
},
handleSpuSelected(item, index) {
handleSpuSelected(item) {
this.spuInfo = item;
this.spuInfo.index = index;
this.updateSpuInfo(item);
this.getSkuList();
},
handleSkuSelected(item, index) {
this.skuInfo = item;
this.skuInfo.index = index;
},
updateSpuInfo(info) {
this.$set(this, 'spuInfo', info);
},
async getList() {
const [res] = await rechargeApi.getSpuList();
if (res) {
......@@ -91,6 +94,7 @@ export default {
const [res] = await rechargeApi.getSkuList({ spuNos, type });
if (res) {
this.skuList = res.rechargeList;
this.handleSkuSelected(res.rechargeList[0], 0);
}
},
async goOrder() {
......
......@@ -9,6 +9,8 @@ const externals = {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
'node-forge': 'forge',
'crypto-js': 'CryptoJS',
'sa-sdk-javascript': 'sensorsDataAnalytic201505' // 神策js在window下的全局引用会出现两个,这个才是真物
// axios: "axios"
};
......@@ -19,6 +21,8 @@ const cdn = {
'https://activitystatic.lkbang.net/vue/2.6.11/vue.min.js',
'https://activitystatic.lkbang.net/vue-router/3.2.0/vue-router.min.js',
'https://activitystatic.lkbang.net/vuex/3.4.0/vuex.min.js',
'https://activitystatic.lkbang.net/node-forge/0.10.0/forge.min.js',
'https://appsync.lkbang.net/crypto.min.js',
'https://activitystatic.lkbang.net/sa-sdk-javascript/1.15.16/sensorsdata.min.js'
]
}
......
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