Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
8092cfe0
Commit
8092cfe0
authored
Jun 08, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 代码暂存
parent
79e1e467
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
17 deletions
+18
-17
wxRequest.js
src/common/wxRequest.js
+2
-2
dialog.js
src/components/vant/dialog/dialog.js
+1
-0
notify.js
src/components/vant/notify/notify.js
+1
-1
index.wpy
src/pages/index.wpy
+3
-3
prize.wpy
src/pages/prize.wpy
+8
-8
raffle.wpy
src/pages/raffle.wpy
+3
-3
No files found.
src/common/wxRequest.js
View file @
8092cfe0
...
@@ -41,10 +41,10 @@ const request = async (url, options) => {
...
@@ -41,10 +41,10 @@ const request = async (url, options) => {
if
(
res
.
data
.
code
===
2000
)
{
if
(
res
.
data
.
code
===
2000
)
{
return
res
.
data
.
data
;
return
res
.
data
.
data
;
}
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
}
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
});
});
};
};
...
...
src/components/vant/dialog/dialog.js
View file @
8092cfe0
...
@@ -42,6 +42,7 @@ Dialog.defaultOptions = {
...
@@ -42,6 +42,7 @@ Dialog.defaultOptions = {
showCancelButton
:
false
,
showCancelButton
:
false
,
closeOnClickOverlay
:
false
,
closeOnClickOverlay
:
false
,
confirmButtonOpenType
:
''
,
confirmButtonOpenType
:
''
,
confirmButtonColor
:
'
#FF5D15
'
,
};
};
Dialog
.
alert
=
Dialog
;
Dialog
.
alert
=
Dialog
;
Dialog
.
confirm
=
(
options
)
=>
Dialog
.
confirm
=
(
options
)
=>
...
...
src/components/vant/notify/notify.js
View file @
8092cfe0
...
@@ -3,7 +3,7 @@ const defaultOptions = {
...
@@ -3,7 +3,7 @@ const defaultOptions = {
selector
:
'
#van-notify
'
,
selector
:
'
#van-notify
'
,
type
:
'
danger
'
,
type
:
'
danger
'
,
message
:
''
,
message
:
''
,
background
:
''
,
background
:
'
#FF5D15
'
,
duration
:
3000
,
duration
:
3000
,
zIndex
:
110
,
zIndex
:
110
,
top
:
0
,
top
:
0
,
...
...
src/pages/index.wpy
View file @
8092cfe0
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
<open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation>
<open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation>
<shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup>
<shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup>
<popup @showMenu="showMenu" :showMenus="showMenus"></popup>
<popup @showMenu="showMenu" :showMenus="showMenus"></popup>
<van-dialog id="van-dialog"
confirmButtonColor="#FF5D15"
/>
<van-dialog id="van-dialog"/>
</view>
</view>
</template>
</template>
...
@@ -588,11 +588,11 @@
...
@@ -588,11 +588,11 @@
getAwards: function() {
getAwards: function() {
const { id, photoUrl, quantity, name, chance } = this.awardsInfo;
const { id, photoUrl, quantity, name, chance } = this.awardsInfo;
if (!id || !this.mainInfo || !this.mainInfo.account) {
if (!id || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试',
background: '#FF5D15',
safeAreaInsetTop: true });
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });
return;
return;
}
}
if (this.mainInfo && this.mainInfo.account && this.mainInfo.account.quantity === 0) {
if (this.mainInfo && this.mainInfo.account && this.mainInfo.account.quantity === 0) {
Notify({ message: '您的克币数为0, 无法参与抽奖',
background: '#FF5D15',
safeAreaInsetTop: true });
Notify({ message: '您的克币数为0, 无法参与抽奖', safeAreaInsetTop: true });
return;
return;
}
}
wx.navigateTo({
wx.navigateTo({
...
...
src/pages/prize.wpy
View file @
8092cfe0
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
<view class="footer">
<view class="footer">
<button class="getprize" bindtap="goprize">{{btnfont}}</button>
<button class="getprize" bindtap="goprize">{{btnfont}}</button>
</view>
</view>
<van-dialog id="van-dialog"
confirmButtonColor="#FF5D15"
/>
<van-dialog id="van-dialog"/>
<van-notify id="van-notify" />
<van-notify id="van-notify" />
</view>
</view>
</template>
</template>
...
@@ -124,28 +124,28 @@
...
@@ -124,28 +124,28 @@
goprize() {
goprize() {
if (!this.prize.cash) {
if (!this.prize.cash) {
if (!this.name) {
if (!this.name) {
Notify({message: '请填写收货人'
, background: '#FF5D15'
});
Notify({message: '请填写收货人'});
return;
return;
}
}
let reg = /^1\d{10}$/;
let reg = /^1\d{10}$/;
if (!this.phone) {
if (!this.phone) {
Notify({message: '请填写手机号码'
, background: '#FF5D15'
});
Notify({message: '请填写手机号码'});
return;
return;
}
}
if (!reg.test(this.phone)) {
if (!reg.test(this.phone)) {
Notify({message: '请填写正确的手机号码'
, background: '#FF5D15'
});
Notify({message: '请填写正确的手机号码'});
return;
return;
}
}
if (!this.idNumber) {
if (!this.idNumber) {
Notify({message: '请填写身份证号'
, background: '#FF5D15'
});
Notify({message: '请填写身份证号'});
return;
return;
}
}
if (!this.city) {
if (!this.city) {
Notify({message: '请选择所在地区'
, background: '#FF5D15'
});
Notify({message: '请选择所在地区'});
return;
return;
}
}
if (!this.address) {
if (!this.address) {
Notify({message: '请填写详细地址'
, background: '#FF5D15'
});
Notify({message: '请填写详细地址'});
return;
return;
}
}
}
}
...
@@ -199,7 +199,7 @@
...
@@ -199,7 +199,7 @@
onLoad (query) {
onLoad (query) {
let joinRecordId = query.joinRecordId || '';
let joinRecordId = query.joinRecordId || '';
this.joinRecordId = joinRecordId;
this.joinRecordId = joinRecordId;
if (!joinRecordId) Notify({message: '缺少参数错误!'
, background: '#FF5D15'
});
if (!joinRecordId) Notify({message: '缺少参数错误!'});
// 请求接口得到数据
// 请求接口得到数据
getOneRaffle({joinRecordId: joinRecordId}).then(data => {
getOneRaffle({joinRecordId: joinRecordId}).then(data => {
let dat = data || {};
let dat = data || {};
...
...
src/pages/raffle.wpy
View file @
8092cfe0
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
</view>
</view>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<van-notify id="van-notify" />
<van-notify id="van-notify" />
<van-dialog id="van-dialog"
confirmButtonColor="#FF5D15"
/>
<van-dialog id="van-dialog"/>
</view>
</view>
</template>
</template>
<script>
<script>
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
await login(code);
await login(code);
goprize();
goprize();
} else {
} else {
Notify({message: '参与失败,请重新授权!'
, background: '#FF5D15'
});
Notify({message: '参与失败,请重新授权!'});
}
}
},
},
async confirmRaff() {
async confirmRaff() {
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
},
},
joinin() {
joinin() {
if (!this.isCheck) {
if (!this.isCheck) {
Notify({message: '勾选同意后才可以抽奖!'
, background: '#FF5D15'
});
Notify({message: '勾选同意后才可以抽奖!'});
return;
return;
}
}
if (this.hasPhone) {
if (this.hasPhone) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment