Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
Harvey
/
ydu-lottery-shop-app
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ca2979e2
由
Harvey
编写于
2022-04-24 16:36:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
宣传设置
1 个父辈
03d5f505
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
104 行增加
和
33 行删除
src/common/request.js
src/pages/auth/login.vue
src/pages/center/adv.vue
src/common/request.js
查看文件 @
ca2979e
//const baseUrl = 'https://app.ydniu.com/graphql'
//
const baseUrl = '/test_graphql'
const
baseUrl
=
'/graphql'
const
baseUrl
=
'/test_graphql'
//
const baseUrl = '/graphql'
function
request
(
options
=
{})
{
...
...
@@ -62,6 +62,15 @@ async function graphql(options = {}) {
}
})
if
(
res
.
data
.
errors
&&
res
.
data
.
errors
.
length
)
{
uni
.
showToast
({
icon
:
'error'
,
title
:
res
.
data
.
errors
[
0
].
message
,
duration
:
2000
})
return
}
res
=
res
.
data
.
data
[
opts
.
name
]
if
(
res
.
Error
==
'未登录'
)
{
...
...
src/pages/auth/login.vue
查看文件 @
ca2979e
...
...
@@ -51,12 +51,12 @@
return
;
}
const
res
=
await
uni
.
$u
.
request
.
post
({
data
:
{
query
:
`mutation{ydn_sms_login(mobile:"
${
this
.
mobile
}
",code:"
${
this
.
code
}
",type:"web")}`
}
})
.
then
(
a
=>
a
.
data
.
data
.
ydn_sms_login
);
const
res
=
await
uni
.
$u
.
request
.
graphql
({
name
:
'ydn_sms_login'
,
type
:
'mutation'
,
args
:
`mobile:"
${
this
.
mobile
}
",code:"
${
this
.
code
}
",type:"web"`
})
if
(
res
.
Error
)
{
uni
.
showToast
({
title
:
res
.
Error
,
...
...
@@ -70,17 +70,17 @@
url
:
decodeURIComponent
(
this
.
from
)
})
},
async
sendMobileCode
()
{
if
(
this
.
mobile
.
length
!=
11
)
{
uni
.
showToast
({
icon
:
"none"
,
icon
:
'error'
,
title
:
"手机号有误"
,
});
return
;
}
async
sendMobileCode
()
{
if
(
this
.
mobile
.
length
!=
11
)
{
uni
.
showToast
({
icon
:
"none"
,
icon
:
'error'
,
title
:
"手机号有误"
,
});
return
;
}
var
yzm
=
this
.
yzm
if
(
yzm
.
class
==
'disabled'
)
{
uni
.
showToast
({
...
...
src/pages/center/adv.vue
查看文件 @
ca2979e
...
...
@@ -2,28 +2,43 @@
<view
class=
"panel"
>
<view
class=
"panel-item panel-item-bottom"
>
<text
class=
"panel-text"
>
彩店类型
</text>
<uni-combox
:border=
"false"
:candidates=
"candidates"
labelWidth=
"50px"
></uni-combox>
<!--
<uni-combox
:border=
"false"
:candidates=
"candidates"
labelWidth=
"50px"
></uni-combox>
-->
<!--
<radio-group
@
change=
"radioChange"
>
<label
class=
"uni-list-cell uni-list-cell-pd"
v-for=
"(item, index) in typeList"
:key=
"index"
>
<view>
<radio
:value=
"''+index"
:checked=
"index == shopType"
/>
</view>
<view>
{{
item
}}
</view>
</label>
</radio-group>
-->
<radio-group
class=
"panel-radio"
@
change=
"radioChange"
>
<radio
v-for=
"(item, index) in typeList"
:key=
"index"
:value=
"index+''"
:checked=
"index == shopType"
>
{{
item
}}
</radio>
</radio-group>
</view>
<view
class=
"panel-item"
>
<view
class=
"panel-text"
>
海报显示名称水印
</view>
<switch
class=
"switch"
:checked=
"
true"
color=
"#1A9BFC
"
/>
<switch
class=
"switch"
:checked=
"
isShowName"
color=
"#1A9BFC"
@
change=
"isShowName=!isShowName
"
/>
</view>
<view
class=
"panel-txt"
>
<input
type=
"text"
class=
"panel-txt-txt"
placeholder=
"彩店名称"
/>
<input
type=
"text"
class=
"panel-txt-txt"
v-model=
"shopName"
placeholder=
"彩店名称"
/>
</view>
<view
class=
"panel-item-bottom panel-top"
></view>
<view
class=
"panel-item"
>
<text
class=
"panel-text"
>
海报显示店主二维码
</text>
<!--
<liSwitch
:checked=
"true"
width=
"90"
bg=
"#1A9BFC"
/>
-->
<switch
class=
"switch"
:checked=
"true"
color=
"#1A9BFC"
/>
<switch
class=
"switch"
:checked=
"isShowQrcode"
color=
"#1A9BFC"
@
change=
"isShowQrcode=!isShowQrcode"
/>
</view>
<view
class=
"panel-img"
>
<imgUpload
limit=
"1
0
"
:FileList=
"imgList"
/>
<imgUpload
limit=
"1"
:FileList=
"imgList"
/>
</view>
<button
type=
"default"
class=
"btn"
@
click=
"subimit"
>
提交
</button>
...
...
@@ -42,22 +57,65 @@
},
data
()
{
return
{
candidates
:
[
'双彩店'
,
'福彩'
,
'体彩'
],
typeList
:
[
'双彩店'
,
'福彩'
,
'体彩'
],
shopName
:
''
,
isShowName
:
true
,
isShowQrcode
:
true
,
shopType
:
0
,
shopId
:
0
,
imgList
:
[]
}
},
async
onLoad
()
{
const
res
=
await
uni
.
$u
.
request
.
graphql
({
name
:
'lottery_shop_get_my_shop_info'
})
if
(
!
(
res
&&
res
.
length
>
0
))
return
const
data
=
res
[
0
]
this
.
shopName
=
data
.
name
this
.
isShowName
=
data
.
poster_enable_name
>
0
this
.
isShowQrcode
=
data
.
poster_enable_qrcode
>
0
this
.
shopId
=
data
.
id
this
.
shopType
=
data
.
type
if
(
data
.
qrcode_url
)
this
.
imgList
.
push
({
path
:
data
.
qrcode_url
,
isUrl
:
true
})
},
methods
:
{
async
subimit
()
{
if
(
this
.
imgList
.
length
<
1
)
{
return
var
args
=
[]
args
.
push
(
`name:"
${
this
.
shopName
}
"`
)
args
.
push
(
`type:
${
this
.
shopType
}
`
)
args
.
push
(
`poster_enable_name:
${
this
.
isShowName
?
1
:
0
}
`
)
args
.
push
(
`poster_enable_qrcode:
${
this
.
isShowQrcode
?
1
:
0
}
`
)
if
(
this
.
shopId
>
0
)
{
args
.
push
(
`shop_id:
${
this
.
shopId
}
`
)
}
const
base64
=
await
this
.
imgToBase64
(
this
.
imgList
[
0
].
path
)
console
.
log
(
base64
)
if
(
this
.
imgList
.
length
==
0
)
{
args
.
push
(
`qrcode:""`
)
}
else
if
(
!
this
.
imgList
[
0
].
isUrl
)
{
const
base64
=
await
this
.
imgToBase64
(
this
.
imgList
[
0
].
path
)
args
.
push
(
`qrcode:"
${
base64
}
"`
)
}
uni
.
showToast
({
title
:
'接口暂未实现'
const
res
=
await
uni
.
$u
.
request
.
graphql
({
name
:
'lottery_shop_save_shop_info'
,
type
:
'mutation'
,
args
:
args
.
join
(
','
)
})
if
(
res
.
length
>
0
)
{
uni
.
showToast
({
title
:
'操作成功'
})
}
},
radioChange
:
function
(
evt
)
{
this
.
shopType
=
evt
.
detail
.
value
},
imgToBase64
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
@@ -116,6 +174,10 @@
height
:
38px
;
}
.panel-radio
{
display
:
flex
;
}
.switch
{
transform
:
scale
(
0.7
,
0.7
);
}
...
...
@@ -127,7 +189,7 @@
.btn
{
height
:
44px
;
margin-top
:
15
px
;
margin-top
:
20
px
;
background-color
:
#D23338
;
color
:
#FFFFFF
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论