添加注释

master
mabo 2021-07-31 09:49:17 +08:00
parent ff92fd8d76
commit 2792d24e98
20 changed files with 39 additions and 139 deletions

View File

@ -1,5 +1,3 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'; import Vue from 'vue';
import App from './App'; import App from './App';
import router from './router'; import router from './router';

View File

@ -219,8 +219,8 @@ export default {
} }
}); });
}, },
clearCart () {
// //
clearCart () {
this.$Modal.confirm({ this.$Modal.confirm({
title: '提示', title: '提示',
content: '<p>确定要清空购物车吗?清空后不可恢复</p>', content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
@ -248,8 +248,8 @@ export default {
showCoupon (storeId, index) { showCoupon (storeId, index) {
this.couponAvailable = index; this.couponAvailable = index;
}, },
changeNum (val, id) {
// //
changeNum (val, id) {
console.log(val, id); console.log(val, id);
APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => { APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => {
console.log(res); console.log(res);
@ -258,8 +258,8 @@ export default {
} }
}); });
}, },
async changeChecked (status, type, id) {
// //
async changeChecked (status, type, id) {
const check = status ? 1 : 0; const check = status ? 1 : 0;
if (type === 'all') { if (type === 'all') {
// //
@ -274,9 +274,8 @@ export default {
this.getCartList(); this.getCartList();
}, },
async receiveShopCoupon (item) {
// //
async receiveShopCoupon (item) {
let res = await APIMember.receiveCoupon(item.id); let res = await APIMember.receiveCoupon(item.id);
if (res.success) { if (res.success) {
this.$set(item, 'disabled', true); this.$set(item, 'disabled', true);
@ -285,8 +284,8 @@ export default {
this.$Message.error(res.message); this.$Message.error(res.message);
} }
}, },
async getCartList () {
// //
async getCartList () {
this.loading = true; this.loading = true;
try { try {
let res = await APICart.cartGoodsAll(); let res = await APICart.cartGoodsAll();

View File

@ -54,6 +54,7 @@ export default {
}; };
}, },
methods: { methods: {
//
getGoodsDetail () { getGoodsDetail () {
this.isLoading = true; this.isLoading = true;
const params = this.$route.query const params = this.$route.query
@ -142,12 +143,6 @@ export default {
color: #2c2c2c; color: #2c2c2c;
} }
.like {
width: 100%;
padding: 20px 0;
@include white_background_color();
}
.shop-nav-container { .shop-nav-container {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;

View File

@ -77,6 +77,7 @@
</div> </div>
<div class="goods-page"> <div class="goods-page">
<Page <Page
show-total
show-sizer show-sizer
@on-change="changePageNum" @on-change="changePageNum"
@on-page-size-change="changePageSize" @on-page-size-change="changePageSize"
@ -126,6 +127,7 @@ export default {
} }
}, },
methods: { methods: {
//
handleSearch (key) { handleSearch (key) {
this.params.keyword = key this.params.keyword = key
this.params.pageNumber = 0 this.params.pageNumber = 0
@ -156,15 +158,18 @@ export default {
}); });
window.open(routeUrl.href, '_blank'); window.open(routeUrl.href, '_blank');
}, },
//
changePageNum (val) { changePageNum (val) {
this.params.pageNumber = val; this.params.pageNumber = val;
this.getGoodsList(); this.getGoodsList();
}, },
//
changePageSize (val) { changePageSize (val) {
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getGoodsList(); this.getGoodsList();
}, },
//
getGoodsList () { getGoodsList () {
this.loading = true; this.loading = true;
apiGoods.goodsList(this.params) apiGoods.goodsList(this.params)
@ -194,7 +199,6 @@ export default {
} }
this.getGoodsList() this.getGoodsList()
}, },
mounted () {},
components: { components: {
GoodsClassNav GoodsClassNav
} }

View File

@ -73,42 +73,6 @@ export default {
.container { .container {
@include sub_background_color($light_background_color); @include sub_background_color($light_background_color);
} }
/** 商品分类 */
.nav-con {
width: 1200px;
height: 40px;
background: #eee;
margin: 0 auto;
display: flex;
.all-categories {
width: 200px;
line-height: 40px;
color: #fff;
background-color: $theme_color;
text-align: center;
font-size: 16px;
}
.nav-item {
width: 1000px;
height: 40px;
line-height: 40px;
overflow: hidden;
list-style: none;
background-color: #eee;
display: flex;
li {
width: 50px;
font-size: 16px;
font-weight: bold;
margin-left: 15px;
color: rgb(89, 88, 88);
font-size: 15px;
&:hover {
color: $theme_color;
}
}
}
}
</style> </style>
<style> <style>
.hover-search { .hover-search {

View File

@ -133,7 +133,7 @@
<router-link to="/article?id=1371992704333905920" class="item" target="_blank">条款</router-link> <router-link to="/article?id=1371992704333905920" class="item" target="_blank">条款</router-link>
</Row> </Row>
<Row type="flex" justify="center" class="copyright"> <Row type="flex" justify="center" class="copyright">
Copyright © 2021 - Present Copyright © {{year}} - Present
<a href="https://pickmall.cn" target="_blank" style="margin: 0 5px">lili-shop</a> <a href="https://pickmall.cn" target="_blank" style="margin: 0 5px">lili-shop</a>
版权所有 版权所有
</Row> </Row>
@ -186,7 +186,8 @@ export default {
}, },
codeMsg: '发送验证码', // codeMsg: '发送验证码', //
interval: null, // interval: null, //
time: 60 // time: 60, //
year: new Date().getFullYear()
}; };
}, },
methods: { methods: {
@ -220,8 +221,6 @@ export default {
} }
}); });
} }
} else {
// this.$Message.error('');
} }
}); });
}, },

View File

@ -102,8 +102,6 @@ export default {
this.getCateList() this.getCateList()
this.getGoodsList() this.getGoodsList()
}, },
mounted () {
},
methods: { methods: {
getStoreMsg () { // getStoreMsg () { //
getDetailById(this.$route.query.id).then(res => { getDetailById(this.$route.query.id).then(res => {
@ -154,10 +152,12 @@ export default {
this.cateName = cate.labelName this.cateName = cate.labelName
this.getGoodsList() this.getGoodsList()
}, },
//
changePageNum (val) { changePageNum (val) {
this.params.pageNumber = val; this.params.pageNumber = val;
this.getGoodsList(); this.getGoodsList();
}, },
//
changePageSize (val) { changePageSize (val) {
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;

View File

@ -43,6 +43,7 @@
<Page :total="total" @on-change="changePageNum" <Page :total="total" @on-change="changePageNum"
@on-page-size-change="changePageSize" @on-page-size-change="changePageSize"
:page-size="params.pageSize" :page-size="params.pageSize"
show-total
show-sizer> show-sizer>
</Page> </Page>
</div> </div>

View File

@ -53,9 +53,6 @@ export default {
mounted () { mounted () {
let detail = this.$route.query.detail; let detail = this.$route.query.detail;
if (detail) this.detail = detail; if (detail) this.detail = detail;
},
methods: {
} }
}; };
</script> </script>

View File

@ -88,7 +88,7 @@
<router-link to="/article?id=1371992704333905920" class="item" target="_blank">条款</router-link> <router-link to="/article?id=1371992704333905920" class="item" target="_blank">条款</router-link>
</Row> </Row>
<Row type="flex" justify="center" class="copyright"> <Row type="flex" justify="center" class="copyright">
Copyright © 2021 - Present Copyright © {{year}} - Present
<a href="https://pickmall.cn" target="_blank" style="margin: 0 5px">lili-shop</a> <a href="https://pickmall.cn" target="_blank" style="margin: 0 5px">lili-shop</a>
版权所有 版权所有
</Row> </Row>
@ -107,6 +107,7 @@ export default {
components: { Verify }, components: { Verify },
data () { data () {
return { return {
year: new Date().getFullYear(),
formRegist: { formRegist: {
// //
mobilePhone: '', mobilePhone: '',
@ -156,6 +157,7 @@ export default {
} else {} } else {}
}); });
}, },
//
sendCode () { sendCode () {
if (this.time === 60) { if (this.time === 60) {
if (this.formRegist.mobilePhone === '') { if (this.formRegist.mobilePhone === '') {
@ -191,14 +193,13 @@ export default {
}); });
} }
}, },
handleCancel () { //
this.$refs.formRegist.resetFields();
},
verifyChange (con) { verifyChange (con) {
if (!con.status) return; if (!con.status) return;
this.$refs.verify.show = false; this.$refs.verify.show = false;
this.verifyStatus = true; this.verifyStatus = true;
}, },
//
verifyBtnClick () { verifyBtnClick () {
if (!this.verifyStatus) { if (!this.verifyStatus) {
this.$refs.verify.init(); this.$refs.verify.init();

View File

@ -241,6 +241,7 @@ export default {
} }
}, },
mounted () { mounted () {
document.querySelector('.forget-password').style.height = window.innerHeight + 'px'
this.$refs.formFirst.resetFields(); this.$refs.formFirst.resetFields();
}, },
watch: { watch: {
@ -250,7 +251,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.forget-password{ .forget-password{
height: 100%; min-height: 700px;
} }
.logo-box { .logo-box {
width: 600px; width: 600px;

View File

@ -66,6 +66,7 @@ export default {
}; };
}, },
methods: { methods: {
//
getTradeDetail () { getTradeDetail () {
const params = this.$route.query; const params = this.$route.query;
params.clientType = 'PC' params.clientType = 'PC'

View File

@ -46,9 +46,9 @@ export default {
}; };
}, },
methods: { methods: {
//
handlePay () { handlePay () {
const params = this.$route.query; const params = this.$route.query;
pay(params).then(res => { pay(params).then(res => {
if (res.success) { if (res.success) {
this.qrcode = res.result; this.qrcode = res.result;

View File

@ -65,7 +65,7 @@ export default {
}; };
}, },
computed: { computed: {
userInfo () { userInfo () { //
return JSON.parse(Storage.getItem('userInfo')); return JSON.parse(Storage.getItem('userInfo'));
} }
}, },

View File

@ -53,51 +53,6 @@ export function unitAddress (val) {
return val.replace(/,/g, ' '); return val.replace(/,/g, ' ');
} }
export function pointStatus (status) {
switch (status) {
case 'COMPLETE':
return '已成交';
case 'WITHDRAW':
return '已撤回';
case 'DEALING':
return '交易中';
case 'AUDITING':
return '待审核';
case 'NODEAL':
return '未成交';
case 'CANCEL':
return '已取消';
}
};
/**
* 根据订单状态码返回订单状态
* @param status_code
* @returns {string}
*/
export function unixOrderStatus (statusCode) {
switch (statusCode) {
case 'NEW':
return '新订单';
case 'INTODB_ERROR':
return '入库失败';
case 'CONFIRM':
return '已确认';
case 'PAID_OFF':
return '已付款';
case 'SHIPPED':
return '已发货';
case 'ROG':
return '已收货';
case 'COMPLETE':
return '已完成';
case 'CANCELLED':
return '已取消';
case 'AFTER_SERVICE':
return '售后中';
}
}
/** /**
* 13888888888 -> 138****8888 * 13888888888 -> 138****8888
* @param mobile * @param mobile
@ -110,13 +65,3 @@ export function secrecyMobile (mobile) {
} }
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3'); return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3');
} }
/**
* 格式化货品的规格
* @param sku
* @returns {*}
*/
export function formatterSkuSpec (sku) {
if (!sku.spec_list || !sku.spec_list.length) return '';
return sku.spec_list.map(spec => spec.spec_value).join(' - ');
}

View File

@ -10,7 +10,7 @@
* Add integers, wrapping at 2^32. This uses 16-bit operations internally * Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters. * to work around bugs in some JS interpreters.
*/ */
function safe_add(x, y) { function safe_add (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF) var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16) var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF) return (msw << 16) | (lsw & 0xFFFF)
@ -19,7 +19,7 @@ function safe_add(x, y) {
/* /*
* Bitwise rotate a 32-bit number to the left. * Bitwise rotate a 32-bit number to the left.
*/ */
function rol(num, cnt) { function rol (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt)) return (num << cnt) | (num >>> (32 - cnt))
} }
@ -42,7 +42,7 @@ function hh(a, b, c, d, x, s, t) {
return cmn(b ^ c ^ d, a, b, x, s, t) return cmn(b ^ c ^ d, a, b, x, s, t)
} }
function ii(a, b, c, d, x, s, t) { function ii (a, b, c, d, x, s, t) {
return cmn(c ^ (b | (~d)), a, b, x, s, t) return cmn(c ^ (b | (~d)), a, b, x, s, t)
} }
@ -50,7 +50,7 @@ function ii(a, b, c, d, x, s, t) {
* Calculate the MD5 of an array of little-endian words, producing an array * Calculate the MD5 of an array of little-endian words, producing an array
* of little-endian words. * of little-endian words.
*/ */
function coreMD5(x) { function coreMD5 (x) {
var a = 1732584193 var a = 1732584193
var b = -271733879 var b = -271733879
var c = -1732584194 var c = -1732584194

View File

@ -1,4 +1,3 @@
// import Vue from 'vue';
import axios from 'axios'; import axios from 'axios';
import https from 'https'; import https from 'https';
import { Message, Spin, Modal } from 'view-design'; import { Message, Spin, Modal } from 'view-design';
@ -8,6 +7,7 @@ import router from '../router/index.js';
import store from '../vuex/store'; import store from '../vuex/store';
import { handleRefreshToken } from '@/api/index'; import { handleRefreshToken } from '@/api/index';
const qs = require('qs'); const qs = require('qs');
// api地址
export const buyerUrl = export const buyerUrl =
process.env.NODE_ENV === 'development' process.env.NODE_ENV === 'development'
? config.api_dev.buyer ? config.api_dev.buyer
@ -180,13 +180,8 @@ export const Method = {
}; };
export default function request (options) { export default function request (options) {
// 如果是服务端或者是请求的刷新token不需要检查token直接请求。
// if (process.server || options.url.indexOf('passport/token') !== -1) {
return service(options); return service(options);
// }
// service(options).then(resolve).catch(reject)
} }
// 防抖闭包来一波 // 防抖闭包来一波
function getTokenDebounce () { function getTokenDebounce () {
let lock = false; let lock = false;

View File

@ -8,9 +8,9 @@ const psl = require('psl');
export default { export default {
setItem: (key, value, options = {}) => { setItem: (key, value, options = {}) => {
if (process.client) { if (process.client) {
const p_psl = psl.parse(document.domain); const pPsl = psl.parse(document.domain);
let domain = p_psl.domain; let domain = pPsl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(p_psl.input)) domain = p_psl.input; if (/\d+\.\d+\.\d+\.\d+/.test(pPsl.input)) domain = pPsl.input;
options = { domain, ...options }; options = { domain, ...options };
} }
Cookies.set(key, value, options); Cookies.set(key, value, options);
@ -20,9 +20,9 @@ export default {
}, },
removeItem: (key, options = {}) => { removeItem: (key, options = {}) => {
if (process.client) { if (process.client) {
const p_psl = psl.parse(document.domain); const pPsl = psl.parse(document.domain);
let domain = p_psl.domain; let domain = pPsl.domain;
if (/\d+\.\d+\.\d+\.\d+/.test(p_psl.input)) domain = p_psl.input; if (/\d+\.\d+\.\d+\.\d+/.test(pPsl.input)) domain = pPsl.input;
options = { domain, ...options }; options = { domain, ...options };
} }
Cookies.remove(key, options); Cookies.remove(key, options);