·修改部分页面数据冗余

This commit is contained in:
lemon橪
2021-05-14 17:31:40 +08:00
parent 23804939eb
commit 7f4212755d
42 changed files with 1415 additions and 2987 deletions

View File

@@ -2,33 +2,24 @@
<view class="about-us">
<view class="box flex-center">
<image src="/static/logo.png" mode="scaleToFill"></image>
<view>lili商城</view>
<view>{{config.name}}</view>
</view>
<u-cell-group :border="false">
<!-- #ifdef APP-PLUS -->
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
<!-- #endif -->
<u-cell-item title="证照信息" @click="
navigateTo('/pages/mine/help/tips?type=message')
"></u-cell-item>
<u-cell-item title="服务协议" @click="
navigateTo('/pages/mine/help/tips?type=user')
"></u-cell-item>
<u-cell-item title="隐私协议" :border-bottom="false" @click="
navigateTo('/pages/mine/help/tips?type=privacy')
"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="
navigateTo('/pages/mine/help/tips?type=about')
"></u-cell-item>
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
</u-cell-group>
<view class="intro flex-center c-content">
<view>客服热线15810610731</view>
<view>客服热线13161366885</view>
<view>客服邮箱lili@lili.com</view>
</view>
<view class="bottom flex-center">
<view @click="navigateTo('/pages/help/tips?type=user')">lili商城用户协议</view>
<view>CopyRight @ lili商城 </view>
<view>CopyRight @ {{config.name}} </view>
</view>
</view>
</template>
@@ -37,11 +28,12 @@
// #ifdef APP-PLUS
import APPUpdate, { getCurrentNo, getServerNo } from "@/plugins/APPUpdate";
import { getAppVersionList } from "@/api/message.js";
// #endif
import config from "@/config/config";
export default {
data() {
return {
config,
showUpdate: false,
version: "",
currentNo: 0,
@@ -51,7 +43,10 @@ export default {
},
};
},
onLoad(options) {
onLoad() {
/**
* 根据当前app系统判断
*/
// #ifdef APP-PLUS
let _this = this;
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
@@ -66,6 +61,9 @@ export default {
// #endif
},
methods: {
/**
* 点击查看更新
*/
async checkUpdate() {
// #ifdef APP-PLUS
let needUpdate = false;

View File

@@ -6,7 +6,7 @@
选择收货地址
</view>
<u-form-item class="border" label="收货人" label-width="130" prop="name">
<u-input v-model="form.name" placeholder="请输入收货人姓名" />
<u-input v-model="form.name" clearable placeholder="请输入收货人姓名" />
</u-form-item>
<u-form-item label="手机号码" label-width="130" prop="mobile">
@@ -59,7 +59,7 @@ export default {
// ios系统
permision.judgeIosPermission("location")
? (this.mapFlage = true)
: this.refuseMapOuther() ;
: this.refuseMapOuther();
} else {
// 安卓
this.requestAndroidPermission(
@@ -116,6 +116,7 @@ export default {
}
},
// 选择地址后数据的回调
callBackAddress(val) {
uni.showLoading({
title: "加载中",
@@ -132,15 +133,19 @@ export default {
uni.hideLoading();
}
this.mapFlage = !this.mapFlage;
this.mapFlage = !this.mapFlage; //关闭地图
},
// 保存当前 地址
save() {
this.$refs.uForm.validate((valid) => {
if (valid) {
let pages = getCurrentPages(); //获取页面栈
let beforePage = pages[pages.length - 2]; //上个页面
console.log(beforePage);
// 如果没有id则为新增地址
if (!this.form.id) {
// 删除没有的数据
delete this.form.___path;
addAddress(this.form).then((res) => {
if (res.data.success) {
@@ -156,6 +161,7 @@ export default {
}
});
} else {
// 修改地址
delete this.form.___path;
delete this.form.updateBy;
delete this.form.updateTime;
@@ -167,18 +173,20 @@ export default {
}
});
}
} else {
console.log("验证失败");
}
});
},
// 三级地址联动回调
getpickerParentValue(e) {
// 将需要绑定的地址设置为空,并赋值
this.form.consigneeAddressIdPath = [];
this.form.consigneeAddressPath = [];
let name = "";
e.forEach((item, index) => {
console.log(item);
if (item.id) {
// 遍历数据
this.form.consigneeAddressIdPath.push(item.id);
this.form.consigneeAddressPath.push(item.localName);
name += item.localName;
@@ -194,8 +202,9 @@ export default {
this.form.lon = _town[0].center.split(",")[1];
}
});
},
// 显示三级地址联动
showPicker() {
this.$refs.cityPicker.show();
},
@@ -203,24 +212,19 @@ export default {
mounted() {},
data() {
return {
lightColor: this.$lightColor,
addSyncData: "",
mapFlage: false,
longitude: "",
markers: [],
latitude: "",
lightColor: this.$lightColor, //高亮颜色
mapFlage: false, // 地图选择开
routerVal: "",
show: false,
form: {
detail: "",
name: "",
mobile: "",
consigneeAddressIdPath: [],
consigneeAddressPath: [],
___path: "",
isDefault: false,
detail: "", //地址详情
name: "", //收货人姓名
mobile: "", //手机号码
consigneeAddressIdPath: [], //地址id
consigneeAddressPath: [], //地址名字
___path: "", //所在区域
isDefault: false, //是否默认地址
},
// 表单提交校验规则
rules: {
name: [
{
@@ -272,6 +276,7 @@ export default {
title: "加载中",
});
this.routerVal = option;
// 如果当前是编辑地址,则需要查询出地址详情信息
if (option.id) {
getAddressDetail(option.id).then((res) => {
const params = res.data.result;
@@ -283,10 +288,7 @@ export default {
}
uni.hideLoading();
},
onShow() {
},
// 必须要在onReady生命周期因为onLoad生命周期组件可能尚未创建完毕
// 初始化rules必须要在onReady生命周期因为onLoad生命周期组件可能尚未创建完毕
onReady() {
this.$refs.uForm.setRules(this.rules);
},

View File

@@ -0,0 +1,132 @@
.empty {
margin-top: 200rpx !important;
}
.alifont {
display: inline-block;
}
.region {
span {
margin: 0 4rpx !important;
}
}
.address {
.default {
border: 1px solid #ff6262;
color: #ff6262;
font-size: 22rpx;
border-radius: 6rpx;
align-self: center;
padding: 2rpx 20rpx;
}
.list {
.item:hover {
background: #ededed;
}
.item {
margin-top: 20rpx;
font-size: $font-base;
color: #666;
.basic {
padding: 30rpx;
line-height: 1.5em;
border-bottom: 1px solid $border-color-light;
:nth-child(2) {
margin: 0 20rpx;
}
:nth-child(4) {
color: $font-color-light;
font-size: $font-sm;
margin-top: 10rpx;
text:nth-child(2) {
margin: 0;
}
view {
font-size: 28rpx;
}
}
}
.edit {
display: flex;
justify-content: space-between;
align-items: center;
vertical-align: middle;
height: 80rpx;
font-size: $font-sm;
color: $font-color-light;
padding: 0 30rpx;
.unchecked {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 1px solid #e0e0e0;
display: inline-block;
vertical-align: middle;
margin-right: 8rpx;
position: relative;
top: -2rpx;
left: 0;
}
view:nth-child(1) {
view:nth-child(1) {
font-size: $font-base;
color: $main-color;
margin-right: 8rpx;
vertical-align: middle;
}
}
view:nth-child(2) {
text {
margin-left: 5rpx;
}
.alifont {
font-size: 32rpx;
}
.icon-bianji-copy {
font-size: 28rpx;
position: relative;
top: 2rpx;
left: 0;
}
.icon-lajitong {
position: relative;
top: 4rpx;
}
}
.mr-40 {
margin-right: 40rpx;
}
}
}
}
.btn {
background: $light-color;
position: fixed;
width: 690rpx;
bottom: 60rpx;
height: 80rpx;
left: 30rpx;
font-size: 30rpx;
line-height: 80rpx;
.u-icon {
margin-right: 10rpx;
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<view class="address">
<view class="bar"></view>
<empty v-if="empty"></empty>
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
<view class="list" v-else>
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
<view class="basic" @click="selectAddressData(item)">
@@ -10,21 +10,11 @@
<text class="default" v-show="item.isDefault">默认</text>
<view>
<div class="region">
<span v-if="item.consigneeAddressPath[0]">{{
item.consigneeAddressPath[0]
}}</span>
<span v-if="item.consigneeAddressPath[1]">{{
item.consigneeAddressPath[1]
}}</span>
<span v-if="item.consigneeAddressPath[2]">{{
item.consigneeAddressPath[2]
}}</span>
<span v-if="item.consigneeAddressPath[3]">{{
item.consigneeAddressPath[3]
}}</span>
<span>
{{ item.detail }}
</span>
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
<span>{{ item.detail }}</span>
</div>
</view>
</view>
@@ -38,7 +28,7 @@
<view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
<view class="alifont icon-lajitong"></view>
<text @click="delAddress(item.id)">删除</text>
<text @click="removeAddress(item.id)">删除</text>
</view>
</view>
</view>
@@ -48,7 +38,7 @@
<u-icon name="plus-circle"></u-icon>
添加新收货人
</button>
<u-action-sheet :list="delList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>
@@ -58,12 +48,10 @@ import * as API_Address from "@/api/address.js";
export default {
data() {
return {
ifOnShow: false, //组件加载为true 离开为false
activeClass: "activeClass",
addressList: [],
showAction: false,
empty: false,
delList: [
addressList: [], //地址列表
showAction: false, //是否显示下栏框
empty: false, //是否为空
removeList: [
{
text: "确定",
},
@@ -71,12 +59,11 @@ export default {
tips: {
text: "确定要删除该收货人信息吗?",
},
delId: "",
addid: "",
removeId: "", //删除的地址id
routerVal: "",
params: {
pageNumber: 1,
pageSize: 50,
pageSize: 1000,
},
};
},
@@ -122,7 +109,6 @@ export default {
this.$set(this, "addressList", res.data.result.records);
console.log(this.addressList);
}
@@ -130,12 +116,12 @@ export default {
});
},
//删除地址
delAddress(id) {
this.delId = id;
removeAddress(id) {
this.removeId = id;
this.showAction = true;
},
deleteAddressMessage() {
API_Address.deleteAddress(this.delId).then((res) => {
API_Address.deleteAddress(this.removeId).then((res) => {
if (res.statusCode == 200) {
uni.showToast({
icon: "none",
@@ -186,158 +172,10 @@ export default {
this.getAddressList();
});
},
// 地址id
addId(params) {
API_Trade.setAddressId(params.address_id).then((res) => {});
},
},
};
</script>
<style lang="scss" scoped>
.active {
background: #f19736;
}
.alifont {
display: inline-block;
}
.region {
span {
margin: 0 4rpx !important;
}
}
.address {
.bar {
height: 20rpx;
overflow: hidden;
width: 100%;
background: url("/pages/floor/imgs/line.png") no-repeat;
background-size: 100%;
position: relative;
top: 0;
left: 0;
transform: scale(1, 0.8);
}
.default {
border: 1px solid #ff6262;
color: #ff6262;
font-size: 22rpx;
border-radius: 6rpx;
align-self: center;
padding: 2rpx 20rpx;
}
.list {
.item:hover {
background: #ededed;
}
.item {
margin-top: 20rpx;
font-size: $font-base;
color: #666;
.basic {
padding: 30rpx;
line-height: 1.5em;
border-bottom: 1px solid $border-color-light;
:nth-child(2) {
margin: 0 20rpx;
}
:nth-child(4) {
color: $font-color-light;
font-size: $font-sm;
margin-top: 10rpx;
text:nth-child(2) {
margin: 0;
}
view {
font-size: 28rpx;
}
}
}
.edit {
display: flex;
justify-content: space-between;
align-items: center;
vertical-align: middle;
height: 80rpx;
font-size: $font-sm;
color: $font-color-light;
padding: 0 30rpx;
.unchecked {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 1px solid #e0e0e0;
display: inline-block;
vertical-align: middle;
margin-right: 8rpx;
position: relative;
top: -2rpx;
left: 0;
}
view:nth-child(1) {
view:nth-child(1) {
font-size: $font-base;
color: $main-color;
margin-right: 8rpx;
vertical-align: middle;
}
}
view:nth-child(2) {
text {
margin-left: 5rpx;
}
.alifont {
font-size: 32rpx;
}
.icon-bianji-copy {
font-size: 28rpx;
position: relative;
top: 2rpx;
left: 0;
}
.icon-lajitong {
position: relative;
top: 4rpx;
}
}
.mr-40 {
margin-right: 40rpx;
}
}
}
}
.btn {
background: $light-color;
position: fixed;
width: 690rpx;
bottom: 60rpx;
height: 80rpx;
left: 30rpx;
font-size: 30rpx;
line-height: 80rpx;
.u-icon {
margin-right: 10rpx;
}
}
}
@import './address.scss';
</style>

View File

@@ -1,32 +1,19 @@
<template>
<view class="address">
<view class="bar"></view>
<empty v-if="empty"></empty>
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
<view class="list" v-else>
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
<view class="basic">
<text>{{ item.name }}</text>
<text>{{ item.mobile }}</text>
<text class="default" v-show="item.isDefault">默认</text>
<view>
<div class="region">
<span v-if="item.consigneeAddressPath[0]">{{
item.consigneeAddressPath[0]
}}</span>
<span v-if="item.consigneeAddressPath[1]">{{
item.consigneeAddressPath[1]
}}</span>
<span v-if="item.consigneeAddressPath[2]">{{
item.consigneeAddressPath[2]
}}</span>
<span v-if="item.consigneeAddressPath[3]">{{
item.consigneeAddressPath[3]
}}</span>
<span>
{{ item.detail }}
</span>
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
<span>{{ item.detail }}</span>
</div>
</view>
</view>
@@ -40,7 +27,7 @@
<view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
<view class="alifont icon-lajitong"></view>
<text @click="delAddress(item.id)">删除</text>
<text @click="removeAddress(item.id)">删除</text>
</view>
</view>
</view>
@@ -52,22 +39,19 @@
添加新收货人
</button>
<u-action-sheet :list="delList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>
<script>
import * as API_Trade from "@/api/trade";
import * as API_Address from "@/api/address.js";
import storage from "@/utils/storage.js";
export default {
data() {
return {
activeClass: "activeClass",
addressList: [],
showAction: false,
empty: false,
delList: [
addressList: [], //地址列表
showAction: false, //是否显示下栏框
empty: false, //是否为空
removeList: [
{
text: "确定",
},
@@ -75,9 +59,8 @@ export default {
tips: {
text: "确定要删除该收货人信息吗?",
},
delId: "",
addid: "",
routerVal: "",
removeId: "", //删除的地址id
routerVal: "",
params: {
pageNumber: 1,
pageSize: 1000,
@@ -94,22 +77,33 @@ export default {
onLoad: function (val) {
this.routerVal = val;
},
/**
* 进入页面检测当前账户是否登录
*/
onShow() {
let userInfo = storage.getUserInfo();
if (userInfo && userInfo.id) {
if (this.$options.filters.isLogin("auth")) {
this.getAddressList();
} else {
uni.showModal({
title: "提示",
content: "检测到您的账号还未登录,是否去登录?",
confirmColor: this.$lightColor,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/passport/login",
});
} else if (res.cancel) {
uni.navigateBack();
}
},
});
}
},
onPullDownRefresh() {
this.getAddressList();
uni.stopPullDownRefresh();
},
methods: {
//获取地址列表
getAddressList() {
uni.showLoading();
API_Address.getAddressList(
this.params.pageNumber,
this.params.pageSize
@@ -120,19 +114,19 @@ export default {
res.data.result.records.forEach((item) => {
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
});
this.addressList = res.data.result.records;
}
uni.hideLoading();
});
},
//删除地址
delAddress(id) {
this.delId = id;
removeAddress(id) {
this.removeId = id;
this.showAction = true;
},
// 删除地址
deleteAddressMessage() {
API_Address.deleteAddress(this.delId).then((res) => {
API_Address.deleteAddress(this.removeId).then((res) => {
if (res.statusCode == 200) {
uni.showToast({
icon: "none",
@@ -150,15 +144,9 @@ export default {
},
//新建。编辑地址
addAddress(id) {
if (id) {
uni.navigateTo({
url: "/pages/mine/address/add?id=" + id,
});
} else {
uni.navigateTo({
url: "/pages/mine/address/add",
});
}
uni.navigateTo({
url: `/pages/mine/address/add${id ? "?id=" + id : ""}`,
});
},
//设为默认地址
setDefault(item) {
@@ -168,7 +156,7 @@ export default {
item.isDefault ? "" : (item.isDefault = !item.isDefault);
API_Address.editAddress(item).then((res) => {
API_Address.editAddress(item).then(() => {
uni.showToast({
title: "设置默认地址成功",
icon: "none",
@@ -176,154 +164,10 @@ export default {
this.getAddressList();
});
},
// 地址id
addId(params) {
API_Trade.setAddressId(params.address_id).then((res) => {});
},
},
};
</script>
<style lang="scss" scoped>
.active {
background: #f19736;
}
.alifont {
display: inline-block;
}
.region {
span {
margin: 0 4rpx !important;
}
}
.address {
.bar {
height: 20rpx;
overflow: hidden;
width: 100%;
background: url("/pages/floor/imgs/line.png") no-repeat;
background-size: 100%;
position: relative;
top: 0;
left: 0;
transform: scale(1, 0.8);
}
.default {
border: 1px solid #ff6262;
color: #ff6262;
font-size: 22rpx;
border-radius: 6rpx;
align-self: center;
padding: 2rpx 20rpx;
}
.list {
.item {
margin-top: 20rpx;
font-size: $font-base;
color: #666;
.basic {
padding: 30rpx;
line-height: 1.5em;
border-bottom: 1px solid $border-color-light;
:nth-child(2) {
margin: 0 20rpx;
}
:nth-child(4) {
color: $font-color-light;
font-size: $font-sm;
margin-top: 10rpx;
text:nth-child(2) {
margin: 0;
}
view {
font-size: 28rpx;
}
}
}
.edit {
display: flex;
justify-content: space-between;
align-items: center;
vertical-align: middle;
height: 80rpx;
font-size: $font-sm;
color: $font-color-light;
padding: 0 30rpx;
.unchecked {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
border: 1px solid #e0e0e0;
display: inline-block;
vertical-align: middle;
margin-right: 8rpx;
position: relative;
top: -2rpx;
left: 0;
}
view:nth-child(1) {
view:nth-child(1) {
font-size: $font-base;
color: $main-color;
margin-right: 8rpx;
vertical-align: middle;
}
}
view:nth-child(2) {
text {
margin-left: 5rpx;
}
.alifont {
font-size: 32rpx;
}
.icon-bianji-copy {
font-size: 28rpx;
position: relative;
top: 2rpx;
left: 0;
}
.icon-lajitong {
position: relative;
top: 4rpx;
}
}
.mr-40 {
margin-right: 40rpx;
}
}
}
}
.btn {
background: $light-color;
position: fixed;
width: 690rpx;
bottom: 60rpx;
height: 80rpx;
left: 30rpx;
font-size: 30rpx;
line-height: 80rpx;
.u-icon {
margin-right: 10rpx;
}
}
}
@import './address.scss';
</style>

View File

@@ -1,66 +0,0 @@
<template>
<!-- 自定义地图组件 -->
<map
class="map"
:latitude="latitude"
:longitude="longitude"
scale="18"
:markers="markers"
:show-location="true"
@markertap="markertap"
@updated="mapUpdated"
@tap="closeMapMarker"
></map>
</template>
<script>
import amap from "@/js_sdk/amap-wx.130.js";
export default {
data() {
return {};
},
mounted() {
this.initMap();
},
methods: {
markertap() {},
mapUpdated() {},
closeMapMarker() {},
// 初始化地图
initMap() {
this.amapPlugin = new amap.AMapWX({
key: "c03fe63e4ed7cfc6612304b3f46c19b5", //该key 是在高德中申请的微信小程序key
});
this.amapPlugin.getRegeo({
type: "gcj02", //map 组件使用的经纬度是国测局坐标, type 为 gcj02
success: function (res) {
const latitude = res[0].latitude;
const longitude = res[0].longitude;
that.longitude = longitude;
that.latitude = latitude;
that.mapInfo = res[0];
},
fail: (res) => {
console.log(JSON.stringify(res));
},
});
},
},
};
</script>
<style lang="scss" scoped>
.map {
width: 100%;
height: 100%;
}
</style>

View File

@@ -1,10 +1,12 @@
<template></template>
<script>
import { getAddressCode } from "@/api/address";
import config from '@/config/config'
export default {
data() {
return {};
return {
config
};
},
mounted() {
this.init();
@@ -33,7 +35,7 @@ export default {
});
},
// 根据当前客户端判断
// 根据当前客户端判断展示不同类型数据
init() {
// #ifdef MP-WEIXIN
this.wechatMap();
@@ -60,12 +62,14 @@ export default {
cancelText: "取消",
success: (res) => {
if (res.confirm) {
// 打开设置好后重新刷新地图
uni.openSetting({
success: (res) => {
that.initMap();
},
});
} else {
// 取消后关闭
that.$emit("close");
return false;
}
@@ -75,18 +79,18 @@ export default {
},
});
},
// 获取城市的数据
posToCity(latitude, longitude) {
return new Promise((resolve, reject) => {
uni.request({
url: `https://restapi.amap.com/v3/geocode/regeo`,
method: "GET",
data: {
key: "d649892b3937a5ad20b76dacb2bcb5bd", //web服务的key
key: config.aMapKey, //web服务的key
location: `${longitude},${latitude}`,
},
success: ({ data }) => {
const { status, info, regeocode } = data;
const { status, info } = data;
if (status === "1") {
resolve(data);
} else {

View File

@@ -1,18 +1,19 @@
<template>
<view class="content">
<view class="navbar">
<!-- 循环出顶部nav栏 -->
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="tabClick(index)">
<text :class="{current: tabCurrentIndex === index}">{{item.text}}</text>
</view>
</view>
<view class="swiper-box" duration="300" @change="changeTab">
<view class="swiper-box">
<!-- 显示商品栏 -->
<view v-if="tabCurrentIndex == 0" class="tab-content">
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
<!-- 空白页 -->
<empty v-if="goodsEmpty"></empty>
<!-- 数据 -->
<u-swipe-action @open="openChange(item,index,'goods')" :show="item.selected" btn-width="180" :options="options" v-else v-for="(item,index) in goodList"
<u-empty text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
<!-- 商品展示数据 -->
<u-swipe-action @open="openLeftChange(item,index,'goods')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in goodList"
@click="clickGoodsSwiperAction(item,index)" :index="index" :key="index">
<view class="goods" @click="goGoodsDetail(item)">
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
@@ -23,20 +24,19 @@
<view class="goods-sn">{{item.goods_sn}}</view>
<view>{{item.price | unitPrice}}</view>
</view>
<!-- <button @click.stop="goSimilar(item)">找相似</button> -->
</view>
</u-swipe-action>
<uni-load-more :status="goodLoad"></uni-load-more>
<uni-load-more :status="goodsLoad"></uni-load-more>
</scroll-view>
</view>
<!-- 显示收藏的店铺栏 -->
<view v-else class="tab-content">
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
<!-- 空白页 -->
<empty v-if="storeEmpty"></empty>
<!-- 数据 -->
<u-swipe-action @open="openChange(item,index,'store')" :show="item.selected" btn-width="180" :options="options" v-else v-for="(item,index) in storeList" :key="index"
<u-empty text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
<!-- 店铺展示数据 -->
<u-swipe-action @open="openLeftChange(item,'store')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in storeList" :key="index"
@click="clickstoreSwiperAction(item)">
<view class="store" @click="gostoreMainPage(item.storeId)">
<view class="intro">
@@ -48,10 +48,8 @@
<view class="store-name">
<view>{{item.storeName}}</view>
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated" text="自营" mode="plain" shape="circle" />
</view>
<view class="store-collect">
<view>进店逛逛</view>
</view>
</view>
@@ -73,7 +71,8 @@ import {
export default {
data() {
return {
options: [
// 商品左滑侧边栏
LeftOptions: [
{
text: "取消",
style: {
@@ -81,8 +80,9 @@ export default {
},
},
],
tabCurrentIndex: 0,
tabCurrentIndex: 0, //tab的下标默认为0也就是说会默认请求商品
navList: [
//tab显示数据
{
text: "商品(0)",
loadingType: "more",
@@ -100,54 +100,51 @@ export default {
},
},
],
goodLoad: "more",
storeLoad: "more",
goodsEmpty: false,
storeEmpty: false,
goodList: [],
storeList: [],
goodsLoad: "more", //商品加载
storeLoad: "more", //店铺加载
goodsEmpty: false, //商品数据是否为空
storeEmpty: false, //店铺数据是否为空
goodList: [], //商品集合
storeList: [], //店铺集合
};
},
onLoad() {
// this.loadData();
this.getGoodList();
this.getstoreList();
},
methods: {
openChange(val, index, type) {
/**
* 打开商品左侧取消收藏
*/
openLeftChange(val, type) {
const { goodList, storeList } = this;
let way;
type == "goods" ? (way = goodList) : (way = storeList);
way.forEach((item, ids) => {
way.forEach((item) => {
this.$set(item, "selected", false);
});
this.$set(val, "selected", false);
val.selected = true;
console.log(val.selected);
},
/* openstore(val, index) {
this.storeList.forEach((item, ids) => {
this.$set(item, "selected", false);
});
this.$set(val, "selected", false);
val.selected = true;
}, */
/** 点击取消按钮 */
clickGoodsSwiperAction(val, index) {
/**
* 点击商品左侧取消收藏
*/
clickGoodsSwiperAction(val) {
deleteGoodsCollection(val.skuId).then((res) => {
console.log(res);
if (res.statusCode == 200) {
this.storeList = [];
this.goodList = []
this.goodList = [];
this.getGoodList();
}
});
},
/**
* 点击店铺左侧取消收藏
*/
clickstoreSwiperAction(val) {
deleteStoreCollection(val.storeId).then((res) => {
if (res.statusCode == 200) {
@@ -157,34 +154,37 @@ export default {
});
},
//顶部tab点击
/**
* 顶部tab点击
*/
tabClick(index) {
this.tabCurrentIndex = index;
console.log(this.tabCurrentIndex);
},
changeTab(e) {
this.tabCurrentIndex = e.target.current;
},
goSimilar(goods) {
//找相似
uni.navigateTo({
url:
"/pages/user/similarGoods?goods=" +
encodeURIComponent(JSON.stringify(goods)),
});
},
/**
* 查看商品详情
*/
goGoodsDetail(val) {
//商品详情
uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId +"&goodsId="+val.goodsId,
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
});
},
/**
* 查看店铺详情
*/
gostoreMainPage(id) {
//店铺主页
uni.navigateTo({
url: "/pages/product/shopPage?id=" + id,
});
},
/**
* 获取商品集合
*/
getGoodList() {
uni.showLoading({
title: "加载中",
@@ -192,24 +192,26 @@ export default {
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.statusCode == 200) {
if (res.statusCode == 200) {
let data = res.data.result;
data.selected = false;
this.navList[0].text = `商品(${data.total})`;
if (data.total == 0) {
this.goodsEmpty = true;
} else if (data.total < 10) {
this.goodLoad = "noMore";
this.goodList.push(...data.records);
} else {
this.goodList.push(...data.records);
if (data.total.length < 10) this.goodLoad = "noMore";
}
if (res.data.success) {
let data = res.data.result;
data.selected = false;
this.navList[0].text = `商品(${data.total})`;
if (data.total == 0) {
this.goodsEmpty = true;
} else if (data.total < 10) {
this.goodsLoad = "noMore";
this.goodList.push(...data.records);
} else {
this.goodList.push(...data.records);
if (data.total.length < 10) this.goodsLoad = "noMore";
}
}
});
},
/**
* 获取店铺集合
*/
getstoreList() {
uni.showLoading({
title: "加载中",
@@ -217,24 +219,26 @@ export default {
getGoodsCollection(this.navList[1].params, "store").then((res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.statusCode == 200) {
if (res.statusCode == 200) {
let data = res.data.result;
data.selected = false;
this.navList[1].text = `店铺(${data.total})`;
if (data.total == 0) {
this.storeEmpty = true;
} else if (data.total < 10) {
this.storeLoad = "noMore";
this.storeList.push(...data.records);
} else {
this.storeList.push(...data.records);
if (data.total.length < 10) this.storeLoad = "noMore";
}
if (res.data.success) {
let data = res.data.result;
data.selected = false;
this.navList[1].text = `店铺(${data.total})`;
if (data.total == 0) {
this.storeEmpty = true;
} else if (data.total < 10) {
this.storeLoad = "noMore";
this.storeList.push(...data.records);
} else {
this.storeList.push(...data.records);
if (data.total.length < 10) this.storeLoad = "noMore";
}
}
});
},
/**
* 底部加载更多
*/
loadMore() {
if (this.tabCurrentIndex == 0) {
this.navList[0].params.pageNumber++;
@@ -245,6 +249,10 @@ export default {
}
},
},
/**
* 下拉刷新时
*/
onPullDownRefresh() {
if (this.tabCurrentIndex == 0) {
this.navList[0].params.pageNumber = 1;
@@ -260,201 +268,154 @@ export default {
</script>
<style lang="scss">
page,
.content {
background: $page-color-base;
height: 100%;
}
.content {
width: 100%;
overflow: hidden;
width: 100%;
overflow: hidden;
}
.swiper-box {
overflow-y: auto;
}
overflow-y: auto;
}
.goods-price {
text-align: left;
}
.list-scroll-content {
height: 100%;
width: 100%;
height: 100%;
width: 100%;
}
.goods-name {
color: #333 !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 22rpx;
}
/deep/ .u-swipe-content{
overflow: hidden;
/deep/ .u-swipe-content {
overflow: hidden;
}
.goods {
background-color: #fff;
border-bottom: 1px solid $border-color-light;
height: 190rpx;
display: flex;
align-items: center;
padding: 30rpx 20rpx;
margin-top: 20rpx;
image {
width: 131rpx;
height: 131rpx;
border-radius: 10rpx;
}
.goods-intro {
flex: 1;
font-size: $font-base;
line-height: 48rpx;
margin-left: 30rpx;
background-color: #fff;
border-bottom: 1px solid $border-color-light;
height: 190rpx;
display: flex;
align-items: center;
padding: 30rpx 20rpx;
margin-top: 20rpx;
image {
width: 131rpx;
height: 131rpx;
border-radius: 10rpx;
}
.goods-intro {
flex: 1;
font-size: $font-base;
line-height: 48rpx;
margin-left: 30rpx;
view:nth-child(1) {
line-height: 1.4em;
font-size: 24rpx;
max-height: 2.8em; //height是line-height的整数倍防止文字显示不全
overflow: hidden;
color: #666;
}
view:nth-child(2) {
color: #cccccc;
font-size: 24rpx;
}
view:nth-child(3) {
color: $light-color;
}
}
button {
color: $main-color;
height: 50rpx;
width: 120rpx;
font-size: $font-sm;
padding: 0;
line-height: 50rpx;
background-color: #ffffff;
margin-top: 80rpx;
&::after {
border-color: $main-color;
}
}
view:nth-child(1) {
line-height: 1.4em;
font-size: 24rpx;
max-height: 2.8em; //height是line-height的整数倍防止文字显示不全
overflow: hidden;
color: #666;
}
view:nth-child(2) {
color: #cccccc;
font-size: 24rpx;
}
view:nth-child(3) {
color: $light-color;
}
}
button {
color: $main-color;
height: 50rpx;
width: 120rpx;
font-size: $font-sm;
padding: 0;
line-height: 50rpx;
background-color: #ffffff;
margin-top: 80rpx;
&::after {
border-color: $main-color;
}
}
}
.store {
background-color: #fff;
border: 1px solid $border-color-light;
border-radius: 16rpx;
margin: 20rpx 10rpx;
.intro {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 30rpx 0 40rpx;
height: 170rpx;
background-color: #fff;
border: 1px solid $border-color-light;
border-radius: 16rpx;
margin: 20rpx 10rpx;
.intro {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 30rpx 0 40rpx;
height: 170rpx;
.store-logo {
width: 102rpx;
height: 102rpx;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.store-name {
flex: 1;
margin-left: 30rpx;
line-height: 2em;
:first-child {
font-size: $font-base;
}
:last-child {
font-size: $font-sm;
color: #999;
}
}
.store-collect {
border-left: 1px solid $border-color-light;
padding-left: 20rpx;
text-align: center;
:last-child {
color: #999;
font-size: $font-sm;
}
}
}
.store-goods {
// height: 300rpx;
// width: 750rpx;
white-space: nowrap;
position: relative;
padding: 30rpx 20rpx;
&::before {
content: "";
width: calc(100% - 40rpx);
position: absolute;
top: 0;
left: 20rpx;
z-index: 2;
border-top: 2rpx solid #eeeeee;
}
.store-item {
display: inline-block;
margin-left: 10rpx;
width: 250rpx;
overflow: hidden;
image {
width: 228rpx;
height: 180rpx;
}
> .goods-price {
color: $main-color;
text:first-child {
font-size: $font-sm;
}
text:last-child {
font-size: $font-base;
font-weight: bold;
}
}
}
}
.store-logo {
width: 102rpx;
height: 102rpx;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.store-name {
flex: 1;
margin-left: 30rpx;
line-height: 2em;
:first-child {
font-size: $font-base;
}
:last-child {
font-size: $font-sm;
color: #999;
}
}
.store-collect {
border-left: 1px solid $border-color-light;
padding-left: 20rpx;
text-align: center;
:last-child {
color: #999;
font-size: $font-sm;
}
}
}
}
.navbar {
display: flex;
height: 40px;
padding: 0 5px;
background: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
position: relative;
z-index: 10;
.nav-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 26rpx;
text {
position: relative;
}
text.current {
color: $light-color;
font-weight: bold;
font-size: 28rpx;
&::after {
content: "";
position: absolute;
left: 20rpx;
bottom: -10rpx;
width: 30rpx;
height: 0;
border-bottom: 2px solid $light-color;
}
}
}
}
display: flex;
height: 40px;
padding: 0 5px;
background: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
position: relative;
z-index: 10;
.nav-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 26rpx;
text {
position: relative;
}
text.current {
color: $light-color;
font-weight: bold;
font-size: 28rpx;
&::after {
content: "";
position: absolute;
left: 20rpx;
bottom: -10rpx;
width: 30rpx;
height: 0;
border-bottom: 2px solid $light-color;
}
}
}
}
</style>

View File

@@ -1,17 +1,17 @@
<template>
<view class="myTracks" v-if="refresh">
<empty v-if="nomsg"></empty>
<view v-else v-for="(item, index) in list" :key="index">
<view class="myTracks-title" @click="gostore(item)">{{item.storeName}}</view>
<view class="myTracks">
<empty v-if="whetherEmpty"></empty>
<view v-else v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
<view class="myTracks-item">
<u-checkbox-group>
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
</u-checkbox-group>
<view class="myTracks-item-img" @click.stop="goDetail(item)">
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
<image :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-content" @click.stop="goDetail(item)">
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
@@ -19,9 +19,6 @@
<view class="myTracks-item-price">
{{ item.price | unitPrice }}
</view>
<!-- <view class="myTracks-item-btn" @click.stop="goSimilar(item)">
找相似
</view> -->
</view>
</view>
</view>
@@ -54,23 +51,22 @@ import { myTrackList, deleteHistoryListId } from "@/api/members.js";
export default {
data() {
return {
editFlag: false,
allChecked: false,
loadStatus: "more",
nomsg: false,
editFlag: false, //是否编辑
allChecked: false, //是否全选
loadStatus: "more", //底部下拉加载状态
whetherEmpty: false, //是否数据为空
params: {
pageNumber: 1,
pageSize: 10,
},
refresh: true,
list: [],
trackList: [], //足迹列表
};
},
onPullDownRefresh() {
this.params.pageNumber = 1;
this.list = [];
this.getList();
},
/**
* 滑到底部加载下一页数据
*/
onReachBottom() {
if (this.loadStatus != "noMore") {
this.params.pageNumber++;
@@ -81,11 +77,18 @@ export default {
this.getList();
},
methods: {
gostore(val) {
/**
* 导航到店铺
*/
navgaiteToStore(val) {
uni.navigateTo({
url: "/pages/product/shopPage?id=" + val.storeId,
});
},
/**
* 设置右侧导航栏文本
*/
setStyle(text) {
//导航按钮文本设置
let pages = getCurrentPages();
@@ -95,7 +98,7 @@ export default {
let titleNView = currentWebview.getStyle().titleNView;
titleNView.buttons[0].text = text;
if (text == "完成") {
this.list.forEach((key) => {
this.trackList.forEach((key) => {
key.history.forEach((item) => {
this.$set(item, "___isDel", false);
});
@@ -110,20 +113,19 @@ export default {
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
// #endif
},
goDetail(item) {
//跳转详情
/**
* 跳转详情
*/
navgaiteToDetail(item) {
uni.navigateTo({
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
});
},
goSimilar(item) {
//找相似
uni.navigateTo({
url:
"/pages/user/similaritem?item=" +
encodeURIComponent(JSON.stringify(item)),
});
},
/**
* 获取我的足迹列表
*/
getList() {
uni.showLoading({
title: "加载中",
@@ -139,35 +141,44 @@ export default {
let data = res.data.result;
if (data.total == 0) {
this.nomsg = true;
this.whetherEmpty = true;
} else if (data.total < 10) {
this.loadStatus = "noMore";
this.list.push(...data);
this.trackList.push(...data);
} else {
this.list.push(...data);
this.trackList.push(...data);
if (data.length < 10) this.loadStatus = "noMore";
}
}
});
},
/**
* 点击后判断是不是全选
*/
changeChecked(val) {
//点击后判断是不是全选
console.log(val);
const isCheckedAll = this.list.every((key) => {
console.log(key);
const isCheckedAll = this.trackList.every((key) => {
return key.___isDel == val.___isDel;
});
this.allChecked = isCheckedAll;
},
/**
* 点击全选按钮
*/
checkedAllitem() {
//全选按钮
this.list.forEach((key) => {
this.trackList.forEach((key) => {
this.$set(key, "___isDel", this.allChecked);
});
},
/**
* 删除足迹
*/
delAllTracks() {
let way = [];
this.list.forEach((key) => {
this.trackList.forEach((key) => {
if (key.___isDel) {
way.push(key.goodsId);
}
@@ -175,10 +186,8 @@ export default {
if (way.length == 0) return false;
deleteHistoryListId(way).then((res) => {
if (res.data.code == 200) {
this.list = [];
this.trackList = [];
this.allChecked = false;
this.getList();
} else {
uni.showToast({
@@ -190,6 +199,10 @@ export default {
});
},
},
/**
* 右侧标签栏切换
*/
onNavigationBarButtonTap(e) {
if (!this.editFlag) {
this.setStyle("完成");
@@ -255,9 +268,6 @@ export default {
}
}
.myTracks-item-content {
}
.myTracks-item-title {
font-size: 28rpx;
color: #333;
@@ -274,36 +284,6 @@ export default {
padding: 10rpx 0 0 0;
}
.myTracks-item-price-now {
font-size: 28rpx;
color: $light-color;
margin: 0 10rpx;
}
.myTracks-item-price-origin {
font-size: 28rpx;
color: #999;
-webkit-text-decoration-line: line-through;
text-decoration-line: line-through;
text-decoration: line-through;
}
.myTracks-item-btn {
position: absolute;
right: 20rpx;
bottom: 20rpx;
width: 120rpx;
height: 42rpx;
background-color: #fff;
border: 1px solid $aider-light-color;
border-radius: 10rpx;
font-size: 24rpx;
color: $aider-light-color;
display: flex;
justify-content: center;
align-items: center;
}
.myTracks-action-btn {
width: 130rpx;
height: 60rpx;
@@ -319,21 +299,6 @@ export default {
height: 110rpx;
}
.myTracks-action {
position: fixed;
bottom: 0;
width: 100%;
height: 100rpx;
padding: 0 20rpx;
box-sizing: border-box;
background-color: #fff;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex;
justify-content: space-between;
}
.myTracks-action-check {
align-items: center;
display: -webkit-box;

View File

@@ -18,104 +18,56 @@
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
</u-col>
</u-row>
<u-row class="portrait-box3">
<!-- #ifndef MP-WEIXIN -->
<u-col span="8">近30天记录</u-col>
<u-col textAlign="right" span="4" @click="goDetail" class="more">更多</u-col>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="mp-weixin-more">
<view>近30天记录</view>
<view @click="goDetail">更多</view>
<div class="point-list">
<view class="point-item" v-for="(item, index) in pointList" :key="index">
<view>
<view>{{ item.content }}</view>
<view>{{ item.createTime}}</view>
</view>
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
</view>
<!-- #endif -->
</u-row>
<view class="dataList" v-for="(item, index) in list" :key="index">
<view>
<view>{{ item.content }}</view>
<view>{{ item.createTime}}</view>
</view>
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
</view>
<uni-load-more :status="count.loadStatus"></uni-load-more>
<u-popup v-model="show" mode="bottom" :closeable="true">
<view class="title">申请积分</view>
<u-form :model="form" ref="uForm">
<u-form-item label="选择店铺" label-width="140">
<u-input v-model="storeParams.storeName" type="select" @click="showstore" placeholder="请选择店铺" />
</u-form-item>
<u-form-item label="申请积分" label-width="140">
<u-input v-model="storeParams.point" type="number" placeholder="请输入积分数量" />
</u-form-item>
</u-form>
<button class="btn-mini" @click="submit" :disabled="avoidClick">提交申请</button>
</u-popup>
<uni-load-more :status="count.loadStatus"></uni-load-more>
</div>
</view>
</template>
<script>
import { getPoints, getPointsData } from "@/api/members.js";
import { getPointsData } from "@/api/members.js";
import { getMemberPointSum } from "@/api/members.js";
import { contractStep } from "@/api/safe.js";
import storage from "@/utils/storage.js";
export default {
onShow() {
this.userInfo = storage.getUserInfo();
},
data() {
return {
count: {
loadStatus: "more",
},
list: [],
userInfo: [],
pointList: [], //积分数据集合
params: {
pageNumber: 1,
pageSize: 10,
start_time: 0,
end_time: 0,
},
pointData: {},
show: false,
form: {},
showAction: false,
actionList: [],
storeParams: {
point: 0,
storeId: 0,
storeName: "请选择店铺",
},
avoidClick: false,
isCertificate: true,
pointData: {}, //累计获取 未输入 集合
};
},
onLoad() {
contractStep().then((res) => {
//是否实名认证
console.log(res);
this.isCertificate = res.data == 1 ? true : false;
});
getPoints().then((res) => {
this.count = res.data;
});
this.initpointDataData();
this.initPointData();
this.getList();
},
/**
* 触底加载
*/
onReachBottom() {
this.params.pageNumber++;
this.getList();
},
methods: {
/**
* 获取积分数据
*/
getList() {
let date = Date.parse(new Date()) / 1000;
let params = this.params;
params.start_time = date - 60 * 60 * 24 * 30; //30天前时间
params.end_time = date;
// console.log(params)
// return;
uni.showLoading({
title: "加载中",
});
@@ -125,55 +77,28 @@ export default {
let data = res.data.result.records;
if (data.length < 10) {
this.$set(this.count, "loadStatus", "noMore");
this.list.push(...data);
this.pointList.push(...data);
} else {
this.list.push(...data);
this.pointList.push(...data);
if (data.length < 10) this.$set(this.count, "loadStatus", "noMore");
}
}
});
},
initpointDataData() {
//累计获得累计使用
/**
* 获得累计使用
*/
initPointData() {
getMemberPointSum().then((res) => {
this.pointData = res.data.result;
});
},
goDetail() {
//积分明细
uni.navigateTo({
url: "/pages/point/pointDetail",
});
},
goIntro() {
//跳转详情
uni.navigateTo({
url: "/pages/pointTrade/pointIntro",
});
},
},
};
</script>
<style lang="scss" scoped>
.mp-weixin-more {
width: 96vw;
padding: 0 2vw;
display: flex;
align-items: center;
height: 100%;
justify-content: space-between;
}
.u-close--top-right {
top: 22rpx;
}
.i_time {
color: $u-tips-color;
}
.title {
height: 80rpx;
text-align: center;
@@ -182,40 +107,22 @@ export default {
font-weight: bold;
}
.btn-mini {
margin: 20rpx auto;
font-size: 24rpx;
border-radius: 6rpx;
}
.u-form-item {
padding: 10rpx 30rpx 10rpx 20rpx;
}
.dataList {
.point-item {
width: 100%;
height: 130rpx;
padding: 0 20rpx;
background: #ffffff;
font-size: $font-sm;
// line-height: 2em;
border-bottom: 1px solid $border-color-light;
display: flex;
justify-content: end;
align-items: center;
.colorRed {
color: #f04844;
}
> view:nth-child(1) {
flex: 1;
line-height: 40rpx;
view {
color: #666666;
}
:last-child {
color: #999;
}
@@ -233,35 +140,17 @@ export default {
border-radius: 0 0 20rpx 20rpx;
margin: 0 20rpx;
font-size: 26rpx;
/deep/ .u-col {
text-align: center !important;
}
/deep/ .u-col:first-child {
border-right: 1px solid $border-color-light;
}
.pcolor {
color: #4ebb9d;
}
}
.portrait-box3 {
// #ifdef MP-WEIXIN
display: flex;
// #endif
height: 110rpx;
background-color: #f1f1f1;
margin-top: 20rpx;
font-size: 28rpx;
.u-col {
padding: 0 20rpx;
}
}
.content {
background: #f9f9f9;
}
@@ -312,27 +201,11 @@ export default {
border-radius: 20rpx 0px 0px 20rpx;
}
}
.point-img {
height: 108rpx;
width: 108rpx;
margin-bottom: 30rpx;
}
.current {
font-size: 26rpx;
text {
vertical-align: middle;
}
> text:nth-child(2) {
color: #ffee80;
font-size: 40rpx;
margin-left: 20rpx;
}
}
.point {
font-size: 56rpx;
}

View File

@@ -1,135 +0,0 @@
<template>
<view class="point-detail">
<empty v-if="nomsg"></empty>
<view v-else class="box" v-for="(con,conIndex) in content" :key="con.conIndex">
<view class="time">
<view> <u-icon name="calendar"></u-icon>&nbsp; {{getMonth(con.months)}}</view>
<view>获得{{con.point}} 使用{{con.consumer_point}}</view>
</view>
<view class="dataList" v-for="(item,index) in con.history" :key="index">
<view>
<view>{{item.reason}}</view>
<view>{{item.time | unixToDate}}</view>
</view>
<view :class="{colorRed:item.consum_point_type==0}">{{item.consum_point_type==0?'-':'+'}}{{item.consum_point}}</view>
<view>{{item.point}}</view>
</view>
</view>
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
</template>
<script>
import {getPointsDataDetail} from '@/api/members.js';
export default {
data() {
return {
params:{
pageNumber:1,
pageSize:10,
start_time:0,
end_time:0
},
content:[],
loadStatus:'more',
nomsg:false,
};
},
onLoad() {
this.getDetailList()
},
methods:{
getDetailList(){
uni.showLoading({
title:'加载中'
})
getPointsDataDetail(this.params).then(res=>{
uni.stopPullDownRefresh();
uni.hideLoading()
if (res.statusCode == 200) {
console.log(res)
let data = res.data;
if (data.length==0) {
if(this.content.length==0){
this.nomsg = true;
}else{
this.loadStatus = 'noMore';
}
}else if(data[data.length-1].history.length<10){
this.content.push(...res.data);
this.loadStatus = 'noMore';
}else{
this.content.push(...res.data);
}
}
})
},
getMonth(time){
console.log(time)
let str = time+'';
let arr = str.split('');
arr.splice(4,0,'-');
return arr.join('')
}
},
onReachBottom(){
if(this.loadStatus == 'more'){
this.params.pageNumber++;
this.getDetailList()
}
}
}
</script>
<style lang="scss" scoped>
.point-detail{
.box{
.time{
display: flex;
justify-content: space-between;
padding: 0 20rpx;
align-items: center;
height: 112rpx;
color: #999999;
font-size: $font-sm;
}
.dataList {
width: 100%;
height: 120rpx;
border-top: 1px solid #f2f2f2;
padding: 30rpx;
background: #ffffff;
font-size: $font-sm;
// line-height: 1.5em;
margin-bottom: 10rpx;
display: flex;
justify-content: end;
align-items: center;
.colorRed{
color: #f04844;
}
>view:nth-child(1){
flex: 1;
line-height: 1.5em;
:nth-child(1){
color: #666666;
}
:nth-child(2){
color: #999;
}
}
>view:nth-child(2){
width: 80rpx;
text-align: center;
}
>view:nth-child(3){
width: 100rpx;
text-align: center;
}
}
}
}
</style>

View File

@@ -1,125 +1,122 @@
// TODO 第一版本暂无此功能 后续优化以及更新
<template>
<view class="edition-intro">
<view class="logo c-content">
<view>
<image src="/static/img/edition.png" mode=""></image>
</view>
<view>版本不息&nbsp;优化不止</view>
</view>
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
<view class="level">
<text style="color: #1ABC9C;">{{item.version}}</text>
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
</view>
<view class="detail" v-html="item.content"></view>
</view>
</view>
<view class="edition-intro">
<view class="logo c-content">
<view>
<image src="/static/img/edition.png" mode=""></image>
</view>
<view>版本不息&nbsp;优化不止</view>
</view>
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
<view class="level">
<text style="color: #1ABC9C;">{{item.version}}</text>
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
</view>
<view class="detail" v-html="item.content"></view>
</view>
</view>
</template>
<script>
import * as API_Message from "@/api/message.js";
export default {
data() {
return {
editionHistory:[],
params: {
pageNumber: 1,
pageSize: 5
},
loadStatus:'more'
};
},
onLoad(){
if (uni.getSystemInfoSync().platform === 'android') {
this.params.type = 0;
} else {
this.params.type = 1;
}
this.GET_AppVersionList(true);
},
onReachBottom() {
if(this.loadStatus!='noMore'){
this.params.pageNumber++
this.GET_AppVersionList(false)
}
},
methods: {
GET_AppVersionList(reset){
if (reset) {
this.params.pageNumber = 1
}
uni.showLoading({
title:"加载中"
})
API_Message.getAppVersionList(this.params).then(response => {
uni.hideLoading()
if(response.statusCode==200){
const { data } = response
if(data.data.length<10){
this.loadStatus = 'noMore';
}
this.editionHistory.push(...data.data)
}
})
}
}
}
import * as API_Message from "@/api/message.js";
export default {
data() {
return {
editionHistory: [], //版本历史
params: {
pageNumber: 1,
pageSize: 5,
},
loadStatus: "more",
};
},
onLoad() {
if (uni.getSystemInfoSync().platform === "android") {
this.params.type = 0;
} else {
this.params.type = 1;
}
this.GET_AppVersionList(true);
},
onReachBottom() {
if (this.loadStatus != "noMore") {
this.params.pageNumber++;
this.GET_AppVersionList(false);
}
},
methods: {
GET_AppVersionList(reset) {
if (reset) {
this.params.pageNumber = 1;
}
uni.showLoading({
title: "加载中",
});
API_Message.getAppVersionList(this.params).then((response) => {
uni.hideLoading();
if (response.statusCode == 200) {
const { data } = response;
if (data.data.length < 10) {
this.loadStatus = "noMore";
}
this.editionHistory.push(...data.data);
}
});
},
},
};
</script>
<style lang="scss">
.edition-intro{
.logo{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: $font-lg;
color: $font-color-light;
height: 330rpx;
margin-bottom: 20rpx;
>view:nth-child(1){
width: 144rpx;
height: 144rpx;
border: 1px solid #FFC71C;
border-radius: 50%;
position: relative;
margin-bottom: 30rpx;
image{
width: 80rpx;
height: 113rpx;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin:auto;
}
}
}
.edition{
margin-bottom: 20rpx;
color: $font-color-light;
font-size: $font-sm;
.level{
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx ;
border-bottom: 1px solid $border-color-light;
text:nth-child(1){
font-size: $font-base;
font-weight: 700;
}
}
.detail{
margin-left: 20rpx;
line-height: 2em;
padding: 20rpx 0;
}
}
<style lang="scss" scoped>
.edition-intro {
.logo {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: $font-lg;
color: $font-color-light;
height: 330rpx;
margin-bottom: 20rpx;
> view:nth-child(1) {
width: 144rpx;
height: 144rpx;
border: 1px solid #ffc71c;
border-radius: 50%;
position: relative;
margin-bottom: 30rpx;
image {
width: 80rpx;
height: 113rpx;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
}
.edition {
margin-bottom: 20rpx;
color: $font-color-light;
font-size: $font-sm;
.level {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
border-bottom: 2rpx solid $border-color-light;
text:nth-child(1) {
font-size: $font-base;
font-weight: 700;
}
}
.detail {
margin-left: 20rpx;
line-height: 2em;
padding: 20rpx 0;
}
}
}
</style>

View File

@@ -45,9 +45,9 @@ export default {
storage,
config,
feedBack: {
type:"FUNCTION"
type: "FUNCTION", //默认反馈问题为 '功能相关'
},
action: upload,
action: upload, //图片上传地址
list: [
{ text: "功能相关", value: "FUNCTION" },
{ text: "优化反馈", value: "OPTIMIZE" },
@@ -55,8 +55,8 @@ export default {
],
};
},
onReady() {},
methods: {
// 点击反馈内容
handleClick(index) {
this.$set(this.feedBack, "type", this.list[index].value);
},
@@ -64,14 +64,15 @@ export default {
//图片上传
onUploaded(lists) {
let images = [];
lists.forEach((item) => {
images.push(item.response.result);
});
console.log(images);
this.feedBack.images = images.join(",");
},
/**
* 提交意见反馈
*/
submit() {
if (!this.feedBack.type) {
uni.showToast({
@@ -97,7 +98,7 @@ export default {
});
return false;
}
/** 提交 */
feedBack(this.feedBack).then((res) => {
if (res.data.success) {
uni.showToast({

View File

@@ -1,40 +0,0 @@
<template>
<view class="device-manage">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="常用设备保护">
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启常用设备保护后在不常用的手机上登录时需要进行账号及密码验证通过后继续登录</view>
<view class="title">常用设备</view>
<u-cell-group class="">
<u-cell-item
title="HUAWEI Mate30"
:center="true"
label="最近使用2020-06-28北京市"
value="正在使用"
:value-style="{color:'#1abc9c','font-size':'14px'}"
:title-style="{'color':'#333'}"
>
</u-cell-item>
</u-cell-group>
</view>
</template>
<script>
export default {
data() {
return {
checked:true
};
}
}
</script>
<style lang="scss">
.device-manage{
.title{
padding:0 30rpx 20rpx;
}
}
</style>

View File

@@ -40,10 +40,9 @@
<script>
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
import storage from "@/utils/storage.js";
import { md5 } from "@/utils/md5.js";
import myVerification from "@/components/verification/verification.vue";
import { md5 } from "@/utils/md5.js"; // md5
import myVerification from "@/components/verification/verification.vue"; //验证
import uuid from "@/utils/uuid.modified.js";
export default {
components: {
@@ -65,15 +64,15 @@ export default {
],
step: 0, //当前验证步骤
flage: false, //是否验证码验证
// 验证码登录form
codeForm: {
mobile: "", //手机号
code: "", //验证码
},
newPassword: "",//新密码
newPassword: "", //新密码
password: "", //密码
tips: "", //提示
seconds: 60,
tips: "", //提示
seconds: 60, // 60s等待时间
// 验证码登录校验
codeRules: {
@@ -174,7 +173,7 @@ export default {
}
});
},
codeChange(text) {
this.tips = text;
},

View File

@@ -1,80 +1,82 @@
// TODO 第一版本暂无此功能 后续优化以及更新
<template>
<view class="face-login">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="面容登录">
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用面容认证完成快捷登录设置仅对本机生效</view>
</view>
<view class="face-login">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="面容登录">
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用面容认证完成快捷登录设置仅对本机生效</view>
</view>
</template>
<script>
import storage from '@/utils/storage.js';
import { setBiolofy } from '@/api/passport.js';
import storage from "@/utils/storage.js";
import { setBiolofy } from "@/api/passport.js";
export default {
data() {
return {
checked: true
};
},
methods: {
faceSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function(e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid
};
setBiolofy(params).then(res => {
if (res.statusCode === 200) {
storage.setFaceLogin(true);
}
});
},
fail: function(e) {
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
} else {
storage.setFaceLogin(false);
}
}
},
onLoad() {
// #ifdef APP-PLUS
uni.checkIsSupportSoterAuthentication({
success(res) {
if (!res.supportMode.find(e => e === 'facial')) {
plus.nativeUI.toast('此设备不支持面部识别');
uni.navigateBack();
}
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: 'facial',
success(_res) {
if (!_res.isEnrolled) {
plus.nativeUI.toast('此设备未录入面部信息');
uni.navigateBack();
}
},
fail(_err) {
// plus.nativeUI.toast(JSON.stringify(_err));
uni.navigateBack();
}
});
},
fail(err) {
// plus.nativeUI.toast(JSON.stringify(err));
uni.navigateBack();
}
});
this.checked = storage.getFaceLogin() || false;
// #endif
}
data() {
return {
lightColor: this.$lightColor,
checked: true,
};
},
methods: {
faceSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function (e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid,
};
setBiolofy(params).then((res) => {
if (res.statusCode === 200) {
storage.setFaceLogin(true);
}
});
},
fail: function (e) {
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
console.error("getDeviceInfo failed: " + JSON.stringify(e));
},
});
} else {
storage.setFaceLogin(false);
}
},
},
onLoad() {
// #ifdef APP-PLUS
uni.checkIsSupportSoterAuthentication({
success(res) {
if (!res.supportMode.find((e) => e === "facial")) {
plus.nativeUI.toast("此设备不支持面部识别");
uni.navigateBack();
}
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: "facial",
success(_res) {
if (!_res.isEnrolled) {
plus.nativeUI.toast("此设备未录入面部信息");
uni.navigateBack();
}
},
fail(_err) {
// plus.nativeUI.toast(JSON.stringify(_err));
uni.navigateBack();
},
});
},
fail(err) {
// plus.nativeUI.toast(JSON.stringify(err));
uni.navigateBack();
},
});
this.checked = storage.getFaceLogin() || false;
// #endif
},
};
</script>

View File

@@ -1,70 +1,70 @@
// TODO 第一版本暂无此功能 后续优化以及更新
<template>
<view class="finger">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
<u-switch slot="right-icon" @change="fingerSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用指纹认证完成快捷登录设置仅对本机生效如需修改指纹请在系统设置中操作</view>
</view>
<view class="finger">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
<u-switch slot="right-icon" @change="fingerSwitchChange" :active-color="lightColor" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用指纹认证完成快捷登录设置仅对本机生效如需修改指纹请在系统设置中操作</view>
</view>
</template>
<script>
import storage from '@/utils/storage.js';
import { setBiolofy } from '@/api/passport.js';
import storage from "@/utils/storage.js";
import { setBiolofy } from "@/api/passport.js";
export default {
data() {
return {
checked: false
};
},
methods: {
fingerSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function(e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid
};
setBiolofy(params).then(res => {
if (res.statusCode === 200) {
storage.setFingerLogin(true);
}
});
},
fail: function(e) {
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
} else {
storage.setFingerLogin(false);
}
}
},
onLoad() {
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
plus.nativeUI.toast('此设备不支持指纹识别');
uni.navigateBack();
}
if (!plus.fingerprint.isKeyguardSecure()) {
plus.nativeUI.toast('此设备未设置密码锁屏');
uni.navigateBack();
}
if (!plus.fingerprint.isEnrolledFingerprints()) {
plus.nativeUI.toast('此设备未录入指纹');
uni.navigateBack();
}
this.checked = storage.getFingerLogin() || false;
// #endif
}
data() {
return {
lightColor: this.$lightColor,
checked: false,
};
},
methods: {
fingerSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function (e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid,
};
setBiolofy(params).then((res) => {
if (res.statusCode === 200) {
storage.setFingerLogin(true);
}
});
},
fail: function (e) {
console.error("getDeviceInfo failed: " + JSON.stringify(e));
},
});
} else {
storage.setFingerLogin(false);
}
},
},
onLoad() {
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
plus.nativeUI.toast("此设备不支持指纹识别");
uni.navigateBack();
}
if (!plus.fingerprint.isKeyguardSecure()) {
plus.nativeUI.toast("此设备未设置密码锁屏");
uni.navigateBack();
}
if (!plus.fingerprint.isEnrolledFingerprints()) {
plus.nativeUI.toast("此设备未录入指纹");
uni.navigateBack();
}
this.checked = storage.getFingerLogin() || false;
// #endif
},
};
</script>
<style lang="scss">
.finger {
}
<style scoped lang="scss">
</style>