Browse Source

Merge branch 'master' of http://gitea.yxtsoft.com/yxt_group/mallplus into master

master
lzh 2 years ago
parent
commit
975c398b65
  1. 3
      mallplusui-uniapp-app/common/api.js
  2. 30
      mallplusui-uniapp-app/components/coolc-coupon/coolc-coupon.vue
  3. 11
      mallplusui-uniapp-app/pages.json
  4. 67
      mallplusui-uniapp-app/pages/index/index.vue
  5. 131
      mallplusui-uniapp-app/pages/index/user.vue
  6. 10
      mallplusui-uniapp-app/pages/public/login.vue
  7. 56
      mallplusui-uniapp-app/pages/public/reg.vue
  8. 4
      mallplusui-uniapp-app/pagesA/product/list.vue
  9. 2
      mallplusui-uniapp-app/pagesU/user/coupon.vue
  10. 4
      mallplusui-uniapp-app/store/index.js

3
mallplusui-uniapp-app/common/api.js

@ -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);
}
}

30
mallplusui-uniapp-app/components/coolc-coupon/coolc-coupon.vue

@ -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,8 +57,12 @@
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
},
computed: {
...mapState(['hasLogin', 'userInfo']),
},
methods: {
async acceptCoupon(item) {
if (this.hasLogin) {
this.types = !this.types
uni.showLoading({
title: '请稍后'
@ -64,15 +71,20 @@
let params = {
couponId: item.id
};
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
console.log(data);
if (data) {
this.$api.msg(data);
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'
});
}
},
clickSubMethod(vel) {
console.log('clickSubMethod')

11
mallplusui-uniapp-app/pages.json

@ -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
}
]
}

67
mallplusui-uniapp-app/pages/index/index.vue

@ -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)
// listfunctionitem
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>

131
mallplusui-uniapp-app/pages/index/user.vue

@ -6,26 +6,36 @@
<view class="member-top-c">
<template v-if="userDetailInfo && userDetailInfo.id">
<view class="" style="display: flex;align-items: center;">
<image class="portrait" mode="aspectFill" :src="userDetailInfo.icon" @click="toUserInfo"></image>
<view class="user-name" style="margin-left: 10upx;color: #FFFFFF;" @click="toUserInfo">{{ userDetailInfo.nickname || userDetailInfo.username }}</view>
<view v-if="userDetailInfo.storeId" class="vip-card-box1" @click="toNav('../../pagesC/seller/index')"><view class="b-btn">卖家中心</view></view>
<image class="portrait" mode="aspectFill" :src="userDetailInfo.icon" @click="toUserInfo">
</image>
<view class="user-name" style="margin-left: 10upx;color: #FFFFFF;" @click="toUserInfo">
{{ userDetailInfo.nickname || userDetailInfo.username }}
</view>
<view v-if="userDetailInfo.storeId" class="vip-card-box1"
@click="toNav('../../pagesC/seller/index')">
<view class="b-btn">卖家中心</view>
</view>
</view>
</template>
<template v-else>
<!-- #ifdef H5 || APP-PLUS -->
<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toLogin"></image>
<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toLogin">
</image>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toWeChatLogin"></image>
<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toWeChatLogin">
</image>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view class="portrait"></view>
<view><button class="login-btn" open-type="getAuthorize" @click="getALICode" hover-class="btn-hover">授权登录</button></view>
<view><button class="login-btn" open-type="getAuthorize" @click="getALICode"
hover-class="btn-hover">授权登录</button></view>
<!-- #endif -->
</template>
</view>
</view>
<view class="vip-card-box" @click="toNav('../../pagesU/user/applyMember')">
<!-- <view class="vip-card-box" @click="toNav('../../pagesU/user/applyMember')"> -->
<view class="vip-card-box" @click="upData()">
<image class="card-bg" src="/static/vip-card-bg.png" mode=""></image>
<view class="b-btn">立即升级</view>
<view class="tit" v-if="userDetailInfo">
@ -37,18 +47,12 @@
</view>
</view>
<view
class="cover-container"
:style="[
<view class="cover-container" :style="[
{
transform: coverTransform,
transition: coverTransition
}
]"
@touchstart="coverTouchstart"
@touchmove="coverTouchmove"
@touchend="coverTouchend"
>
]" @touchstart="coverTouchstart" @touchmove="coverTouchmove" @touchend="coverTouchend">
<image class="arc" src="/static/arc.png"></image>
<view class="tj-sction">
@ -67,20 +71,24 @@
</view>
<!-- 订单 -->
<view class="order-section">
<view class="order-item" @click="navTo('/pages/order/order?status=0')" hover-class="common-hover" :hover-stay-time="50">
<view class="order-item" @click="navTo('/pages/order/order?status=0')" hover-class="common-hover"
:hover-stay-time="50">
<text class="yticon icon-shouye"></text>
<text>全部订单</text>
</view>
<view class="order-item" @click="navTo('/pages/order/order?status=2')" hover-class="common-hover" :hover-stay-time="50">
<view class="order-item" @click="navTo('/pages/order/order?status=2')" hover-class="common-hover"
:hover-stay-time="50">
<text class="yticon icon-daifukuan"></text>
<text>待付款</text>
</view>
<view class="order-item" @click="navTo('/pages/order/order?status=3')" hover-class="common-hover" :hover-stay-time="50">
<view class="order-item" @click="navTo('/pages/order/order?status=3')" hover-class="common-hover"
:hover-stay-time="50">
<text class="yticon icon-yishouhuo"></text>
<text>待收货</text>
</view>
<view class="order-item" @click="navTo('../../pagesA/after_sale/list')" hover-class="common-hover" :hover-stay-time="50">
<view class="order-item" @click="navTo('../../pagesA/after_sale/list')" hover-class="common-hover"
:hover-stay-time="50">
<text class="yticon icon-shouhoutuikuan"></text>
<text>退款/售后</text>
</view>
@ -92,14 +100,18 @@
<text>浏览历史</text>
</view>
<scroll-view scroll-x class="h-list" v-if="viewList && viewList.length > 0">
<image v-for="(item, index) in viewList" :key="index" @click="navToDetailPage(item)" :src="item.pic" mode="aspectFill"></image>
<image v-for="(item, index) in viewList" :key="index" @click="navToDetailPage(item)" :src="item.pic"
mode="aspectFill"></image>
</scroll-view>
<!--<list-cell icon="icon-iconfontweixin" iconColor="#e07472" title="我的钱包" tips="您的会员还有3天过期"></list-cell>-->
<list-cell icon="icon-dizhi" iconColor="#5fcda2" title="地址管理" @eventClick="navTo('../../pagesU/address/address')"></list-cell>
<list-cell icon="icon-tuandui" iconColor="#EE82EE" title="个人资料" @eventClick="navTo('../../pagesU/user/profile')"></list-cell>
<list-cell icon="icon-dizhi" iconColor="#5fcda2" title="地址管理"
@eventClick="navTo('../../pagesU/address/address')"></list-cell>
<list-cell icon="icon-tuandui" iconColor="#EE82EE" title="个人资料"
@eventClick="navTo('../../pagesU/user/profile')"></list-cell>
<!--<list-cell icon="icon-share" iconColor="#9789f7" title="分享" tips="邀请好友赢10万大礼"></list-cell>
<list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="晒单" tips="晒单抢红包"></list-cell>-->
<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏" @eventClick="navTo('../../pagesU/user/collect')"></list-cell>
<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏"
@eventClick="navTo('../../pagesU/user/collect')"></list-cell>
<!-- <list-cell
icon="icon-share cgtt"
iconColor="#0e68d7"
@ -137,7 +149,8 @@
@eventClick="navTo('../../pagesU/user/invite')"
></list-cell> -->
<!-- <list-cell icon="icon-pinglun-copy" iconColor="#0e68d7" v-if="!userDetailInfo.invitecode" title="推荐邀请码" @eventClick="inputShowModal('invitecode')"></list-cell> -->
<list-cell icon="icon-shezhi1" iconColor="#e07472" title="系统设置" border="" @eventClick="navTo('/pages/set/set')"></list-cell>
<list-cell icon="icon-shezhi1" iconColor="#e07472" title="系统设置" border=""
@eventClick="navTo('/pages/set/set')"></list-cell>
<!-- <list-cell icon="icon-shezhi1" iconColor="#e07472" title="test" border="" @eventClick="navTo('/pages/search/test')"></list-cell> -->
</view>
</view>
@ -151,7 +164,10 @@ import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue
import Api from '@/common/api';
import listCell from '@/components/mix-list-cell';
import neilModal from '@/components/neil-modal.vue';
import { mapState, mapMutations } from 'vuex';
import {
mapState,
mapMutations
} from 'vuex';
let startY = 0,
moveY = 0,
pageAtTop = true;
@ -180,9 +196,15 @@ export default {
},
async onLoad() {
this.userDetailInfo = {}
this.couponList = []
this.viewList = []
this.getData();
},
async onShow() {
this.userDetailInfo = {}
this.couponList = []
this.viewList = []
this.getData();
},
@ -232,7 +254,9 @@ export default {
that.$api.msg('输入不能为空');
return;
}
let obj = { id: this.userDetailInfo.id };
let obj = {
id: this.userDetailInfo.id
};
obj[that.feild] = that.inputContent;
Api.apiCall('post', Api.member.updateMember, obj);
that.$api.msg('修改成功');
@ -249,10 +273,15 @@ export default {
if (!data1) {
this.userDetailInfo = {};
}
this.userDetailInfo = data1.member;
console.log("data", data1);
if (!data1.member) {
this.logout();
this.couponList = []
this.viewList = []
this.getHistory();
} else {
this.userDetailInfo = data1.member;
uni.setStorageSync('userInfos', data1.member);
console.log(this.userDetailInfo);
let couponList = data1.histories;
@ -267,11 +296,27 @@ export default {
this.viewList = data.result;
}
},
upData(){
uni.showModal({
title: '提示',
content: '已经是最新版本',
showCancel:false,
success: function(res) {
if (res.confirm) {
}
}
});
},
toNav(url) {
if (!this.hasLogin) {
url = '/pages/public/login';
}
uni.navigateTo({
url: url
});
},
toUserInfo() {
uni.navigateTo({
@ -524,9 +569,11 @@ export default {
font-style: normal;
src: url('//at.alicdn.com/t/font_1475801_5innv59qqcr.ttf') format('truetype');
}
page {
background: #f3f3f3;
}
.cgtt {
font-family: 'cgtt' !important;
font-size: 16px;
@ -549,6 +596,7 @@ page {
justify-content: center;
align-items: center;
}
%section {
display: flex;
justify-content: space-around;
@ -561,6 +609,7 @@ page {
height: 520upx;
padding: 100upx 30upx 0;
position: relative;
.bg {
position: absolute;
left: 0;
@ -571,24 +620,28 @@ page {
// opacity: 0.7;
}
}
.user-info-box {
height: 180upx;
display: flex;
align-items: center;
position: relative;
z-index: 1;
.portrait {
width: 130upx;
height: 130upx;
border: 5upx solid #fff;
border-radius: 50%;
}
.username {
font-size: $font-lg + 6upx;
color: $font-color-dark;
margin-left: 20upx;
}
}
.login-btn {
color: #fff;
width: 180upx;
@ -598,6 +651,7 @@ page {
background: #ff7159;
font-size: 12px;
}
.vip-card-box {
display: flex;
flex-direction: column;
@ -608,6 +662,7 @@ page {
overflow: hidden;
position: relative;
padding: 20upx 24upx;
.card-bg {
position: absolute;
top: 20upx;
@ -615,6 +670,7 @@ page {
width: 380upx;
height: 260upx;
}
.b-btn {
position: absolute;
right: 20upx;
@ -629,21 +685,25 @@ page {
background: linear-gradient(left, #f9e6af, #ffd465);
z-index: 1;
}
.tit {
font-size: $font-base + 2upx;
color: #f7d680;
margin-bottom: 28upx;
.yticon {
color: #f6e5a3;
margin-right: 16upx;
}
}
.e-b {
font-size: $font-sm;
color: #d8cba9;
margin-top: 10upx;
}
}
.vip-card-box1 {
display: flex;
flex-direction: column;
@ -670,21 +730,25 @@ page {
background: linear-gradient(left, #f9e6af, #ffd465);
z-index: 1;
}
.tit {
font-size: $font-base + 2upx;
color: #f7d680;
margin-bottom: 28upx;
.yticon {
color: #f6e5a3;
margin-right: 16upx;
}
}
.e-b {
font-size: $font-sm;
color: #d8cba9;
margin-top: 10upx;
}
}
.cover-container {
background: $page-color-base;
margin-top: -150upx;
@ -692,6 +756,7 @@ page {
position: relative;
background: #f5f5f5;
padding-bottom: 20upx;
.arc {
position: absolute;
left: 0;
@ -700,8 +765,10 @@ page {
height: 36upx;
}
}
.tj-sction {
@extend %section;
.tj-item {
@extend %flex-center;
flex-direction: column;
@ -709,16 +776,19 @@ page {
font-size: $font-sm;
color: #75787d;
}
.num {
font-size: $font-lg;
color: $font-color-dark;
margin-bottom: 8upx;
}
}
.order-section {
@extend %section;
padding: 28upx 0;
margin-top: 20upx;
.order-item {
@extend %flex-center;
width: 120upx;
@ -727,20 +797,24 @@ page {
font-size: $font-sm;
color: $font-color-dark;
}
.yticon {
font-size: 48upx;
margin-bottom: 18upx;
color: #fa436a;
}
.icon-shouhoutuikuan {
font-size: 44upx;
}
}
.history-section {
padding: 30upx 0 0;
margin-top: 20upx;
background: #fff;
border-radius: 10upx;
.sec-header {
display: flex;
align-items: center;
@ -748,6 +822,7 @@ page {
color: $font-color-dark;
line-height: 40upx;
margin-left: 30upx;
.yticon {
font-size: 44upx;
color: #5eba8f;
@ -755,9 +830,11 @@ page {
line-height: 40upx;
}
}
.h-list {
white-space: nowrap;
padding: 30upx 30upx 0;
image {
display: inline-block;
width: 160upx;

10
mallplusui-uniapp-app/pages/public/login.vue

@ -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;

56
mallplusui-uniapp-app/pages/public/reg.vue

@ -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;

4
mallplusui-uniapp-app/pagesA/product/list.vue

@ -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>

2
mallplusui-uniapp-app/pagesU/user/coupon.vue

@ -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: {

4
mallplusui-uniapp-app/store/index.js

@ -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'

Loading…
Cancel
Save