Commit 8092cfe0 authored by ziyu's avatar ziyu

improvement: 代码暂存

parent 79e1e467
......@@ -41,10 +41,10 @@ const request = async (url, options) => {
if (res.data.code === 2000) {
return res.data.data;
}
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop });
throw new Error(res.data.msg || '服务器异常,请求url:' + url);
}
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop });
throw new Error(res.data.msg || '服务器异常,请求url:' + url);
});
};
......
......@@ -42,6 +42,7 @@ Dialog.defaultOptions = {
showCancelButton: false,
closeOnClickOverlay: false,
confirmButtonOpenType: '',
confirmButtonColor:'#FF5D15',
};
Dialog.alert = Dialog;
Dialog.confirm = (options) =>
......
......@@ -3,7 +3,7 @@ const defaultOptions = {
selector: '#van-notify',
type: 'danger',
message: '',
background: '',
background: '#FF5D15',
duration: 3000,
zIndex: 110,
top: 0,
......
......@@ -279,7 +279,7 @@
<open-animation v-if="showAwardsModal" :joinRecord="mainInfo && mainInfo.joinRecord"></open-animation>
<shared-popup v-if="showShareModal" :inviteinfo="mainInfo && mainInfo.inviteRecord" @getSharedGold="getSharedGold"></shared-popup>
<popup @showMenu="showMenu" :showMenus="showMenus"></popup>
<van-dialog id="van-dialog" confirmButtonColor="#FF5D15"/>
<van-dialog id="van-dialog"/>
</view>
</template>
......@@ -588,11 +588,11 @@
getAwards: function() {
const { id, photoUrl, quantity, name, chance } = this.awardsInfo;
if (!id || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop: true });
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });
return;
}
if (this.mainInfo && this.mainInfo.account && this.mainInfo.account.quantity === 0) {
Notify({ message: '您的克币数为0, 无法参与抽奖', background: '#FF5D15', safeAreaInsetTop: true });
Notify({ message: '您的克币数为0, 无法参与抽奖', safeAreaInsetTop: true });
return;
}
wx.navigateTo({
......
......@@ -91,7 +91,7 @@
<view class="footer">
<button class="getprize" bindtap="goprize">{{btnfont}}</button>
</view>
<van-dialog id="van-dialog" confirmButtonColor="#FF5D15"/>
<van-dialog id="van-dialog"/>
<van-notify id="van-notify" />
</view>
</template>
......@@ -124,28 +124,28 @@
goprize() {
if (!this.prize.cash) {
if (!this.name) {
Notify({message: '请填写收货人', background: '#FF5D15'});
Notify({message: '请填写收货人'});
return;
}
let reg = /^1\d{10}$/;
if (!this.phone) {
Notify({message: '请填写手机号码', background: '#FF5D15'});
Notify({message: '请填写手机号码'});
return;
}
if (!reg.test(this.phone)) {
Notify({message: '请填写正确的手机号码', background: '#FF5D15'});
Notify({message: '请填写正确的手机号码'});
return;
}
if (!this.idNumber) {
Notify({message: '请填写身份证号', background: '#FF5D15'});
Notify({message: '请填写身份证号'});
return;
}
if (!this.city) {
Notify({message: '请选择所在地区', background: '#FF5D15'});
Notify({message: '请选择所在地区'});
return;
}
if (!this.address) {
Notify({message: '请填写详细地址', background: '#FF5D15'});
Notify({message: '请填写详细地址'});
return;
}
}
......@@ -199,7 +199,7 @@
onLoad (query) {
let joinRecordId = query.joinRecordId || '';
this.joinRecordId = joinRecordId;
if (!joinRecordId) Notify({message: '缺少参数错误!', background: '#FF5D15'});
if (!joinRecordId) Notify({message: '缺少参数错误!'});
// 请求接口得到数据
getOneRaffle({joinRecordId: joinRecordId}).then(data => {
let dat = data || {};
......
......@@ -150,7 +150,7 @@
</view>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<van-notify id="van-notify" />
<van-dialog id="van-dialog" confirmButtonColor="#FF5D15"/>
<van-dialog id="van-dialog"/>
</view>
</template>
<script>
......@@ -196,7 +196,7 @@
await login(code);
goprize();
} else {
Notify({message: '参与失败,请重新授权!', background: '#FF5D15'});
Notify({message: '参与失败,请重新授权!'});
}
},
async confirmRaff() {
......@@ -225,7 +225,7 @@
},
joinin() {
if (!this.isCheck) {
Notify({message: '勾选同意后才可以抽奖!', background: '#FF5D15'});
Notify({message: '勾选同意后才可以抽奖!'});
return;
}
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