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; return res.data.data;
} else { } else {
console.log(">>>>>="); console.log(">>>>>=");
console.log(">>>>>=",res.data);
if (res.data) { if (res.data) {
if (!res.data.msg) { if (!res.data.msg) {
res.data.msg = res.data.data; res.data.msg = res.data.data;
@ -321,7 +322,7 @@ export default {
title: res.data.msg, title: res.data.msg,
icon: 'none' 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 class="demand">{{ item.minPoint }} {{ item.amount }}</view>
</view> </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> @click="acceptCoupon(item)">立即领取</view>
<navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}" <!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
:url='item.url' @click="useCoupon(item)">立即使用</navigator> :url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
</view> </view>
</template> </template>
@ -21,6 +21,9 @@
import { import {
formatDate formatDate
} from '@/common/date'; } from '@/common/date';
import {
mapState
} from 'vuex';
export default { export default {
components: { components: {
@ -54,8 +57,12 @@
return formatDate(date, 'yyyy-MM-dd hh:mm:ss') return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}, },
}, },
computed: {
...mapState(['hasLogin', 'userInfo']),
},
methods: { methods: {
async acceptCoupon(item) { async acceptCoupon(item) {
if (this.hasLogin) {
this.types = !this.types this.types = !this.types
uni.showLoading({ uni.showLoading({
title: '请稍后' title: '请稍后'
@ -64,15 +71,20 @@
let params = { let params = {
couponId: item.id 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) 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(); uni.hideLoading();
} else {
uni.navigateTo({
url: '/pages/public/login'
});
}
}, },
clickSubMethod(vel) { clickSubMethod(vel) {
console.log('clickSubMethod') console.log('clickSubMethod')

11
mallplusui-uniapp-app/pages.json

@ -17,10 +17,11 @@
"placeholder": "请输入要查询的信息", "placeholder": "请输入要查询的信息",
"disabled": true, "disabled": true,
"placeholderColor": "#606266" "placeholderColor": "#606266"
}, }
,
"buttons": [{ "buttons": [{
"fontSrc": "/static/yticon.ttf", "fontSrc": "/static/yticon.ttf",
"text": "\ue60d", "text": "",
"fontSize": "26", "fontSize": "26",
"color": "#303133", "color": "#303133",
"float": "left", "float": "left",
@ -28,11 +29,11 @@
}, },
{ {
"fontSrc": "/static/yticon.ttf", "fontSrc": "/static/yticon.ttf",
"text": "\ue744", "text": "",
"fontSize": "27", "fontSize": "27",
"color": "#303133", "color": "#303133",
"background": "rgba(0,0,0,0)", "background": "rgba(0,0,0,0)"
"redDot": true // "redDot": true
} }
] ]
} }

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

@ -245,8 +245,8 @@
</view> </view>
<text class="title clamp">{{ item.name }}</text> <text class="title clamp">{{ item.name }}</text>
<view> <view>
<text class="price">惠农价{{ item.price }}</text> <text class="price">惠农价{{ item.originalPrice }}</text>
<text class="m-price">市场价{{ item.originalPrice }}</text> <text class="m-price">市场价{{ item.price }}</text>
</view> </view>
</view> </view>
@ -360,6 +360,9 @@
} }
}, },
}, },
computed: {
...mapState(['hasLogin', 'userInfo']),
},
methods: { methods: {
clickParentMethod() { clickParentMethod() {
console.log('clickParentMethod') console.log('clickParentMethod')
@ -368,11 +371,21 @@
callParentMethod(val) { callParentMethod(val) {
console.log('callParentMethod: ' + val) console.log('callParentMethod: ' + val)
// listfunctionitem // listfunctionitem
var index = this.couponList.findIndex(function(item) { var index = this.couponList.findIndex(
return item.id == val.id; // 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.couponList.splice(index, 1);
// this.getCouponList();
}, },
async sysInfoMethod() { async sysInfoMethod() {
@ -526,7 +539,7 @@
} }
}, },
/** /**
* 获取轮播图 * 获取优惠券
*/ */
async getCouponList() { async getCouponList() {
let params = { let params = {
@ -536,7 +549,9 @@
if (data) { if (data) {
console.log("优惠券") console.log("优惠券")
console.log("优惠券", data) 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' url: '/pages/search/search'
}); });
}, },
// buttons // // buttons
onNavigationBarButtonTap(e) { // onNavigationBarButtonTap(e) {
const index = e.index; // const index = e.index;
if (index === 0) { // if (index === 0) {
this.$api.msg('点击了扫描'); // this.$api.msg('');
} else if (index === 1) { // } else if (index === 1) {
// #ifdef APP-PLUS // // #ifdef APP-PLUS
const pages = getCurrentPages(); // const pages = getCurrentPages();
const page = pages[pages.length - 1]; // const page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview(); // const currentWebview = page.$getAppWebview();
currentWebview.hideTitleNViewButtonRedDot({ // currentWebview.hideTitleNViewButtonRedDot({
index // index
}); // });
// #endif // // #endif
uni.navigateTo({ // uni.navigateTo({
url: '../../pagesU/notice/notice' // url: '../../pagesU/notice/notice'
}); // });
} // }
} // }
}; };
</script> </script>

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

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

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

@ -785,7 +785,7 @@
line-height: 76upx; line-height: 76upx;
border-radius: 50px; border-radius: 50px;
margin-top: 70upx; margin-top: 70upx;
background: $uni-color-primary; background: $uni-color-warning;
color: #fff; color: #fff;
font-size: $font-lg; font-size: $font-lg;
@ -797,13 +797,12 @@
.login_bot { .login_bot {
display: flex; display: flex;
margin-top: 25upx; margin-top: 25upx;
margin-left: 70upx; align-items: center;
margin-right: 70upx; flex-direction: column;
flex-direction: row;
justify-content: space-between;
} }
.forget-section { .forget-section {
margin-top: 30px;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-spec; color: $font-color-spec;
text-align: center; text-align: center;
@ -811,6 +810,7 @@
.register-section { .register-section {
bottom: 50upx; bottom: 50upx;
margin-top: 20px;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-base; color: $font-color-base;
text-align: center; text-align: center;

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

@ -21,13 +21,13 @@
<input type="password" placeholder="请输入确认密码" v-model="confimpassword" @confirm="reg" /> <input type="password" placeholder="请输入确认密码" v-model="confimpassword" @confirm="reg" />
</view> </view>
<view class="input-item"> <view class="input-item">
<text class="tit">邀请码</text> <text class="tit">汇融乡村振兴卡号</text>
<input type="number" v-model="invitecode" placeholder="请输入邀请码" /> <input type="number" v-model="invitecode" maxlength="19" placeholder="请输入汇融乡村振兴卡号" />
</view> </view>
</view> </view>
<button class="confirm-btn" @click="reg" :disabled="logining">注册</button> <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>
<view class="register-section"> <view class="register-section">
已经有账号? 已经有账号?
@ -88,7 +88,7 @@
}, },
async reg() { async reg() {
var that = this; var that = this;
let phoneReg = /^1[1-9][0-9]\d{8}$/; let phoneReg = /^1[3456789]\d{9}$/;
try { try {
if (this.phone == '') { if (this.phone == '') {
throw '请填写手机号'; throw '请填写手机号';
@ -99,11 +99,37 @@
if (this.password == '') { if (this.password == '') {
throw '请填写密码'; throw '请填写密码';
} }
if (this.confimpassword == '') {
throw '请填写确认密码';
}
if (this.password != this.confimpassword) {
throw '俩次密码不一致';
}
} catch (err) { } catch (err) {
this.$api.msg(err); this.$api.msg(err);
return; 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; let params;
// //
var invitecode = this.$db.get('invitecode') var invitecode = this.$db.get('invitecode')
@ -127,12 +153,19 @@
} }
let data = await Api.apiCall('post', Api.index.simpleReg, params); 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 = { let params2 = {
phone: this.phone, phone: this.phone,
@ -151,7 +184,6 @@
uni.navigateBack({ uni.navigateBack({
delta: 2 delta: 2
}); });
} }
} }
} }
@ -301,9 +333,7 @@
} }
.register-section { .register-section {
position: absolute; margin-top: 40upx;
left: 0;
bottom: 40upx;
width: 100%; width: 100%;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-base; 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> <view class="image-wrapper"><image :src="item.pic" mode="aspectFill"></image></view>
<text class="title clamp">{{ item.name }}</text> <text class="title clamp">{{ item.name }}</text>
<view class="price-box" > <view class="price-box" >
<text class="price">{{ item.price }}</text> <text class="price">{{ item.originalPrice }}</text>
<text class="price2">市场价 ¥{{ item.originalPrice }}</text> <text class="price2">市场价 ¥{{ item.price }}</text>
</view> </view>
<!-- <view class="price-box" v-if="item.isVip == 1"> <!-- <view class="price-box" v-if="item.isVip == 1">
<text class="price">会员价{{ item.vipPrice }}</text> <text class="price">会员价{{ item.vipPrice }}</text>

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

@ -158,7 +158,7 @@ import Api from '@/common/api';
filters: { filters: {
formatCreateTime(time) { formatCreateTime(time) {
let date = new Date(time); let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss') return formatDate(date, 'yyyy-MM-dd')
}, },
}, },
methods: { methods: {

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

@ -6,13 +6,16 @@ Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
hasLogin: false, hasLogin: false,
hasVip: false,
userInfo: '' userInfo: ''
}, },
mutations: { mutations: {
login(state, provider) { login(state, provider) {
console.log(provider); console.log(provider);
if (provider && provider != undefined) { if (provider && provider != undefined) {
console.log("provider",provider);
state.hasLogin = true; state.hasLogin = true;
state.hasVip = true;
uni.setStorage({ //缓存用户登陆状态 uni.setStorage({ //缓存用户登陆状态
key: 'userInfo', key: 'userInfo',
data: provider.userInfo data: provider.userInfo
@ -24,6 +27,7 @@ const store = new Vuex.Store({
}, },
logout(state) { logout(state) {
state.hasLogin = false; state.hasLogin = false;
state.hasVip = false;
state.userInfo = ''; state.userInfo = '';
uni.removeStorage({ uni.removeStorage({
key: 'userInfo' key: 'userInfo'

Loading…
Cancel
Save