Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
msjf-customized
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
msjf-customized
Commits
6f0199cf
提交
6f0199cf
authored
9月 20, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
设置是否默认功能
上级
358e12e7
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
171 行增加
和
85 行删除
+171
-85
pages.json
src/pages.json
+6
-0
my.vue
src/pages/customized/my.vue
+1
-1
queryRecord.vue
src/pages/customized/queryRecord.vue
+1
-1
uploadImageVideo.vue
src/pages/customized/uploadImageVideo.vue
+50
-50
uploadPreview.vue
src/pages/customized/uploadPreview.vue
+40
-30
homePage.vue
src/pages/homePage/homePage.vue
+67
-0
api.ts
src/services/api.ts
+6
-3
logo.png
src/static/msjf-picture/logo.png
+0
-0
没有找到文件。
src/pages.json
浏览文件 @
6f0199cf
...
...
@@ -7,6 +7,12 @@
},
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/homePage/homePage"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"topWindow"
:
false
}
},{
"path"
:
"pages/login/login"
,
"style"
:
{
"navigationBarTitleText"
:
"登录"
,
...
...
src/pages/customized/my.vue
浏览文件 @
6f0199cf
...
...
@@ -103,7 +103,7 @@ let initHavePage = async () => {
console
.
log
(
res
,
'模板数据'
);
uni
.
hideLoading
();
currencyPage
.
value
=
res
.
data
.
currencyPage
;
uni
.
$emit
(
'previewData'
,
{
previewData
:
res
.
data
.
customPage
});
uni
.
$emit
(
'previewData'
,
{
previewData
:
res
.
data
});
};
initHavePage
();
</
script
>
...
...
src/pages/customized/queryRecord.vue
浏览文件 @
6f0199cf
...
...
@@ -69,7 +69,7 @@ let confirm = async (data: any) => {
let
res
:
any
=
await
searchSnInfo
({
code
:
data
.
value
});
if
(
res
.
data
.
errno
==
0
)
{
queryRecord
.
value
=
res
.
data
.
data
;
console
.
log
(
queryRecord
.
value
[
0
]
);
console
.
log
(
queryRecord
.
value
,
'查询记录'
);
}
}
};
...
...
src/pages/customized/uploadImageVideo.vue
浏览文件 @
6f0199cf
...
...
@@ -44,19 +44,6 @@ onLoad((options: any) => {
type
:
currencyPage
[
s
].
type
,
sort
:
currencyPage
[
s
].
sort
});
// uni.downloadFile({
// url: baseURL + downUrl + currencyPage[s].pageComponent,
// success(res: any) {
// imageVideoData.value.push({
// path: res.tempFilePath,
// type: currencyPage[s].type,
// sort: currencyPage[s].sort
// })
// imageVideoData.value.sort((a: any, b: any) => {
// return a.sort - b.sort
// })
// }
// });
}
}
else
if
(
type
.
value
==
'edit'
)
{
// 编辑模板列表
...
...
@@ -68,15 +55,6 @@ onLoad((options: any) => {
type
:
pageData
[
s
].
type
,
sort
:
pageData
[
s
].
sort
});
// uni.downloadFile({
// url: baseURL + downUrl + pageData[s].pageComponent,
// success(res: any) {
// imageVideoData.value.push({
// path: res.tempFilePath,
// type: pageData[s].type
// });
// }
// });
}
}
}
...
...
@@ -145,11 +123,13 @@ let uploadVideo = () => {
});
}
};
let
kuaidata
=
ref
()
let
save
=
()
=>
{
if
(
templateId
.
value
)
{
let
idArr
:
any
=
[];
let
count
=
0
;
new
Promise
((
resolve
:
any
,
reject
:
any
)
=>
{
let
idArr
:
any
=
[];
console
.
log
(
imageVideoData
.
value
);
for
(
let
key
in
imageVideoData
.
value
)
{
if
(
imageVideoData
.
value
[
key
].
path
.
split
(
'.'
).
length
==
1
)
{
uni
.
uploadFile
({
...
...
@@ -164,10 +144,7 @@ let save = () => {
pageComponent
:
JSON
.
parse
(
res
.
data
).
data
.
key
,
sort
:
imageVideoData
.
value
[
key
].
sort
});
// console.log(idArr);
}
// count = count + 1; // 2, 2
// console.log(count, 'if');
},
fail
(
res
:
any
)
{
console
.
log
(
res
);
...
...
@@ -179,20 +156,39 @@ let save = () => {
pageComponent
:
str
[
str
.
length
-
1
],
sort
:
imageVideoData
.
value
[
key
].
sort
});
// count = count + 1; // 1, 2
// console.log(count, 'else');
}
if
(
Number
(
key
)
==
imageVideoData
.
value
.
length
-
1
)
{
console
.
log
(
idArr
,
'resolve'
);
resolve
(
idArr
);
}
}
}).
then
((
res
:
any
)
=>
{
console
.
log
(
res
,
'1'
);
for
(
let
s
in
res
)
{
imageVideoData
.
value
[
s
].
sort
=
imageVideoData
.
value
[
s
].
sort
;
}).
then
((
idArr
:
any
)
=>
{
console
.
log
(
idArr
);
if
(
type
.
value
==
'currency'
)
{
console
.
log
(
idArr
,
'添加'
);
setTimeout
(()
=>
{
templateAdd
({
pageComponentList
:
idArr
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
uni
.
hideLoading
();
// imageVideoData.value = [];
// close();
}
});
},
50
);
}
else
{
kuaidata
.
value
=
idArr
console
.
log
(
'編輯'
,
idArr
);
setTimeout
(()
=>
{
updateCustomPage
({
id
:
templateId
.
value
,
pageComponentList
:
kuaidata
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
console
.
log
(
'你快一点吗!'
,
idArr
);
uni
.
hideLoading
();
// imageVideoData.value = [];
// close();
}
});
},
50
);
}
console
.
log
(
res
);
pro
(
res
);
});
}
else
{
// 空白
...
...
@@ -234,23 +230,27 @@ let pro = (idArr: any) => {
// console.log(key, count, imageVideoData.value.length - 1);
if
(
type
.
value
==
'currency'
)
{
console
.
log
(
idArr
,
'添加'
);
templateAdd
({
pageComponentList
:
idArr
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
uni
.
hideLoading
();
imageVideoData
.
value
=
[];
close
();
}
});
setTimeout
(()
=>
{
templateAdd
({
pageComponentList
:
idArr
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
uni
.
hideLoading
();
// imageVideoData.value = [];
// close();
}
});
},
50
);
}
else
{
console
.
log
(
'編輯'
,
idArr
);
updateCustomPage
({
id
:
templateId
.
value
,
pageComponentList
:
idArr
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
console
.
log
(
'你快一点吗!'
);
uni
.
hideLoading
();
// imageVideoData.value = [];
// close();
}
});
setTimeout
(()
=>
{
updateCustomPage
({
id
:
templateId
.
value
,
pageComponentList
:
idArr
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
console
.
log
(
'你快一点吗!'
,
idArr
);
uni
.
hideLoading
();
// imageVideoData.value = [];
// close();
}
});
},
50
);
}
// }
};
...
...
src/pages/customized/uploadPreview.vue
浏览文件 @
6f0199cf
...
...
@@ -3,6 +3,9 @@
<view
class=
"preview-container"
>
<view
v-for=
"(item, index) in previewData"
:key=
"item.id"
>
<view
class=
"preview-list"
>
<view
style=
"transform:scale(0.7)"
>
<radio-group
@
change=
"change"
><radio
value=
"defValue"
:checked=
"item.check"
:disabled=
"item.check"
@
click=
"radioChange(item, index)"
/></radio-group>
</view>
<view
class=
"img"
><image
:src=
"baseURL + downUrl + item.cover"
mode=
"aspectFill"
class=
"preview-img"
/></view>
<view
class=
"preview-content"
>
<text>
创建时间:
{{
item
.
createTime
}}
</text>
...
...
@@ -21,14 +24,11 @@
<
script
lang=
"ts"
setup
>
import
{
ref
}
from
'vue'
;
import
{
on
Load
,
on
BackPress
}
from
'@dcloudio/uni-app'
;
import
{
onBackPress
}
from
'@dcloudio/uni-app'
;
import
{
baseURL
}
from
'@/services/request'
;
import
{
getPageComponent
,
deletePageComponent
}
from
'@/services/api'
;
import
{
getPageComponent
,
deletePageComponent
,
customPageChecked
}
from
'@/services/api'
;
let
downUrl
=
'/wx/storage/fetch/'
let
videoList
=
ref
();
let
imageArr
=
ref
();
let
imageValue
=
ref
([]
as
any
);
let
downUrl
=
'/wx/storage/fetch/'
;
let
emits
=
defineEmits
([
'initHavePage'
]);
// 模板列表
...
...
@@ -37,6 +37,29 @@ let previewData = ref();
// 模板子列表数据
let
pageData
=
ref
();
let
change
=
(
data
:
string
)
=>
{
console
.
log
(
data
);
}
let
radioChange
=
(
data
:
any
,
i
:
number
)
=>
{
if
(
data
.
check
==
true
)
return
;
uni
.
showModal
({
content
:
'确认设为默认?'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'默认'
);
customPageChecked
({
customPageId
:
data
.
id
}).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
errno
==
0
)
{
emits
(
'initHavePage'
);
}
});
}
else
{
location
.
reload
()
}
}
});
};
// 删除模板列表
let
preDelete
=
async
(
id
:
number
)
=>
{
uni
.
showModal
({
...
...
@@ -74,36 +97,23 @@ let preEdit = async (id: number) => {
}
};
// 替换图片
let
replacevideo
=
(
index
:
number
)
=>
{
uni
.
showModal
({
cancelText
:
'取消'
,
confirmText
:
'确认'
,
content
:
'确认替换图片?'
,
success
:
(
res
:
any
)
=>
{
if
(
res
.
confirm
)
{
uni
.
chooseImage
({
count
:
1
,
//默认9
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
:
any
)
{
videoList
.
value
[
index
][
'path'
]
=
res
.
tempFiles
[
0
].
path
;
}
});
}
}
});
};
let
initHavePage
=
async
()
=>
{
uni
.
$on
(
'previewData'
,
(
data
:
any
)
=>
{
previewData
.
value
=
data
.
previewData
;
previewData
.
value
=
data
.
previewData
.
customPage
;
for
(
let
s
in
previewData
.
value
)
{
if
(
previewData
.
value
[
s
].
id
==
data
.
previewData
.
checkedId
)
previewData
.
value
[
s
][
'check'
]
=
true
;
else
previewData
.
value
[
s
][
'check'
]
=
false
;
}
// checkId.value = data.previewData.checkId;
console
.
log
(
previewData
.
value
,
'zzz'
);
});
};
initHavePage
();
onBackPress
(()
=>
{
uni
.
navigateBack
();
uni
.
navigateBack
({
delta
:
0
});
});
</
script
>
...
...
@@ -124,7 +134,7 @@ onBackPress(() => {
height
:
100%
;
display
:
flex
;
align-items
:
center
;
margin-right
:
20rpx
;
//
margin-right: 20rpx;
.preview-img
{
width
:
100%
;
height
:
100%
;
...
...
src/pages/homePage/homePage.vue
0 → 100644
浏览文件 @
6f0199cf
<
template
>
<view
class=
"content"
:animation=
"animationData"
>
<image
src=
"/static/msjf-picture/logo.png"
mode=
"widthFix"
style=
"width: 50%;"
></image>
<view
class=
"main"
></view>
<text
class=
"c-text"
>
科 技 赋 能 高 端 定 制 酒
</text>
</view>
<!--
<uni-transition
class=
"content"
>
<image
src=
"/static/msjf-picture/msjf-08.jpg"
mode=
"widthFix"
style=
"width: 50%;"
></image>
<view
class=
"main"
></view>
<text
class=
"c-text"
>
科 技 赋 能 高 端 定 制 酒
</text>
</uni-transition>
-->
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
reactive
}
from
'vue'
;
import
{
onLoad
}
from
'@dcloudio/uni-app'
;
let
animationData
=
ref
();
let
userData
=
reactive
({
sequenceCode
:
''
,
userId
:
''
});
onLoad
(()
=>
{
let
animation
=
uni
.
createAnimation
({
duration
:
2000
,
timingFunction
:
'ease-out'
});
animation
.
scale
(
0.5
,
0.5
).
step
();
animationData
.
value
=
animation
.
export
();
setTimeout
(()
=>
{
uni
.
redirectTo
({
url
:
`/pages/login/login`
});
},
2000
);
});
</
script
>
<
style
>
page
{
background-color
:
#fff
;
}
.content
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
padding-top
:
30%
;
height
:
100vh
;
width
:
100%
;
box-sizing
:
border-box
;
}
.main
{
flex
:
1
;
}
.c-text
{
flex-grow
:
0.5
;
color
:
#a36f54
;
}
</
style
>
src/services/api.ts
浏览文件 @
6f0199cf
...
...
@@ -21,10 +21,10 @@ export let templateAdd = (data: any) => request('/wx/customPage/templateAdd', 'P
export
let
getHavePage
=
()
=>
request
(
'/wx/customPage/getHavePage'
,
'GET'
);
// 查询模板
export
let
getPageComponent
=
(
pageId
:
number
)
=>
request
(
'/wx/customPage/getPageComponent'
,
'GET'
,
pageId
);
export
let
getPageComponent
=
(
data
:
any
)
=>
request
(
'/wx/customPage/getPageComponent'
,
'GET'
,
data
);
// 删除模板
export
let
deletePageComponent
=
(
id
:
number
)
=>
request
(
'/wx/customPage/delete'
,
'POST'
,
id
);
export
let
deletePageComponent
=
(
data
:
any
)
=>
request
(
'/wx/customPage/delete'
,
'POST'
,
data
);
// 查询记录
export
let
searchSnInfo
=
(
sn
:
string
)
=>
request
(
'/wx/orderSequence/searchRecordInfo'
,
'GET'
,
sn
);
...
...
@@ -33,4 +33,7 @@ export let searchSnInfo = (sn: string) => request('/wx/orderSequence/searchRecor
export
let
downLoad
=
(
imgUrl
:
string
)
=>
request
(
'/wx/storage/download/'
+
imgUrl
,
'GET'
);
// 单个图片上传
export
let
singleUpload
=
(
data
:
any
)
=>
request
(
'/wx/customPage/update'
,
'POST'
,
data
)
export
let
singleUpload
=
(
data
:
any
)
=>
request
(
'/wx/customPage/update'
,
'POST'
,
data
);
// 设置默认 http://127.0.0.1:8080/wx/customPage/checked
export
let
customPageChecked
=
(
data
:
any
)
=>
request
(
'/wx/customPage/checked'
,
'POST'
,
data
)
src/static/msjf-picture/logo.png
0 → 100644
浏览文件 @
6f0199cf
301.5 KB
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论