Commit f6daa87a authored by 石盼盼's avatar 石盼盼

修改

parent 38697ebe
> 1%
last 2 versions
not dead
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
module.exports = {
root: true,
env: {
es6: true,
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'indent': ['error', 4, { 'SwitchCase': 1 }]
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
yarn.lock*
\ No newline at end of file
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This diff is collapsed.
{
"name": "fhxm",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "rimraf -rf ./node_modules/.cache/vue-loader && vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"autoprefixer": "^8.0.0",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"postcss": "^8.3.1",
"vant": "^2.12.21",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"webpack": "^4.43.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^4.0.0",
"css-loader": "^5.2.6",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"less-loader": "^9.0.0",
"node-sass": "^4.12.0",
"postcss-loader": "^5.3.0",
"postcss-pxtorem": "5.1.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"sass-loader": "^7.3.1",
"style-loader": "^2.0.0",
"vue-template-compiler": "^2.6.11"
}
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no, viewport-fit=cover"" />
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" /> -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="http://at.alicdn.com/t/font_2606532_org72jq1gc.css">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script>
// 手机端rem适应
(function (win) {
resizeRoot();
function resizeRoot() {
var wWidth = document.documentElement.clientWidth;
if (wWidth > 1024) wWidth = 1024;
else if (wWidth <320) wWidth = 320;
document.documentElement.style.fontSize = wWidth / 7.5 + 'px';
}
window.onresize = resizeRoot;
})(window);
</script>
</html>
\ No newline at end of file
<template>
<div id="app">
<keep-alive>
<router-view />
</keep-alive>
<div class="goBack-btn flex-h flex-hc flex-align-center" v-if="!$route.meta.hideBack" >
<i class="iconfont icon-icon_fanhuishouye" @click="gohome"></i>
</div>
</div>
</template>
<script>
export default {
data () {
return {
keepAliveView: [],
type: 1
}
},
methods: {
gohome () {
// 第一个页面不是首页
if (this.type === 1) {
console.log('type--------1')
this.$router.replace({
name: 'home'
})
} else if (this.type === 2) {
console.log('type--------2')
// 第二个页面且第一个页面是首页
this.$router.go(-1)
} else {
var idx = this.keepAliveView.indexOf('home')
if (idx !== -1) {
console.log('type--------3')
var backlen = history.length - idx
history.go(-backlen)
} else {
console.log('type--------4')
this.$router.replace({
name: 'home'
})
}
}
// console.log(history.length, backlen, '----------')
// history.go(-backlen)
}
},
watch: {
$route (to, from) {
// console.log(to, from, history, '-----------')
if (history.length === 1 && to.name !== 'home') {
this.type = 1
} else if (history.length === 2 && from.name === 'home') {
this.type = 2
} else {
this.type = 3
}
var idxs = this.keepAliveView.indexOf(to.name)
if (idxs === -1) {
this.keepAliveView.push(to.name)
} else if (to.name !== from.name) {
var idx = this.keepAliveView.indexOf(from.name)
this.keepAliveView.splice(idx, 1)
}
// console.log(this.keepAliveView, 'keepAliveView-------')
}
}
}
</script>
<style lang="css">
@import "./assets/styles/line.css";
</style>
<style lang="scss">
@import "@assets/styles/global.scss";
.goBack-btn{
width: 1rem;
height: 1rem;
background: #F8F8F8;
background-size: 100%;
position: fixed;
right: .2rem;
bottom: 1.5rem;
z-index: 100;
border-radius: 50%;
box-shadow: -1px 0px 9px 0px rgba(50, 91, 239, .36);
color: rgba(50, 91, 239, .66);
// $text-gray
.iconfont {
font-size: .5rem;
}
}
</style>
const baseUrl = '/api'
// if (process.env.NODE_ENV === 'testing') {
// // baseUrl = store.state.apiTestUrl + 'api';
// } else if (process.env.NODE_ENV === 'production') {
// // baseUrl = store.state.apiUrl + 'api';
// baseUrl = '/api'
// }
// todo: url
// const httpUrl = 'https://fhxmtest.xueyoubangedu.com' // 测试接口
// const h5Url = 'http://fhxmtest.h5.xueyoubangedu.com' // 测试h5线上地址
const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
const h5Url = 'http://depository.fhxmcy.com' // 正式h5线上地址
export default {
// url地址
WINDOWHREF_LOGIN: `${httpUrl}/api/scm/login?callBack=${h5Url}/login&scopes=snsapi_base&type=1`,
WINDOWHREF_LOGIN_ROUTE: `${httpUrl}/api/scm/login?callBack=${window.location.href}&scopes=snsapi_base&type=1`,
WINDOWHREF_INDEX: `${httpUrl}/api/scm/login?callBack=${h5Url}&scopes=snsapi_base&type=1`,
WINDOWHREF_ASK: `${httpUrl}/api/scm/login?callBack=${h5Url}&scopes=snsapi_userinfo&type=1`,
// 登录相关
SENDCODE: baseUrl + '/scm/send', // 发送验证码
BINDLOGIN: baseUrl + '/scm/bind/login', // 绑定后台账号
BINDLOGINTWO: baseUrl + '/scm/bind/login/two', // 绑定后台账号
REFRESHTOKEN: baseUrl + '/scm/change/token', // 更新token
LOGOUT: baseUrl + '/scm/logout', // 更新token
// 首页
WARNGOODS: baseUrl + '/scm/warn_goods/today', // 今日预警
WARNGOODSADD: baseUrl + '/scm/warn_goods/addCars', // 采购预警-点击将商品添加至购物车
SUPPLIER: baseUrl + '/scm/supplier/my', // 机构列表
CHANGE_SUPPLIER: baseUrl + '/scm/change_agency', // 切换机构
TIPSNUM: baseUrl + '/scm/home/index', // 首页提示数量
// 消息
NOTICELIST: baseUrl + '/scm/notice/list', // 消息
// 个人中心
WXLIST: baseUrl + '/scm/supplier/wx_list', // 获取机构绑定的微信列表
SUPPLIWRDETAIL: baseUrl + '/scm/supplier/detail', // 获取机构详情
// //////////////////// 筛选 列表 /////////////////////
PROVIDERLIST: baseUrl + '/scm/purchase_return/get_providers', // 供应商列表
SHOPLIST: baseUrl + '/scm/supplier_trade_return/get_shop_list', // 商铺列表
// //////////////////// 采购管理 /////////////////////
// 采购计划
CATE: baseUrl + '/scm/cates', // 采购计划分类列表
CATEGOODS: baseUrl + '/scm/goods', // 采购计划分类商品列表 搜索商品列表
CHANGECART: baseUrl + '/scm/car_goods', // 更改购物车数量
CARTLIST: baseUrl + '/scm/cars', // 购物车列表
CLEARCART: baseUrl + '/scm/clear_car', // 清空购物车
ADDPLAN: baseUrl + '/scm/add_plan', // 提交采购计划
PLANLIST: baseUrl + '/scm/plan_list', // 采购计划列表
PURCHASE_DETAIL: baseUrl + '/scm/purchase_detail', // 详情 1:采购计划,2:采购订单,3:入库订单
PLANAUDIT: baseUrl + '/scm/audit', // 采购计划-审核
PLANDELETE: baseUrl + '/scm/del', // 采购计划-删除
PLANBILLS: baseUrl + '/scm/bills', // 相关单据
// 采购订单
PURORDERLIST: baseUrl + '/scm/order_list', // 采购订单列表
PURORDERCANCEL: baseUrl + '/scm/order_cancel', // 采购订单-取消
// 入库订单
ENTRYLIST: baseUrl + '/scm/purchase/into/storehouses/list', // 入库订单列表
ENTRYGOODS: baseUrl + '/scm/purchase/into/storehouses/goods', // 入库商品列表
ENTRYCHECK: baseUrl + '/scm/order_store', // 验收入库详情
PURENTRY: baseUrl + '/scm/order_intostore', // 验收入库
// //////////////////// 销售管理 /////////////////////
SALELIST: baseUrl + '/scm/supplier_trade/list', // 销售列表
SALEDETAIL: baseUrl + '/scm/supplier_trade/operation_out', // 销售详情
SALE_EDIT_DETAIL: baseUrl + '/scm/supplier_trade/detail', // 销售编辑详情
SALE_EDIT_SAVE: baseUrl + '/scm/supplier_trade/alter', // 销售编辑详情
SALEOUT: baseUrl + '/scm/supplier_trade/out', // 验收出库
SALEGOODSLIST: baseUrl + '/scm/supplier_trade_good/goods_list', // 销售商品
// //////////////////// 档案管理 /////////////////////
// 调价
ADJUSTPRICE: baseUrl + '/scm/adjust/price/list', // 调价列表
ADJUSTPRICEDETAIL: baseUrl + '/scm/adjust/price/detail', // 调价详情
ADJUSTPRICEGOODS: baseUrl + '/scm/adjust/price/goods', // 调价商品列表
// 调库
ADJUSTSTOCK: baseUrl + '/scm/adjust/stock/list', // 调库列表
ADJUSTSTOCKDETAIL: baseUrl + '/scm/adjust/stock/detail', // 调库列表详情
ADJUSTSTOCKGOODS: baseUrl + '/scm/adjust/stock/goods', // 调库商品列表
// //////////////////// 运维管理 /////////////////////
// 采购退货
PURCHASERETURN: baseUrl + '/scm/purchase_return/list', // 采购退货列表
PURCHASERETURN_DETAIL: baseUrl + '/scm/purchase_return/details', // 采购退货详情
PURCHASERETURN_CREATE: baseUrl + '/scm/purchase_return/create', // 采购退货添加
PURCHASERETURN_DETELE: baseUrl + '/scm/purchase_return/destroy', // 采购退货删除
PURCHASERETURN_EDIT: baseUrl + '/scm/purchase_return/edit', // 采购退货编辑
PURCHASERETURN_CHECK: baseUrl + '/scm/purchase_return/check', // 采购退货审核
// 销售退货
SALERETURN: baseUrl + '/scm/supplier_trade_return/list', // 销售退货列表
SALERETURN_DETAIL: baseUrl + '/scm/supplier_trade_return/details', // 销售退货详情
SALERETURN_CREATE: baseUrl + '/scm/supplier_trade_return/create', // 销售退货添加
SALERETURN_EDIT: baseUrl + '/scm/supplier_trade_return/edit', // 销售退货编辑
SALERETURN_DELETE: baseUrl + '/scm/supplier_trade_return/destroy', // 销售退货删除
SALERETURN_CHECK: baseUrl + '/scm/supplier_trade_return/check', // 销售退货审核
// 商品档案
GOODSCLASS: baseUrl + '/scm/goods_record', // 商品档案列表
// 赠送入库
FREELIST: baseUrl + '/scm/free/gift/storage/list', // 赠送入库列表
FREE_CREATE: baseUrl + '/scm/free/gift/storage/stock', // 赠送入库新增
FREE_CHECK: baseUrl + '/scm/free/gift/storage/check', // 赠送入库审核
FREE_DELETE: baseUrl + '/scm/free/gift/storage/delete', // 赠送入库删除
GOODS_ADD_CHOOSE: baseUrl + '/scm/free/gift/storage/goods/list', // 搜索商品-添加商品页
// 协助订单
ASSIST_CREATE: baseUrl + '/scm/help/add_trade', // 协助订单列表
ASSIST_LIST: baseUrl + '/scm/help/trade_list', // 协助订单列表
ASSIST_DETAIL: baseUrl + '/scm/help/trade_detail', // 协助订单详情
ASSIST_DETELE: baseUrl + '/scm/help/trade_del', // 协助订单删除
ASSIST_CODE: baseUrl + '/scm/help/pay_code' // 协助订单扫码支付
}
import axios from 'axios'
import { updateToken } from './common'
import { Toast } from 'vant'
import selfApi from './apiList'
// 创建 axios 实例
const service = axios.create({
headers: { 'Content-Type': 'application/json' },
timeout: 30000
})
// 设置 post、put 默认 Content-Type
service.defaults.headers.post['Content-Type'] = 'application/json'
service.defaults.headers.put['Content-Type'] = 'application/json'
// 添加请求拦截器
service.interceptors.request.use(
config => {
// console.log(config, 'config-----------')
if (config.method === 'post' || config.method === 'put') {
// post、put 提交时,将对象转换为string, 为处理后台解析问题
config.data = JSON.stringify(config.data)
}
// 请求发送前进行处理
// console.log("请求发送前进行处理", config)
return config
}, error => {
// 请求错误处理
// console.log("请求发送前---请求错误处理", error)
return Promise.reject(error)
}
)
// 添加响应拦截器
service.interceptors.response.use(
response => {
const { data, config } = response
// console.log('添加响应拦截器', response)
if (data.code === 400) {
console.log('===== token过期 =====')
const promisefresh = new Promise(function (resolve, reject) {
updateToken(() => {
config.headers.token = window.localStorage.getItem('token')
axios.request(response.config).then(res => {
const curData = res.data
if (curData.code === 200) {
resolve(curData)
} else {
// window.localStorage.removeItem('token')
// window.localStorage.removeItem('status')
resolve(curData)
}
})
}, (err) => {
resolve(err)
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
console.log('错误--------', err)
})
})
return promisefresh
} else {
return data
}
},
error => {
let info = {}
if (!error.response) {
info = {
code: 5000,
message: 'Network Error'
}
} else {
const { status, statusText, data } = error.response
// 此处整理错误信息格式
info = {
code: status,
data: data,
message: statusText
}
}
// console.log("添加响应拦截器err", error, info)
return Promise.reject(info)
}
)
/**
* 创建统一封装过的 axios 实例
* @return {AxiosInstance}
*/
export default function () {
return service
}
\ No newline at end of file
import axios from 'axios'
import apiList from './apiList'
export function updateToken (cb, errcb) {
axios
.post(apiList.REFRESHTOKEN, null, {
headers: {
token: window.localStorage.getItem('token'),
type: 1
}
})
.then((response) => {
if (response.status === 200) {
const curdata = response.data
const code = curdata.code
const msg = curdata.msg
console.log('换取token ' + code + ' --- ' + msg)
if (code === 200) {
window.localStorage.setItem('token', curdata.data.token)
console.log(
'获取保存的token ' + window.localStorage.getItem('token')
)
typeof cb === 'function' && cb()
} else {
console.log('token换取失败-------', curdata)
typeof errcb === 'function' && errcb(curdata)
}
}
})
.catch((error) => {
console.log('换取token失败 ' + error, '----------------')
typeof errcb === 'function' && errcb(error)
})
};
import axios from './axios'
import { Toast, Dialog } from 'vant'
import router from '../router/index'
import selfApi from '@/api/apiList'
const instance = axios()
export default {
get (url, params, headers, toast = true) {
const options = {}
options.headers = {
token: window.localStorage.getItem('token'),
type: 1
}
if (params) {
options.params = params
}
if (headers) {
options.headers = { ...options.headers, ...headers }
}
Toast.allowMultiple()
let tipsToast = ''
if (toast) {
tipsToast = Toast.loading({
message: '正在请求...',
duration: 0,
forbidClick: true,
loadingType: 'spinner'
})
}
return new Promise((resolve, reject) => {
instance.get(url, options).then(res => {
const { code, data, message } = res
// console.log(code, typeof code, '11111111111111')
toast && tipsToast.clear()
if (code === 200) {
resolve(data)
} else if (code === -300) {
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
} else {
reject(res)
Toast(message)
}
}).catch(err => {
toast && tipsToast.clear()
reject(err)
})
})
},
post (url, data, headers, params, toast = true) {
const options = {}
options.headers = {
token: window.localStorage.getItem('token'),
type: 1
}
if (params) {
options.params = params
}
if (headers) {
options.headers = { ...options.headers, ...headers }
}
Toast.allowMultiple()
let tipsToast = ''
if (toast) {
tipsToast = Toast.loading({
message: '正在请求...',
duration: 0,
forbidClick: true,
loadingType: 'spinner'
})
}
return new Promise((resolve, reject) => {
instance.post(url, data, options).then(res => {
const { code, data, message } = res
toast && tipsToast.clear()
if (code === 200) {
resolve(data)
} else if (code === -300) {
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
} else {
reject(res)
Toast(message)
}
}).catch(err => {
toast && tipsToast.clear()
reject(err)
})
})
},
put (url, params, headers) {
const options = {}
if (headers) {
options.headers = { ...options.headers, ...headers }
}
return new Promise((resolve, reject) => {
instance.put(url, params, options).then(res => {
const { code, data, message } = res
if (code === 200) {
resolve(data)
} else if (code !== 400) {
reject(res)
Toast(message)
}
}).catch(err => {
reject(err)
})
})
},
delete (url, params, headers) {
const options = {}
if (params) {
options.params = params
}
if (headers) {
options.headers = { ...options.headers, ...headers }
}
return instance.delete(url, options)
}
}
This diff is collapsed.
/**
* 格式化手机号
* @param {string} tel 手机号
*/
export function formatTel (tel) {
var phone = tel.substr(0, 3) + '****' + tel.substring(7, 11)
return phone
}
export default {
purchase: [
{
name: 'purchase_plan',
title: '采购计划',
icon: require('@assets/images/index/icon1-plan.png'),
page: 'purchasePlan',
num: 0
},
{
name: 'purchase_order',
title: '采购订单',
icon: require('@assets/images/index/icon1-order.png'),
page: 'purchaseOrder',
num: 0
},
{
name: 'purchase_ruku',
title: '入库订单',
icon: require('@assets/images/index/icon1-ruku.png'),
page: 'purchaseEntry',
num: 0
},
{
name: 'purchase_goods',
title: '入库商品',
icon: require('@assets/images/index/icon1-goods.png'),
page: 'goodsList',
params: 'entry',
num: 0
}
],
sale: [
{
name: 'purchase_plan',
title: '销售订单',
icon: require('@assets/images/index/icon2-sale-order.png'),
page: 'saleOrder',
num: 0
},
{
name: 'purchase_order',
title: '销售商品',
icon: require('@assets/images/index/icon2-sale-goods.png'),
page: 'saleGoodsList',
params: 'sale',
num: 0
},
{
name: 'purchase_ruku',
title: '出库订单',
icon: require('@assets/images/index/icon2-chuku.png'),
page: 'saleOutOrder',
num: 0
},
{
name: 'purchase_goods',
title: '出库商品',
icon: require('@assets/images/index/icon2-chuku-goods.png'),
page: 'saleOutGoodsList',
params: 'out',
num: 0
}
],
archives: [
{
name: 'purchase_plan',
title: '调价清单',
icon: require('@assets/images/index/icon3-adjust-price.png'),
page: 'adjustPrice',
num: 0
},
{
name: 'purchase_order',
title: '调价商品',
icon: require('@assets/images/index/icon3-adjust-goods.png'),
page: 'adjustPriceGoods',
num: 0
},
{
name: 'purchase_ruku',
title: '调库清单',
icon: require('@assets/images/index/icon3-stock.png'),
page: 'adjustStock',
num: 0
},
{
name: 'purchase_goods',
title: '调库商品',
icon: require('@assets/images/index/icon3-goods.png'),
page: 'adjustStockGoods',
num: 0
}
],
devops: [
{
name: 'purchase_plan',
title: '商品档案',
icon: require('@assets/images/index/icon4-goods-list.png'),
page: 'goods',
num: 0
},
{
name: 'purchase_order',
title: '采购退货',
icon: require('@assets/images/index/icon4-purchase.png'),
page: 'purchaseReturn',
num: 0
},
// todo: 采购换货 -- 首页num需要修改
// {
// name: 'purchase_ruku',
// title: '采购换货',
// icon: require('@assets/images/index/icon4-exchange.png'),
// page: 'purchaseExchange',
// num: 0
// },
{
name: 'purchase_ruku',
title: '销售退货',
icon: require('@assets/images/index/icon4-sale.png'),
page: 'saleReturn',
num: 0
},
{
name: 'purchase_goods',
title: '赠送入库',
icon: require('@assets/images/index/icon4-free.png'),
page: 'freeList',
num: 0
},
{
name: 'purchase_goods',
title: '协助订单',
icon: require('@assets/images/index/icon4-goods.png'),
page: 'assistList',
num: 0
// tips: true
}
]
}
// 机构信息
export const SELFSHOP = 'self_shop'
// 采购计划的购物车
export const PURCHASE_CART = 'PURCHASE_CART'
// 添加采购计划商品页面数据
export const PURCHASE_DATA = 'PURCHASE_DATA'
// 采购计划、采购订单列表、销售列表、赠送入库列表刷新
export const PURCHASE_LIST = 'PURCHASE_LIST'
export const REFRESH_LIST = 'REFRESH_LIST'
// 详情页刷新
export const DETAIL_REFRESH = 'DETAIL_REFRESH'
// 采购退货刷新
export const PURCHASE_RETURN_REFRESH = 'PURCHASE_RETURN_REFRESH'
// 销售退货刷新
export const SALE_RETURN_REFRESH = 'SALE_RETURN_REFRESH'
// 选择商户
export const CHOOSE_SHOP = 'CHOOSE_SHOP'
// 选择添加的商品
export const CHOOSE_ADD_GOODS = 'CHOOSE_ADD_GOODS'
// 添加赠送入库刷新
export const ADD_FREE_REFRESH = 'ADD_FREE_REFRESH'
// 个人中心刷新(机构切换刷新)
export const MY_REFRESH = 'MY_REFRESH'
// 首页刷新(绑定机构)
export const INDEX_REFRESH = 'INDEX_REFRESH'
/**
* 设置缓存 getLocalStorage
* @param {*} key key
* @param {*} value 值
*/
export function setLocalStorage (key, value) {
window.localStorage.setItem(key, window.JSON.stringify(value))
}
/**
* 获取指定缓存 getLocalStorage
* @param {*} key key值
* @returns
*/
export function getLocalStorage (key) {
return window.JSON.parse(window.localStorage.getItem(key)) || ''
}
/**
* 清除指定缓存clearStorage
* @param {*} key key值
*/
export function removeLocalStorage (key) {
window.localStorage.removeItem(key)
}
/**
* 清空缓存
*/
export function clearStorage () {
window.localStorage.clear()
}
import { Toast, Dialog } from 'vant'
function selfLoading (msg = '加载中...') {
Toast.loading({
message: msg,
duration: 0,
forbidClick: true,
loadingType: 'spinner'
})
}
export default {
selfLoading: selfLoading
}
@charset "UTF-8";
html, body, div, span, applet, object, iframe, h1, h2, h3,
h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address,
big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption, tbody, tfoot,
thead, tr, th, td, input, select {
margin:0;
padding:0;
/*font-family:sans-serif;*/
font-weight:inherit;
font-style:inherit;
font-size:inherit;
text-align:inherit;
vertical-align:baseline;
color:inherit;
border:0;
outline:0;
}
html,
body {
max-width: 1024px;
margin: 0 auto;
-webkit-user-select: none;
font-size: .3rem;
background: #F5F5F5;
width: 100vw;
overflow-x: hidden;
padding-left: calc(100vw - 100%);
}
body>iframe {
display: none;
}
html,
body,
textarea,
input,
button,
select,
keygen,
legend {
color: #333;
outline: 0;
}
:focus {
outline: 0;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
table {
border-collapse: separate;
border-spacing: 0;
}
caption,
th,
td {
text-align: left;
font-weight: normal;
}
a {
display: block;
text-decoration: none;
}
a img,
iframe {
border: none;
}
img {
max-width: 100%;
height: auto;
}
ol,
ul,
li {
list-style: none;
}
input,
textarea,
select,
button {
font-size: 100%;
font-family: inherit;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-touch-callout: none;
}
\ No newline at end of file
@import "../global.scss";
.editItem-cont {
font-size: .28rem;
// header
.menu-header {
@extend .flex-h;
@extend .flex-align-center;
@extend .flex-space-between;
width: 6.9rem;
height: 1rem;
position: fixed;
left: 50%;
top: 0.1rem;
margin-left: -3.45rem;
background: #ffffff;
padding: 0.2rem;
.tab-item {
@extend .flex-h;
width: 4rem;
font-weight: bold;
.title {
display: inline-block;
width: 0.8rem;
max-width: 1.2rem;
}
}
.add-btn {
@extend .flex-h;
@extend .flex-hc;
@extend .flex-align-center;
width: 2rem;
height: .5rem;
background: $color-main;
color: #ffffff;
border-radius: .3rem;
}
.disabled-btn {
opacity: 0.6;
}
}
}
.goods-view {
margin: 1.2rem auto;
padding: .2rem;
}
.goods-item {
width: 100%;
border-bottom: 1px solid $border-color;
padding: 0 0 .3rem 0;
margin-bottom: .3rem;
.top-cont {
@extend .flex-h;
@extend .flex-align-center;
width: 100%;
}
.goods-img {
width: 1.34rem;
min-width: 1.34rem;
height: 1.34rem;
border-radius: .15rem;
border: 1px solid $border-color;
margin-right: .3rem;
}
.goods-msg-cont {
width: 100%;
.goods-name {
width: 100%;
font-size: .32rem;
font-weight: bold;
margin-bottom: .1rem;
}
.goods-price {
color: #FF5500;
}
}
}
.operate-cont {
@extend .flex-h;
@extend .flex-space-between;
@extend .flex-align-center;
margin-top: .2rem;
.del-btn {
padding: 0.05rem 0.2rem;
color: #F01251;
}
.group-btn {
@extend .flex-h;
@extend .flex-end;
@extend .flex-align-center;
width: 3.5rem;
.van-stepper {
margin-right: .13rem;
}
/deep/ .van-stepper--round .van-stepper__plus {
background: linear-gradient(-67deg, #325BEF, #5F82FF) !important;
}
/deep/ .van-stepper--round .van-stepper__minus {
color: #515151;
border-color: $text-gray;
}
// /deep/ .van-stepper--round .van-stepper__input {
// // border: 1px solid #f2f3f5;
// // width: 0.7rem;
// // margin: 0 0.1rem;
// }
}
.jia {
width: .44rem;
height: .44rem;
border-radius: 50%;
text-align: center;
line-height: .44rem;
color: #ffffff;
font-size: .46rem;
background: linear-gradient(-67deg, #325BEF, #5F82FF);
margin-right: .13rem;
}
}
.bottom-cont {
width: 100%;
padding: .1rem 0;
background: #ffffff;
position: fixed;
left: 0;
bottom: 0;
z-index: 60;
}
.submit-btn {
width: 6.9rem;
height: .82rem;
line-height: .82rem;
text-align: center;
background: $color-main;
color: #ffffff;
font-size: .32rem;
margin: 0 auto;
border-radius: .12rem;
&.disabled-btn {
opacity: 0.6;
}
}
.del-btn {
font-size: .36rem;
}
.custom-image {
margin-top: 1.5rem;
}
.goods-all-price {
@extend .flex-h;
@extend .flex-end;
width: 100%;
padding: 0 0 .1rem 0;
font-size: .32rem;
}
.placeholder-cont {
height: 2rem;
}
.text-tips {
color: #F01251;
}
\ No newline at end of file
@import "../global.scss";
.condition-header {
.cont-list {
@extend .flex-h;
@extend .flex-align-center;
width: 100%;
height: .96rem;
background: #ffffff;
font-size: .28rem;
padding: 0 .3rem;
}
.header {
@extend .flex-hc;
background: $color-main;
color: #ffffff;
border-bottom: 1px solid #eeeeee;
}
.condition-cont {
@extend .flex-space-between;
}
}
.btn-cont {
@extend .flex-h;
@extend .flex-align-center;
margin: 0 0.1rem;
min-width: 1.4rem;
max-width: 30%;
text-align: center;
.item-condition-cont {
display: inline-block;
width: 90%;
margin-right: 0.05rem;
}
.iconfont {
display: inline-block;
font-size: .2rem;
}
}
.condition-header-one {
.cont-list {
padding: 0 .1rem;
}
.condition-cont-one {
.btn-cont {
max-width: 50%;
}
}
}
\ No newline at end of file
@import "../global.scss";
.my-tabbar {
@extend .flex-h;
@extend .flex-align-center;
@extend .flex-space-around;
position: fixed;
width: 100%;
height: .98rem;
left: 0;
bottom: 0;
border-top: 1px solid #eeeeee;
background-color: #fbfbfb;
z-index: 99;
}
.my-tabbar .tabbar-item {
@extend .flex-v;
@extend .flex-hc;
@extend .flex-align-center;
width: 1.5rem;
height: 100%;
text-align: center;
font-size: 0.26rem;
color: #333333;
}
.tabbar-item.active {
color: $color-main;
}
.tabbar-item img {
width: 0.44rem;
height: 0.44rem;
margin: 0 auto;
}
\ No newline at end of file
/* flex兼容性 */
/* 父元素-横向排列(主轴) */
.flex-h {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
}
/* 父元素-纵向排列(主轴) */
.flex-v {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: vertical;
/* 12版 */
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
}
.flex-hb {
-webkit-box-pack: space-between;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
-o-justify-content: space-between;
justify-content: space-between;
}
.flex-vc {
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
}
.flex-hr {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
/* 09版 */
-webkit-box-orient: horizontal;
/* 12版 */
-webkit-flex-direction: row-reverse;
-moz-flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
-o-flex-direction: row-reverse;
flex-direction: row-reverse;
}
/* justify-content 属性 */
.flex-hc {
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
}
.flex-space-between {
-webkit-box-pack: space-between;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
-o-justify-content: space-between;
justify-content: space-between;
}
.flex-space-around {
-webkit-box-pack: space-around;
-webkit-justify-content: space-around;
-moz-justify-content: space-around;
-ms-justify-content: space-around;
-o-justify-content: space-around;
justify-content: space-around;
}
.flex-start {
-webkit-box-pack: flex-start;
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
-o-justify-content: flex-start;
justify-content: flex-start;
}
.flex-end {
-webkit-box-pack: flex-end;
-webkit-justify-content: flex-end;
-moz-justify-content: flex-end;
-ms-justify-content: flex-end;
-o-justify-content: flex-end;
justify-content: flex-end;
}
/* align-item 属性 */
.flex-align-center {
/* 09版 */
-webkit-box-align: center;
/* 12版 */
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
}
.flex-align-start {
/* 09版 */
-webkit-box-align: flex-start;
/* 12版 */
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
-o-align-items: flex-start;
align-items: flex-start;
}
.flex-align-end {
/* 09版 */
-webkit-box-align: flex-end;
/* 12版 */
-webkit-align-items: flex-end;
-moz-align-items: flex-end;
-ms-align-items: flex-end;
-o-align-items: flex-end;
align-items: flex-end;
}
/* 父元素-横向换行 */
.flex-hw {
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
-o-flex-wrap: wrap;
flex-wrap: wrap;
}
.flex1 {
flex: 1;
-webkit-flex: 1;
}
@import "@assets/styles/flex.scss";
@import "@assets/styles/common.scss";
// 主题颜色
$color-main: #325BEF;
$bg-color-light: #F5F7FE;
$border-color: #e7e7e7;
$text-gray: #989794;
// 弹出框
.self-dialog .van-goods-action-button--first {
border-radius: .5rem !important;
color: #000000 !important;
width: 2.72rem !important;
background: #dddddd !important;
margin-right: 0.3rem;
}
.self-dialog .van-goods-action-button--last {
border-radius: .5rem !important;
width: 2.72rem !important;
}
.self-dialog .van-dialog__content {
padding: 0.2rem 0;
}
.placeholder-list-cont {
height: 1rem;
}
// 购物车数量操作按钮
.group-cont {
@extend .flex-h;
@extend .flex-align-center;
margin-right: .13rem;
.self-btn {
@extend .flex-h;
@extend .flex-hc;
@extend .flex-align-center;
width: .44rem;
min-width: .44rem;
height: .44rem;
border-radius: 50%;
text-align: center;
font-size: .36rem;
}
.add-btn {
color: #ffffff;
background: linear-gradient(-67deg, #325BEF, #5F82FF);
// margin-right: .13rem;
}
.reduce-btn {
color: #515151;
border: 1px solid $text-gray;
// margin-left: .13rem;
span {
margin-top: -.05rem;
}
}
/deep/ .van-cell.van-field {
height: .43rem;
}
/deep/ .van-field__body {
// border: 1px solid #f2f3f5;
width: 0.7rem;
height: 100%;
margin: 0 0.1rem;
input {
text-align: center;
}
}
}
// 公共盒子 module-view
.module-view {
width: 6.9rem;
background: #ffffff;
border-radius: .15rem;
box-shadow: -1px 0px 9px 0px rgba(210, 210, 210, 0.36);
font-size: .28rem;
color: #000000;
margin-bottom: .12rem;
}
// 划线
.through-text {
text-decoration: line-through;
}
.table-cont {
width: 100%;
border-left: 1px solid $border-color;
tr {
width: 100%;
&.table-header {
// background: #F8FAFF;
td {
border-top: 1px solid $border-color;
}
}
.first-cont {
background: #F8FAFF;
width: 1.5rem;
}
.second-cont {
width: 2.3rem;
}
td {
@extend .flex1;
text-align: center;
border-bottom: 1px solid $border-color;
border-right: 1px solid $border-color;
}
}
}
// 空盒子
.self-empty-cont {
color: $text-gray;
text-align: center;
font-size: .26rem;
line-height: 1rem;
}
.changetext {
color: #F01251;
/deep/ .van-field__control {
color: #F01251;
}
}
.no-bottom-border {
border-bottom: none !important;
}
// 扫码支付
.code-content {
width: 6rem;
height: 4.6rem;
border-radius: 0.2rem;
padding: .35rem .2rem .2rem .2rem;
img {
width: 3rem;
height: 3rem;
margin: .2rem auto;
display: block;
}
.code-title {
text-align: center;
}
.code-money {
text-align: center;
font-weight: bold;
color: #F01251;
}
}
//
.self-cont-sticky .van-sticky.van-sticky--fixed {
width: 1rem !important;
}
\ No newline at end of file
@import "../global.scss";
.menu-header {
@extend .flex-h;
@extend .flex-align-center;
width: 100%;
padding: .3rem 0;
border-bottom: 1px solid $border-color;
.title-icon {
display: inline-block;
width: .05rem;
height: .32rem;
background: $color-main;
margin-right: .1rem;
}
.title-cont {
font-size: .32rem;
}
}
.list-cont {
@extend .flex-h;
@extend .flex-align-center;
// @extend .flex-space-between;
@extend .flex-hw;
padding: .3rem 0 0 0;
}
.list-item {
@extend .flex-v;
@extend .flex-hc;
@extend .flex-align-center;
width: 1.48rem;
height: 1.48rem;
border: 1px solid #F0F0F0;
background: #F8F8F8;
font-size: .22rem;
margin-bottom: .15rem;
margin-right: .325rem;
&.no-margin {
margin-right: 0 !important;
}
.icon-img-cont {
position: relative;
margin-bottom: .12rem;
.icon-num-tips {
display: inline-block;
width: .24rem;
height: .24rem;
border-radius: 50%;
background: #F11A1A;
position: absolute;
right: -0.15rem;
top: -.13rem;
text-align: center;
line-height: .24rem;
color: #ffffff;
font-size: .12rem;
}
}
.icon-img {
width: auto;
height: .5rem;
}
}
\ No newline at end of file
/* 一行显示 */
.one-line {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.two-line {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-webkit: line clamp 2;
-moz-webkit: line clamp 2;
-ms-webkit: line clamp 2;
-o-webkit: line clamp 2;
-webkit-line-clamp: 2;
}
.three-line {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-webkit: line clamp 3;
-moz-webkit: line clamp 3;
-ms-webkit: line clamp 3;
-o-webkit: line clamp 3;
-webkit-line-clamp: 3;
}
.four-line {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-webkit: line clamp 4;
-moz-webkit: line clamp 4;
-ms-webkit: line clamp 4;
-o-webkit: line clamp 4;
-webkit-line-clamp: 4;
}
@import "../global.scss";
.login-view {
min-height: 100vh;
background: #ffffff;
}
.logo-view {
padding: 1.03rem 0 1.19rem 0;
text-align: center;
img {
width: 2.07rem;
height: 2.074rem;
margin: 0 auto;
}
.title {
font-size: .32rem;
color: #000000;
font-weight: bold;
}
}
.filed-list {
@extend .flex-h;
@extend .flex-align-center;
width: 5.95rem;
height: 1.02rem;
background: $bg-color-light;
border-radius: .12rem;
margin: 0 auto 0.3rem auto;
padding: 0 .3rem;
.icon-img {
width: .25rem;
height: auto;
margin-right: .3rem;
}
/deep/ .van-cell.van-field {
height: 100%;
background: $bg-color-light;
.van-field__body {
width: 100%;
height: 100%;
}
}
.code-btn {
width: 1.7rem;
height: .6rem;
border-radius: .12rem;
color: #ffffff;
background: $color-main;
text-align: center;
line-height: .6rem;
font-size: .24rem;
}
}
.code-cont {
/deep/ .van-cell.van-field {
width: 55%;
margin-right: 0.3rem;
}
}
.login-btn {
width: 5.95rem;
height: .9rem;
line-height: .9rem;
text-align: center;
color: #ffffff;
background: $color-main;
border-radius: 0.5rem;
margin: 2rem auto 0.5rem;
}
.login-tip {
color: #9F9F9F;
font-size: 0.24rem;
margin: 0 auto;
text-align: center;
}
\ No newline at end of file
@import "../global.scss";
.tips-cont {
@extend .flex-h;
@extend .flex-space-between;
width: 100%;
height: 2.36rem;
background: $color-main;
color: #ffffff;
padding: .4rem .3rem .3rem .3rem;
font-size: .28rem;
.left-cont {
width: 4rem;
.tips-title {
@extend .flex-h;
@extend .flex-align-center;
font-size: .36rem;
margin-bottom: .16rem;
img {
width: .35rem;
height: .35rem;
margin-left: .12rem;
vertical-align: middle;
}
}
.tip-text {
font-size: .32rem;
margin-top: .2rem;
}
}
.btn {
@extend .flex-h;
@extend .flex-hc;
@extend .flex-align-center;
min-width: 1.6rem;
max-width: 2.5rem;
height: .46rem;
border: 1px solid #ffffff;
text-align: center;
line-height: .46rem;
border-radius: .25rem;
font-size: .28rem;
padding: 0 .1rem;
p {
margin-right: .05rem;
}
.iconfont {
font-size: .16rem;
}
}
.purchase-btn {
width: 1.88rem;
height: .6rem;
line-height: .6rem;
color: #000000;
background: #FFCA3C;
text-align: center;
line-height: .6rem;
border-radius: .16rem;
margin-top: .56rem;
// &.disabled-btn {
// color: #cccccc;
// background: #aca9a2;
// }
&.disabled-btn {
opacity: 0.6;
}
}
}
.content {
padding: .1rem .3rem;
background: #ffffff;
margin-top: .12rem;
}
.placeholder-view {
width: 100%;
height: 2rem;
background: #ffffff;
}
\ No newline at end of file
@import "../global.scss";
.cont {
min-height: 100vh;
background: #ffffff;
}
.tel input{
width: 6.9rem;
height: 0.97rem;
border-bottom: 1px solid #F1F1F1;
position: relative;
margin: 0 auto;
}
.code input{
width: 6.9rem;
height: 0.97rem;
border-bottom: 1px solid #F1F1F1;
margin: 0 auto;
display: block;
}
input::-webkit-input-placeholder{
color: #C8C8C8;
font-size: 0.28rem;
}
.tel .getCode{
width: 2rem;
height: 0.6rem;
background: #0054FF;
border-radius: 0.3rem;
color: #fff;
text-align: center;
line-height: 0.6rem;
position: absolute;
top: 0.2rem;
right: 0.1rem;
}
.submit-btn{
width: 6.9rem;
height: 0.9rem;
background: #0054FF;
border-radius: 0.43rem;
color: #fff;
text-align: center;
line-height: 0.9rem;
margin: 0.8rem auto;
}
<template>
<div>
<!-- 筛选 -->
<div class="condition-header" :class="curType.length < 3 ? 'condition-header-one' : '' ">
<div class="header cont-list">{{selfShop ? selfShop.text : '--'}}</div>
<div class="condition-cont cont-list" :class="curType.length < 3 ? 'condition-cont-one' : '' " v-if="curType.length">
<!-- 审核状态 -->
<template v-for="(item, index) in curType">
<p class="btn-cont" @click="showPicker=true" v-if="item == 'status'" :key='index'>
<span class="one-line item-condition-cont">{{cur_audit_status.text}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 其它状态 -->
<p class="btn-cont" @click="otherShow=true" v-if="item == 'otherstatus'" :key='index'>
<span class="one-line item-condition-cont">{{cur_other_status.text}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 供应商审核 (采购:采购订单、入库订单) -->
<p class="btn-cont" @click="supplierShow=true" v-if="item == 'supplier'" :key="index">
<span class="one-line item-condition-cont">{{cursupplier.text ? cursupplier.text : '供货商选择'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 商户 -->
<p class="btn-cont time-btn" @click="goMerchant" v-if="item == 'shop'" :key="index">
<span class="one-line item-condition-cont">{{storeDetail ? storeDetail.shop_name : '全部商户'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 商品 -->
<p class="btn-cont time-btn" @click="goGoods" v-if="item == 'goods'" :key="index">
<span class="one-line item-condition-cont">{{goodsDetail ? goodsDetail.title : '全部商品'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
<!-- 日期 -->
<p class="btn-cont time-btn" @click="showDate" v-if="item == 'date'" :key="index">
<span class="one-line item-condition-cont">{{cur_date ? cur_date : '日期'}}</span>
<span class="iconfont icon-arrow-down"></span>
</p>
</template>
</div>
</div>
<!-- 选择审核状态 -->
<van-popup v-model="showPicker" round position="bottom">
<van-picker
title="状态"
show-toolbar
:default-index="cur_audit_index"
:columns="auditStatusList"
@confirm="chooseAuditStatus"
@cancel="showPicker = false"
/>
</van-popup>
<van-popup v-model="otherShow" round position="bottom">
<van-picker
title="状态"
show-toolbar
:default-index="cur_other_index"
:columns="otherStatusList"
@confirm="chooseOtherStatus"
@cancel="otherShow = false"
/>
</van-popup>
<!-- 选择时间 -->
<van-calendar
v-model="dateShow"
type="range"
:max-date="curday"
:min-date="minday"
:default-date="defaultday"
@confirm="chooseDate"
:allow-same-day="true"
ref="dateview"
color="#325BEF"
:poppable="true"
>
</van-calendar>
<!-- 选择供应商 -->
<van-popup v-model="supplierShow" round position="bottom">
<van-picker
title="供应商"
show-toolbar
:default-index="cur_sup_index"
:columns="supplier"
@confirm="chooseSupplier"
@cancel="supplierShow = false"
/>
</van-popup>
</div>
</template>
<script>
import { SELFSHOP, getLocalStorage } from '@assets/js/self.js'
export default {
name: 'myCondition',
props: {
curType: {
type: Array,
default: () => ['date']
},
// 审核状态信息
auditStatusList: { // 审核状态列表
type: Array,
default: () => [{ key: 1, text: '待审核状态' }, { key: 2, text: '全部' }]
},
cur_audit_status: { // 当前选中的审核状态
type: Object,
value: { key: 1, text: '待审核状态' }
},
// 供应商
supplier: { // 供应商列表
type: Array,
value: [{ id: 0, text: '全部供应商' }]
},
cursupplier: { // 当前选中的供应商
type: Object,
value: { id: 0, text: '全部供应商' }
},
// 其它状态
otherStatusList: {
type: Array,
default: () => [{ key: 1, text: '已下单/已接单' }, { key: 2, text: '全部' }]
},
cur_other_status: {
type: Object,
value: { key: 1, text: '已下单/已接单' }
},
// 商户
storeDetail: {
type: Object,
value: null
},
// 商品
goodsDetail: {
type: Object,
value: null
},
cur_date: {
type: String,
value: ''
}
},
computed: {
cur_audit_index: (vm) => {
return 0
// return vm.auditStatusList.findIndex(item => item.key === vm.cur_audit_status.key)
},
cur_sup_index: (vm) => {
return 0
// return vm.supplier.findIndex(item => item.key === vm.cursupplier.key)
},
cur_other_index: (vm) => {
return vm.otherStatusList.findIndex(item => item.key === 1)
}
},
data () {
return {
selfShop: null,
// curIndex: 0,
// 审核状态
showPicker: false,
// 供应商
supplierShow: false,
// 其它
otherShow: false,
// 日期
dateShow: false,
curday: new Date(),
minday: new Date('2021-06-01'),
defaultday: new Date()
}
},
methods: {
// 选择审核状态
chooseAuditStatus (value, index) {
// this.curIndex = index
this.showPicker = false
this.$emit('chooseAuditStatus', value, index)
},
// 选择其它状态
chooseOtherStatus (value, index) {
// this.curIndex = index
this.otherShow = false
this.$emit('chooseOtherStatus', value, index)
},
// 选择供应商
chooseSupplier (value, index) {
// this.cur_sup_index = index
this.supplierShow = false
this.$emit('chooseSupplier', value, index)
},
// 日期
showDate () {
this.$refs.dateview.reset()
this.dateShow = true
},
chooseDate (date) {
const [start, end] = date
this.dateShow = false
const curStatus = this.curType.length > 2
const curdate = `${this.formatDate(start, curStatus)} ~ ${this.formatDate(end, curStatus)}`
var formatDate = `${this.formatDate(start)},${this.formatDate(end)}`
this.$emit('changeDate', {
cur_date: curdate,
format_date: formatDate
})
},
formatDate (date, curStatus = false) {
var d = new Date(date)
var month = '' + (d.getMonth() + 1)
var day = '' + d.getDate()
var year = d.getFullYear()
if (month.length < 2) month = '0' + month
if (day.length < 2) day = '0' + day
if (curStatus) {
return [month, day].join('-')
}
return [year, month, day].join('-')
},
// 商户
goMerchant () {
// chooseShop
this.$router.push({
name: 'searchShop'
})
},
// 商品
goGoods () {
// changeGoods
const idlist = []
if (this.goodsDetail) {
idlist.push(this.goodsDetail.id)
}
this.$router.push({
name: 'addGoodsSearch',
params: {
ids: idlist,
type: 2 // 选择商品
}
})
}
},
mounted () {
this.selfShop = getLocalStorage(SELFSHOP) ? getLocalStorage(SELFSHOP) : null
this.showPicker = false
this.supplierShow = false
this.otherShow = false
this.dateShow = false
this.curday = new Date()
this.minday = new Date('2021-06-01')
this.defaultday = new Date()
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/common/module.scss";
</style>
<template>
<div>
头部
</div>
</template>
<script>
export default {
name: 'Header',
data () {
return {
}
}
}
</script>
<template>
<div class="list-tips">
<div class="self-tips-view" v-if="isloading && more">
<van-loading size="24px">加载中...</van-loading>
</div>
<div class="self-tips-view" v-else-if="!more">没有更多了</div>
</div>
</template>
<script>
export default {
name: 'list-tips',
props: {
more: {
type: Boolean,
defalut: false
},
isloading: {
type: Boolean,
defalut: false
}
}
}
</script>
<style lang="scss" scoped>
.self-tips-view {
width: 100%;
height: 1rem;
text-align: center;
line-height: 1rem;
color: #969799;
font-size: .22rem;
}
</style>
<template>
<div class="my-tabbar">
<div
class="tabbar-item"
v-for="(item, index) in list"
:key="index"
:class="{ active: item.name == curname }"
@click="changetab(item)"
>
<img :src="item.name == curname ? item.active_icon : item.normal_icon" />
<p>{{ item.title }}</p>
</div>
</div>
</template>
<script>
export default {
name: 'myTabbar',
props: {
curname: {
type: String,
default: 'home'
}
},
data () {
return {
them_color: '',
list: [
{ name: 'home', title: '工单', url: 'home', active_icon: require('@assets/images/tabbar/icon_01_sel.png'), normal_icon: require('@assets/images/tabbar/icon_01_nor.png') },
{ name: 'my', title: '我的', url: 'mine', active_icon: require('@assets/images/tabbar/icon_03_sel.png'), normal_icon: require('@assets/images/tabbar/icon_03_nor.png') }
]
}
},
methods: {
changetab (item) {
if (item.url !== this.curname) {
this.$router.replace({
name: item.url
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/common/tabbar.scss";
</style>
<template>
<div class="editItem-cont">
<!-- header -->
<div class="menu-header module-view">
<div class="tab-item">
<span class="title">{{title}}</span>
<p class="one-line">{{title_cont}}</p>
</div>
<div class="add-btn flex-h flex-vc" @click="addGoods">
<!-- <div class="add-btn flex-h flex-vc" :class="selflist.length?'':'disabled-btn'" @click="addGoods"> -->
<span>+添加商品</span>
</div>
</div>
<!-- -->
<div class="goods-view module-view" v-if="list.length">
<div class="goods-item" v-for="(item, index) in list" :key="item.id">
<div class="top-cont">
<img class="goods-img" :src="item.img_url" />
<div class="goods-msg-cont">
<p class="goods-name one-line">{{item.title}}</p>
<p class="goods-price" v-if="page_type=='sale'">批发价:¥{{item.price}}</p>
<p class="goods-price" v-else>进货价:¥{{item.purchase_price}}</p>
</div>
</div>
<div class="operate-cont">
<span class="del-btn iconfont icon-shanchu-copy-copy-copy-copy-copy-copy" @click="del_click(item, index)"></span>
<div class="group-btn">
<div class="group-cont">
<div class="reduce-btn self-btn"
@click="numChange('reduce', item.choose_num, index)">
<span class="iconfont icon-houdongfangiconfont30"></span>
</div>
<van-field
v-model.trim.number="item.choose_num"
type="digit"
min="1"
@focus="focusInput(item, index)"
@blur="numChange('', item.choose_num, index)"
/>
<div class="add-btn self-btn" @click="numChange('add', item.choose_num, index)">
<span class="iconfont icon-jia2" ></span>
</div>
</div>
<span>{{item.unit}}</span>
</div>
</div>
</div>
<div class="goods-all-price" v-if="page_type!='sale'">
小计: ¥{{allPrice ? allPrice : '0.00'}}
</div>
<div class="goods-all-price1 flex-h flex-align-center flex-space-between" v-else>
<p>原订单金额: ¥{{self_allprice}}</p>
<p :class="Number(self_allprice) != Number(allPrice) ? 'text-tips': ''">小计: ¥{{allPrice ? allPrice : '0.00'}}</p>
</div>
</div>
<!-- 空数据 -->
<van-empty class="custom-image" description="暂无商品信息" v-if="!list.length" />
<div class="placeholder-cont"></div>
<div class="bottom-cont">
<div v-if="list.length > 0" class="submit-btn" @click="submitClick">保存</div>
<div v-else class="submit-btn disabled-btn">保存</div>
</div>
</div>
</template>
<script>
export default {
name: 'editItem',
props: {
title: {
type: String,
value: '采购仓'
},
title_cont: {
type: String,
value: ''
},
selflist: {
type: Array,
value: []
},
list: {
type: Array,
value: []
},
ids: {
type: Array,
value: []
},
isClick: {
type: Boolean,
value: false
},
page_type: {
type: String,
value: ''
},
self_allprice: {
type: [String, Number],
value: '0.00'
}
},
computed: {
allPrice: vm => {
return vm.getAllPrice()
}
},
data () {
return {
ischange: 0, // input聚焦更改为空时
isloading: true
}
},
methods: {
// 添加商品
addGoods () {
// console.log(this.selflist, '11111')
// if (!this.selflist.length) return
this.$router.push({
name: 'addGoodsSearch',
params: {
ids: this.ids,
type: 1 // 添加商品
}
})
},
del_click (item, index) {
this.$dialog.confirm({
title: '提示',
message: '确定删除当前商品',
theme: 'round-button',
confirmButtonColor: '#325BEF',
cancelButtonColor: '#FFFFFF',
className: 'self-dialog'
})
.then(() => {
// list
const midList = this.list
midList.splice(index, 1)
this.$emit('changeList', midList)
// ids
const midIds = this.ids
const curIndex = midIds.indexOf(item.id)
if (curIndex !== -1) {
midIds.splice(curIndex, 1)
this.$emit('changeIds', midIds)
}
})
.catch(() => {})
},
focusInput (item, index) {
this.ischange = item.id
},
// 购物车数量变换监听
cartNumChange (val) {
this.numChange(val.btnType, val.goodsid, val.curnum, val.index, true)
},
// 商品数量改变请求(列表、购物车)
numChange (btnType, curnum, index) {
let changenum = Number(curnum)
if (btnType === 'add') {
changenum = Number(curnum) + 1 // 加之后的数量
} else if (btnType === 'reduce') {
changenum = Number(curnum) - 1 <= 0 ? 1 : Number(curnum) - 1 // 减之后的数量
} else if (!curnum) {
changenum = 1
}
const midList = this.list
midList[index].choose_num = changenum
this.$emit('changeList', midList)
},
getAllPrice () {
let price = 0
this.list.forEach(item => {
const selfPrice = (this.page_type === 'sale' ? item.price : item.purchase_price)
price += Number(selfPrice) * item.choose_num
})
return Number(price.toFixed(2))
},
// 清空商品数据
emptyList () {
},
submitClick () {
if (this.isClick || !this.list.length) return
if (this.page_type === 'sale' && Number(this.self_allprice) !== Number(this.allPrice)) {
this.$toast('商品总价与与原订单总价不一致')
return
}
this.$dialog.confirm({
title: '提示',
message: '确定提交',
theme: 'round-button',
confirmButtonColor: '#325BEF',
cancelButtonColor: '#FFFFFF',
className: 'self-dialog'
})
.then(() => {
if (!this.list.length) {
this.$toast('请选择商品')
return
}
this.$emit('submitEvent')
})
.catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/common/edit_item.scss";
</style>
<template>
<div class="devopsGoodsItem">
<div class="top-cont">
<img
class="goods-img"
:src="data.img_url"
/>
<div class="goods-msg-cont">
<p class="goods-name one-line">{{data.title}}</p>
<p class="goods-supplier">{{data.provider? data.provider.name : ''}}</p>
</div>
</div>
<div class="operate-cont">
<table class="table-cont">
<tr class="table-header flex-h">
<td class="first-cont">进货价</td>
<td class="">{{data.purchase_price}}</td>
<td class="first-cont">库存</td>
<td class="">{{data.stock}}{{data.unit}}</td>
</tr>
<tr class="flex-h">
<td class="first-cont">批发价</td>
<td class="">{{data.price}}</td>
<td class="first-cont">预计库存</td>
<td class="">{{data.exp_stock}}{{data.unit}}</td>
</tr>
</table>
</div>
</div>
</template>
<script>
export default {
name: 'devopsGoodsItem',
props: {
data: {
type: Object,
value: null
}
},
data () {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/devops/devops.scss";
.devopsGoodsItem {
.top-cont {
@extend .flex-h;
@extend .flex-align-center;
width: 100%;
margin-bottom: .15rem;
}
.goods-img {
min-width: 1.34rem;
width: 1.34rem;
height: 1.34rem;
border-radius: 0.15rem;
border: 1px solid $border-color;
margin-right: 0.3rem;
}
.goods-msg-cont {
width: 70%;
.goods-name {
width: 100%;
font-size: 0.32rem;
font-weight: bold;
margin-bottom: 0.1rem;
}
}
}
</style>
<template>
<div class="my-menu-list">
<!-- header 标题 -->
<div class="menu-header">
<span class="title-icon"></span>
<p class="title-cont">{{title}}</p>
</div>
<!-- menu 菜单 -->
<div class="list-cont">
<div class="list-item" :class="!((index+1)%4 )? 'no-margin' : '' " v-for="(item, index) in list" :key="index" @click="gopage(item)">
<!-- <div class="icon-img-cont"> -->
<van-badge :content="item.num ? item.num : ''" max="99">
<img class="icon-img" :src="item.icon" />
</van-badge>
<!-- <span class="icon-num-tips" v-if="item.num">{{item.num}}</span> -->
<!-- </div> -->
<p class="text">{{item.title}}</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'myMenuList',
props: {
title: {
type: String,
default: 'home'
},
list: {
type: Array,
value: []
}
},
data () {
return {
}
},
methods: {
gopage (item) {
if (item.tips) {
this.$toast('功能即将上线,敬请期待')
return true
}
if (!item.page) return true
if (item.page === 'goodsList') {
this.$router.push({
name: item.page,
params: {
type: item.params
}
})
} else {
this.$router.push({
name: item.page
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/index/menulist.scss";
</style>
<template>
<div class="cart-list">
<!-- header -->
<div class="popup-header">
<div class='title'>已选商品</div>
<div @click="emptyCart">
<span class="iconfont icon-lajixiang"></span>
<span>清除购物车</span>
</div>
</div>
<div class="pupup-cont">
<div class="goods-item" v-for="(item, index) in list" :key="item.id">
<div class="top-cont">
<img
class="goods-img"
:src="item.goods.img_url"
/>
<div class="goods-msg-cont">
<p class="goods-name one-line">{{item.goods.title}}</p>
<p class="goods-price" v-if="priceType == 2">批发价:¥{{item.sell_price}}</p>
<p class="goods-price" v-else>进货价:¥{{item.price}}</p>
</div>
</div>
<div class="operate-cont">
<p class="stock-text">当前库存:{{item.goods.stock}}</p>
<div class="group-btn">
<div class="group-cont">
<div class="reduce-btn self-btn" v-if="item.num>0 || ischange == item.id" @click="numChange('reduce', item, index)"><span class="iconfont icon-houdongfangiconfont30"></span></div>
<van-field
v-model="item.num"
type="digit"
@focus="focusInput(item, index)"
@blur="numChange('', item, index)"
v-if="item.num>0 || ischange == item.id"
/>
<div class="add-btn self-btn" @click="numChange('add', item, index)"><span class="iconfont icon-jia2" ></span></div>
</div>
<span>{{item.unit}}</span>
</div>
</div>
</div>
<van-empty description="购物车暂无商品" v-if="!list.length" />
<!-- <div class="self-empty-cont" v-if="!list.length">购物车暂无商品</div> -->
</div>
</div>
</template>
<script>
export default {
name: 'cart-list',
props: {
list: {
type: Array,
value: []
},
priceType: {
type: [String, Number],
value: 1
}
},
data () {
return {
ischange: 0
}
},
methods: {
focusInput (item, index) {
this.ischange = item.id
},
numChange (btnType, item, index) {
this.$emit('cartNumChange', {
btnType: btnType,
goodsid: item.goods.id,
curnum: item.num,
index: index,
iscart: true
})
},
emptyCart () {
const _this = this
this.$dialog.confirm({
title: '提示',
message: '确认要清空购物车',
theme: 'round-button',
confirmButtonColor: '#325BEF',
cancelButtonColor: '#FFFFFF',
className: 'self-dialog'
})
.then(() => {
_this.$emit('emptyList')
})
.catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/purchase/cart-list.scss";
</style>
<template>
<div class="cart-nav">
<div class="bottom-cartBox flex-h flex-space-between flex-align-center">
<div class="flex-h flex-align-center">
<!-- logo -->
<div class="logo-view" @click="show_click">
<van-badge :content="cart_num > 0? cart_num : '' " max="99">
<div class="cart-logo iconfont icon-gwc" :class="cart_num>0?'cart-active':''"></div>
</van-badge>
</div>
<!-- msg -->
<div class="msg-view">
<span class="tips" v-if="cart_num<=0">未选购</span>
<span class="price" v-if="cart_num>0">{{cart_price ? cart_price : '0.00'}}</span>
</div>
</div>
<!-- 右侧盒子 -->
<div class="btn-view" v-if="cart_num<=0"></div>
<div class="btn-view1 flex-h flex-hc flex-align-center" v-if="cart_num>0" @click="goConfirm">
<span>确定</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'cart-nav',
props: {
cart_price: {
type: [String, Number],
value: '0.00'
},
cart_num: {
type: Number,
value: 6
},
next: {
type: String,
default: 'confirmOrder'
}
},
methods: {
show_click () {
if (this.cart_num) {
this.$emit('cartPopup', true)
}
},
goConfirm () {
this.$emit('submitClick')
// confirmOrder 采购计划订单确认页
// returnConfirm 退货订单确认页
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/purchase/cart-nav.scss";
</style>
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import myApi from './api/apiList'
import myAxios from './api/index'
import Vant from 'vant'
import 'vant/lib/index.css'
import vConsole from '@/plugins/vconsole.js'
import myCondition from '@/components/common/condition.vue'
import listTips from '@/components/common/listtips.vue'
// Vue.component('chooseDate', chooseDate)
// import chooseDate from '@/components/common/chooseDate.vue'
Vue.component('myCondition', myCondition)
Vue.component('listTips', listTips)
Vue.use(vConsole)
Vue.config.productionTip = false
Vue.prototype.$http = myAxios
Vue.prototype.$axios = axios
Vue.prototype.$myApi = myApi
Vue.use(Vant)
new Vue({
router,
store,
render: (h) => h(App)
}).$mount('#app')
import Vconsole from 'vconsole'
const vConsole = new Vconsole()
export default vConsole
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/tabbar/Home.vue'
// import selfApi from '@/api/apiList'
Vue.use(VueRouter)
const routes = [
{ path: '/', name: 'home', meta: { title: '首页', hideBack: true }, component: Home },
{
path: '/mine',
name: 'mine',
meta: {
title: '我的',
hideBack: true
},
component: () => import('../views/tabbar/mine.vue')
},
{
path: '/modifyPhone',
name: 'mesmodifyPhonesage',
meta: {
title: '修改手机号',
hideBack: true
},
component: () => import('../views/tabbar/modifyPhone.vue')
},
// 登录
{ path: '/login', name: 'login', meta: { title: '机构登录', hideBack: true }, component: () => import('@/views/login/login.vue') },
{ path: '/againLogin', name: 'againLogin', meta: { title: '机构登录', hideBack: true }, component: () => import('@/views/login/againlogin.vue') },
// 个人中心
{ path: '/relationUsers', name: 'relationUsers', meta: { title: '我的' }, component: () => import('@/views/my/relation-users.vue') },
{ path: '/addRelation', name: 'addRelation', meta: { title: '绑定机构' }, component: () => import('@/views/my/add-relation.vue') },
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
scrollBehavior (to, from, savePosition) {
if (savePosition) {
return savePosition
} else {
return { x: 0, y: 0 }
}
}
})
router.beforeEach((to, from, next) => {
next()
// console.log(to)
// localStorage.setItem('fromQuery',from.path); //记录路由
// console.log(to.path)
/** 商品列表 */
// if (to.path.indexOf('goodsList/') !== -1) {
// switch (to.params.type) {
// case 'entry':
// to.meta.title = '入库商品'
// break
// case 'out':
// to.meta.title = '出库商品'
// break
// case 'sale':
// to.meta.title = '销售商品'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// } else if (to.path.indexOf('returnGoods/list/') !== -1) {
// switch (to.params.type) {
// case 'purchase':
// to.meta.title = '采购退货'
// break
// case 'sale':
// to.meta.title = '销售退货'
// break
// default:
// to.meta.title = '商品列表'
// break
// }
// }
// let token = window.localStorage.getItem('token')
// let status = window.localStorage.getItem('status')
// if (to.path === '/againLogin') {
// next()
// return true
// }
// if (to.path === '/login' && token && status) {
// next()
// return true
// }
// if (to.query.token && to.query.status) {
// console.log('ok-------0', status)
// token = to.query.token
// status = to.query.status
// // console.log(token)
// // console.log(status)
// window.localStorage.setItem('token', token)
// window.localStorage.setItem('status', status)
// }
// if (token && status === '200') {
// console.log('ok-------1', 200)
// next()
// } else if (token && status === '100') {
// console.log('ok-------2', 100)
// setTimeout(() => {
// next({
// path: '/login'
// })
// }, 50)
// return true
// } else {
// console.log('ok-------3')
// window.document.location = selfApi.WINDOWHREF_LOGIN_ROUTE // url-
// return true
// }
})
router.afterEach((to, from, next) => {
// window.scrollTo(0,0);
window.document.title = to.meta.title || '工人端'
})
export default router
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
shop: null
},
mutations: {
// 处理状态(methods,同步)
setShop: (state, shop) => {
state.shop = shop
}
},
actions: {
// 提交改变后的状态(异步)Action
setShop: (context, shop) => {
context.commit('setShop', shop)
}
},
modules: {}
})
<template>
<div class="login-view">
<div class="logo-view">
<img src="@assets/images/login/logo.png" />
<p class="title">机构端</p>
</div>
<!-- <div>
<div class="filed-list">
<img class="icon-img" src="@assets/images/login/tel-icon.png" />
<van-field v-model.trim="tel" type="tel" placeholder="请输入手机号" maxlength="11" />
</div>
<div class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/code-icon.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="code-btn" @click="getCode">{{buttonText}}</div>
</div>
</div> -->
<div class="login-btn" @click="goLogin">重新登录</div>
</div>
</template>
<script>
export default {
name: 'againLogin',
data () {
return {}
},
methods: {
goLogin () {
window.document.location = this.$myApi.WINDOWHREF_INDEX // url-
}
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/login/login.scss";
</style>
<template>
<div class="login-view">
<div class="logo-view">
<img src="@assets/images/login/logo2.png" />
<p class="title">E速报修</p>
</div>
<div>
<div class="filed-list">
<img class="icon-img" src="@assets/images/login/shouji.png" />
<van-field v-model.trim="tel" type="tel" placeholder="请输入手机号" maxlength="11" />
</div>
<div class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/yzm.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="code-btn" @click="getCode">{{buttonText}}</div>
</div>
</div>
<div class="login-btn" @click="goLogin">立即登录</div>
<div class="login-tip">您身边的校园服务管家</div>
</div>
</template>
<script>
export default {
name: 'login',
data () {
return {
tel: '', // 手机号
code: '', // 验证码
buttonText: '获取验证码',
isSending: false,
seconds: 60,
timer: null
}
},
methods: {
checkData () {
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
return true
}
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.tel))) {
this.$toast('请正确输入手机号码------')
return true
}
if (this.code.length !== 6) {
this.$toast('请正确输入验证码')
return true
}
return false
},
getCode () {
if (this.isSending) return
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
return true
}
const curParams = { tel: this.tel }
this.$http.post(this.$myApi.SENDCODE, curParams)
.then(res => {
this.isSending = true
this.countDown()
})
.catch(() => {})
},
countDown () {
// const _this = this
let seconds = 60
this.timer = setInterval(() => {
seconds--
this.buttonText = `重新获取(${seconds}s)`
if (seconds < 1) {
this.isSending = false
this.buttonText = '重新获取'
clearInterval(this.timer)
}
}, 1000)
},
goLogin () {
if (this.checkData()) return true
const curParams = {
tel: this.tel,
code: this.code
}
// const _this = this
this.$http.post(this.$myApi.BINDLOGIN, curParams)
.then(res => {
window.localStorage.removeItem('againLogin')
window.document.location = this.$myApi.WINDOWHREF_ASK // url-
})
.catch(() => {})
},
fetchData (to, from) {
this.tel = '' // 手机号
this.code = '' // 验证码
this.buttonText = '获取验证码'
this.isSending = false
this.seconds = 60
this.timer = null
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
if (this.timer) {
clearInterval(this.timer)
}
next()
}
// beforeCreate () {
// document.querySelector('body').setAttribute('style', 'background: #ffffff')
// },
// beforeDestroy () {
// document.querySelector('body').removeAttribute('style')
// }
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/login/login.scss";
</style>
<template>
<div class="cont">
<div class="top flex-h flex-vc">
<div class="point"></div>
<div class="status">工作中</div>
</div>
<div class="menu flex-h flex-hb">
<div class="total">共3个工单</div>
<div class="options">今日</div>
</div>
<div class="order-item">
<div class="title">已派工</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div class="item-desc">2021-6-20 10:00-12:00</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">重点水房类-水房的阀门关不紧</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">公寓区-16号楼-东侧水房</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">张三三</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone">186787867463</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="img"></div>
</div>
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">王振海</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc">13180043554</div>
</div>
<div class="line"></div>
<div class="material">
<div class="item-title">已支付耗材</div>
<div class="ma-item flex-h flex-hb">
<div class="one">洁具</div>
<div class="one">水龙头*1</div>
<div class="one">¥16</div>
</div>
</div>
<div class="line"></div>
<div class="btn flex-h flex-hr">
<div class="btn-item bz-btn">备注耗材</div>
<div class="btn-item qr-btn">确认完成</div>
<div class="btn-item sf-btn">发起收费</div>
<!-- <div class="btn-item">发起转单</div> -->
<!-- <div class="btn-item">开始维修</div> -->
<!-- <div class="btn-item">查看评价</div> -->
<!-- <div class="btn-item sf-btn">查看耗材</div> -->
</div>
</div>
<div class="blank"></div>
<!-- tabbar -->
<my-tabbar curname="home"></my-tabbar>
</div>
</template>
<script>
import myTabbar from '@components/common/tabbar.vue'
export default {
name: 'home',
components: {
myTabbar
},
}
</script>
<style lang="scss" scoped>
.cont {
min-height: 100vh;
background: #fff;
padding: 0.4rem 0.3rem;
}
.top {
height: 0.36rem;
margin-bottom: 0.38rem;
}
.top .point {
width: 0.1rem;
height: 0.1rem;
background: #0054ff;
border-radius: 50%;
margin-right: 0.13rem;
}
.top .status {
color: #0054ff;
font-size: 0.36rem;
font-weight: bold;
}
.menu .total {
color: #727272;
font-size: 0.28rem;
}
.menu .options {
width: 1.76rem;
height: 0.58rem;
background: #ffffff;
border: 1px solid #0054ff;
border-radius: 0.12rem;
color: #0054ff;
font-size: 0.28rem;
line-height: 0.58rem;
text-align: center;
}
.order-item {
width: 6.9rem;
background: #ffffff;
box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78);
border-radius: 0.12rem;
margin-top: 0.4rem;
padding: 0.4rem 0.3rem;
margin-bottom: 0.2rem;
}
.title {
color: #0054ff;
font-size: 0.32rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
.item {
height: 0.3rem;
margin-bottom: 0.4rem;
}
.item-title {
color: #000000;
font-size: 0.3rem;
}
.item-desc {
color: #727272;
font-size: 0.3rem;
}
.que-desc {
margin-top: 0.4rem;
margin-bottom: 0.4rem;
}
.line {
width: 6.28rem;
height: 0.01rem;
background: #f1f1f1;
margin-bottom: 0.4rem;
}
.ma-item {
margin-top: 0.3rem;
}
.one {
color: #727272;
font-size: 0.3rem;
margin-bottom: 0.3rem;
}
.btn-item {
width: 1.8rem;
height: 0.7rem;
background: #0054ff;
border-radius: 0.35rem;
text-align: center;
line-height: 0.7rem;
color: #fff;
font-size: 0.27rem;
margin-left: 0.2rem;
}
.sf-btn {
background: #ffffff;
border: 1px solid #0054ff;
color: #0054ff;
}
.blank {
height: 1rem;
}
</style>
\ No newline at end of file
<template>
<div class="cont">
<div class="top"></div>
<div class="info-item">
<div class="photo">
<img src="@assets/images/my/touxiang.png" alt="">
</div>
<div class="btn">工作中</div>
<div class="name">张初一</div>
<div class="group">能源保障组</div>
<div class="tel flex-h">
<div class="telNumber">13180043557</div>
<img src="@assets/images/my/bianji.png" alt="">
</div>
</div>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div>
</template>
<script>
import myTabbar from '@components/common/tabbar.vue'
export default {
name: 'my',
components: {
myTabbar
},
}
</script>
<style lang="scss" scoped>
.cont {
min-height: 100vh;
background: #f7f7f7;
}
.top {
width: 100%;
height: 2.82rem;
background: #0054ff;
position: relative;
}
.info-item {
width: 7.5rem;
height: 8.05rem;
background: #ffffff;
border-radius: 0.28rem 0.28rem 0rem 0rem;
position: absolute;
top: 2.5rem;
left: 0;
text-align: center;
}
.photo {
width: 1.7rem;
height: 1.7rem;
border-radius: 50%;
background: #f1f1f1;
position: absolute;
top: -1rem;
left: 2.9rem;
}
.btn {
width: 1.38rem;
height: 0.48rem;
background: #0054ff;
border-radius: 0.24rem;
color: #fff;
text-align: center;
line-height: 0.48rem;
margin: 1.13rem auto 0.59rem;
}
.name{
color: #000000;
font-size: 0.38rem;
margin-bottom: 0.27rem;
font-weight: bold;
}
.group{
color: #000000;
font-size: 0.3rem;
margin-bottom: 0.48rem;
}
.tel{
width: 2rem;
height: 0.28rem;
margin: 0 auto;
}
.tel .telNumber{
color: #000000;
font-size: 0.3rem;
margin-right: 0.2rem;
}
.tel img{
width: 0.28rem;
height: 0.28rem;
}
</style>
\ No newline at end of file
<template>
<div class="cont">
<div class="tel flex-h">
<input type="number" placeholder="请输入新的手机号">
<div class="getCode">获取验证码</div>
</div>
<div class="code">
<input type="number" placeholder="请输入验证码">
</div>
<div class="submit-btn">提交</div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/modifyPhone.scss";
</style>
\ No newline at end of file
var path = require('path')
// const webpack = require('webpack')
// const CompressionWebpackPlugin = require('compression-webpack-plugin')
// const productionGzipExtensions = ['js', 'css']
const autoprefixer = require('autoprefixer')
// const pxtorem = require('postcss-pxtorem')
module.exports = {
// 项目部署的基础路径
// 如果应用程序部署在子路径上,则需要使用此选项指定子路径。如果您的应用程序部署在https://www.foobar.com/my-app/,集baseUrl到'/my-app/'.
publicPath: '/',
// outputDir: 在npm run build时 生成文件的目录 type:string, default:'dist'
outputDir: 'dist',
// 放置build生成的静态资源 (js、css、img、fonts) 的目录。
assetsDir: 'static',
// lintOnSave:{ type:Boolean default:true } 问你是否使用eslint
lintOnSave: false, // bbbb
css: {
sourceMap: false,
loaderOptions: {
postcss: {
plugins: [
autoprefixer()
// pxtorem({
// rootValue: 37.5,
// propList: ['*']
// })
]
}
}
// modules: false
},
configureWebpack: {
externals: {
// wx: "jWeixin",
// 'element-ui': 'ELEMENT',
// 'vue': 'Vue'
},
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './src/assets'),
'@components': path.resolve(__dirname, './src/components')
}
},
plugins: [
]
},
// productionSourceMap:生产源映射,如果您不需要生产时的源映射,那么将此设置为false可以加速生产构建
productionSourceMap: false,
// devServer:{type:Object} 3个属性host,port,https 支持webPack-dev-server的所有选项
devServer: {
port: 8080, // 端口号
host: 'localhost',
https: false, // https:{type:Boolean}
open: true, // 配置自动启动浏览器
proxy: {
'/api/': {
// todo: url
// target: 'https://fhxmtest.xueyoubangedu.com/api', // 测试
target: 'https://fenghexm.xueyoubangedu.com/api', // 正式
autoRewrite: true,
changeOrigin: true,
ws: true,
pathRewrite: {
'^/api/': ''
}
}
}
}
}
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