Commit 90486b11 by liuliufashi

update

parent bbc53a2a
VUE_APP_MODE = 'dev' VUE_APP_MODE = 'dev'
NODE_ENV = 'development' NODE_ENV = 'development'
VUE_APP_BASE_URL = 'http://47.102.211.197:8092' VUE_APP_BASE_URL = '/iships/'
VUE_APP_MODE = 'http://47.102.211.197:8092'
VUE_APP_TEXT = '测试环境' VUE_APP_TEXT = '测试环境'
\ No newline at end of file
VUE_APP_MODE = 'prod' VUE_APP_MODE = 'prod'
NODE_ENV = 'production' NODE_ENV = 'production'
VUE_APP_BASE_URL = 'http://47.102.211.197:8092' VUE_APP_BASE_URL = '/iships/'
VUE_APP_MODE = 'http://47.102.211.197:8092'
VUE_APP_TEXT = '生产环境' VUE_APP_TEXT = '生产环境'
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build --mode prod",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"dev": "vue-cli-service serve --mode dev --open", "dev": "vue-cli-service serve --mode dev --open",
"prod": "vue-cli-service serve --mode prod --open", "prod": "vue-cli-service serve --mode prod --open",
......
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <!-- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00251 14.9297L0 1.07422H6.14651L8.00251 4.27503L9.84583 1.07422H16L8.00251 14.9297Z" fill="black"/> <path d="M8.00251 14.9297L0 1.07422H6.14651L8.00251 4.27503L9.84583 1.07422H16L8.00251 14.9297Z" fill="black"/>
</svg> </svg> -->
...@@ -158,8 +158,18 @@ export const onUpdateGoods = async(data:any)=>{ ...@@ -158,8 +158,18 @@ export const onUpdateGoods = async(data:any)=>{
export const onUpdateGoodsPay = async(data:any)=>{ export const onUpdateGoodsPay = async(data:any)=>{
return await request({ return await request({
url: `/goods/updategoodspay2`, url: `/goods/updategoodspay`,
method:'post', method:'post',
data data
}); });
} }
export const onDelectgoodpay = async(data:any)=>{
console.log(data,'data');
return await request({
url: `/goods/delectgoodpay?goodspayid=${data.goodsid}&uid=${data.uid}`,
method:'post',
});
}
// /goods/delectgoodpay
\ No newline at end of file
...@@ -4,7 +4,7 @@ import { getToken } from "./token"; ...@@ -4,7 +4,7 @@ import { getToken } from "./token";
// 创建axios实例 // 创建axios实例
const instance = axios.create({ const instance = axios.create({
baseURL: process.env.VUE_APP_BASE_URL, baseURL: process.env.VUE_APP_MODE,
// 设置相应的时间 // 设置相应的时间
timeout: 5000, timeout: 5000,
headers: { headers: {
......
...@@ -165,16 +165,16 @@ const plainOptions = [ ...@@ -165,16 +165,16 @@ const plainOptions = [
const props = defineProps(); const props = defineProps();
const emit = defineEmits(['onBack']); const emit = defineEmits(['onBack']);
let content = ref(""); let content = ref("");
const myQuillEditor = ref(null); const myQuillEditor = ref<any>(null);
const crossedPrice = ref<Number>(1); const crossedPrice = ref<Number>(1);
const sellingPrice = ref<Number>(1); const sellingPrice = ref<Number>(1);
const value = ref<number>(1); const value = ref<number>(1);
const previewVisible = ref(false); const previewVisible = ref(false);
const previewImage = ref(""); const previewImage = ref("");
const previewTitle = ref(""); const previewTitle = ref("");
const fileList = ref<UploadProps["fileList"]>([ const fileList = ref<any>([
]); ]);
let isEditfileList = ref<UploadProps["fileList"]>([ let isEditfileList = ref<any>([
]); ]);
const optionsEdit = reactive({ const optionsEdit = reactive({
modules: { modules: {
...@@ -362,7 +362,7 @@ const onSubmit = () => { ...@@ -362,7 +362,7 @@ const onSubmit = () => {
}; };
watch(isEditfileList, (newVal, old) => { watch(isEditfileList, (newVal:any, old) => {
if (newVal[0]) { if (newVal[0]) {
const str = myQuillEditor.value.getHTML() + `<img src=${newVal[0].response.data}>` const str = myQuillEditor.value.getHTML() + `<img src=${newVal[0].response.data}>`
myQuillEditor.value.setHTML(str) myQuillEditor.value.setHTML(str)
......
...@@ -136,7 +136,7 @@ const plainOptions = [ ...@@ -136,7 +136,7 @@ const plainOptions = [
const props = defineProps(); const props = defineProps();
const emit = defineEmits(['onBack']); const emit = defineEmits(['onBack']);
let content = ref(""); let content = ref("");
const myQuillEditor = ref(null); const myQuillEditor = ref<any>(null);
const crossedPrice = ref<Number>(1); const crossedPrice = ref<Number>(1);
const sellingPrice = ref<Number>(1); const sellingPrice = ref<Number>(1);
const value = ref<number>(1); const value = ref<number>(1);
...@@ -157,16 +157,6 @@ const fileList = ref<UploadProps["fileList"]>([ ...@@ -157,16 +157,6 @@ const fileList = ref<UploadProps["fileList"]>([
[{ color: [] }, { background: [] }], [{ color: [] }, { background: [] }],
[{ align: [] }], [{ align: [] }],
], ],
handlers: {
image: function (value: any) {
if (value) {
// 调用element图片上传
// document.querySelector(".editor-img-uploader>.el-upload").click();
} else {
Quill.format("image", true);
}
},
},
}, },
history: { history: {
delay: 1000, delay: 1000,
...@@ -361,7 +351,7 @@ const onBeforeUpload: UploadProps['beforeUpload'] = file => { ...@@ -361,7 +351,7 @@ const onBeforeUpload: UploadProps['beforeUpload'] = file => {
return Upload.LIST_IGNORE; return Upload.LIST_IGNORE;
} }
}; };
watch(isEditfileList, (newVal, old) => { watch(isEditfileList, (newVal:any) => {
if (newVal[0]) { if (newVal[0]) {
const str = myQuillEditor.value.getHTML() + `<img src=${newVal[0].response.data}>` const str = myQuillEditor.value.getHTML() + `<img src=${newVal[0].response.data}>`
myQuillEditor.value.setHTML(str) myQuillEditor.value.setHTML(str)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'tags'"> <template v-if="column.key === 'tags'">
<a-button type="primary" @click="onEdit(record)">编辑</a-button> <a-button type="primary" @click="onEdit(record)">编辑</a-button>
<a-button type="primary" style="margin-left: 20px">统计</a-button> <!-- <a-button type="primary" style="margin-left: 20px">统计</a-button> -->
<a-popconfirm title="确定删除这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)"> <a-popconfirm title="确定删除这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)">
<a-button type="primary" style="margin-left: 20px">删除</a-button> <a-button type="primary" style="margin-left: 20px">删除</a-button>
</a-popconfirm> </a-popconfirm>
...@@ -142,14 +142,14 @@ ...@@ -142,14 +142,14 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, defineExpose, onMounted,watch } from "vue"; import { ref, reactive, defineExpose, onMounted,watch, toRaw } from "vue";
import { LeftOutlined } from "@ant-design/icons-vue"; import { LeftOutlined } from "@ant-design/icons-vue";
import GoodsBags from "./components/goods/index.vue"; import GoodsBags from "./components/goods/index.vue";
import GoodsBagSubs from "./components/goodsubs/index.vue"; import GoodsBagSubs from "./components/goodsubs/index.vue";
import { onSelectGoods, onfindby, onUpdateGoods } from "@/api/index"; import { onSelectGoods, onfindby, onUpdateGoods } from "@/api/index";
import { getUid } from "@/utils/userInfo"; import { getUid } from "@/utils/userInfo";
import { Form, message, Upload } from 'ant-design-vue'; import { Form, message, Upload, UploadProps } from 'ant-design-vue';
import { QuillEditor } from '@vueup/vue-quill' import { Quill, QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'; import '@vueup/vue-quill/dist/vue-quill.snow.css';
const useForm = Form.useForm; const useForm = Form.useForm;
...@@ -241,9 +241,9 @@ let modelRef = ref<any>({}); ...@@ -241,9 +241,9 @@ let modelRef = ref<any>({});
const propsData = reactive<props>({ const propsData = reactive<props>({
isCad: 0, isCad: 0,
}); });
let isEditfileList = ref<UploadProps["fileList"]>([ let isEditfileList = ref<any>([
]); ]);
const fileList = ref<UploadProps["fileList"]>([ const fileList = ref<any>([
{ {
uid: '-1', uid: '-1',
name: 'image.png', name: 'image.png',
...@@ -278,8 +278,7 @@ const handleOk = async () => { ...@@ -278,8 +278,7 @@ const handleOk = async () => {
free: modelRef.value.sellingmodel, free: modelRef.value.sellingmodel,
sub: [0] sub: [0]
} }
const data = await onUpdateGoods(prarms); const data:any = await onUpdateGoods(prarms);
console.log(data);
if (data.state === 1) { if (data.state === 1) {
visible.value = false; visible.value = false;
modelRef.value = {} modelRef.value = {}
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<a-select <a-select
v-model:value="formState.subject" v-model:value="formState.subject"
style="width: 100%" style="width: 100%"
:options="optionss.map((item,index) => ({ value: item.goodsid, label: item.subject,index:index }))" :options="optionss.map((item:any,index:number) => ({ value: item.goodsid, label: item.subject,index:index }))"
@change="onSelectss" @change="onSelectss"
> >
...@@ -116,7 +116,7 @@ interface FormState { ...@@ -116,7 +116,7 @@ interface FormState {
} }
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const list = ref([]) const list = ref([])
const optionss = ref([]) const optionss = ref<any>([])
let goodspayditch = ref([{}]) let goodspayditch = ref([{}])
const props = defineProps(); const props = defineProps();
const dateFormat = 'YYYY/MM/DD'; const dateFormat = 'YYYY/MM/DD';
...@@ -175,7 +175,7 @@ const onSubmit = () => { ...@@ -175,7 +175,7 @@ const onSubmit = () => {
const uid =getUid() const uid =getUid()
const starttime = (moment(toRaw(formState).starttime.$d).format('YYYY-MM-DD'))+(moment(startvalue.value.$d).format('THH:mm:[00][Z]')) const starttime = (moment(toRaw(formState).starttime.$d).format('YYYY-MM-DD'))+(moment(startvalue.value.$d).format('THH:mm:[00][Z]'))
const expireendtime = (moment(toRaw(formState).expireendtime.$d).format('YYYY-MM-DD'))+(moment(endvalue.value.$d).format('THH:mm:[00][Z]')) const expireendtime = (moment(toRaw(formState).expireendtime.$d).format('YYYY-MM-DD'))+(moment(endvalue.value.$d).format('THH:mm:[00][Z]'))
goodspayditch.value.map((item)=>{return item.goodsid = toRaw(formState).subject.value}) goodspayditch.value.map((item:any)=>{return item.goodsid = toRaw(formState).subject.value})
const prarms = { const prarms = {
subject:toRaw(formState).subject.label, subject:toRaw(formState).subject.label,
shortname:toRaw(formState).shortname, shortname:toRaw(formState).shortname,
...@@ -249,7 +249,7 @@ onMounted(async () => { ...@@ -249,7 +249,7 @@ onMounted(async () => {
optionss.value = data.data optionss.value = data.data
return optionss return optionss
}) })
watch(formState,(newVal,oldVal) => { watch(formState,(newVal:any) => {
if(newVal.paymentmodel =='0'){ if(newVal.paymentmodel =='0'){
price.value = optionss.value[newVal.subject.index].price price.value = optionss.value[newVal.subject.index].price
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div v-if="column.key == 'tags'"> <div v-if="column.key == 'tags'">
<a-button type="primary" @click="onEdit(record)">编辑</a-button> <a-button type="primary" @click="onEdit(record)">编辑</a-button>
<a-button type="primary" style="margin-left: 20px;" @click="onCopy(record)">支付链接</a-button> <a-button type="primary" style="margin-left: 20px;" @click="onCopy(record)">支付链接</a-button>
<a-button type="primary" style="margin-left: 20px;">统计</a-button> <!-- <a-button type="primary" style="margin-left: 20px;">统计</a-button> -->
<a-popconfirm title="确定下架这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)"> <a-popconfirm title="确定下架这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)">
<a-button type="primary" style="margin-left: 20px">删除</a-button> <a-button type="primary" style="margin-left: 20px">删除</a-button>
</a-popconfirm> </a-popconfirm>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<a-form-item label="选择商品" name="subject" :label-col="{ span: 2 }" labelAlign="left"> <a-form-item label="选择商品" name="subject" :label-col="{ span: 2 }" labelAlign="left">
<div style="width:100%;display: flex;align-items: center;"> <div style="width:100%;display: flex;align-items: center;">
<a-select v-model:value="formState.subject" style="width: 120px" <a-select v-model:value="formState.subject" style="width: 120px"
:options="listArray.map((item, index) => ({ value: item.goodsid, label: item.subject, index: index }))" @change="onSelect"> :options="listArray.map((item:any, index:number) => ({ value: item.goodsid, label: item.subject, index: index }))" @change="onSelect">
</a-select> </a-select>
</div> </div>
</a-form-item> </a-form-item>
...@@ -104,16 +104,16 @@ ...@@ -104,16 +104,16 @@
</a-form-item> </a-form-item>
<a-form-item label="开始时间" name="price" :label-col="{ span: 2 }" labelAlign="left"> <a-form-item label="开始时间" name="price" :label-col="{ span: 2 }" labelAlign="left">
<div style="display:flex"> <div style="display:flex">
<!-- <a-date-picker v-model:value="formState.starttime" :format="dateFormat" <a-date-picker v-model:value="value2" :format="dateFormat"
:disabledDate="disabledDate" /> --> :disabledDate="disabledDate" />
<a-time-picker v-model:value="formState.startvalue" format="HH:mm" /> <a-time-picker v-model:value="value3" format="HH:mm" />
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="结束时间" name="price" :label-col="{ span: 2 }" labelAlign="left"> <a-form-item label="结束时间" name="price" :label-col="{ span: 2 }" labelAlign="left">
<div style="display:flex"> <div style="display:flex">
<!-- <a-date-picker v-model:value="formState.expireendtime" :format="dateFormat" <a-date-picker v-model:value="value4" :format="dateFormat"
:disabledDate="disabledDate" /> --> :disabledDate="disabledDate" />
<a-time-picker v-model:value="formState.endvalue" format="HH:mm" /> <a-time-picker v-model:value="value5" format="HH:mm" />
</div> </div>
</a-form-item> </a-form-item>
<a-form-item label="信息备注" name="price" :label-col="{ span: 2 }" labelAlign="left"> <a-form-item label="信息备注" name="price" :label-col="{ span: 2 }" labelAlign="left">
...@@ -131,10 +131,9 @@ import { ref, defineExpose, onMounted, } from 'vue'; ...@@ -131,10 +131,9 @@ import { ref, defineExpose, onMounted, } from 'vue';
import { SelectProps,message } from 'ant-design-vue'; import { SelectProps,message } from 'ant-design-vue';
import { getUid } from '@/utils/userInfo' import { getUid } from '@/utils/userInfo'
import moment from 'moment'; import moment from 'moment';
import { onUpdateGoodsPay, onfindby, onSelectGoods,onfindWX,onfindAli} from '@/api/index' import { onUpdateGoodsPay, onfindby, onSelectGoods,onfindWX,onfindAli,onDelectgoodpay} from '@/api/index'
import CreatePay from './components/createpay/index.vue' import CreatePay from './components/createpay/index.vue'
import dayjs, { Dayjs } from 'dayjs'; import dayjs, { Dayjs } from 'dayjs';
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
import useClipboard from 'vue-clipboard3' import useClipboard from 'vue-clipboard3'
import { LeftOutlined} from "@ant-design/icons-vue"; import { LeftOutlined} from "@ant-design/icons-vue";
const dateFormat = 'YYYY/MM/DD'; const dateFormat = 'YYYY/MM/DD';
...@@ -200,30 +199,55 @@ const columns = [ ...@@ -200,30 +199,55 @@ const columns = [
}, },
] ]
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const value2 = ref<any>(dayjs('2015/01/01', dateFormat))
const value3 = ref<any>()
const value4 = ref<any>(dayjs('2015/01/01', dateFormat))
const value5 = ref<any>()
const showModal = () => { const showModal = () => {
visible.value = true; visible.value = true;
}; };
const handleOk =async(e: MouseEvent) => { const handleOk =async(e: MouseEvent) => {
const starttime = (moment(value2.value.$d).format('YYYY-MM-DD'))+(moment(value3.value.$d).format('THH:mm:[00][Z]'))
const expireendtime = (moment(value4.value.$d).format('YYYY-MM-DD'))+(moment(value5.value.$d).format('THH:mm:[00][Z]'))
const uid =getUid() const uid =getUid()
const params={ const params={
...formState.value, id: formState.value.id,
uid, goodsid: formState.value.goodspayditch[0].goodsid,
goodsid:formState.value.goodspayditch[0].goodsid paymentmodel: formState.value.paymentmodel,
payment: formState.value.payment,
fullphone:formState.value.fullphone,
expiremodel:formState.value.expiremodel,
expireendtime:expireendtime,
expiremillisecond: formState.value.expiremillisecond,
starttime: starttime,
subject:formState.value.subject,
uid: uid,
status: formState.value.status,
shortname: formState.value.shortname,
remark: formState.value.remark,
goodspayditch: formState.value.goodspayditch.map((item:any)=>{
return {
id:item.id,
payname:item.payname,
optpay:item.optpay,
random:item.random,
appointpay:item.appointpay
}
})
}
const data:any = await onUpdateGoodsPay(params)
if(data.state == 1){
visible.value = false;
onSearch()
} }
const data = await onUpdateGoodsPay(params)
console.log(data,'data');
// console.log(e);
// visible.value = false;
}; };
const onEdit = (e: any) => { const onEdit = (e: any) => {
console.log(e, 'e'); formState.value =e
value2.value = dayjs(moment(formState.value.starttime).format(('YYYY/MM/DD')), dateFormat)
formState.value = e value3.value = dayjs(moment(formState.value.starttime).format(('HH:mm')), 'HH:mm')
value4.value = dayjs(moment(formState.value.expireendtime).format(('YYYY-MM-DD')), dateFormat)
value5.value = dayjs(moment(formState.value.expireendtime).format(('HH:mm')), 'HH:mm')
showModal() showModal()
} }
const onSearch = async () => { const onSearch = async () => {
...@@ -264,13 +288,13 @@ const onSet = async(index:string)=>{ ...@@ -264,13 +288,13 @@ const onSet = async(index:string)=>{
list.value = data.data; list.value = data.data;
} }
const onDel = async (e: any) => { const onDel = async (e: any) => {
e.status = '1' const prarms = {
e.uid = getUid() uid:getUid(),
e.goodsid = e.goodspayditch[0].goodsid goodsid:e.id
e.expiremodel = '0' }
const data:any = await onUpdateGoodsPay(e) const data:any = await onDelectgoodpay(prarms)
if(data.state == 1){ if(data.state == 1){
await init() await onSearch()
} }
} }
const onFinish = (values: any) => { const onFinish = (values: any) => {
...@@ -307,11 +331,14 @@ defineExpose({ ...@@ -307,11 +331,14 @@ defineExpose({
checkboxValue, checkboxValue,
optionsWithDisabled, optionsWithDisabled,
dateFormat, dateFormat,
locale,
startvalue, startvalue,
endvalue, endvalue,
listValue, listValue,
list, list,
value2,
value3,
value4,
value5,
onSet, onSet,
onSearch, onSearch,
columns, columns,
......
module.exports = { module.exports = {
transpileDependencies: true, transpileDependencies: true,
lintOnSave:false, lintOnSave:false,
pwa: {
iconPaths: {
favicon32: 'favicon.ico',
favicon16: 'favicon.ico',
appleTouchIcon: 'favicon.ico',
maskIcon: 'favicon.ico',
msTileImage: 'favicon.ico'
}
},
css: { css: {
loaderOptions: { loaderOptions: {
less: { less: {
...@@ -29,7 +38,7 @@ module.exports = { ...@@ -29,7 +38,7 @@ module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target:process.env.VUE_APP_BASE_URL, target:process.env.VUE_APP_MODE,
ws: true,//代理websocked ws: true,//代理websocked
changeOrigin: true, changeOrigin: true,
secure: false, //target是否为https接口 secure: false, //target是否为https接口
......
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