·修改部分页面数据冗余

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

View File

@ -35,7 +35,7 @@ export function getRegionsById(id = 0) {
} }
/** /**
* 文件上传 * 文件上传地址
* @type {string} * @type {string}
*/ */
export const upload =api.common+'/upload/file'; export const upload =api.common+'/upload/file';

View File

@ -72,19 +72,6 @@ export function receiveCoupons(couponId) {
}); });
} }
/**
* 获取当前会员积分
* @returns {*}
*/
export function getPoints() {
return http.request({
url: 'members/points/current',
method: Method.GET,
needToken: true,
});
}
/** /**
* 获取积分明细数据 * 获取积分明细数据
* @param params * @param params
@ -99,19 +86,6 @@ export function getPointsData(params) {
}); });
} }
/**
* 获取积分明细数据 按月分组
* @param params
* @returns {AxiosPromise}
*/
export function getPointsDataDetail(params) {
return http.request({
url: 'members/points/total',
method: Method.GET,
needToken: true,
params,
});
}
/** /**
* 获取我的评论列表 * 获取我的评论列表

View File

@ -66,9 +66,10 @@ export function getLogisticsMessages(params) {
/** /**
* 获取版本更新信息 * TODO 获取版本更新信息 暂无此功能后续会优化更新
* @param params * @param params
* @returns {AxiosPromise} * @returns {AxiosPromise}
*
*/ */
export function getAppVersionList(params) { export function getAppVersionList(params) {
params = params || {}; params = params || {};

View File

@ -1,9 +1,10 @@
const name = 'lilishop' const name = "lilishop";
export default { export default {
name: name, name: name,
schemeLink: `${name}://`, //唤起app地址 schemeLink: `${name}://`, //唤起app地址
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址 downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址 shareLink: "https://m-b2b2c.pickmall.cn", //分享地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态) appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
appSecret :"6dfbe0c72380dce5d49d65b3c91059b1" //可在 manifest.json 查看 appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
}; };

View File

@ -213,14 +213,6 @@
"navigationBarTitleText": "面容登录" "navigationBarTitleText": "面容登录"
} }
}, },
{
"path": "set/securityCenter/deviceManage",
"style": {
"navigationBarTitleText": "设备管理"
}
},
{ {
"path": "set/securityCenter/editPassword", "path": "set/securityCenter/editPassword",
"style": { "style": {
@ -284,12 +276,7 @@
"navigationBarTitleText": "我的积分" "navigationBarTitleText": "我的积分"
} }
}, },
{ {
"path": "point/pointDetail",
"style": {
"navigationBarTitleText": "积分明细"
}
}, {
"path": "msgTips/main", "path": "msgTips/main",
"style": { "style": {
"navigationBarTitleText": "消息中心" "navigationBarTitleText": "消息中心"
@ -492,12 +479,7 @@
"navigationBarTitleText": "优惠券" "navigationBarTitleText": "优惠券"
} }
}, },
{
"path": "coupon/couponIntro",
"style": {
"navigationBarTitleText": "优惠券说明"
}
},
{ {
"path": "coupon/couponCenter", "path": "coupon/couponCenter",
"style": { "style": {
@ -594,24 +576,13 @@
"navigationBarTitleText": "订单详情" "navigationBarTitleText": "订单详情"
} }
}, },
{
"path": "evaluate/evaluateInfo",
"style": {
"navigationBarTitleText": "评价介绍"
}
},
{ {
"path": "evaluate/evaluateDetail", "path": "evaluate/evaluateDetail",
"style": { "style": {
"navigationBarTitleText": "评价详情" "navigationBarTitleText": "评价详情"
} }
}, },
{
"path": "evaluate/againEvaluate",
"style": {
"navigationBarTitleText": "追加评价"
}
},
{ {
"path": "evaluate/releaseEvaluate", "path": "evaluate/releaseEvaluate",
"style": { "style": {

View File

@ -1,17 +1,17 @@
<template> <template>
<view class="coupon-center"> <view class="coupon-center">
<swiper :current="tabIndex" class="swiper-box" @change="ontabchange"> <swiper class="swiper-box">
<swiper-item class="swiper-item">
<swiper-item @touchmove.stop class="swiper-item" v-for="tab in categoryIndexData" :key="tab.category_id">
<scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore"> <scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore">
<u-empty mode="coupon" text="没有优惠券了" v-if="nomsg"></u-empty> <u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty>
<view v-else class="coupon-item" v-for="(item, index) in list" :key="index"> <view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
<view class="left"> <view class="left">
<view class="wave-line"> <view class="wave-line">
<view class="wave" v-for="(item, index) in 12" :key="index"></view> <view class="wave" v-for="(item, index) in 12" :key="index"></view>
</view> </view>
<view class="msg"> <view class="message">
<view> <view>
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-else>{{ item.price }}</span> <span v-else>{{ item.price }}</span>
</view> </view>
@ -22,11 +22,11 @@
</view> </view>
<view class="right"> <view class="right">
<view> <view>
<!-- 根据scopeType 判断是否是 平台品类或店铺 -->
<view v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span> <span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'"></span> <span v-if="item.scopeType == 'PORTION_CATEGORY'"></span>
<view v-else>{{ item.storeName == 'platform' ? '' :item.storeName+'' }}使</view> <view v-else>{{ item.storeName == 'platform' ? '' :item.storeName+'' }}使</view>
</view> </view>
<view>有效期至{{ item.endTime.split(" ")[0] }}</view> <view>有效期至{{ item.endTime.split(" ")[0] }}</view>
</view> </view>
@ -47,53 +47,53 @@
<script> <script>
import { receiveCoupons } from "@/api/members.js"; import { receiveCoupons } from "@/api/members.js";
import { getAllCoupons } from "@/api/promotions.js"; import { getAllCoupons } from "@/api/promotions.js";
import { getCategoryIndexData } from "@/api/home.js";
export default { export default {
data() { data() {
return { return {
loadStatus: "more", loadStatus: "more", //
nomsg: false, whetherEmpty: false, //
list: [], couponList: [], //
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
status: 1,
}, },
storeId: "", storeId: "", // id
categoryIndexData: [],
currentLeft: 0,
tabIndex: 0,
}; };
}, },
onLoad(option) { onLoad(option) {
this.storeId = option.storeId; this.storeId = option.storeId;
this.getCoupon(); this.getCoupon();
this.getTabbar();
}, },
onPullDownRefresh() { onPullDownRefresh() {
// //
console.log("refresh"); console.log("refresh");
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.list = []; this.couponList = [];
this.getCoupon(); this.getCoupon();
}, },
methods: { methods: {
/**
* 获取当前优惠券
*/
getCoupon() { getCoupon() {
//
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
if (this.storeId) { let submitData = { ...this.params };
getAllCoupons({ storeId: this.storeId ,...this.params }) //
this.storeId ? (submitData = { ...this.params, storeId: this.storeId }): "",
getAllCoupons(submitData)
.then((res) => { .then((res) => {
uni.hideLoading(); uni.hideLoading();
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if (res.statusCode == 200) { if (res.data.code == 200) {
//
let data = res.data.result; let data = res.data.result;
if (data.total == 0) { if (data.total == 0) {
this.nomsg = true; //
this.whetherEmpty = true;
} else { } else {
this.list.push(...data.records); this.couponList.push(...data.records);
this.loadStatus = "noMore"; this.loadStatus = "noMore";
} }
} }
@ -101,33 +101,11 @@ export default {
.catch((err) => { .catch((err) => {
uni.hideLoading(); uni.hideLoading();
}); });
} else {
getAllCoupons(this.params)
.then((res) => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.statusCode == 200) {
console.log(res);
let data = res.data.result;
if (data.total == 0) {
this.nomsg = true;
console.log("这里");
} else if (data.total < 10) {
this.list.push(...data.records);
this.loadStatus = "noMore";
} else {
this.list.push(...data.records);
if (data.data.length < 10) this.loadStatus = "noMore";
}
}
})
.catch((err) => {
uni.hideLoading();
});
}
}, },
/**
* 领取优惠券
*/
receive(item) { receive(item) {
//
receiveCoupons(item.id).then((res) => { receiveCoupons(item.id).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.showToast({ uni.showToast({
@ -141,49 +119,16 @@ export default {
}); });
} }
}); });
// this.$set(this.list,0,this.list[0])
// console.log(this.list)
},
getTabbar() {
//
// uni.showLoading({
// title: ""
// })
let tabbar = {
category_id: 0,
name: "全部",
parent_id: 0,
category_path: "|0|",
goods_count: 0,
category_order: 0,
list_show: 1,
image:
"https://wwwyinbeicn.oss-cn-beijing.aliyuncs.com/yinbeistore/normal/FF468285411041E1AE5C36DAD1161AE4.png",
};
getCategoryIndexData().then((res) => {
console.log(res);
this.categoryIndexData.push(tabbar, ...res.data.result);
});
}, },
/**
* 加载更多
*/
loadMore() { loadMore() {
if (this.loadStatus != "noMore") { if (this.loadStatus != "noMore") {
this.params.pageNumber++; this.params.pageNumber++;
this.getAllCoupons(); this.getAllCoupons();
} }
}, },
setCat(type) {
this.tabIndex = type;
// this.searchStore();
},
ontabchange(e) {
this.tabIndex = e.detail.current;
if (e.detail.current > 3) {
this.currentLeft = (e.detail.current - 3) * 90;
} else {
this.currentLeft = 0;
}
// this.searchStore();
},
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
uni.navigateTo({ uni.navigateTo({
@ -201,7 +146,7 @@ page {
.coupon-center { .coupon-center {
height: 100%; height: 100%;
.list-scroll-content { .couponList-scroll-content {
position: relative; position: relative;
width: 100%; width: 100%;
display: flex; display: flex;
@ -247,7 +192,7 @@ page {
width: 260rpx; width: 260rpx;
background-color: $light-color; background-color: $light-color;
position: relative; position: relative;
.msg { .message {
color: $font-color-white; color: $font-color-white;
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -21,9 +21,9 @@
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+'' : coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
}}使用</view> }}使用</view>
<view class="text"> 有效期至{{coupon.endTime}}</view> <view class="text"> 有效期至{{coupon.endTime}}</view>
</view> </view>
<button class="btn" @click="gostorePage" v-if="coupon.used_status==0">使</button>
</view> </view>
</view> </view>
</template> </template>
@ -32,34 +32,16 @@
export default { export default {
data() { data() {
return { return {
customStyle: { coupon: {}, //
backgroundColor: this.lightColor,
},
coupon: {},
}; };
}, },
onLoad(option) { onLoad(option) {
this.coupon = JSON.parse(decodeURIComponent(option.item)); this.coupon = JSON.parse(decodeURIComponent(option.item));
console.log(this.coupon);
},
methods: {
gostorePage() {
let id = this.coupon.storeId;
if (id) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${id}`,
});
} else {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
}
},
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
page, page,
.content { .content {
// background: $main-color; // background: $main-color;
@ -140,9 +122,5 @@ page,
line-height: 2em; line-height: 2em;
color: #999; color: #999;
} }
.btn {
margin: 140rpx 20rpx;
}
} }
</style> </style>

View File

@ -1,59 +0,0 @@
<template>
<view class="coupin-intro">
<view class="title">
1.优惠券的获取
</view>
<view class="mb-60">
通过活动赠送客服补偿等获得(系统自动添加, 无需兑换);
</view>
<view class="title">
2.优惠券使用
</view>
<view>1每张抵用券仅能使用一次不找零不退换不兑换现金</view>
<view>2单笔订单只能使用1张优惠券, 不支持同时使用多张, 用券后差额不找零, 不退回</view>
<view>3优惠券 (包括新用户券) 不能抵扣运费, 只能抵扣商品金额特价商品不可使用优惠券, 与其他优惠不同享</view>
<view>4每张优惠券的使用条件请查看对应优惠券的使用说明</view>
<view>5请在有效期内使用优惠券, 未使用的优惠券过期后, 将自动作废</view>
<view>6每个用户仅限使用1张新用户专享优惠券, 同一帐号和手机号均视为同一用户</view>
<view>7用券前订单满88元即可包邮港澳台地区需满500元包邮</view>
<view class="mb-60">8使用抵用券抵扣部分的货款不开具发票</view>
<view class="title">3.优惠券失效</view>
<view>1新用户券使用一张后其他新用户券失效, 取消订单后不返还</view>
<view>2使用优惠券的订单, 若产生退货, 优惠券均不退回, 退款金额按优惠后的小计金额退款</view>
<view>3参加满赠券活动获得的赠券,发生退货时,若订单中剩余商品不满足赠券条件,实物赠品需勾选退货并寄回,否则将从退款中扣减对应金额,客服审核通过退货申请后,所获赠券将会自动失效</view>
<view>4优惠券严禁出售或转让, 如经发现并证实的, 该券将予以失效处理</view>
<view>5如需了解更多, 请联系在线客服或拨打客服电话400-0000-000</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss">
.coupin-intro{
background-color: #fff;
color: #999999;
font-size: $font-sm;
padding: 30rpx;
border-top: 1px solid $border-color-light;
line-height: 2.5em;
.title{
font-size: $font-base;
font-weight: bold;
}
.mb-60{
margin-bottom: 60rpx;
}
}
</style>

View File

@ -1,18 +1,14 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="nomore" v-if="current === 0 && couponsList.length <= 0"> <div class="empty" v-if="couponsList.length <= 0">
暂无优惠券 <u-empty text="暂无优惠券" mode="coupon"></u-empty>
</div> </div>
<div class="nomore" v-if="current === 1 && disabledCouponsList.length <= 0">
暂无优惠券
</div>
<view class="coupon-item" v-for="(item, index) in couponsList" :key="index" v-if="item.memberCouponStatus == 'NEW'"> <view class="coupon-item" v-for="(item, index) in couponsList" :key="index" v-if="item.memberCouponStatus == 'NEW'">
<view class="left"> <view class="left">
<view class="wave-line"> <view class="wave-line">
<view class="wave" v-for="(item, index) in 12" :key="index"></view> <view class="wave" v-for="(item, index) in 12" :key="index"></view>
</view> </view>
<view class="msg"> <view class="message">
<view> <view>
<span v-if="item.couponType == 'DISCOUNT'">{{ item.discount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.discount }}</span>
<span v-else>{{ item.price }}</span> <span v-else>{{ item.price }}</span>
@ -41,51 +37,31 @@
</div> </div>
</template> </template>
<script> <script>
import { import { useCoupon, getMemberCanUse } from "@/api/trade.js";
useCoupon,
getMemberCouponList,
getMemberCanUse,
} from "@/api/trade.js";
export default { export default {
data() { data() {
return { return {
current: 0, couponsList: [], //
list: [
{
name: "可用优惠券",
},
{
name: "不可用优惠券",
},
],
curNow: "",
couponsList: [],
disabledCouponsList: [],
params: { params: {
memberCouponStatus: "NEW", //
memberCouponStatus: "NEW", //
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
scopeId: "", scopeId: "", //skuid
storeId: "", storeId: "", //id
totalPrice: "", totalPrice: "", //
// endTime: this.$u.timeFormat(new Date().getTime(),'yyyy-mm-dd hh:MM:ss')
}, },
way: [], routerVal: "", //
routerVal: "",
}; };
}, },
onReachBottom() { /**
this.pageNumber++; * 赋值
this.getAllCouponsFun(); */
},
onLoad(val) { onLoad(val) {
this.routerVal = val; this.routerVal = val;
this.params.scopeId = val.skuId; this.params.scopeId = val.skuId;
this.params.storeId = val.storeId; this.params.storeId = val.storeId;
if (val.type) {
this.params.endTime = new Date().getTime();
}
}, },
mounted() { mounted() {
uni.getStorage({ uni.getStorage({
@ -98,20 +74,21 @@ export default {
}, },
methods: { methods: {
/**
// * 获取优惠券数量
*/
getCoupons() { getCoupons() {
getMemberCanUse(this.params).then((res) => { getMemberCanUse(this.params).then((res) => {
if (res.data.success) { if (res.data.success) {
this.couponsList = res.data.result.records; this.couponsList = res.data.result.records;
} }
}); });
}, },
// /**
async clickWay(coupon) { * 领取优惠券
*/
clickWay(coupon) {
useCoupon({ useCoupon({
memberCouponId: coupon.id, memberCouponId: coupon.id,
used: true, used: true,
@ -128,139 +105,18 @@ export default {
} }
}); });
}, },
submitback() {
uni.navigateBack();
},
//
getAllCouponsFun() {},
sectionChange(index) {
this.curNow = index;
},
change(index) {
this.current = index;
},
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.nomore { .empty {
margin-top: 20px; margin-top: 20px;
text-align: center; text-align: center;
} }
.selectBtn {
position: fixed;
bottom: 0;
background: #fff;
text-align: center;
width: 100%;
padding: 20rpx 0;
}
.wrapper { .wrapper {
background: #f9f9f9; background: #f9f9f9;
overflow: hidden; overflow: hidden;
} }
.coupon-jd {
margin: 40rpx auto 0 auto;
width: 700rpx;
height: auto;
background-color: #ffffff;
display: flex;
.left {
padding: 0 30rpx;
width: 200rpx;
background-color: $aider-light-color;
text-align: center;
font-size: 28rpx;
color: #ffffff;
.sum {
margin-top: 50rpx;
font-weight: bold;
font-size: 32rpx;
.num {
font-size: 60rpx;
}
}
.type {
margin-bottom: 50rpx;
font-size: 24rpx;
}
}
.right {
padding: 20rpx 20rpx 0;
font-size: 28rpx;
.top {
border-bottom: 2rpx dashed $u-border-color;
.title {
margin-right: 60rpx;
line-height: 40rpx;
.tag {
padding: 4rpx 20rpx;
background-color: $aider-light-color;
border-radius: 20rpx;
color: #ffffff;
font-weight: bold;
font-size: 24rpx;
margin-right: 10rpx;
}
}
.bottom {
display: flex;
margin-top: 20rpx;
align-items: center;
justify-content: space-between;
margin-bottom: 10rpx;
.date {
font-size: 20rpx;
flex: 1;
}
}
}
.tips {
width: 100%;
line-height: 50rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
.transpond {
margin-right: 10rpx;
}
.explain {
display: flex;
align-items: center;
}
.particulars {
width: 30rpx;
height: 30rpx;
box-sizing: border-box;
padding-top: 8rpx;
border-radius: 50%;
background-color: $u-type-info-disabled;
text-align: center;
}
}
}
}
.immediate-use {
height: auto;
padding: 0 20rpx;
font-size: 24rpx;
text-align: center;
width: 160rpx;
margin: 20rpx 0;
border-radius: 40rpx;
line-height: 40rpx;
color: $aider-light-color;
border: 2rpx solid $aider-light-color;
}
.coupon-item { .coupon-item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -272,7 +128,7 @@ export default {
width: 260rpx; width: 260rpx;
background-color: $light-color; background-color: $light-color;
position: relative; position: relative;
.msg { .message {
color: $font-color-white; color: $font-color-white;
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -1,26 +1,25 @@
<template> <template>
<view class="b-content"> <view class="b-content">
<view class="navbar"> <view class="navbar">
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="tabClick(index)"><text :class="{ current: tabCurrentIndex === index }">{{ <!-- 循环出头部tab栏 -->
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text :class="{ current: tabCurrentIndex === index }">{{
item.text item.text
}}</text></view> }}</text></view>
</view> </view>
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"> <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"> <swiper-item class="tab-content" v-for="(navItem, navIndex) in navList" :key="navIndex">
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData"> <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
<!-- 空白页 --> <!-- 空白页 -->
<empty v-if="tabItem.nomsg"></empty> <u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
<!-- 数据 --> <!-- 数据 -->
<view v-if="tabItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': tabIndex != 0 }" v-for="(coupon, index) in tabItem.dataList" :key="index"> <view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }" v-for="(coupon, index) in navItem.dataList" :key="index">
<view class="left"> <view class="left">
<view class="wave-line"> <view class="wave-line">
<view class="wave" v-for="(item, index) in 12" :key="index"></view> <view class="wave" v-for="(item, index) in 12" :key="index"></view>
</view> </view>
<view class="msg"> <view class="message">
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}</view> <view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}</view>
<view class="price" v-else>{{ coupon.price }}</view> <view class="price" v-else>{{ coupon.price }}</view>
<!-- <view class="price" v-if="coupon.couponType == 'PRICE'">{{ coupon.price | unitPrice }}</view> -->
<!-- <view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.couponDiscount }}</view> -->
<view class="sub-price">{{ coupon.consumeThreshold | unitPrice }}可用</view> <view class="sub-price">{{ coupon.consumeThreshold | unitPrice }}可用</view>
</view> </view>
<view class="circle circle-top"></view> <view class="circle circle-top"></view>
@ -43,20 +42,20 @@
<u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon> <u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<view class="jiao-1" v-if="tabIndex == 0"> <view class="jiao-1" v-if="navIndex == 0">
<text class="text-1">新到</text> <text class="text-1">新到</text>
<text class="text-2" v-if="coupon.used_status == 1"></text> <text class="text-2" v-if="coupon.used_status == 1"></text>
</view> </view>
<image class="no-icon" v-if="tabIndex == 1" src="@/static/img/used.png"></image> <image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
<image class="no-icon" v-if="tabIndex == 2" src="@/pages/floor/imgs/overdue.png"></image> <image class="no-icon" v-if="navIndex == 2" src="@/pages/floor/imgs/overdue.png"></image>
<view class="receive" v-if="tabIndex == 0" @click="nowUse(coupon)"> <view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
<text>立即</text><br /> <text>立即</text><br />
<text>使用</text> <text>使用</text>
</view> </view>
<view class="bg-quan"> </view> <view class="bg-quan"> </view>
</view> </view>
</view> </view>
<uni-load-more :status="tabItem.loadStatus"></uni-load-more> <uni-load-more :status="navItem.loadStatus"></uni-load-more>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -69,8 +68,9 @@ import { getMemberCoupons } from "@/api/members.js";
export default { export default {
data() { data() {
return { return {
tabCurrentIndex: 0, tabCurrentIndex: 0, //tab0 使
navList: [ navList: [
//tab
{ {
text: "未使用", text: "未使用",
loadStatus: "more", loadStatus: "more",
@ -81,7 +81,7 @@ export default {
pageSize: 10, pageSize: 10,
status: 1, status: 1,
}, },
nomsg: false, wheterEmpty: false,
}, },
{ {
text: "已使用", text: "已使用",
@ -93,7 +93,7 @@ export default {
pageSize: 10, pageSize: 10,
status: 2, status: 2,
}, },
nomsg: false, wheterEmpty: false,
}, },
{ {
text: "已过期", text: "已过期",
@ -105,40 +105,37 @@ export default {
pageSize: 10, pageSize: 10,
status: 3, status: 3,
}, },
nomsg: false, wheterEmpty: false,
}, },
], ],
couponList: [], couponList: [], //
}; };
}, },
onNavigationBarButtonTap() {
uni.navigateTo({
url: "/pages/cart/coupon/couponIntro",
});
},
onLoad() { onLoad() {
// this.tabCurrentIndex = 0;
this.getData();
},
onPullDownRefresh() {
let index = this.tabCurrentIndex;
this.navList[index].params.pageNumber = 1;
this.navList[index].dataList = [];
this.getData(); this.getData();
}, },
watch: { watch: {
/**
* 监听切换顶部tab栏实现刷新数据
*/
tabCurrentIndex(val) { tabCurrentIndex(val) {
if (this.navList[val].dataList.length == 0) this.getData(); if (this.navList[val].dataList.length == 0) this.getData();
}, },
}, },
methods: { methods: {
//tab /**
tabClick(index) { * 顶部tab点击
*/
handleTabClick(index) {
this.tabCurrentIndex = index; this.tabCurrentIndex = index;
// this.loadData();
}, },
/**
* 读取优惠券
*/
getData() { getData() {
//
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
@ -149,7 +146,7 @@ export default {
let data = res.data.result.records; let data = res.data.result.records;
if (data.length == 0) { if (data.length == 0) {
if (res.data.pageNumber == 1) { if (res.data.pageNumber == 1) {
this.navList[index].nomsg = true; this.navList[index].wheterEmpty = true;
} else { } else {
this.navList[index].loadStatus = "noMore"; this.navList[index].loadStatus = "noMore";
} }
@ -163,9 +160,17 @@ export default {
uni.hideLoading(); uni.hideLoading();
}); });
}, },
/**
* 切换tab
*/
changeTab(e) { changeTab(e) {
this.tabCurrentIndex = e.target.current; this.tabCurrentIndex = e.target.current;
}, },
/**
* 加载数据
*/
loadData() { loadData() {
let index = this.tabCurrentIndex; let index = this.tabCurrentIndex;
if (this.navList[index].loadStatus != "noMore") { if (this.navList[index].loadStatus != "noMore") {
@ -173,10 +178,11 @@ export default {
this.getData(); this.getData();
} }
}, },
nowUse(item) {
console.log(item) /**
return * 立即使用优惠券
//使 */
useItNow(item) {
if (item.storeId) { if (item.storeId) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.storeId}`, url: `/pages/product/shopPage?id=${item.storeId}`,
@ -186,9 +192,11 @@ export default {
url: "/pages/tabbar/home/index", url: "/pages/tabbar/home/index",
}); });
} }
}, },
/**
* 优惠券详情
*/
couponDetail(item) { couponDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: url:
@ -199,12 +207,11 @@ export default {
}, },
}; };
</script> </script>
<style>
<style lang="scss" scoped>
page { page {
height: 100%; height: 100%;
} }
</style>
<style lang="scss">
$item-color: #fff; $item-color: #fff;
.b-content { .b-content {
@ -232,7 +239,7 @@ $item-color: #fff;
background-color: $light-color; background-color: $light-color;
position: relative; position: relative;
.msg { .message {
color: $font-color-white; color: $font-color-white;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -370,27 +377,6 @@ $item-color: #fff;
} }
} }
} }
.coupon-used {
.left {
background-color: #dddddd;
.wave-line {
background-color: #dddddd;
}
}
.right {
color: #cccccc;
.content {
color: #cccccc;
> view:nth-child(1) {
color: #cccccc;
}
}
.bg-quan {
border: 6rpx solid #cccccc;
color: #cccccc;
}
}
}
} }
.navbar { .navbar {

View File

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

View File

@ -6,7 +6,7 @@
选择收货地址 选择收货地址
</view> </view>
<u-form-item class="border" label="收货人" label-width="130" prop="name"> <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>
<u-form-item label="手机号码" label-width="130" prop="mobile"> <u-form-item label="手机号码" label-width="130" prop="mobile">
@ -59,7 +59,7 @@ export default {
// ios // ios
permision.judgeIosPermission("location") permision.judgeIosPermission("location")
? (this.mapFlage = true) ? (this.mapFlage = true)
: this.refuseMapOuther() ; : this.refuseMapOuther();
} else { } else {
// //
this.requestAndroidPermission( this.requestAndroidPermission(
@ -116,6 +116,7 @@ export default {
} }
}, },
//
callBackAddress(val) { callBackAddress(val) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -132,15 +133,19 @@ export default {
uni.hideLoading(); uni.hideLoading();
} }
this.mapFlage = !this.mapFlage; this.mapFlage = !this.mapFlage; //
}, },
//
save() { save() {
this.$refs.uForm.validate((valid) => { this.$refs.uForm.validate((valid) => {
if (valid) { if (valid) {
let pages = getCurrentPages(); // let pages = getCurrentPages(); //
let beforePage = pages[pages.length - 2]; // let beforePage = pages[pages.length - 2]; //
console.log(beforePage);
// id
if (!this.form.id) { if (!this.form.id) {
//
delete this.form.___path; delete this.form.___path;
addAddress(this.form).then((res) => { addAddress(this.form).then((res) => {
if (res.data.success) { if (res.data.success) {
@ -156,6 +161,7 @@ export default {
} }
}); });
} else { } else {
//
delete this.form.___path; delete this.form.___path;
delete this.form.updateBy; delete this.form.updateBy;
delete this.form.updateTime; delete this.form.updateTime;
@ -167,18 +173,20 @@ export default {
} }
}); });
} }
} else {
console.log("验证失败");
} }
}); });
}, },
//
getpickerParentValue(e) { getpickerParentValue(e) {
//
this.form.consigneeAddressIdPath = []; this.form.consigneeAddressIdPath = [];
this.form.consigneeAddressPath = []; this.form.consigneeAddressPath = [];
let name = ""; let name = "";
e.forEach((item, index) => { e.forEach((item, index) => {
console.log(item);
if (item.id) { if (item.id) {
//
this.form.consigneeAddressIdPath.push(item.id); this.form.consigneeAddressIdPath.push(item.id);
this.form.consigneeAddressPath.push(item.localName); this.form.consigneeAddressPath.push(item.localName);
name += item.localName; name += item.localName;
@ -194,8 +202,9 @@ export default {
this.form.lon = _town[0].center.split(",")[1]; this.form.lon = _town[0].center.split(",")[1];
} }
}); });
}, },
//
showPicker() { showPicker() {
this.$refs.cityPicker.show(); this.$refs.cityPicker.show();
}, },
@ -203,24 +212,19 @@ export default {
mounted() {}, mounted() {},
data() { data() {
return { return {
lightColor: this.$lightColor, lightColor: this.$lightColor, //
addSyncData: "", mapFlage: false, //
mapFlage: false,
longitude: "",
markers: [],
latitude: "",
routerVal: "", routerVal: "",
show: false,
form: { form: {
detail: "", detail: "", //
name: "", name: "", //
mobile: "", mobile: "", //
consigneeAddressIdPath: [], consigneeAddressIdPath: [], //id
consigneeAddressPath: [], consigneeAddressPath: [], //
___path: "", ___path: "", //
isDefault: false, isDefault: false, //
}, },
//
rules: { rules: {
name: [ name: [
{ {
@ -272,6 +276,7 @@ export default {
title: "加载中", title: "加载中",
}); });
this.routerVal = option; this.routerVal = option;
// ,
if (option.id) { if (option.id) {
getAddressDetail(option.id).then((res) => { getAddressDetail(option.id).then((res) => {
const params = res.data.result; const params = res.data.result;
@ -283,10 +288,7 @@ export default {
} }
uni.hideLoading(); uni.hideLoading();
}, },
onShow() { // rulesonReadyonLoad
},
// onReadyonLoad
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules); 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> <template>
<view class="address"> <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="list" v-else>
<view class="item c-content" v-for="(item, index) in addressList" :key="index"> <view class="item c-content" v-for="(item, index) in addressList" :key="index">
<view class="basic" @click="selectAddressData(item)"> <view class="basic" @click="selectAddressData(item)">
@ -10,21 +10,11 @@
<text class="default" v-show="item.isDefault"></text> <text class="default" v-show="item.isDefault"></text>
<view> <view>
<div class="region"> <div class="region">
<span v-if="item.consigneeAddressPath[0]">{{ <span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
item.consigneeAddressPath[0] <span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
}}</span> <span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
<span v-if="item.consigneeAddressPath[1]">{{ <span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
item.consigneeAddressPath[1] <span>{{ item.detail }}</span>
}}</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> </div>
</view> </view>
</view> </view>
@ -38,7 +28,7 @@
<view class="alifont icon-bianji-copy"></view> <view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)"></text> <text class="mr-40" @click="addAddress(item.id)"></text>
<view class="alifont icon-lajitong"></view> <view class="alifont icon-lajitong"></view>
<text @click="delAddress(item.id)"></text> <text @click="removeAddress(item.id)"></text>
</view> </view>
</view> </view>
</view> </view>
@ -48,7 +38,7 @@
<u-icon name="plus-circle"></u-icon> <u-icon name="plus-circle"></u-icon>
添加新收货人 添加新收货人
</button> </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> </view>
</template> </template>
@ -58,12 +48,10 @@ import * as API_Address from "@/api/address.js";
export default { export default {
data() { data() {
return { return {
ifOnShow: false, //true false addressList: [], //
activeClass: "activeClass", showAction: false, //
addressList: [], empty: false, //
showAction: false, removeList: [
empty: false,
delList: [
{ {
text: "确定", text: "确定",
}, },
@ -71,12 +59,11 @@ export default {
tips: { tips: {
text: "确定要删除该收货人信息吗?", text: "确定要删除该收货人信息吗?",
}, },
delId: "", removeId: "", //id
addid: "",
routerVal: "", routerVal: "",
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 50, pageSize: 1000,
}, },
}; };
}, },
@ -122,7 +109,6 @@ export default {
this.$set(this, "addressList", res.data.result.records); this.$set(this, "addressList", res.data.result.records);
console.log(this.addressList); console.log(this.addressList);
} }
@ -130,12 +116,12 @@ export default {
}); });
}, },
// //
delAddress(id) { removeAddress(id) {
this.delId = id; this.removeId = id;
this.showAction = true; this.showAction = true;
}, },
deleteAddressMessage() { deleteAddressMessage() {
API_Address.deleteAddress(this.delId).then((res) => { API_Address.deleteAddress(this.removeId).then((res) => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -186,158 +172,10 @@ export default {
this.getAddressList(); this.getAddressList();
}); });
}, },
// id
addId(params) {
API_Trade.setAddressId(params.address_id).then((res) => {});
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.active { @import './address.scss';
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;
}
}
}
</style> </style>

View File

@ -1,32 +1,19 @@
<template> <template>
<view class="address"> <view class="address">
<view class="bar"></view> <u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
<empty v-if="empty"></empty>
<view class="list" v-else> <view class="list" v-else>
<view class="item c-content" v-for="(item, index) in addressList" :key="index"> <view class="item c-content" v-for="(item, index) in addressList" :key="index">
<view class="basic"> <view class="basic">
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
<text>{{ item.mobile }}</text> <text>{{ item.mobile }}</text>
<text class="default" v-show="item.isDefault"></text> <text class="default" v-show="item.isDefault"></text>
<view> <view>
<div class="region"> <div class="region">
<span v-if="item.consigneeAddressPath[0]">{{ <span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
item.consigneeAddressPath[0] <span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
}}</span> <span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
<span v-if="item.consigneeAddressPath[1]">{{ <span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
item.consigneeAddressPath[1] <span>{{ item.detail }}</span>
}}</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> </div>
</view> </view>
</view> </view>
@ -40,7 +27,7 @@
<view class="alifont icon-bianji-copy"></view> <view class="alifont icon-bianji-copy"></view>
<text class="mr-40" @click="addAddress(item.id)"></text> <text class="mr-40" @click="addAddress(item.id)"></text>
<view class="alifont icon-lajitong"></view> <view class="alifont icon-lajitong"></view>
<text @click="delAddress(item.id)"></text> <text @click="removeAddress(item.id)"></text>
</view> </view>
</view> </view>
</view> </view>
@ -52,22 +39,19 @@
添加新收货人 添加新收货人
</button> </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> </view>
</template> </template>
<script> <script>
import * as API_Trade from "@/api/trade";
import * as API_Address from "@/api/address.js"; import * as API_Address from "@/api/address.js";
import storage from "@/utils/storage.js";
export default { export default {
data() { data() {
return { return {
activeClass: "activeClass", addressList: [], //
addressList: [], showAction: false, //
showAction: false, empty: false, //
empty: false, removeList: [
delList: [
{ {
text: "确定", text: "确定",
}, },
@ -75,9 +59,8 @@ export default {
tips: { tips: {
text: "确定要删除该收货人信息吗?", text: "确定要删除该收货人信息吗?",
}, },
delId: "", removeId: "", //id
addid: "", routerVal: "",
routerVal: "",
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 1000, pageSize: 1000,
@ -94,22 +77,33 @@ export default {
onLoad: function (val) { onLoad: function (val) {
this.routerVal = val; this.routerVal = val;
}, },
/**
* 进入页面检测当前账户是否登录
*/
onShow() { onShow() {
let userInfo = storage.getUserInfo(); if (this.$options.filters.isLogin("auth")) {
if (userInfo && userInfo.id) {
this.getAddressList(); 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: { methods: {
// //
getAddressList() { getAddressList() {
uni.showLoading(); uni.showLoading();
API_Address.getAddressList( API_Address.getAddressList(
this.params.pageNumber, this.params.pageNumber,
this.params.pageSize this.params.pageSize
@ -120,19 +114,19 @@ export default {
res.data.result.records.forEach((item) => { res.data.result.records.forEach((item) => {
item.consigneeAddressPath = item.consigneeAddressPath.split(","); item.consigneeAddressPath = item.consigneeAddressPath.split(",");
}); });
this.addressList = res.data.result.records; this.addressList = res.data.result.records;
} }
uni.hideLoading(); uni.hideLoading();
}); });
}, },
// //
delAddress(id) { removeAddress(id) {
this.delId = id; this.removeId = id;
this.showAction = true; this.showAction = true;
}, },
//
deleteAddressMessage() { deleteAddressMessage() {
API_Address.deleteAddress(this.delId).then((res) => { API_Address.deleteAddress(this.removeId).then((res) => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -150,15 +144,9 @@ export default {
}, },
// //
addAddress(id) { addAddress(id) {
if (id) { uni.navigateTo({
uni.navigateTo({ url: `/pages/mine/address/add${id ? "?id=" + id : ""}`,
url: "/pages/mine/address/add?id=" + id, });
});
} else {
uni.navigateTo({
url: "/pages/mine/address/add",
});
}
}, },
// //
setDefault(item) { setDefault(item) {
@ -168,7 +156,7 @@ export default {
item.isDefault ? "" : (item.isDefault = !item.isDefault); item.isDefault ? "" : (item.isDefault = !item.isDefault);
API_Address.editAddress(item).then((res) => { API_Address.editAddress(item).then(() => {
uni.showToast({ uni.showToast({
title: "设置默认地址成功", title: "设置默认地址成功",
icon: "none", icon: "none",
@ -176,154 +164,10 @@ export default {
this.getAddressList(); this.getAddressList();
}); });
}, },
// id
addId(params) {
API_Trade.setAddressId(params.address_id).then((res) => {});
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.active { @import './address.scss';
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;
}
}
}
</style> </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> <template></template>
<script> <script>
import { getAddressCode } from "@/api/address"; import { getAddressCode } from "@/api/address";
import config from '@/config/config'
export default { export default {
data() { data() {
return {}; return {
config
};
}, },
mounted() { mounted() {
this.init(); this.init();
@ -33,7 +35,7 @@ export default {
}); });
}, },
// //
init() { init() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.wechatMap(); this.wechatMap();
@ -60,12 +62,14 @@ export default {
cancelText: "取消", cancelText: "取消",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
//
uni.openSetting({ uni.openSetting({
success: (res) => { success: (res) => {
that.initMap(); that.initMap();
}, },
}); });
} else { } else {
//
that.$emit("close"); that.$emit("close");
return false; return false;
} }
@ -75,18 +79,18 @@ export default {
}, },
}); });
}, },
//
posToCity(latitude, longitude) { posToCity(latitude, longitude) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: `https://restapi.amap.com/v3/geocode/regeo`, url: `https://restapi.amap.com/v3/geocode/regeo`,
method: "GET", method: "GET",
data: { data: {
key: "d649892b3937a5ad20b76dacb2bcb5bd", //webkey key: config.aMapKey, //webkey
location: `${longitude},${latitude}`, location: `${longitude},${latitude}`,
}, },
success: ({ data }) => { success: ({ data }) => {
const { status, info, regeocode } = data; const { status, info } = data;
if (status === "1") { if (status === "1") {
resolve(data); resolve(data);
} else { } else {

View File

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

View File

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

View File

@ -18,104 +18,56 @@
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text> <text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
</u-col> </u-col>
</u-row> </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 --> <div class="point-list">
<view class="mp-weixin-more"> <view class="point-item" v-for="(item, index) in pointList" :key="index">
<view>近30天记录</view> <view>
<view @click="goDetail"></view> <view>{{ item.content }}</view>
<view>{{ item.createTime}}</view>
</view>
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
</view> </view>
<!-- #endif --> <uni-load-more :status="count.loadStatus"></uni-load-more>
</u-row> </div>
<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>
</view> </view>
</template> </template>
<script> <script>
import { getPoints, getPointsData } from "@/api/members.js"; import { getPointsData } from "@/api/members.js";
import { getMemberPointSum } from "@/api/members.js"; import { getMemberPointSum } from "@/api/members.js";
import { contractStep } from "@/api/safe.js";
import storage from "@/utils/storage.js";
export default { export default {
onShow() {
this.userInfo = storage.getUserInfo();
},
data() { data() {
return { return {
count: { count: {
loadStatus: "more", loadStatus: "more",
}, },
list: [], pointList: [], //
userInfo: [],
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
start_time: 0,
end_time: 0,
}, },
pointData: {}, pointData: {}, //
show: false,
form: {},
showAction: false,
actionList: [],
storeParams: {
point: 0,
storeId: 0,
storeName: "请选择店铺",
},
avoidClick: false,
isCertificate: true,
}; };
}, },
onLoad() { onLoad() {
contractStep().then((res) => { this.initPointData();
//
console.log(res);
this.isCertificate = res.data == 1 ? true : false;
});
getPoints().then((res) => {
this.count = res.data;
});
this.initpointDataData();
this.getList(); this.getList();
}, },
/**
* 触底加载
*/
onReachBottom() { onReachBottom() {
this.params.pageNumber++; this.params.pageNumber++;
this.getList(); this.getList();
}, },
methods: { methods: {
/**
* 获取积分数据
*/
getList() { getList() {
let date = Date.parse(new Date()) / 1000;
let params = this.params; let params = this.params;
params.start_time = date - 60 * 60 * 24 * 30; //30
params.end_time = date;
// console.log(params)
// return;
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
@ -125,55 +77,28 @@ export default {
let data = res.data.result.records; let data = res.data.result.records;
if (data.length < 10) { if (data.length < 10) {
this.$set(this.count, "loadStatus", "noMore"); this.$set(this.count, "loadStatus", "noMore");
this.list.push(...data); this.pointList.push(...data);
} else { } else {
this.list.push(...data); this.pointList.push(...data);
if (data.length < 10) this.$set(this.count, "loadStatus", "noMore"); if (data.length < 10) this.$set(this.count, "loadStatus", "noMore");
} }
} }
}); });
}, },
initpointDataData() {
//使 /**
* 获得累计使用
*/
initPointData() {
getMemberPointSum().then((res) => { getMemberPointSum().then((res) => {
this.pointData = res.data.result; this.pointData = res.data.result;
}); });
}, },
goDetail() {
//
uni.navigateTo({
url: "/pages/point/pointDetail",
});
},
goIntro() {
//
uni.navigateTo({
url: "/pages/pointTrade/pointIntro",
});
},
}, },
}; };
</script> </script>
<style lang="scss" scoped> <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 { .title {
height: 80rpx; height: 80rpx;
text-align: center; text-align: center;
@ -182,40 +107,22 @@ export default {
font-weight: bold; font-weight: bold;
} }
.btn-mini { .point-item {
margin: 20rpx auto;
font-size: 24rpx;
border-radius: 6rpx;
}
.u-form-item {
padding: 10rpx 30rpx 10rpx 20rpx;
}
.dataList {
width: 100%; width: 100%;
height: 130rpx; height: 130rpx;
padding: 0 20rpx; padding: 0 20rpx;
background: #ffffff; background: #ffffff;
font-size: $font-sm; font-size: $font-sm;
// line-height: 2em;
border-bottom: 1px solid $border-color-light; border-bottom: 1px solid $border-color-light;
display: flex; display: flex;
justify-content: end; justify-content: end;
align-items: center; align-items: center;
.colorRed {
color: #f04844;
}
> view:nth-child(1) { > view:nth-child(1) {
flex: 1; flex: 1;
line-height: 40rpx; line-height: 40rpx;
view { view {
color: #666666; color: #666666;
} }
:last-child { :last-child {
color: #999; color: #999;
} }
@ -233,35 +140,17 @@ export default {
border-radius: 0 0 20rpx 20rpx; border-radius: 0 0 20rpx 20rpx;
margin: 0 20rpx; margin: 0 20rpx;
font-size: 26rpx; font-size: 26rpx;
/deep/ .u-col { /deep/ .u-col {
text-align: center !important; text-align: center !important;
} }
/deep/ .u-col:first-child { /deep/ .u-col:first-child {
border-right: 1px solid $border-color-light; border-right: 1px solid $border-color-light;
} }
.pcolor { .pcolor {
color: #4ebb9d; 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 { .content {
background: #f9f9f9; background: #f9f9f9;
} }
@ -312,27 +201,11 @@ export default {
border-radius: 20rpx 0px 0px 20rpx; border-radius: 20rpx 0px 0px 20rpx;
} }
} }
.point-img { .point-img {
height: 108rpx; height: 108rpx;
width: 108rpx; width: 108rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.current {
font-size: 26rpx;
text {
vertical-align: middle;
}
> text:nth-child(2) {
color: #ffee80;
font-size: 40rpx;
margin-left: 20rpx;
}
}
.point { .point {
font-size: 56rpx; 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> <template>
<view class="edition-intro"> <view class="edition-intro">
<view class="logo c-content"> <view class="logo c-content">
<view> <view>
<image src="/static/img/edition.png" mode=""></image> <image src="/static/img/edition.png" mode=""></image>
</view> </view>
<view>版本不息&nbsp;优化不止</view> <view>版本不息&nbsp;优化不止</view>
</view> </view>
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index"> <view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
<view class="level"> <view class="level">
<text style="color: #1ABC9C;">{{item.version}}</text> <text style="color: #1ABC9C;">{{item.version}}</text>
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text> <text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
</view> </view>
<view class="detail" v-html="item.content"></view> <view class="detail" v-html="item.content"></view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import * as API_Message from "@/api/message.js"; import * as API_Message from "@/api/message.js";
export default { export default {
data() { data() {
return { return {
editionHistory:[], editionHistory: [], //
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 5 pageSize: 5,
}, },
loadStatus:'more' loadStatus: "more",
}; };
}, },
onLoad(){ onLoad() {
if (uni.getSystemInfoSync().platform === 'android') { if (uni.getSystemInfoSync().platform === "android") {
this.params.type = 0; this.params.type = 0;
} else { } else {
this.params.type = 1; this.params.type = 1;
} }
this.GET_AppVersionList(true); this.GET_AppVersionList(true);
}, },
onReachBottom() { onReachBottom() {
if(this.loadStatus!='noMore'){ if (this.loadStatus != "noMore") {
this.params.pageNumber++ this.params.pageNumber++;
this.GET_AppVersionList(false) this.GET_AppVersionList(false);
} }
},
}, methods: {
methods: { GET_AppVersionList(reset) {
GET_AppVersionList(reset){ if (reset) {
if (reset) { this.params.pageNumber = 1;
this.params.pageNumber = 1 }
} uni.showLoading({
uni.showLoading({ title: "加载中",
title:"加载中" });
}) API_Message.getAppVersionList(this.params).then((response) => {
API_Message.getAppVersionList(this.params).then(response => { uni.hideLoading();
uni.hideLoading() if (response.statusCode == 200) {
if(response.statusCode==200){ const { data } = response;
const { data } = response if (data.data.length < 10) {
if(data.data.length<10){ this.loadStatus = "noMore";
this.loadStatus = 'noMore'; }
} this.editionHistory.push(...data.data);
this.editionHistory.push(...data.data) }
} });
},
}) },
};
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.edition-intro{ .edition-intro {
.logo{ .logo {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
font-size: $font-lg; font-size: $font-lg;
color: $font-color-light; color: $font-color-light;
height: 330rpx; height: 330rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
>view:nth-child(1){ > view:nth-child(1) {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
border: 1px solid #FFC71C; border: 1px solid #ffc71c;
border-radius: 50%; border-radius: 50%;
position: relative; position: relative;
margin-bottom: 30rpx; margin-bottom: 30rpx;
image{ image {
width: 80rpx; width: 80rpx;
height: 113rpx; height: 113rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
margin:auto; margin: auto;
} }
} }
}
} .edition {
.edition{ margin-bottom: 20rpx;
margin-bottom: 20rpx; color: $font-color-light;
color: $font-color-light; font-size: $font-sm;
font-size: $font-sm; .level {
.level{ display: flex;
display: flex; justify-content: space-between;
justify-content: space-between; align-items: center;
align-items: center; padding: 20rpx 30rpx;
padding: 20rpx 30rpx ; border-bottom: 2rpx solid $border-color-light;
border-bottom: 1px solid $border-color-light; text:nth-child(1) {
text:nth-child(1){ font-size: $font-base;
font-size: $font-base; font-weight: 700;
font-weight: 700; }
} }
} .detail {
.detail{ margin-left: 20rpx;
margin-left: 20rpx; line-height: 2em;
line-height: 2em; padding: 20rpx 0;
padding: 20rpx 0; }
} }
}
} }
</style> </style>

View File

@ -45,9 +45,9 @@ export default {
storage, storage,
config, config,
feedBack: { feedBack: {
type:"FUNCTION" type: "FUNCTION", // ''
}, },
action: upload, action: upload, //
list: [ list: [
{ text: "功能相关", value: "FUNCTION" }, { text: "功能相关", value: "FUNCTION" },
{ text: "优化反馈", value: "OPTIMIZE" }, { text: "优化反馈", value: "OPTIMIZE" },
@ -55,8 +55,8 @@ export default {
], ],
}; };
}, },
onReady() {},
methods: { methods: {
//
handleClick(index) { handleClick(index) {
this.$set(this.feedBack, "type", this.list[index].value); this.$set(this.feedBack, "type", this.list[index].value);
}, },
@ -64,14 +64,15 @@ export default {
// //
onUploaded(lists) { onUploaded(lists) {
let images = []; let images = [];
lists.forEach((item) => { lists.forEach((item) => {
images.push(item.response.result); images.push(item.response.result);
}); });
console.log(images);
this.feedBack.images = images.join(","); this.feedBack.images = images.join(",");
}, },
/**
* 提交意见反馈
*/
submit() { submit() {
if (!this.feedBack.type) { if (!this.feedBack.type) {
uni.showToast({ uni.showToast({
@ -97,7 +98,7 @@ export default {
}); });
return false; return false;
} }
/** 提交 */
feedBack(this.feedBack).then((res) => { feedBack(this.feedBack).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.showToast({ 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> <script>
import { sendMobile, resetByMobile, modifyPass } from "@/api/login"; import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import { md5 } from "@/utils/md5.js"; import { md5 } from "@/utils/md5.js"; // md5
import myVerification from "@/components/verification/verification.vue"; import myVerification from "@/components/verification/verification.vue"; //
import uuid from "@/utils/uuid.modified.js"; import uuid from "@/utils/uuid.modified.js";
export default { export default {
components: { components: {
@ -65,15 +64,15 @@ export default {
], ],
step: 0, // step: 0, //
flage: false, // flage: false, //
// form
codeForm: { codeForm: {
mobile: "", // mobile: "", //
code: "", // code: "", //
}, },
newPassword: "",// newPassword: "", //
password: "", // password: "", //
tips: "", // tips: "", //
seconds: 60, seconds: 60, // 60s
// //
codeRules: { codeRules: {
@ -174,7 +173,7 @@ export default {
} }
}); });
}, },
codeChange(text) { codeChange(text) {
this.tips = text; this.tips = text;
}, },

View File

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

View File

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

View File

@ -323,6 +323,9 @@ export default {
}, },
}, },
methods: { methods: {
/**
* 点击图片放大或保存
*/
preview(urls, index) { preview(urls, index) {
uni.previewImage({ uni.previewImage({
current: index, current: index,

View File

@ -37,7 +37,7 @@
<view class="cell-view"> {{ complainTopic }} </view> <view class="cell-view"> {{ complainTopic }} </view>
<u-icon style="margin-left: 20rpx" name="arrow-down"></u-icon> <u-icon style="margin-left: 20rpx" name="arrow-down"></u-icon>
</view> </view>
<view class="cell-item complain-content"> <view class="cell-item complain-content">
<view class="cell-title title"> 投诉内容 </view> <view class="cell-title title"> 投诉内容 </view>
<view class="cell-view content"> <view class="cell-view content">
@ -47,7 +47,8 @@
<view class="cell-item"> <view class="cell-item">
<view class="cell-title"> 投诉凭证 </view> <view class="cell-title"> 投诉凭证 </view>
<view class="cell-view"> <view class="cell-view">
<u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5"></u-upload> <u-upload ref="uUpload" :header=" { accessToken: storage.getAccessToken() }" upload-text="" :show-progress="false" :action="action" width="100" @on-uploaded="onUploaded" :max-count="5">
</u-upload>
</view> </view>
</view> </view>
</view> </view>
@ -65,8 +66,9 @@ export default {
data() { data() {
return { return {
storage, storage,
action: upload, action: upload, //
orderStatusList: { orderStatusList: {
//
UNDELIVERED: "待发货", UNDELIVERED: "待发货",
UNPAID: "未付款", UNPAID: "未付款",
PAID: "已付款", PAID: "已付款",
@ -77,45 +79,44 @@ export default {
}, },
complainValue: "", // complainValue: "", //
complainShow: false, // complainShow: false, //
complainTopic: "", complainTopic: "", //
// complainList: [], //
complainList: [], images: [], //
images: [], order: "", //
order: "", orderGoodsList: "", //
orderGoodsList: "", orderDetail: "", //
orderDetail: "",
sn: "", sn: "",
skuId: "", skuId: "", //skuid
}; };
}, },
onLoad(option) { onLoad(option) {
console.log(option);
this.loadData(option.sn); this.loadData(option.sn);
this.sn = option.sn; this.sn = option.sn;
this.skuId = option.skuId; this.skuId = option.skuId;
},
mounted() {
this.getReasion(); this.getReasion();
}, },
methods: {
onUploaded(lists) {
console.log(lists);
let images = [];
methods: {
/**
* 上传完成
*/
onUploaded(lists) {
let images = [];
lists.forEach((item) => { lists.forEach((item) => {
images.push(item.response.result); images.push(item.response.result);
}); });
this.images = images; this.images = images;
console.log(this.images);
}, },
// /**
* 提交
*/
handleSumit() { handleSumit() {
//
let goods = this.orderGoodsList.filter((item) => { let goods = this.orderGoodsList.filter((item) => {
return item.skuId == this.skuId; return item.skuId == this.skuId;
}); });
//
let data = { let data = {
complainTopic: this.complainTopic, //, complainTopic: this.complainTopic, //,
content: this.complainValue, // content: this.complainValue, //
@ -124,7 +125,6 @@ export default {
orderSn: this.sn, // orderSn: this.sn, //
skuId: this.skuId, //skuid skuId: this.skuId, //skuid
}; };
addComplain(data).then((res) => { addComplain(data).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.showToast({ uni.showToast({
@ -142,6 +142,9 @@ export default {
}); });
}, },
/**
* 获取投诉原因
*/
getReasion() { getReasion() {
getComplainReason().then((res) => { getComplainReason().then((res) => {
if (res.data.result.length >= 1) { if (res.data.result.length >= 1) {
@ -153,10 +156,13 @@ export default {
this.complainList.push(way); this.complainList.push(way);
}); });
this.complainTopic = res.data.result[0].reason; this.complainTopic = res.data.result[0].reason;
console.log(this.complainTopic);
} }
}); });
}, },
/**
* 加载订单详情
*/
loadData(sn) { loadData(sn) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -166,12 +172,14 @@ export default {
this.order = order.order; this.order = order.order;
this.orderGoodsList = order.orderItems; this.orderGoodsList = order.orderItems;
this.orderDetail = res.data.result; this.orderDetail = res.data.result;
uni.hideLoading(); uni.hideLoading();
}); });
}, },
/**
* 确认投诉
*/
confirmComplain(e) { confirmComplain(e) {
console.log(e);
this.complainTopic = e[0].label; this.complainTopic = e[0].label;
}, },
}, },

View File

@ -2,76 +2,28 @@
<view class="wrapper"> <view class="wrapper">
<view class="tips">我的投诉信息</view> <view class="tips">我的投诉信息</view>
<u-cell-group> <u-cell-group>
<u-cell-item <u-cell-item :arrow="false" :value="complainDetail.goodsName" title="投诉商品"></u-cell-item>
:arrow="false" <u-cell-item :arrow="false" :value="statusData[complainDetail.complainStatus]" title="投诉状态"></u-cell-item>
:value="detail.goodsName" <u-cell-item :arrow="false" :value="complainDetail.createTime" title="投诉时间"></u-cell-item>
title="投诉商品" <u-cell-item :arrow="false" :value="complainDetail.complainTopic" title="投诉主题"></u-cell-item>
></u-cell-item> <u-cell-item :arrow="false" :value="complainDetail.content" title="投诉内容"></u-cell-item>
<u-cell-item <view class="row" v-if="complainDetail.orderComplaintImages">
:arrow="false" <u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.orderComplaintImages" :key="index" :src="item"
:value="statusData[detail.complainStatus]" @click="preview(complainDetail.orderComplaintImages, index)" />
title="投诉状态"
></u-cell-item>
<u-cell-item
:arrow="false"
:value="detail.createTime"
title="投诉时间"
></u-cell-item>
<u-cell-item
:arrow="false"
:value="detail.complainTopic"
title="投诉主题"
></u-cell-item>
<u-cell-item
:arrow="false"
:value="detail.content"
title="投诉内容"
></u-cell-item>
<view class="row" v-if="detail.orderComplaintImages">
<u-image
width="100rpx"
height="100rpx"
border-radius="10"
style="margin: 0 10rpx"
v-for="(item, index) in detail.orderComplaintImages"
:key="index"
:src="item"
@click="preview(detail.orderComplaintImages, index)"
/>
</view> </view>
</u-cell-group> </u-cell-group>
<view class="tips">商家申诉信息</view> <view class="tips">商家申诉信息</view>
<u-cell-group> <u-cell-group>
<u-cell-item <u-cell-item :arrow="false" :value="complainDetail.appealTime || '暂无'" title="申诉时间"></u-cell-item>
:arrow="false" <u-cell-item :arrow="false" :value="complainDetail.appealContent || '暂无'" title="申诉内容"></u-cell-item>
:value="detail.appealTime || '暂无'" <view class="row" v-if="complainDetail.appealImagesList">
title="申诉时间" <u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.appealImagesList"
></u-cell-item> @click="preview(complainDetail.appealImagesList, index)" :key="index" :src="item" />
<u-cell-item
:arrow="false"
:value="detail.appealContent || '暂无'"
title="申诉内容"
></u-cell-item>
<view class="row" v-if="detail.appealImagesList">
<u-image
width="100rpx"
height="100rpx"
border-radius="10"
style="margin: 0 10rpx"
v-for="(item, index) in detail.appealImagesList"
@click="preview(detail.appealImagesList, index)"
:key="index"
:src="item"
/>
</view> </view>
</u-cell-group> </u-cell-group>
<view class="tips">对话详情</view> <view class="tips">对话详情</view>
<view class="speak-way" v-if="detail.orderComplaintCommunications"> <view class="speak-way" v-if="complainDetail.orderComplaintCommunications">
<view <view class="speak-msg seller" :key="i" v-for="(complaint, i) in complainDetail.orderComplaintCommunications">
class="speak-msg seller"
:key="i"
v-for="(complaint, i) in detail.orderComplaintCommunications"
>
{{ {{
complaint.owner == "PLATFORM" complaint.owner == "PLATFORM"
? "平台" ? "平台"
@ -85,11 +37,7 @@
<view class="speak-way" v-else></view> <view class="speak-way" v-else></view>
<view class="tips">平台仲裁</view> <view class="tips">平台仲裁</view>
<u-cell-group> <u-cell-group>
<u-cell-item <u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
:arrow="false"
title="仲裁意见"
:value="detail.arbitrationResult || '暂无'"
></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
</template> </template>
@ -99,8 +47,7 @@ import { getComplainDetail } from "@/api/after-sale";
export default { export default {
data() { data() {
return { return {
detail: "", complainDetail: "", //
statusData: { statusData: {
NO_APPLY: "未申请", NO_APPLY: "未申请",
APPLYING: "申请中", APPLYING: "申请中",
@ -110,10 +57,14 @@ export default {
}, },
}; };
}, },
onLoad(option) { onLoad(option) {
this.init(option.id); this.init(option.id);
}, },
methods: { methods: {
/**
* 点击图片放大或保存
*/
preview(urls, index) { preview(urls, index) {
uni.previewImage({ uni.previewImage({
current: index, current: index,
@ -125,24 +76,29 @@ export default {
}, },
}); });
}, },
/**
* 初始化投诉详情
*/
init(id) { init(id) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
getComplainDetail(id).then((res) => { getComplainDetail(id).then((res) => {
if (res.data.success) { if (res.data.success) {
this.detail = res.data.result; this.complainDetail = res.data.result;
} else {
uni.showToast({
title: res.data.message,
duration: 2000,
icon: "none",
});
} }
uni.hideLoading(); uni.hideLoading();
}); });
}, },
}, },
mounted() {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.row { .row {
display: flex; display: flex;

View File

@ -1,10 +1,6 @@
<template> <template>
<view> <view>
<view <view class="seller-view" v-for="(item, index) in complaionData" :key="index">
class="seller-view"
v-for="(item, index) in complaionData"
:key="index"
>
<view class="seller-info u-flex u-row-between"> <view class="seller-info u-flex u-row-between">
<view class="seller-name"> <view class="seller-name">
<view class="name">{{ item.storeName }}</view> <view class="name">{{ item.storeName }}</view>
@ -14,12 +10,7 @@
<u-line color="#DCDFE6"></u-line> <u-line color="#DCDFE6"></u-line>
<view class="goods-item-view"> <view class="goods-item-view">
<view class="goods-img" @click="handleToGoods(item)"> <view class="goods-img" @click="handleToGoods(item)">
<u-image <u-image border-radius="6" width="131rpx" height="131rpx" :src="item.goodsImage"></u-image>
border-radius="6"
width="131rpx"
height="131rpx"
:src="item.goodsImage"
></u-image>
</view> </view>
<view class="goods-info" @click="handleToGoods(item)"> <view class="goods-info" @click="handleToGoods(item)">
<view class="goods-title u-line-2">{{ item.goodsName }}</view> <view class="goods-title u-line-2">{{ item.goodsName }}</view>
@ -37,34 +28,16 @@
<view class="complain-speak"> {{ item.complainTopic }} </view> <view class="complain-speak"> {{ item.complainTopic }} </view>
</view> </view>
<view class="complain-btn"> <view class="complain-btn">
<u-tag <u-tag mode="plain" @click="handleClear(item)" class="complain-tag" text="撤销投诉" type="info" v-if="
mode="plain"
@click="handleClear(item)"
class="complain-tag"
text="撤销投诉"
type="info"
v-if="
item.complainStatus != 'EXPIRED' && item.complainStatus != 'CANCEL' item.complainStatus != 'EXPIRED' && item.complainStatus != 'CANCEL'
" " />
/> <u-tag mode="plain" @click="handleInfo(item)" class="complain-tag" text="投诉详情" type="info" />
<u-tag
mode="plain"
@click="handleInfo(item)"
class="complain-tag"
text="投诉详情"
type="info"
/>
</view> </view>
</view> </view>
<view v-if="empty" style="margin-top: 40rpx">
<u-empty text="暂无投诉列表" mode="list"></u-empty> <u-empty v-if="empty" :style="{'marginTop':complaionDetail.total == 0 ? '200rpx':'0rpx'}" class="empty" style="" text="暂无投诉列表" mode="list"></u-empty>
</view>
<u-modal <u-modal show-cancel-button @confirm="handleClearConfirm" v-model="show" :content="content"></u-modal>
show-cancel-button
@confirm="handleClearConfirm"
v-model="show"
:content="content"
></u-modal>
</view> </view>
</template> </template>
@ -87,38 +60,49 @@ export default {
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 20, pageSize: 20,
// memberId: "",
// memberName: "",
}, },
complaionData: [], complaionDetail: "", //response
complaionData: [], //
empty: false, empty: false,
rows: "", checkComplainData: "", //
}; };
}, },
mounted() { mounted() {
this.init(); this.init();
}, },
/**
* 触底加载
*/
onReachBottom() { onReachBottom() {
this.params.pageNumber++; if (
this.init(); this.complaionDetail &&
this.complaionDetail.total < this.params.pageNumber * this.params.pageSize
) {
this.params.pageNumber++;
this.init();
}
}, },
methods: { methods: {
// //
handleToGoods(val) { handleToGoods(val) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/product/goods?id=" + val.skuId+"&goodsId="+val.goodsId, url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
}); });
}, },
// /**
* 点击撤销投诉
*/
handleClear(val) { handleClear(val) {
console.log(val);
this.show = true; this.show = true;
this.rows = val; this.checkComplainData = val;
}, },
/**
* 执行撤销
*/
handleClearConfirm() { handleClearConfirm() {
clearComplain(this.rows.id).then((res) => { clearComplain(this.checkComplainData.id).then((res) => {
if (res.data.success) { if (res.data.success) {
uni.showToast({ uni.showToast({
title: "撤销成功", title: "撤销成功",
@ -131,19 +115,25 @@ export default {
} }
}); });
}, },
/**
* 查看详情
*/
handleInfo(val) { handleInfo(val) {
uni.navigateTo({ uni.navigateTo({
url: "./complainInfo?id=" + val.id, url: "./complainInfo?id=" + val.id,
}); });
}, },
/**
* 初始化投诉列表
*/
init() { init() {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
}); });
getComplain(this.params).then((res) => { getComplain(this.params).then((res) => {
console.log(res); this.complaionDetail = res.data.result;
if (res.data.result.records.length >= 1) { if (res.data.result.records.length >= 1) {
this.complaionData.push(...res.data.result.records); this.complaionData.push(...res.data.result.records);
} else { } else {
@ -185,4 +175,7 @@ export default {
.complain-tag { .complain-tag {
margin-left: 10rpx; margin-left: 10rpx;
} }
.empty {
margin-top: 40rpx;
}
</style> </style>

View File

@ -1,241 +0,0 @@
<template>
<view class="page-main">
<view class="after-sales-goods-detail-view">
<view>
<view class="goods-item-view">
<view class="goods-img"><u-image width="131rpx" height="131rpx" :src="order.goods_img"></u-image></view>
<view class="goods-info">
<view class="goods-title u-line-2">{{ order.goodsName }}</view>
<view class="goods-specs">/</view>
<view class="goods-price"></view>
</view>
<view class="goods-num"><view></view></view>
</view>
</view>
</view>
<view class="info-evaluate-view">
<view class="info-cell">
<view class="info-cell-title">初评日期{{ $u.timeFormat(order.create_time, 'yyyy-mm-dd') }}</view>
</view>
<view class="info-cell">
<view class="info-cell-title">初评评价{{ order.grade_str }}</view>
</view>
<view class="info-cell">
<view class="info-cell-title">初评内容{{ order.content }}</view>
</view>
<view class="info-cell"><view class="info-cell-title">初评审核状态您的初评审核通过</view></view>
</view>
<view class="info-evaluate-view">
<view class="input-view">
<u-input
height="200"
placeholder-style="font-size:12px;color:#CCCCCC"
v-model="form[0].content"
:type="type"
maxlength="500"
:border="border"
:maxlength="maxlength"
:placeholder="placeholder"
/>
</view>
<view class="input-num">
<text>{{ form[0].content.length }}/{{ maxlength }}</text>
</view>
</view>
<view class="info-evaluate-view">
<view class="images-view"><u-upload :action="action" width="150" @on-uploaded="onUploaded" :max-count="5"></u-upload></view>
</view>
<view class="submit-view"><u-button shape="circle" style="background-color: #1abc9c;color: #ffffff;" @click="onSubmit"></u-button></view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import { commentsOrder, AppendCommentsOrder } from '@/api/members.js';
import { upload } from '@/api/common.js';
export default {
data() {
return {
value: '',
type: 'textarea',
border: false,
maxlength: 500,
placeholder: '对评价进行补充,更客观,更全面',
order: {},
form: [],
action: upload
};
},
onLoad(options) {
this.order = JSON.parse(options.order);
console.log(this.order);
let sku = {
comment_id: this.order.comment_id,
content: '',
grade: this.order.grade,
images: [],
sku_id: this.order.sku_id
};
this.form.push(sku);
},
methods: {
onSubmit() {
AppendCommentsOrder(this.form).then(res => {
if(res.statusCode == 200){
this.$refs.uToast.show({
title: '发布追评成功',
type: 'success',
url: '/pages/order/evaluate/myEvaluate'
});
}
});
},
onUploaded(lists) {
let images = [];
lists.forEach(item => {
images.push(item.response.url);
});
this.form[0].images = images;
}
}
};
</script>
<style lang="scss">
page,
.content {
background: #f1f1f1;
height: 100%;
margin-bottom: 100rpx;
}
.after-sales-goods-detail-view {
background-color: #f4f4f5;
.header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-bottom: 20rpx;
.header-text {
background-color: #f4f4f5;
padding: 10rpx 30rpx;
border-radius: 50rpx;
.seller-name {
color: #fa3534;
font-weight: 600;
}
}
}
.goods-item-view {
display: flex;
flex-direction: row;
padding: 30rpx 30rpx;
background-color: #eef1f2;
.goods-img {
}
.goods-info {
padding-left: 30rpx;
flex: 1;
.goods-title {
margin-bottom: 10rpx;
color: $font-color-dark;
}
.goods-specs {
font-size: 24rpx;
margin-bottom: 10rpx;
color: #cccccc;
}
.goods-price {
font-size: 28rpx;
margin-bottom: 10rpx;
color: #ff5a10;
}
}
.goods-num {
width: 60rpx;
color: $main-color;
}
}
.after-num {
margin: 0rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
height: 80rpx;
}
}
.goods-evaluate-view {
margin-top: 8rpx;
padding: 30rpx;
margin-bottom: 5rpx;
background-color: #fff;
display: flex;
flex-direction: row;
align-items: center;
.goods-view {
width: 250rpx;
}
.rate-view {
display: flex;
flex-direction: row;
align-items: center;
.rate-btn {
margin: 0rpx 35rpx;
}
}
}
.info-evaluate-view {
margin: 20rpx 0;
padding: 30rpx;
background-color: #fff;
color: #666666;
align-items: center;
.input-view {
width: 100%;
}
.input-num {
color: #cccccc;
text-align: right;
}
.images-view {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
}
.info-header {
font-size: 33rpx;
margin-bottom: 10rpx;
}
.seller-rate-view {
display: flex;
flex-direction: row;
align-items: center;
.rate-title {
width: 150rpx;
font-size: 33rpx;
}
}
.info-cell {
display: flex;
flex-direction: row;
align-items: center;
margin: 8rpx 0rpx;
}
}
.submit-view {
margin-top: 100rpx;
height: 100rpx;
width: 750rpx;
align-items: center;
padding: 10rpx 20rpx;
}
.uni-textarea-wrapper {
font-size: 24rpx;
}
.u-hairline-border:after{
border: none;
}
</style>

View File

@ -3,13 +3,7 @@
<view class="exaluate-member-view"> <view class="exaluate-member-view">
<view class="member-view"> <view class="member-view">
<view class="member-img"> <view class="member-img">
<u-image <u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
width="82rpx"
style="border: 1px solid #ededed"
height="82rpx"
shape="circle"
:src="comment.memberProfile || '/static/missing-face.png'"
></u-image>
</view> </view>
<view class="member-info"> <view class="member-info">
<view class="memName">{{ comment.memberName }}</view> <view class="memName">{{ comment.memberName }}</view>
@ -17,21 +11,13 @@
</view> </view>
</view> </view>
<view class="goods-view"> <view class="goods-view">
<view class="goods-title" <view class="goods-title">商品评价: {{ gradeList[comment.grade] }}</view>
>商品评价: {{ gradeList[comment.grade] }}</view
>
<view class="goods-subtitle"> <view class="goods-subtitle">
{{ comment.content }} {{ comment.content }}
</view> </view>
<view class="goods-imgs-view" v-if="comment.image != null && comment.image.length != 0"> <!-- 如果有图片则会循环显示评价的图片 -->
<view class="goods-imgs-view" v-if="comment.image != null && comment.image.length != 0">
<view <view class="img-view" v-for="(img, imgIndex) in comment.image.split(',')" :key="imgIndex">
class="img-view"
v-for="(img, imgIndex) in comment.image.split(',')"
:key="imgIndex"
>
<u-image @click.native="preview(comment.image.split(','),imgIndex)" width="160rpx" height="160rpx" :src="img"></u-image> <u-image @click.native="preview(comment.image.split(','),imgIndex)" width="160rpx" height="160rpx" :src="img"></u-image>
</view> </view>
</view> </view>
@ -39,38 +25,7 @@
{{ comment.goodsName }} {{ comment.goodsName }}
</view> </view>
<view class="goods-subtitle"></view> <view class="goods-subtitle"></view>
<view v-if="comment.additional_comment != null">
<view class="goods-comm">
<span style="margin-left: 10rpx">
购买{{ calcDay(comment) }}天后追加评论
</span>
<text>{{
comment.additional_comment.create_time | unixToDate
}}</text>
</view>
<view class="goods-subtitle additional">{{
comment.additional_comment.content
}}</view>
<view class="goods-imgs-view">
<view
class="img-view"
v-for="(img, imgIndex) in comment.additional_comment.images"
:key="imgIndex"
>
<!-- <image :src="img"></image> -->
<u-image width="160rpx" height="160rpx" :src="img"></u-image>
</view>
</view>
<view v-if="comment.additional_comment.reply_status == 1">
<view style="border-bottom: 1px solid #ededed; width: 100%"></view>
<view class="goods-comm store-reply">
<span style="margin-left: 10rpx">掌柜回复</span>
</view>
<view class="goods-subtitle additional">{{
comment.additional_comment.reply.content
}}</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -80,9 +35,9 @@
export default { export default {
data() { data() {
return { return {
src: "", comment: {}, //
comment: {}, gradeList: {
gradeList: { //grade
GOOD: "好评", GOOD: "好评",
MODERATE: "中评", MODERATE: "中评",
WORSE: "差评", WORSE: "差评",
@ -92,11 +47,12 @@ export default {
}, },
onLoad(options) { onLoad(options) {
this.comment = JSON.parse(decodeURIComponent(options.comment)); this.comment = JSON.parse(decodeURIComponent(options.comment));
}, },
methods: { methods: {
preview(urls, index) { /**
* 点击图片放大或保存
*/
preview(urls, index) {
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: urls, urls: urls,
@ -107,47 +63,15 @@ export default {
}, },
}); });
}, },
calcDay(order) {
let date = "";
console.log();
if (order.additional_comment) {
date =
(order.additional_comment.create_time - order.create_time) /
60 /
60 /
24;
}
return Math.ceil(date);
},
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.goods-comm {
color: #ff6262;
border-left: 3px solid #1abc9c;
text {
float: right;
font-size: 24rpx;
color: #999999;
}
&::after {
content: "";
display: block;
clear: both;
}
}
.store-reply {
color: #333;
margin-top: 20rpx;
}
.memName { .memName {
font-size: 28rpx; font-size: 28rpx;
} }
.additional {
margin: 20rpx 0;
}
.goods-name { .goods-name {
border-bottom: 1px solid #ededed; border-bottom: 1px solid #ededed;
padding-bottom: 30rpx; padding-bottom: 30rpx;
@ -162,73 +86,7 @@ page,
background: $page-color-base; background: $page-color-base;
height: 100%; height: 100%;
} }
.seller-view {
background-color: #fff;
margin: 5rpx 0rpx;
padding: 0rpx 30rpx;
.seller-info {
height: 70rpx;
.seller-name {
font-size: 33rpx;
font-weight: 600;
}
.order-sn {
color: #909399;
}
}
.goods-item-view {
display: flex;
flex-direction: row;
padding: 10rpx 0rpx;
.goods-img {
}
.goods-info {
padding-left: 30rpx;
width: 380rpx;
.goods-title {
margin-bottom: 10rpx;
}
.goods-specs {
margin-bottom: 10rpx;
color: #909399;
}
.goods-price {
margin-bottom: 10rpx;
color: #909399;
}
}
.goods-num {
margin: 0rpx 10rpx;
display: flex;
flex-direction: row;
align-items: flex-end;
margin-bottom: 10rpx;
}
}
.btn-view {
min-height: 70rpx;
margin: 5rpx 0rpx;
display: flex;
flex-direction: row;
.description {
color: #909399;
size: 25rpx;
.text {
margin: 10rpx 0rpx;
}
.title {
color: #000000;
}
}
.again-btn {
margin: 0rpx 10rpx;
display: flex;
flex-direction: row;
align-items: flex-end;
margin-bottom: 10rpx;
}
}
}
.exaluate-member-view { .exaluate-member-view {
background-color: #fff; background-color: #fff;
margin-top: 12rpx; margin-top: 12rpx;
@ -247,26 +105,26 @@ page,
} }
.goods-view { .goods-view {
margin-left: 15rpx; margin-left: 15rpx;
.border-bottom { }
padding-bottom: 20rpx; }
border-bottom: 1px solid #ededed; .border-bottom {
} padding-bottom: 20rpx;
.goods-title { border-bottom: 1px solid #ededed;
margin-bottom: 10rpx; }
} .goods-title {
.goods-subtitle { margin-bottom: 10rpx;
margin-bottom: 20rpx; }
color: #909399; .goods-subtitle {
} margin-bottom: 20rpx;
.goods-imgs-view { color: #909399;
margin: 20rpx 0; }
display: flex; .goods-imgs-view {
flex-direction: row; margin: 20rpx 0;
align-items: center; display: flex;
.img-view { flex-direction: row;
margin-right: 15rpx; align-items: center;
} .img-view {
} margin-right: 15rpx;
} }
} }
</style> </style>

View File

@ -1,81 +0,0 @@
<template>
<view>
<view class="info-view">
<view class="info-text">
1.对商品金额大于20元商品(虚拟商品除外)进行评价并通过审核后根据商品价格和您的评价内容为您发放积分
</view>
<view class="info-text">
2.只能对90天内购买的订单进行商品评价
</view>
<view class="info-text">
3.同一订单和相隔15日内不同订单中的相同商品只能评价一次
</view>
<view class="info-text">
4.退换货订单产生的商品评价将会被删除且会扣除相应的优币
</view>
<view class="info-text">
5.鼓励发表原创有价值的评价;杜绝剽窃发表无意义违反法律法规的评价内容如果您发布的无效评价超过(包含)5则一年内您发表的商品评价都不会获得积分奖励
</view>
<view class="info-text">
6.晒单发表成功后会对晒图进行审核审核过程中心得文字会先展示出来审核通过后晒图会一起进行展示
</view>
<view class="info-text">
7.对于审核不通过的评价晒单不能获得优币奖励且文字晒图均不能被展示出来有下列情形之一的审核不予通过
</view>
<view class="info-text">
评价心得文字与商品无关且出现言辞露骨的情况;
</view>
<view class="info-text">
图片与所购商品不一致;
</view>
<view class="info-text">
晒单为截屏图片;
</view>
<view class="info-text">
图片不清晰不能达到晒单目的;
</view>
<view class="info-text">
图片中涉及淫秽色情等违法不良信息;
</view>
<view class="info-text">
未经过他人同意涉及使用他人图片或将他人图片进行编辑后发布;
</view>
<view class="info-text">
盗用他人图片经举报诉讼情况属实;
</view>
<view class="info-text">
图片中涉及敏感词汇(曝光315假二水翻新等);
</view>
<view class="info-text">
图片涉及与客服聊天记录;
</view>
<view class="info-text">
对于成人用品晒单未对特殊部位进行遮掩或打马赛克
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
page, .content{
background: $page-color-base;
height: 100%;
}
.info-view {
padding: 50rpx;
.info-text {
color: #909399;
margin-bottom: 8rpx;
}
}
</style>

View File

@ -2,9 +2,9 @@
<view> <view>
<view class="wrap"> <view class="wrap">
<view class="u-tabs-box"> <view class="u-tabs-box">
<u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs" :active-color="$lightColor" @change="change"></u-tabs> <u-tabs :list="list" :is-scroll="false" inactive-color="#333" :current="current" class="utabs" :active-color="$lightColor" @change="changeTab"></u-tabs>
</view> </view>
<swiper class="swiper-box" :current="current" @change="changeTab" duration="500"> <swiper class="swiper-box" :current="current" @change="changeSwiper" duration="500">
<swiper-item v-for="(item, listIndex) in list" :key="listIndex"> <swiper-item v-for="(item, listIndex) in list" :key="listIndex">
<scroll-view scroll-y style="height: 100%" @scrolltolower="renderData(listIndex)"> <scroll-view scroll-y style="height: 100%" @scrolltolower="renderData(listIndex)">
<u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty> <u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty>
@ -32,7 +32,7 @@
<rich-text :nodes="'评论内容:' + order.content || ''"></rich-text> <rich-text :nodes="'评论内容:' + order.content || ''"></rich-text>
</u-read-more> </u-read-more>
</view> </view>
<view class="goods-imgs-view" v-if="order.image"> <view class="goods-imgs-view" v-if="order.image">
<view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')" :key="imgIndex"> <view class="img-view" v-if="order.image" v-for="(img, imgIndex) in order.image.split(',')" :key="imgIndex">
<u-image v-if="order.image" @click.native=" <u-image v-if="order.image" @click.native="
@ -47,7 +47,7 @@
</view> </view>
<view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'"> <view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'">
<view class="evaluate"> <view class="evaluate">
<view @click="onCommont(order)"> <view @click="talkCommont(order)">
<u-tag text="发表评价" shape="circle" mode="plain" type="error" /> <u-tag text="发表评价" shape="circle" mode="plain" type="error" />
</view> </view>
</view> </view>
@ -69,14 +69,7 @@ import { getComments } from "@/api/members.js";
export default { export default {
data() { data() {
return { return {
customStyle: { list: [ //tab
backgroundColor: this.$lightColor,
color: "#FFF",
height: "60rpx",
width: "150rpx",
margin: "20rpx 0",
},
list: [
{ {
name: "待评价", name: "待评价",
}, },
@ -84,28 +77,32 @@ export default {
name: "已评价", name: "已评价",
}, },
], ],
gradeList: { gradeList: { //
GOOD: "好评", GOOD: "好评",
MODERATE: "中评", MODERATE: "中评",
WORSE: "差评", WORSE: "差评",
haveImage: "有图", haveImage: "有图",
}, },
current: 0, current: 0, //tabIndex
orderList: [], orderList: [], //
params: { params: {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
orderStatus: "",
loadStatus: "more", loadStatus: "more",
}, },
}; };
}, },
onShow() { onShow() {
this.orderList = []; this.orderList = [];
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.current == 0 ? this.loadData() : this.loadComments(); this.current == 0 ? this.loadData() : this.loadComments();
}, },
watch: { watch: {
/**
* 切换current
* 更改页面并重新加载数据
*/
current(val) { current(val) {
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.params.loadStatus = "more"; this.params.loadStatus = "more";
@ -120,16 +117,16 @@ export default {
} }
}, },
}, },
mounted() {
},
methods: { methods: {
// /**
* 判断当前店铺是否有可评价的商品
*/
commentStatus(val) { commentStatus(val) {
if (this.current == 1) { if (this.current == 1) {
return true; return true;
} else { } else {
let show; let show;
val.orderItems && val.orderItems &&
val.orderItems.forEach((item) => { val.orderItems.forEach((item) => {
if (item.commentStatus == "UNFINISHED") { if (item.commentStatus == "UNFINISHED") {
@ -143,6 +140,9 @@ export default {
} }
}, },
/**
* 点击图片放大或保存
*/
preview(urls, index) { preview(urls, index) {
uni.previewImage({ uni.previewImage({
current: index, current: index,
@ -155,14 +155,27 @@ export default {
}); });
}, },
change(index) { /**
* 点击tab触发
*/
changeTab(index) {
this.current = index; this.current = index;
}, },
changeTab(e) {
/**
* 点击swiper
*/
changeSwiper(e) {
this.current = e.target.current; this.current = e.target.current;
}, },
/**
* 获取订单数据
*/
loadData() { loadData() {
uni.showLoading({}); uni.showLoading({
title: "加载中",
});
getOrderList(this.params).then((res) => { getOrderList(this.params).then((res) => {
uni.hideLoading(); uni.hideLoading();
const orderList = res.data.result.records; const orderList = res.data.result.records;
@ -175,15 +188,25 @@ export default {
} }
}); });
}, },
onCommont(order) {
/**
* 发表评价
*/
talkCommont(order) {
uni.navigateTo({ uni.navigateTo({
url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent( url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent(
JSON.stringify(order) JSON.stringify(order)
)}`, )}`,
}); });
}, },
/**
* 加载已评价数据
*/
loadComments() { loadComments() {
uni.showLoading({}); uni.showLoading({
title: "加载中",
});
getComments(this.params).then((res) => { getComments(this.params).then((res) => {
uni.hideLoading(); uni.hideLoading();
let orderList = res.data.result.records; let orderList = res.data.result.records;
@ -200,19 +223,14 @@ export default {
}, },
]; ];
}); });
this.orderList = this.orderList.concat(orderList); this.orderList = this.orderList.concat(orderList);
this.params.pageNumber += 1; this.params.pageNumber += 1;
}); });
}, },
onAgain(order) {
uni.navigateTo({ /**
url: `./againEvaluate?order=${encodeURIComponent( * 滑到底部加载数据
JSON.stringify(order) */
)}`,
});
},
renderData(index) { renderData(index) {
if (this.params.loadStatus == "noMore") return; if (this.params.loadStatus == "noMore") return;
if (index == 0) { if (index == 0) {
@ -224,13 +242,11 @@ export default {
this.params.comment_status = "WAIT_CHASE"; this.params.comment_status = "WAIT_CHASE";
this.loadComments(); this.loadComments();
} }
if (index == 2) {
this.params.audit_status = "";
this.params.comments_type = "";
this.params.comment_status = "FINISHED";
this.loadComments();
}
}, },
/**
* 评价详情
*/
onDetail(comment) { onDetail(comment) {
uni.navigateTo({ uni.navigateTo({
url: url:

View File

@ -1,5 +1,6 @@
<template> <template>
<view> <view>
<!-- 遍历出评价商品 -->
<view v-for="(sku, index) in order.orderItems" :key="index"> <view v-for="(sku, index) in order.orderItems" :key="index">
<view class="after-sales-goods-detail-view"> <view class="after-sales-goods-detail-view">
<view> <view>
@ -45,7 +46,7 @@
</view> </view>
</view> </view>
<view class="info-evaluate-view"> <view class="info-evaluate-view">
<view class="images-view" @click="beforeUpload(index)"> <view class="images-view">
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload> <u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
</view> </view>
</view> </view>
@ -88,47 +89,45 @@ export default {
data() { data() {
return { return {
storage, storage,
value: "", type: "textarea", // textarea
type: "textarea", border: false, //border
border: false, maxlength: 500, //500
maxlength: 500,
placeholder: placeholder:
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人", "宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
order: {}, order: {}, //
form: { form: {
content: "", content: "", //
goodsId: "", goodsId: "", //id
grade: "GOOD", grade: "GOOD", //
orderItemSn: "", orderItemSn: "", //sn
skuId: "", skuId: "", //skuId
descriptionScore: 5, descriptionScore: 5, //5
serviceScore: 5, serviceScore: 5, //5
deliveryScore: 5, deliveryScore: 5, //5
// // true
// first_comment: true,
//content,grade: 'GOOD',skuId,images:[]
}, },
currentIndex: 0, action: upload, //
action: upload,
}; };
}, },
onLoad(options) { onLoad(options) {
//
this.form.orderItemSn = options.sn; this.form.orderItemSn = options.sn;
this.order = JSON.parse(decodeURIComponent(options.order)); this.order = JSON.parse(decodeURIComponent(options.order));
//
},
mounted() {
this.form.goodsId = this.order.orderItems[0].goodsId; this.form.goodsId = this.order.orderItems[0].goodsId;
this.form.orderItemSn = this.order.orderItems[0].sn; this.form.orderItemSn = this.order.orderItems[0].sn;
this.form.skuId = this.order.orderItems[0].skuId; this.form.skuId = this.order.orderItems[0].skuId;
}, },
methods: { methods: {
beforeUpload(index) {
this.currentIndex = index; /**
}, * 点击评价
onGrade(grade, index) { */
onGrade(grade) {
this.form.grade = grade; this.form.grade = grade;
}, },
/**
* 提交评价
*/
onSubmit() { onSubmit() {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -148,9 +147,12 @@ export default {
}); });
}); });
}, },
/**
* 图片成功后回调
*/
onUploaded(lists) { onUploaded(lists) {
let images = []; let images = [];
console.log(lists);
lists.forEach((item) => { lists.forEach((item) => {
images.push(item.response.result); images.push(item.response.result);
}); });

View File

@ -63,6 +63,9 @@ export default {
this.order = order; this.order = order;
}); });
}, },
/**
* 点击图片放大或保存
*/
preview() { preview() {
// //
if (this.order.elec_file_list.length) { if (this.order.elec_file_list.length) {

View File

@ -23,31 +23,30 @@
<script> <script>
import { sendMobile, smsLogin } from "@/api/login"; import { sendMobile, smsLogin } from "@/api/login";
import { getUserInfo } from "@/api/members"; import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js"; //
import { whetherNavigate } from "@/utils/Foundation"; //
import myVerification from "@/components/verification/verification.vue"; import myVerification from "@/components/verification/verification.vue"; //
import uuid from "@/utils/uuid.modified.js"; import uuid from "@/utils/uuid.modified.js"; // uuid
export default { export default {
components: { components: {
myVerification, myVerification,
}, },
props: ["status"], props: ["status"], //
data() { data() {
return { return {
uuid, uuid,
flage: false, // flage: false, //
codeFlag: true, codeFlag: true, //
// form
codeForm: { codeForm: {
mobile: "", mobile: "", //
code: "", code: "", //
}, },
tips: "", tips: "", //
clientType: "", clientType: "", //
seconds: 60, seconds: 60,
//
codeRules: { codeRules: {
//
mobile: [ mobile: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -57,6 +56,7 @@ export default {
trigger: ["blur"], trigger: ["blur"],
}, },
], ],
//
code: [ code: [
{ {
min: 4, min: 4,
@ -72,6 +72,9 @@ export default {
// onReadyonLoad // onReadyonLoad
mounted() { mounted() {
this.$refs.validateCodeForm.setRules(this.codeRules); this.$refs.validateCodeForm.setRules(this.codeRules);
/**
* 条件编译判断当前客户端类型
*/
//#ifdef H5 //#ifdef H5
this.clientType = "H5"; this.clientType = "H5";
//#endif //#endif
@ -115,6 +118,10 @@ export default {
// //
submit() { submit() {
if (!this.status) { if (!this.status) {
/**
* 用户必须了解
* 用户协议以及隐私政策
*/
uni.showToast({ uni.showToast({
title: "请您阅读并同意用户协议以及隐私政策", title: "请您阅读并同意用户协议以及隐私政策",
duration: 2000, duration: 2000,
@ -125,18 +132,30 @@ export default {
let _this = this; let _this = this;
this.$refs.validateCodeForm.validate((valid) => { this.$refs.validateCodeForm.validate((valid) => {
if (valid) { if (valid) {
/**
* 清空当前账号信息
*/
storage.setHasLogin(false); storage.setHasLogin(false);
storage.setAccessToken(""); storage.setAccessToken("");
storage.setRefreshToken(""); storage.setRefreshToken("");
storage.setUuid(this.uuid.v1()); storage.setUuid(this.uuid.v1());
storage.setUserInfo({}); storage.setUserInfo({});
/**
* 执行登录
*/
smsLogin(this.codeForm, _this.clientType).then((res) => { smsLogin(this.codeForm, _this.clientType).then((res) => {
if (res.data.success) { if (res.data.success) {
storage.setAccessToken(res.data.result.accessToken); storage.setAccessToken(res.data.result.accessToken);
storage.setRefreshToken(res.data.result.refreshToken); storage.setRefreshToken(res.data.result.refreshToken);
/**
* 登录成功后获取个人信息
*/
getUserInfo().then((user) => { getUserInfo().then((user) => {
if (user.data.success) { if (user.data.success) {
/**
* 个人信息存储到缓存userInfo中
*/
storage.setUserInfo(user.data.result); storage.setUserInfo(user.data.result);
storage.setHasLogin(true); storage.setHasLogin(true);
// //
@ -145,34 +164,12 @@ export default {
icon: "none", icon: "none",
}); });
if (getCurrentPages().length > 1) { /**
if ( * 计算出当前router路径
(getCurrentPages().length - 2).route == * 1.如果跳转的链接为登录页面或跳转的链接为空页面则会重新跳转到首页
"pages/passport/login" * 2.都不满足返回跳转页面
) { */
uni.switchTab({ whetherNavigate();
url: "/pages/tabbar/home/index",
});
} else {
if (
!(getCurrentPages().length - 2).route ||
(getCurrentPages().length - 2).route == "undefined"
) {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
} else {
uni.navigateBack({
delta: getCurrentPages().length - 2,
});
}
}
} else {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
}
} else { } else {
uni.switchTab({ uni.switchTab({
url: "/pages/tabbar/home/index", url: "/pages/tabbar/home/index",
@ -184,15 +181,16 @@ export default {
} }
}); });
}, },
//
clickLogin() { clickLogin() {
this.$emit("open", "click"); this.$emit("open", "click");
}, },
/**点击验证码*/
codeChange(text) { codeChange(text) {
console.log(text);
this.tips = text; this.tips = text;
}, },
/** 结束验证码后执行 */
end() {}, end() {},
/**获取验证码 */ /**获取验证码 */
getCode() { getCode() {
@ -219,6 +217,8 @@ export default {
return false; return false;
} }
}, },
//
start() { start() {
this.$u.toast("验证码已发送"); this.$u.toast("验证码已发送");
this.flage = false; this.flage = false;

View File

@ -2,9 +2,9 @@
<div class="form"> <div class="form">
<u-form ref="validateCodeForm"> <u-form ref="validateCodeForm">
<div class="login-list"> <div class="login-list">
<!-- 循环出当前可使用的第三方登录模式 -->
<div class="login-item" v-for="(item,index) in loginList" :key="index"> <div class="login-item" v-for="(item,index) in loginList" :key="index">
<u-icon :color="item.color" size="80" :name="item.icon" @click="toLogin(item)"></u-icon> <u-icon :color="item.color" size="80" :name="item.icon" @click="navigateLogin(item)"></u-icon>
<div>{{item.title}}</div> <div>{{item.title}}</div>
</div> </div>
</div> </div>
@ -15,7 +15,7 @@
<script> <script>
import { webConnect, openIdLogin } from "@/api/connect.js"; import { webConnect, openIdLogin } from "@/api/connect.js";
import { whetherNavigate } from "@/utils/Foundation"; //
import { getUserInfo } from "@/api/members"; import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
@ -48,7 +48,7 @@ export default {
props: ["status"], props: ["status"],
mounted() { mounted() {
//#ifdef APP-PLUS //#ifdef APP-PLUS
//app /**如果是app 加载支持的登录方式*/
let _this = this; let _this = this;
uni.getProvider({ uni.getProvider({
service: "oauth", service: "oauth",
@ -94,7 +94,11 @@ export default {
}); });
}, },
fail: (error) => { fail: (error) => {
console.log("获取登录通道失败", error); uni.showToast({
title: "获取登录通道失败" + error,
duration: 2000,
icon: "none",
});
}, },
}); });
//#endif //#endif
@ -111,21 +115,28 @@ export default {
}, },
methods: { methods: {
/** 根据参数显示登录模块 */
methodFilter(code) { methodFilter(code) {
let way = []; let way = [];
this.loginList.forEach((item) => { this.loginList.forEach((item) => {
code.length != 0 if (code.length != 0) {
? code.forEach((val) => { code.forEach((val) => {
if (item.code == val) { if (item.code == val) {
way.push(item); way.push(item);
} }
}) });
: console.error("error"); } else {
uni.showToast({
title: '配置有误请联系管理员',
duration: 2000,
icon:"none"
});
}
}); });
this.loginList = way; this.loginList = way;
}, },
/**跳转到登录页面 */
toLogin(connectLogin) { navigateLogin(connectLogin) {
if (!this.status) { if (!this.status) {
uni.showToast({ uni.showToast({
title: "请您阅读并同意用户协议以及隐私政策", title: "请您阅读并同意用户协议以及隐私政策",
@ -148,6 +159,8 @@ export default {
this.nonH5OpenId(connectLogin); this.nonH5OpenId(connectLogin);
// #endif // #endif
}, },
//
clickCodeLogin() { clickCodeLogin() {
this.$emit("open", "code"); this.$emit("open", "code");
}, },
@ -169,7 +182,6 @@ export default {
// #endif // #endif
}, },
fail(e) { fail(e) {
console.log(e);
uni.showToast({ uni.showToast({
title: "第三方登录暂不可用!", title: "第三方登录暂不可用!",
icon: "none", icon: "none",
@ -184,15 +196,15 @@ export default {
// //
uni.setStorageSync("nickname", infoRes.userInfo.nickName); uni.setStorageSync("nickname", infoRes.userInfo.nickName);
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl); uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
//openid openiduni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id //openid openiduni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
_this.weixinMPOpenID(res).then((res) => { _this.weixinMPOpenID(res).then((res) => {
//openid使openid //openid使openid
_this.goOpenidLogin("WECHAT_MP"); _this.goOpenidLogin("WECHAT_MP");
}); });
// #endif // #endif
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
_this.goOpenidLogin("APP"); _this.goOpenidLogin("APP");
//#endif //#endif
@ -230,23 +242,17 @@ export default {
title: "第三方登录成功!", title: "第三方登录成功!",
icon: "none", icon: "none",
}); });
//
getUserInfo().then((user) => { getUserInfo().then((user) => {
storage.setUserInfo(user.data.result); storage.setUserInfo(user.data.result);
storage.setHasLogin(true); storage.setHasLogin(true);
}); });
getCurrentPages().length > 1 whetherNavigate()
? uni.navigateBack({
delta: getCurrentPages().length - 2,
})
: uni.switchTab({
url: "/pages/tabbar/home/index",
});
} }
}); });
}, },
//openid //openid
async weixinMPOpenID(res) { async weixinMPOpenID(res) {
let openId = "";
await miniProgramLogin(res.code).then((res) => { await miniProgramLogin(res.code).then((res) => {
uni.setStorageSync("openid", res.data); uni.setStorageSync("openid", res.data);
}); });

View File

@ -1,11 +1,7 @@
<template> <template>
<view class="comment"> <view class="comment">
<!-- <view class="status_bar" -->
<!--</view> -->
<view class="top-tab"> <view class="top-tab">
<!-- <view class="good-comment">商品好评率{{ grade || "100" }}%</view> -->
<view class="tab-btn" :v-if="commentDetail"> <view class="tab-btn" :v-if="commentDetail">
<!-- <view v-for="item in selectObj" :key="item.id" @click="select(item.id)" :class="{cur:selectIndex===item.id}">{{item.text}}</view> -->
<view @click="select(0)" :class="{ cur: selectIndex == 0 }">全部</view> <view @click="select(0)" :class="{ cur: selectIndex == 0 }">全部</view>
<view @click="select(1)" :class="{ cur: selectIndex == 1 }">好评{{ commentDetail.good }}</view> <view @click="select(1)" :class="{ cur: selectIndex == 1 }">好评{{ commentDetail.good }}</view>
<view @click="select(2)" :class="{ cur: selectIndex == 2 }">中评{{ commentDetail.moderate }}</view> <view @click="select(2)" :class="{ cur: selectIndex == 2 }">中评{{ commentDetail.moderate }}</view>
@ -13,25 +9,19 @@
<view @click="select(4)" :class="{ cur: selectIndex == 4 }">有图{{ commentDetail.haveImage }}</view> <view @click="select(4)" :class="{ cur: selectIndex == 4 }">有图{{ commentDetail.haveImage }}</view>
</view> </view>
</view> </view>
<!-- 评价 --> <!-- 评价 -->
<div class="goodsBoxOver"> <div class="goodsBoxOver">
<scroll-view :style="{ height: DivHeight }" lower-threshold="150" @scrolltolower="loadmore()" scroll-anchoring enableBackToTop="true" scroll-y class="scoll-page"> <div class="scoll-page">
<view class="eva-section"> <view class="eva-section">
<div class="nodata" v-if="commDetail.length < 1"> <div class="empty" v-if="commDetail.length < 1">
<view> <view>
<image style="height: 240rpx; width: 320rpx" src="/static/nodata.png" alt="" /> <u-empty mode="message" text="赞无评论"></u-empty>
</view>
<view>
<p>暂无评价</p>
</view> </view>
</div> </div>
<view class="eva-box" v-for="(item, index) in commDetail" :key="index"> <view class="eva-box" v-for="(item, index) in commDetail" :key="index">
<view class="section-info"> <view class="section-info">
<image class="portrait" :src="item.memberProfile || '/static/missing-face.png'" mode="aspectFill"></image> <image class="portrait" :src="item.memberProfile || '/static/missing-face.png'" mode="aspectFill"></image>
<view class="star-con"> <view class="star-content">
<text class="name">{{ item.memberName | noPassByName }}</text> <text class="name">{{ item.memberName | noPassByName }}</text>
<text class="time">{{ item.createTime }}</text> <text class="time">{{ item.createTime }}</text>
</view> </view>
@ -44,48 +34,30 @@
</view> </view>
</view> </view>
<view class="section-contant"> <view class="section-contant">
<div class="con">{{ item.content }}</div> <div class="content">{{ item.content }}</div>
<view class="img"> <view class="img">
<!-- 循环出用户评价的图片 -->
<u-image width="140rpx" height="140rpx" v-if="item.image" v-for="(img, i) in splitImg(item.image)" :src="img" :key="i" @click="preview(splitImg(item.image), i)"> <u-image width="140rpx" height="140rpx" v-if="item.image" v-for="(img, i) in splitImg(item.image)" :src="img" :key="i" @click="preview(splitImg(item.image), i)">
</u-image> </u-image>
</view> </view>
<view class="bot"> <view class="bot">
<text class="attr">{{ item.goodsName }} - {{ gradeList[item.grade] }}</text> <text class="attr">{{ item.goodsName }} - {{ gradeList[item.grade] }}</text>
<!-- <text class="zan" :class="{cur:item.isZan}" @click="dianzan(index)">{{item.zan}}</text> -->
</view> </view>
</view> </view>
<view class="addComment commentStyle" v-if="item.additional_comment">
<div>
<b>追加评价:</b>
<span class="addCommentSpan">{{
item.additional_comment.content
}}</span>
<view class="img">
<image v-for="(item, addIndex) in item.additional_comment.images" :src="item" :key="addIndex" @click="preview(item)"></image>
</view>
</div>
</view>
<view class="commentStyle" v-if="item.reply"> <view class="commentStyle" v-if="item.reply">
商家回复 商家回复
<span class="addCommentSpan">{{ item.reply }}</span> <span class="addCommentSpan">{{ item.reply }}</span>
<view class="img"> <view class="img">
<u-image width="140rpx" height="140rpx" v-if="item.replyImage" v-for="(replyImg, replyIndex) in splitImg(replyImg.image)" :src="replyImg" :key="replyIndex" <!-- 循环出商家回复评价的图片 -->
<u-image width="140rpx" height="140rpx" v-if="item.replyImage" v-for="(replyImg, replyIndex) in splitImg(item.replyImage)" :src="replyImg" :key="replyIndex"
@click="preview(splitImg( item.replyImage), index)"> @click="preview(splitImg( item.replyImage), index)">
</u-image> </u-image>
</view> </view>
</view> </view>
<view class="commentStyle" v-if="item.additional_comment && item.additional_comment.reply">
商家回复:
<span class="addCommentSpan">{{
item.additional_comment.reply.content
}}</span>
</view>
</view> </view>
<u-loadmore bg-color="transparent" style="margin:40rpx 0" :status="status" @loadmore="loadmore()" icon-type="iconType" />
</view> </view>
</div>
<!-- <u-loadmore :status="status" @loadmore="loadmore()" icon-type="iconType" /> -->
</scroll-view>
</div> </div>
</view> </view>
</template> </template>
@ -93,23 +65,14 @@
<script> <script>
// import { getGoodsDetail } from '@/api/goods.js'; // import { getGoodsDetail } from '@/api/goods.js';
import * as membersApi from "@/api/members.js"; import * as membersApi from "@/api/members.js";
export default { export default {
data() { data() {
return { return {
header: { status: "loadmore", //
top: 0, commentDetail: "", //
height: 50,
},
DivHeight: "",
status: "loadmore",
commentObj: {},
selectObj: [],
commentDetail: "",
selectIndex: "0", // selectIndex: "0", //
imgUrl: "", params: { //
previewImgFlag: false,
//
params: {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
grade: "", grade: "",
@ -122,21 +85,28 @@ export default {
}, },
// //
commDetail: [], commDetail: [],
dataTotal: 0, dataTotal: 0, //total
opid: "", //id
opid: "",
grade: "100%",
}; };
}, },
async onLoad(options) { async onLoad(options) {
this.grade = options.grade;
this.getGoodsCommentsFun(options.id); this.getGoodsCommentsFun(options.id);
this.getGoodsCommentsNum(options.id); this.getGoodsCommentsNum(options.id);
this.opid = options.id; this.opid = options.id;
}, },
mounted() {},
/**
* 触底加载
*/
onReachBottom() {
this.params.pageNumber++;
this.getGoodsCommentsFun(this.opid);
},
methods: { methods: {
/**
* 切割图像
*/
splitImg(val) { splitImg(val) {
if (val && val.split(",")) { if (val && val.split(",")) {
return val.split(","); return val.split(",");
@ -146,12 +116,10 @@ export default {
return false; return false;
} }
}, },
loadmore() {
this.params.pageNumber++;
this.getGoodsCommentsFun(this.opid);
},
// /**
* 获取商品评论
*/
getGoodsCommentsFun(id) { getGoodsCommentsFun(id) {
this.status = "loading"; this.status = "loading";
// getGoodsComments // getGoodsComments
@ -165,13 +133,14 @@ export default {
return false; return false;
} }
this.commDetail = this.commDetail.concat(res.data.result.records); this.commDetail = this.commDetail.concat(res.data.result.records);
console.log(this.commDetail);
this.dataTotal = res.data.result.total; this.dataTotal = res.data.result.total;
this.status = "loadmore"; this.status = "loadmore";
}); });
}, },
/**
* 获取商品评论数
*/
getGoodsCommentsNum(id) { getGoodsCommentsNum(id) {
membersApi.getGoodsCommentsCount(id).then((res) => { membersApi.getGoodsCommentsCount(id).then((res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
@ -179,10 +148,12 @@ export default {
} }
}); });
}, },
/**
* 顶部筛选条件
*/
select(index) { select(index) {
//
this.selectIndex = index; this.selectIndex = index;
console.log(this.selectIndex);
this.params.grade = ["", "GOOD", "MODERATE", "WORSE", ""][ this.params.grade = ["", "GOOD", "MODERATE", "WORSE", ""][
this.selectIndex this.selectIndex
]; ];
@ -197,27 +168,14 @@ export default {
grade: "", grade: "",
}; };
} }
//
this.getGoodsCommentsFun(this.opid); this.getGoodsCommentsFun(this.opid);
}, },
//
back() { /**
uni.navigateTo({ * 点击图片放大或保存
url: "./product?id=" + this.opid, */
});
},
//
dianzan(index) {
if (this.commentObj.item[index].isZan) {
this.commentObj.item[index].zan--;
} else {
this.commentObj.item[index].zan++;
}
this.commentObj.item[index].isZan = !this.commentObj.item[index].isZan;
},
//
preview(urls, index) { preview(urls, index) {
console.log(urls);
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: urls, urls: urls,
@ -240,10 +198,6 @@ export default {
}, },
}); });
}, },
close() {
this.previewImgFlag = false;
this.imgUrl = "";
},
}, },
}; };
</script> </script>
@ -285,123 +239,14 @@ export default {
overflow-y: scroll; overflow-y: scroll;
} }
.headerBox {
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
font-size: 34rpx;
.left,
.right {
position: absolute;
width: max-content;
height: max-content;
top: 0;
bottom: 0;
margin: auto;
}
.left {
float: left;
top: 0;
bottom: 0;
left: 20rpx;
}
.right {
float: right;
right: 20rpx;
}
}
page { page {
background: #f7f7f7; background: #f7f7f7;
} }
.preview-img {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
/* background: rgba(0,0,0,0.5); */
background-repeat: no-repeat;
background-color: rgba(0, 0, 0, 0.5);
background-position: center;
background-size: 90% auto;
z-index: 1000;
.close {
position: absolute;
width: 100rpx;
height: 100rpx;
text-align: center;
line-break: 50rpx;
/* background: rgba(0,0,0,0.5); */
font-size: 80rpx;
color: #fff;
top: 100rpx;
}
image {
/* width: 100%; */
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}
// .goodsBoxOver{
// height: calc(100vh - 200rpx) ;
// }
.comment { .comment {
color: #333; color: #333;
background: #f7f7f7; background: #f7f7f7;
overflow: hidden; overflow: hidden;
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
background: #fff;
z-index: 999;
display: flex;
justify-content: space-between;
height: 90rpx;
line-height: 90rpx;
font-size: 30rpx;
transition: all 0.5s;
.back {
width: 90rpx;
background: url(/static/search/back.png);
background-size: 100%;
}
.share {
width: 90rpx;
background: url(/static/search/back.png);
background-size: 100%;
}
}
.header-line {
height: 2px;
background: #f2f2f2;
position: fixed;
top: 90rpx;
left: 0;
right: 0;
z-index: 999;
}
.header-line1 {
height: 20rpx;
position: static;
}
.top-tab { .top-tab {
background: #fff; background: #fff;
@ -412,11 +257,6 @@ page {
padding: 0 30rpx 0 30rpx; padding: 0 30rpx 0 30rpx;
font-size: 24rpx; font-size: 24rpx;
.good-comment {
text-align: right;
color: #a5a5a5;
}
.tab-btn { .tab-btn {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
@ -449,7 +289,7 @@ page {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
/* star */ /* star */
.star-con { .star-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -493,7 +333,7 @@ page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.con { .content {
font-size: 24rpx; font-size: 24rpx;
line-height: 46rpx; line-height: 46rpx;
font-weight: 400; font-weight: 400;
@ -519,7 +359,7 @@ page {
color: $font-color-light; color: $font-color-light;
margin-top: 20rpx; margin-top: 20rpx;
.zan { .good {
color: #333; color: #333;
position: relative; position: relative;
@ -541,31 +381,13 @@ page {
} }
} }
} }
.reply {
padding: 16rpx 30rpx;
background: #f8f8fe;
font-size: 24rpx;
border-radius: 5px;
margin-top: 20rpx;
text {
color: #999;
line-height: 48rpx;
}
}
} }
} }
} }
.nodata { .empty {
padding-top: 300rpx; padding-top: 300rpx;
color: #999999; color: #999999;
text-align: center; text-align: center;
img {
width: 346rpx;
height: 304rpx;
}
} }
</style> </style>

View File

@ -17,7 +17,7 @@
</view> </view>
<view class="section-contant"> <view class="section-contant">
<u-read-more ref="uReadMore" :color="lightColor"> <u-read-more ref="uReadMore" :color="lightColor">
<rich-text @load="parseLoaded" :nodes="commItem.content " class="con"></rich-text> <rich-text @load="parseLoaded" :nodes="commItem.content " class="con"></rich-text>
</u-read-more> </u-read-more>
<scroll-view scroll-x class="scroll-x" v-if="commItem.image"> <scroll-view scroll-x class="scroll-x" v-if="commItem.image">
<view class="img"> <view class="img">
@ -37,7 +37,7 @@
</div> </div>
</view> </view>
<!-- 查看全部评价按钮 --> <!-- 查看全部评价按钮 -->
<view v-if="commDetail && commDetail.records && commDetail.records.length > 0" class="eva-section-btn" @click="toComment(goodsDetail.goodsId, goodsDetail.grade)" > <view v-if="commDetail && commDetail.records && commDetail.records.length > 0" class="eva-section-btn" @click="toComment(goodsDetail.goodsId, goodsDetail.grade)">
<text>查看全部评价</text> <text>查看全部评价</text>
</view> </view>
</view> </view>
@ -48,7 +48,7 @@ import * as API_Members from "@/api/members.js";
export default { export default {
data() { data() {
return { return {
lightColor:this.$lightColor, lightColor: this.$lightColor,
// //
commDetail: [], commDetail: [],
// //
@ -81,7 +81,9 @@ export default {
url: `/pages/product/comment?id=${id}&grade=${grade}`, url: `/pages/product/comment?id=${id}&grade=${grade}`,
}); });
}, },
// /**
* 点击图片放大或保存
*/
previewImg(url, index) { previewImg(url, index) {
uni.previewImage({ uni.previewImage({
urls: url, urls: url,

View File

@ -1,5 +1,6 @@
/** /**
* 一些常用的基础方法 * 一些常用的基础方法
* whetherNavigate 登录后跳转判断
* unixToDate 将unix时间戳转换为指定格式 * unixToDate 将unix时间戳转换为指定格式
* dateToUnix 将时间转unix时间戳 * dateToUnix 将时间转unix时间戳
* deepClone 对一个对象进行深拷贝 * deepClone 对一个对象进行深拷贝
@ -8,6 +9,39 @@
* randomString 随机生成指定长度的字符串 * randomString 随机生成指定长度的字符串
*/ */
/**
* 登录后跳转判断
* 计算出当前router路径
* 1.如果跳转的链接为登录页面或跳转的链接为空页面则会重新跳转到首页
* 2.都不满足返回跳转页面
*/
export function whetherNavigate() {
if (getCurrentPages().length > 1) {
if ((getCurrentPages().length - 2).route == "pages/passport/login") {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
} else {
if (
!(getCurrentPages().length - 2).route ||
(getCurrentPages().length - 2).route == "undefined"
) {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
} else {
uni.navigateBack({
delta: getCurrentPages().length - 2,
});
}
}
} else {
uni.switchTab({
url: "/pages/tabbar/home/index",
});
}
}
/** /**
* 将unix时间戳转换为指定格式 * 将unix时间戳转换为指定格式
* @param unix 时间戳 * @param unix 时间戳
@ -15,23 +49,30 @@
* @returns {*|string} * @returns {*|string}
*/ */
export function unixToDate(unix, format) { export function unixToDate(unix, format) {
if (!unix) return unix if (!unix) return unix;
let _format = format || 'yyyy-MM-dd hh:mm:ss' let _format = format || "yyyy-MM-dd hh:mm:ss";
const d = new Date(unix) const d = new Date(unix);
const o = { const o = {
'M+': d.getMonth() + 1, "M+": d.getMonth() + 1,
'd+': d.getDate(), "d+": d.getDate(),
'h+': d.getHours(), "h+": d.getHours(),
'm+': d.getMinutes(), "m+": d.getMinutes(),
's+': d.getSeconds(), "s+": d.getSeconds(),
'q+': Math.floor((d.getMonth() + 3) / 3), "q+": Math.floor((d.getMonth() + 3) / 3),
S: d.getMilliseconds() S: d.getMilliseconds(),
} };
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length)) if (/(y+)/.test(_format))
for (const k in o) _format = _format.replace(
if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : RegExp.$1,
(('00' + o[k]).substr(('' + o[k]).length))) (d.getFullYear() + "").substr(4 - RegExp.$1.length)
return _format );
for (const k in o)
if (new RegExp("(" + k + ")").test(_format))
_format = _format.replace(
RegExp.$1,
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
);
return _format;
} }
/** /**
@ -40,18 +81,20 @@ export function unixToDate(unix, format) {
* @returns {number} * @returns {number}
*/ */
export function dateToUnix(date) { export function dateToUnix(date) {
let newStr = date.replace(/:/g, '-') let newStr = date.replace(/:/g, "-");
newStr = newStr.replace(/ /g, '-') newStr = newStr.replace(/ /g, "-");
const arr = newStr.split('-') const arr = newStr.split("-");
const datum = new Date(Date.UTC( const datum = new Date(
arr[0], Date.UTC(
arr[1] - 1, arr[0],
arr[2], arr[1] - 1,
arr[3] - 8 || -8, arr[2],
arr[4] || 0, arr[3] - 8 || -8,
arr[5] || 0 arr[4] || 0,
)) arr[5] || 0
return parseInt(datum.getTime() / 1000) )
);
return parseInt(datum.getTime() / 1000);
} }
/** /**
@ -60,8 +103,8 @@ export function dateToUnix(date) {
* @returns {string} * @returns {string}
*/ */
export function formatPrice(price) { export function formatPrice(price) {
if (typeof price !== 'number') return price if (typeof price !== "number") return price;
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',') return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
} }
/** /**
@ -71,11 +114,11 @@ export function formatPrice(price) {
* @returns {*} * @returns {*}
*/ */
export function secrecyMobile(mobile) { export function secrecyMobile(mobile) {
mobile = String(mobile) mobile = String(mobile);
if (!/\d{11}/.test(mobile)) { if (!/\d{11}/.test(mobile)) {
return mobile return mobile;
} }
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3') return mobile.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3");
} }
/** /**
@ -84,13 +127,14 @@ export function secrecyMobile(mobile) {
* @returns {string} * @returns {string}
*/ */
export function randomString(length = 32) { export function randomString(length = 32) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' const chars =
const maxPos = chars.length "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let _string = '' const maxPos = chars.length;
for (let i = 0; i < length; i++) { let _string = "";
_string += chars.charAt(Math.floor(Math.random() * maxPos)) for (let i = 0; i < length; i++) {
} _string += chars.charAt(Math.floor(Math.random() * maxPos));
return _string }
return _string;
} }
/** /**
@ -100,16 +144,16 @@ export function randomString(length = 32) {
*/ */
export function countTimeDown(seconds) { export function countTimeDown(seconds) {
const leftTime = (time) => { const leftTime = (time) => {
if (time < 10) time = '0' + time if (time < 10) time = "0" + time;
return time + '' return time + "";
} };
return { return {
day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)), day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)),
hours: leftTime(parseInt(seconds / 60 / 60 % 24, 10)), hours: leftTime(parseInt((seconds / 60 / 60) % 24, 10)),
minutes: leftTime(parseInt(seconds / 60 % 60, 10)), minutes: leftTime(parseInt((seconds / 60) % 60, 10)),
seconds: leftTime(parseInt(seconds % 60, 10)) seconds: leftTime(parseInt(seconds % 60, 10)),
} };
} }
/** /**
@ -117,16 +161,25 @@ export function countTimeDown(seconds) {
* @returns {number} * @returns {number}
*/ */
export function theNextDayTime() { export function theNextDayTime() {
const nowDate = new Date() const nowDate = new Date();
const time = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() + 1, 0, 0, 0).getTime() - nowDate.getTime() const time =
return parseInt(time / 1000) new Date(
nowDate.getFullYear(),
nowDate.getMonth(),
nowDate.getDate() + 1,
0,
0,
0
).getTime() - nowDate.getTime();
return parseInt(time / 1000);
} }
module.exports = { module.exports = {
unixToDate, unixToDate,
dateToUnix, dateToUnix,
formatPrice, formatPrice,
secrecyMobile, secrecyMobile,
randomString, randomString,
countTimeDown, countTimeDown,
theNextDayTime theNextDayTime,
} whetherNavigate
};