Merge branch 'master' of http://gitea.yxtsoft.com/yxt_group/mallplus into master
This commit is contained in:
@@ -313,6 +313,7 @@ export default {
|
||||
return res.data.data;
|
||||
} else {
|
||||
console.log(">>>>>=");
|
||||
console.log(">>>>>=",res.data);
|
||||
if (res.data) {
|
||||
if (!res.data.msg) {
|
||||
res.data.msg = res.data.data;
|
||||
@@ -321,7 +322,7 @@ export default {
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
this.$api.msg(res.data.msg);
|
||||
// this.$api.msg(res.data.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<view class="demand">满{{ item.minPoint }} 减 {{ item.amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="get-btn" v-if="!types" :style="{color:color, borderColor:color, background:solid}"
|
||||
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}"
|
||||
@click="acceptCoupon(item)">立即领取</view>
|
||||
<navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
|
||||
:url='item.url' @click="useCoupon(item)">立即使用</navigator>
|
||||
<!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
|
||||
:url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
import {
|
||||
formatDate
|
||||
} from '@/common/date';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -54,25 +57,34 @@
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
async acceptCoupon(item) {
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
if (this.hasLogin) {
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.$api.msg(data);
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
this.clickSubMethod(item)
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
// console.log("data?????", data);
|
||||
// if (data) {
|
||||
// // this.$api.msg(data);
|
||||
// this.clickSubMethod(item)
|
||||
|
||||
// }
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
||||
},
|
||||
clickSubMethod(vel) {
|
||||
console.log('clickSubMethod')
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
"placeholder": "请输入要查询的信息",
|
||||
"disabled": true,
|
||||
"placeholderColor": "#606266"
|
||||
},
|
||||
}
|
||||
,
|
||||
"buttons": [{
|
||||
"fontSrc": "/static/yticon.ttf",
|
||||
"text": "\ue60d",
|
||||
"text": "",
|
||||
"fontSize": "26",
|
||||
"color": "#303133",
|
||||
"float": "left",
|
||||
@@ -28,11 +29,11 @@
|
||||
},
|
||||
{
|
||||
"fontSrc": "/static/yticon.ttf",
|
||||
"text": "\ue744",
|
||||
"text": "",
|
||||
"fontSize": "27",
|
||||
"color": "#303133",
|
||||
"background": "rgba(0,0,0,0)",
|
||||
"redDot": true
|
||||
"background": "rgba(0,0,0,0)"
|
||||
// "redDot": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -245,8 +245,8 @@
|
||||
</view>
|
||||
<text class="title clamp">{{ item.name }}</text>
|
||||
<view>
|
||||
<text class="price">惠农价¥{{ item.price }}</text>
|
||||
<text class="m-price">市场价¥{{ item.originalPrice }}</text>
|
||||
<text class="price">惠农价¥{{ item.originalPrice }}</text>
|
||||
<text class="m-price">市场价¥{{ item.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -360,6 +360,9 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
clickParentMethod() {
|
||||
console.log('clickParentMethod')
|
||||
@@ -368,11 +371,21 @@
|
||||
callParentMethod(val) {
|
||||
console.log('callParentMethod: ' + val)
|
||||
// 默认去遍历list集合,将集合中的每个元素传入到function的item里,
|
||||
var index = this.couponList.findIndex(function(item) {
|
||||
return item.id == val.id;
|
||||
})
|
||||
var index = this.couponList.findIndex(
|
||||
// function(item) {
|
||||
// console.log('item: ' + JSON.stringify(item))
|
||||
// console.log('val: ' + val)
|
||||
// return item.id == val.id;
|
||||
item => {
|
||||
console.log('item_id: ' +JSON.parse(JSON.stringify(item)).id)
|
||||
console.log('val_id: ' +JSON.parse(val).id)
|
||||
if (JSON.parse(JSON.stringify(item)).id == JSON.parse(val).id) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
console.log('index: ' + index)
|
||||
this.couponList.splice(index, 1);
|
||||
|
||||
// this.getCouponList();
|
||||
},
|
||||
|
||||
async sysInfoMethod() {
|
||||
@@ -526,7 +539,7 @@
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取轮播图
|
||||
* 获取优惠券
|
||||
*/
|
||||
async getCouponList() {
|
||||
let params = {
|
||||
@@ -536,7 +549,9 @@
|
||||
if (data) {
|
||||
console.log("优惠券")
|
||||
console.log("优惠券", data)
|
||||
this.couponList = data || [];
|
||||
console.log("优惠券id",data[0].id)
|
||||
this.couponList = []
|
||||
this.couponList = this.couponList.concat(data) || [];
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -785,25 +800,25 @@
|
||||
url: '/pages/search/search'
|
||||
});
|
||||
},
|
||||
//点击导航栏 buttons 时触发
|
||||
onNavigationBarButtonTap(e) {
|
||||
const index = e.index;
|
||||
if (index === 0) {
|
||||
this.$api.msg('点击了扫描');
|
||||
} else if (index === 1) {
|
||||
// #ifdef APP-PLUS
|
||||
const pages = getCurrentPages();
|
||||
const page = pages[pages.length - 1];
|
||||
const currentWebview = page.$getAppWebview();
|
||||
currentWebview.hideTitleNViewButtonRedDot({
|
||||
index
|
||||
});
|
||||
// #endif
|
||||
uni.navigateTo({
|
||||
url: '../../pagesU/notice/notice'
|
||||
});
|
||||
}
|
||||
}
|
||||
// //点击导航栏 buttons 时触发
|
||||
// onNavigationBarButtonTap(e) {
|
||||
// const index = e.index;
|
||||
// if (index === 0) {
|
||||
// this.$api.msg('点击了扫描');
|
||||
// } else if (index === 1) {
|
||||
// // #ifdef APP-PLUS
|
||||
// const pages = getCurrentPages();
|
||||
// const page = pages[pages.length - 1];
|
||||
// const currentWebview = page.$getAppWebview();
|
||||
// currentWebview.hideTitleNViewButtonRedDot({
|
||||
// index
|
||||
// });
|
||||
// // #endif
|
||||
// uni.navigateTo({
|
||||
// url: '../../pagesU/notice/notice'
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -785,7 +785,7 @@
|
||||
line-height: 76upx;
|
||||
border-radius: 50px;
|
||||
margin-top: 70upx;
|
||||
background: $uni-color-primary;
|
||||
background: $uni-color-warning;
|
||||
color: #fff;
|
||||
font-size: $font-lg;
|
||||
|
||||
@@ -797,13 +797,12 @@
|
||||
.login_bot {
|
||||
display: flex;
|
||||
margin-top: 25upx;
|
||||
margin-left: 70upx;
|
||||
margin-right: 70upx;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.forget-section {
|
||||
margin-top: 30px;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-spec;
|
||||
text-align: center;
|
||||
@@ -811,6 +810,7 @@
|
||||
|
||||
.register-section {
|
||||
bottom: 50upx;
|
||||
margin-top: 20px;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-base;
|
||||
text-align: center;
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
<input type="password" placeholder="请输入确认密码" v-model="confimpassword" @confirm="reg" />
|
||||
</view>
|
||||
<view class="input-item">
|
||||
<text class="tit">邀请码</text>
|
||||
<input type="number" v-model="invitecode" placeholder="请输入邀请码" />
|
||||
<text class="tit">汇融乡村振兴卡号</text>
|
||||
<input type="number" v-model="invitecode" maxlength="19" placeholder="请输入汇融乡村振兴卡号" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="confirm-btn" @click="reg" :disabled="logining">注册</button>
|
||||
|
||||
<view class="forget-section" @click="toForget">忘记密码?</view>
|
||||
<!-- <view class="forget-section" @click="toForget">忘记密码?</view> -->
|
||||
</view>
|
||||
<view class="register-section">
|
||||
已经有账号?
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
async reg() {
|
||||
var that = this;
|
||||
let phoneReg = /^1[1-9][0-9]\d{8}$/;
|
||||
let phoneReg = /^1[3456789]\d{9}$/;
|
||||
try {
|
||||
if (this.phone == '') {
|
||||
throw '请填写手机号';
|
||||
@@ -99,11 +99,37 @@
|
||||
if (this.password == '') {
|
||||
throw '请填写密码';
|
||||
}
|
||||
if (this.confimpassword == '') {
|
||||
throw '请填写确认密码';
|
||||
}
|
||||
if (this.password != this.confimpassword) {
|
||||
throw '俩次密码不一致';
|
||||
}
|
||||
} catch (err) {
|
||||
this.$api.msg(err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!this.invitecode.includes("62350109317")) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '汇融乡村振兴卡号输入有误,将无法享受惠农价。是否继续注册?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.aaa(false);
|
||||
} else if (res.cancel) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.aaa(true);
|
||||
}
|
||||
},
|
||||
|
||||
async aaa(vel) {
|
||||
let that = this
|
||||
let params;
|
||||
//有推荐码的话,带上
|
||||
var invitecode = this.$db.get('invitecode')
|
||||
@@ -127,12 +153,19 @@
|
||||
}
|
||||
let data = await Api.apiCall('post', Api.index.simpleReg, params);
|
||||
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: vel ? "恭喜您注册成功,并成为惠农会员。" : "恭喜您注册成功。",
|
||||
duration: 2000
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/public/login'
|
||||
// });
|
||||
|
||||
// 注册成功 直接默认登录
|
||||
});
|
||||
setTimeout(function() {
|
||||
that.request();
|
||||
}, 3000);
|
||||
},
|
||||
async request() {
|
||||
var that = this;
|
||||
|
||||
let params2 = {
|
||||
phone: this.phone,
|
||||
@@ -151,7 +184,6 @@
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,9 +333,7 @@
|
||||
}
|
||||
|
||||
.register-section {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 40upx;
|
||||
margin-top: 40upx;
|
||||
width: 100%;
|
||||
font-size: $font-sm + 2upx;
|
||||
color: $font-color-base;
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view>
|
||||
<text class="title clamp">{{ item.name }}</text>
|
||||
<view class="price-box" >
|
||||
<text class="price">{{ item.price }}</text>
|
||||
<text class="price2">市场价 ¥{{ item.originalPrice }}</text>
|
||||
<text class="price">{{ item.originalPrice }}</text>
|
||||
<text class="price2">市场价 ¥{{ item.price }}</text>
|
||||
</view>
|
||||
<!-- <view class="price-box" v-if="item.isVip == 1">
|
||||
<text class="price">会员价{{ item.vipPrice }}</text>
|
||||
|
||||
@@ -158,7 +158,7 @@ import Api from '@/common/api';
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
return formatDate(date, 'yyyy-MM-dd')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -6,13 +6,16 @@ Vue.use(Vuex)
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
hasLogin: false,
|
||||
hasVip: false,
|
||||
userInfo: ''
|
||||
},
|
||||
mutations: {
|
||||
login(state, provider) {
|
||||
console.log(provider);
|
||||
if (provider && provider != undefined) {
|
||||
console.log("provider",provider);
|
||||
state.hasLogin = true;
|
||||
state.hasVip = true;
|
||||
uni.setStorage({ //缓存用户登陆状态
|
||||
key: 'userInfo',
|
||||
data: provider.userInfo
|
||||
@@ -24,6 +27,7 @@ const store = new Vuex.Store({
|
||||
},
|
||||
logout(state) {
|
||||
state.hasLogin = false;
|
||||
state.hasVip = false;
|
||||
state.userInfo = '';
|
||||
uni.removeStorage({
|
||||
key: 'userInfo'
|
||||
|
||||
Reference in New Issue
Block a user