Commit 8092cfe0 authored by ziyu's avatar ziyu

improvement: 代码暂存

parent 79e1e467
...@@ -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);
}); });
}; };
......
...@@ -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) =>
......
...@@ -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,
......
...@@ -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({
......
...@@ -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 || {};
......
...@@ -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) {
......
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