·修改部分页面数据冗余
parent
23804939eb
commit
7f4212755d
|
@ -35,7 +35,7 @@ export function getRegionsById(id = 0) {
|
|||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* 文件上传地址
|
||||
* @type {string}
|
||||
*/
|
||||
export const upload =api.common+'/upload/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
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的评论列表
|
||||
|
|
|
@ -66,9 +66,10 @@ export function getLogisticsMessages(params) {
|
|||
|
||||
|
||||
/**
|
||||
* 获取版本更新信息
|
||||
* TODO 获取版本更新信息 暂无此功能。后续会优化更新
|
||||
* @param params
|
||||
* @returns {AxiosPromise}
|
||||
*
|
||||
*/
|
||||
export function getAppVersionList(params) {
|
||||
params = params || {};
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
const name = 'lilishop'
|
||||
const name = "lilishop";
|
||||
export default {
|
||||
name: name,
|
||||
schemeLink: `${name}://`, //唤起app地址
|
||||
schemeLink: `${name}://`, //唤起app地址
|
||||
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址
|
||||
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址
|
||||
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
|
||||
appSecret :"6dfbe0c72380dce5d49d65b3c91059b1" //可在 manifest.json 查看
|
||||
appSecret: "6dfbe0c72380dce5d49d65b3c91059b1", //可在 manifest.json 查看
|
||||
aMapKey: "d649892b3937a5ad20b76dacb2bcb5bd", //在高德中申请web端key
|
||||
};
|
||||
|
|
35
pages.json
35
pages.json
|
@ -213,14 +213,6 @@
|
|||
"navigationBarTitleText": "面容登录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "set/securityCenter/deviceManage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设备管理"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"path": "set/securityCenter/editPassword",
|
||||
"style": {
|
||||
|
@ -284,12 +276,7 @@
|
|||
"navigationBarTitleText": "我的积分"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "point/pointDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分明细"
|
||||
}
|
||||
}, {
|
||||
{
|
||||
"path": "msgTips/main",
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息中心"
|
||||
|
@ -492,12 +479,7 @@
|
|||
"navigationBarTitleText": "优惠券"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "coupon/couponIntro",
|
||||
"style": {
|
||||
"navigationBarTitleText": "优惠券说明"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "coupon/couponCenter",
|
||||
"style": {
|
||||
|
@ -594,24 +576,13 @@
|
|||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "evaluate/evaluateInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评价介绍"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "evaluate/evaluateDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "评价详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "evaluate/againEvaluate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "追加评价"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "evaluate/releaseEvaluate",
|
||||
"style": {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<template>
|
||||
<view class="coupon-center">
|
||||
<swiper :current="tabIndex" class="swiper-box" @change="ontabchange">
|
||||
|
||||
<swiper-item @touchmove.stop class="swiper-item" v-for="tab in categoryIndexData" :key="tab.category_id">
|
||||
<swiper class="swiper-box">
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore">
|
||||
<u-empty mode="coupon" text="没有优惠券了" v-if="nomsg"></u-empty>
|
||||
<view v-else class="coupon-item" v-for="(item, index) in list" :key="index">
|
||||
<u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty>
|
||||
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="left">
|
||||
<view class="wave-line">
|
||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||
</view>
|
||||
<view class="msg">
|
||||
<view class="message">
|
||||
<view>
|
||||
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
|
||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||
<span v-else>{{ item.price }}元</span>
|
||||
</view>
|
||||
|
@ -22,11 +22,11 @@
|
|||
</view>
|
||||
<view class="right">
|
||||
<view>
|
||||
<!-- 根据scopeType 判断是否是 平台、品类或店铺 -->
|
||||
<view v-if="item.scopeType">
|
||||
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'">全平台</span>
|
||||
<span v-if="item.scopeType == 'PORTION_CATEGORY'">仅限品类</span>
|
||||
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用</view>
|
||||
|
||||
</view>
|
||||
<view>有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
||||
</view>
|
||||
|
@ -47,53 +47,53 @@
|
|||
<script>
|
||||
import { receiveCoupons } from "@/api/members.js";
|
||||
import { getAllCoupons } from "@/api/promotions.js";
|
||||
import { getCategoryIndexData } from "@/api/home.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loadStatus: "more",
|
||||
nomsg: false,
|
||||
list: [],
|
||||
loadStatus: "more", //下拉状态
|
||||
whetherEmpty: false, //是否为空
|
||||
couponList: [], // 优惠券列表
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
status: 1,
|
||||
},
|
||||
storeId: "",
|
||||
categoryIndexData: [],
|
||||
currentLeft: 0,
|
||||
tabIndex: 0,
|
||||
storeId: "", //店铺 id
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.storeId = option.storeId;
|
||||
this.getCoupon();
|
||||
this.getTabbar();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
//下拉刷新
|
||||
console.log("refresh");
|
||||
this.params.pageNumber = 1;
|
||||
this.list = [];
|
||||
this.couponList = [];
|
||||
this.getCoupon();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取当前优惠券
|
||||
*/
|
||||
getCoupon() {
|
||||
//全部优惠券
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
if (this.storeId) {
|
||||
getAllCoupons({ storeId: this.storeId ,...this.params })
|
||||
let submitData = { ...this.params };
|
||||
// 判断当前是否有店铺
|
||||
this.storeId ? (submitData = { ...this.params, storeId: this.storeId }): "",
|
||||
getAllCoupons(submitData)
|
||||
.then((res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.statusCode == 200) {
|
||||
if (res.data.code == 200) {
|
||||
// 如果请求成功,展示数据并进行展示
|
||||
let data = res.data.result;
|
||||
if (data.total == 0) {
|
||||
this.nomsg = true;
|
||||
// 当本次请求数据为空展示空信息
|
||||
this.whetherEmpty = true;
|
||||
} else {
|
||||
this.list.push(...data.records);
|
||||
this.couponList.push(...data.records);
|
||||
this.loadStatus = "noMore";
|
||||
}
|
||||
}
|
||||
|
@ -101,33 +101,11 @@ export default {
|
|||
.catch((err) => {
|
||||
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) {
|
||||
//领取优惠券
|
||||
receiveCoupons(item.id).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
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() {
|
||||
if (this.loadStatus != "noMore") {
|
||||
this.params.pageNumber++;
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
|
@ -201,7 +146,7 @@ page {
|
|||
.coupon-center {
|
||||
height: 100%;
|
||||
|
||||
.list-scroll-content {
|
||||
.couponList-scroll-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
@ -247,7 +192,7 @@ page {
|
|||
width: 260rpx;
|
||||
background-color: $light-color;
|
||||
position: relative;
|
||||
.msg {
|
||||
.message {
|
||||
color: $font-color-white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
||||
}}使用</view>
|
||||
<view class="text">• 有效期至:{{coupon.endTime}}</view>
|
||||
|
||||
|
||||
</view>
|
||||
<button class="btn" @click="gostorePage" v-if="coupon.used_status==0">立即使用</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -32,34 +32,16 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
customStyle: {
|
||||
backgroundColor: this.lightColor,
|
||||
},
|
||||
coupon: {},
|
||||
coupon: {}, //优惠券数据
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
page,
|
||||
.content {
|
||||
// background: $main-color;
|
||||
|
@ -140,9 +122,5 @@ page,
|
|||
line-height: 2em;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 140rpx 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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>
|
|
@ -1,18 +1,14 @@
|
|||
<template>
|
||||
<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 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="left">
|
||||
<view class="wave-line">
|
||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||
</view>
|
||||
<view class="msg">
|
||||
<view class="message">
|
||||
<view>
|
||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.discount }}折</span>
|
||||
<span v-else>{{ item.price }}元</span>
|
||||
|
@ -41,51 +37,31 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
useCoupon,
|
||||
getMemberCouponList,
|
||||
getMemberCanUse,
|
||||
} from "@/api/trade.js";
|
||||
import { useCoupon, getMemberCanUse } from "@/api/trade.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
list: [
|
||||
{
|
||||
name: "可用优惠券",
|
||||
},
|
||||
{
|
||||
name: "不可用优惠券",
|
||||
},
|
||||
],
|
||||
curNow: "",
|
||||
couponsList: [],
|
||||
disabledCouponsList: [],
|
||||
couponsList: [], //优惠券集合
|
||||
params: {
|
||||
memberCouponStatus: "NEW",
|
||||
//传参
|
||||
memberCouponStatus: "NEW", //优惠券状态
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
scopeId: "",
|
||||
storeId: "",
|
||||
totalPrice: "",
|
||||
// endTime: this.$u.timeFormat(new Date().getTime(),'yyyy-mm-dd hh:MM:ss')
|
||||
scopeId: "", //商品skuid
|
||||
storeId: "", //店铺id
|
||||
totalPrice: "", //价格
|
||||
},
|
||||
way: [],
|
||||
routerVal: "",
|
||||
routerVal: "", //上级传参
|
||||
};
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pageNumber++;
|
||||
this.getAllCouponsFun();
|
||||
},
|
||||
/**
|
||||
* 赋值
|
||||
*/
|
||||
onLoad(val) {
|
||||
this.routerVal = val;
|
||||
this.params.scopeId = val.skuId;
|
||||
this.params.storeId = val.storeId;
|
||||
if (val.type) {
|
||||
this.params.endTime = new Date().getTime();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
uni.getStorage({
|
||||
|
@ -98,20 +74,21 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 获取优惠券数量
|
||||
/**
|
||||
* 获取优惠券数量
|
||||
*/
|
||||
getCoupons() {
|
||||
getMemberCanUse(this.params).then((res) => {
|
||||
if (res.data.success) {
|
||||
|
||||
|
||||
this.couponsList = res.data.result.records;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 领取优惠券
|
||||
async clickWay(coupon) {
|
||||
/**
|
||||
* 领取优惠券
|
||||
*/
|
||||
clickWay(coupon) {
|
||||
useCoupon({
|
||||
memberCouponId: coupon.id,
|
||||
used: true,
|
||||
|
@ -128,139 +105,18 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
submitback() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
// 获取商品优惠券
|
||||
getAllCouponsFun() {},
|
||||
|
||||
sectionChange(index) {
|
||||
this.curNow = index;
|
||||
},
|
||||
|
||||
change(index) {
|
||||
this.current = index;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.nomore {
|
||||
.empty {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.selectBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
background: #f9f9f9;
|
||||
|
||||
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 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -272,7 +128,7 @@ export default {
|
|||
width: 260rpx;
|
||||
background-color: $light-color;
|
||||
position: relative;
|
||||
.msg {
|
||||
.message {
|
||||
color: $font-color-white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
<template>
|
||||
<view class="b-content">
|
||||
<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
|
||||
}}</text></view>
|
||||
</view>
|
||||
<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">
|
||||
<!-- 空白页 -->
|
||||
<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="wave-line">
|
||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
||||
</view>
|
||||
<view class="msg">
|
||||
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}折</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="message">
|
||||
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}折</view>
|
||||
<view class="price" v-else>{{ coupon.price }}元</view>
|
||||
<view class="sub-price">满{{ coupon.consumeThreshold | unitPrice }}可用</view>
|
||||
</view>
|
||||
<view class="circle circle-top"></view>
|
||||
|
@ -43,20 +42,20 @@
|
|||
<u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon>
|
||||
</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-2" v-if="coupon.used_status == 1">将过期</text>
|
||||
</view>
|
||||
<image class="no-icon" v-if="tabIndex == 1" src="@/static/img/used.png"></image>
|
||||
<image class="no-icon" v-if="tabIndex == 2" src="@/pages/floor/imgs/overdue.png"></image>
|
||||
<view class="receive" v-if="tabIndex == 0" @click="nowUse(coupon)">
|
||||
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
||||
<image class="no-icon" v-if="navIndex == 2" src="@/pages/floor/imgs/overdue.png"></image>
|
||||
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
||||
<text>立即</text><br />
|
||||
<text>使用</text>
|
||||
</view>
|
||||
<view class="bg-quan"> 券 </view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more :status="tabItem.loadStatus"></uni-load-more>
|
||||
<uni-load-more :status="navItem.loadStatus"></uni-load-more>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
@ -69,8 +68,9 @@ import { getMemberCoupons } from "@/api/members.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabCurrentIndex: 0,
|
||||
tabCurrentIndex: 0, //tab栏下标默认为0 未使用
|
||||
navList: [
|
||||
//每个tab存储的信息
|
||||
{
|
||||
text: "未使用",
|
||||
loadStatus: "more",
|
||||
|
@ -81,7 +81,7 @@ export default {
|
|||
pageSize: 10,
|
||||
status: 1,
|
||||
},
|
||||
nomsg: false,
|
||||
wheterEmpty: false,
|
||||
},
|
||||
{
|
||||
text: "已使用",
|
||||
|
@ -93,7 +93,7 @@ export default {
|
|||
pageSize: 10,
|
||||
status: 2,
|
||||
},
|
||||
nomsg: false,
|
||||
wheterEmpty: false,
|
||||
},
|
||||
{
|
||||
text: "已过期",
|
||||
|
@ -105,40 +105,37 @@ export default {
|
|||
pageSize: 10,
|
||||
status: 3,
|
||||
},
|
||||
nomsg: false,
|
||||
wheterEmpty: false,
|
||||
},
|
||||
],
|
||||
couponList: [],
|
||||
couponList: [], //优惠券列表
|
||||
};
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/cart/coupon/couponIntro",
|
||||
});
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// this.tabCurrentIndex = 0;
|
||||
this.getData();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
let index = this.tabCurrentIndex;
|
||||
this.navList[index].params.pageNumber = 1;
|
||||
this.navList[index].dataList = [];
|
||||
this.getData();
|
||||
},
|
||||
|
||||
watch: {
|
||||
/**
|
||||
* 监听切换顶部tab栏实现刷新数据
|
||||
*/
|
||||
tabCurrentIndex(val) {
|
||||
if (this.navList[val].dataList.length == 0) this.getData();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
//顶部tab点击
|
||||
tabClick(index) {
|
||||
/**
|
||||
* 顶部tab点击
|
||||
*/
|
||||
handleTabClick(index) {
|
||||
this.tabCurrentIndex = index;
|
||||
// this.loadData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 读取优惠券
|
||||
*/
|
||||
getData() {
|
||||
//读取优惠券
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
|
@ -149,7 +146,7 @@ export default {
|
|||
let data = res.data.result.records;
|
||||
if (data.length == 0) {
|
||||
if (res.data.pageNumber == 1) {
|
||||
this.navList[index].nomsg = true;
|
||||
this.navList[index].wheterEmpty = true;
|
||||
} else {
|
||||
this.navList[index].loadStatus = "noMore";
|
||||
}
|
||||
|
@ -163,9 +160,17 @@ export default {
|
|||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换tab
|
||||
*/
|
||||
changeTab(e) {
|
||||
this.tabCurrentIndex = e.target.current;
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载数据
|
||||
*/
|
||||
loadData() {
|
||||
let index = this.tabCurrentIndex;
|
||||
if (this.navList[index].loadStatus != "noMore") {
|
||||
|
@ -173,10 +178,11 @@ export default {
|
|||
this.getData();
|
||||
}
|
||||
},
|
||||
nowUse(item) {
|
||||
console.log(item)
|
||||
return
|
||||
//立即使用
|
||||
|
||||
/**
|
||||
* 立即使用优惠券
|
||||
*/
|
||||
useItNow(item) {
|
||||
if (item.storeId) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
||||
|
@ -186,9 +192,11 @@ export default {
|
|||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 优惠券详情
|
||||
*/
|
||||
couponDetail(item) {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
|
@ -199,12 +207,11 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
$item-color: #fff;
|
||||
|
||||
.b-content {
|
||||
|
@ -232,7 +239,7 @@ $item-color: #fff;
|
|||
background-color: $light-color;
|
||||
position: relative;
|
||||
|
||||
.msg {
|
||||
.message {
|
||||
color: $font-color-white;
|
||||
display: flex;
|
||||
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 {
|
||||
|
|
|
@ -2,33 +2,24 @@
|
|||
<view class="about-us">
|
||||
<view class="box flex-center">
|
||||
<image src="/static/logo.png" mode="scaleToFill"></image>
|
||||
<view>lili商城</view>
|
||||
<view>{{config.name}}</view>
|
||||
</view>
|
||||
<u-cell-group :border="false">
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<u-cell-item title="检查更新" @click="checkUpdate"></u-cell-item>
|
||||
<!-- #endif -->
|
||||
<u-cell-item title="证照信息" @click="
|
||||
navigateTo('/pages/mine/help/tips?type=message')
|
||||
"></u-cell-item>
|
||||
<u-cell-item title="服务协议" @click="
|
||||
navigateTo('/pages/mine/help/tips?type=user')
|
||||
"></u-cell-item>
|
||||
<u-cell-item title="隐私协议" :border-bottom="false" @click="
|
||||
navigateTo('/pages/mine/help/tips?type=privacy')
|
||||
"></u-cell-item>
|
||||
<u-cell-item title="关于我们" :border-bottom="false" @click="
|
||||
navigateTo('/pages/mine/help/tips?type=about')
|
||||
"></u-cell-item>
|
||||
<u-cell-item title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=message')"></u-cell-item>
|
||||
<u-cell-item title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=user')"></u-cell-item>
|
||||
<u-cell-item title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=privacy')"></u-cell-item>
|
||||
<u-cell-item title="关于我们" :border-bottom="false" @click="navigateTo('/pages/mine/help/tips?type=about')"></u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="intro flex-center c-content">
|
||||
<view>客服热线:15810610731</view>
|
||||
<view>客服热线:13161366885</view>
|
||||
<view>客服邮箱:lili@lili.com</view>
|
||||
|
||||
</view>
|
||||
<view class="bottom flex-center">
|
||||
<view @click="navigateTo('/pages/help/tips?type=user')">《lili商城用户协议》</view>
|
||||
<view>CopyRight @ lili商城 </view>
|
||||
<view>CopyRight @ {{config.name}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -37,11 +28,12 @@
|
|||
// #ifdef APP-PLUS
|
||||
import APPUpdate, { getCurrentNo, getServerNo } from "@/plugins/APPUpdate";
|
||||
import { getAppVersionList } from "@/api/message.js";
|
||||
|
||||
// #endif
|
||||
import config from "@/config/config";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
config,
|
||||
showUpdate: false,
|
||||
version: "",
|
||||
currentNo: 0,
|
||||
|
@ -51,7 +43,10 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
onLoad() {
|
||||
/**
|
||||
* 根据当前app系统判断
|
||||
*/
|
||||
// #ifdef APP-PLUS
|
||||
let _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid, function (inf) {
|
||||
|
@ -66,6 +61,9 @@ export default {
|
|||
// #endif
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击查看更新
|
||||
*/
|
||||
async checkUpdate() {
|
||||
// #ifdef APP-PLUS
|
||||
let needUpdate = false;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
选择收货地址
|
||||
</view>
|
||||
<u-form-item class="border" label="收货人" label-width="130" prop="name">
|
||||
<u-input v-model="form.name" placeholder="请输入收货人姓名" />
|
||||
<u-input v-model="form.name" clearable placeholder="请输入收货人姓名" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="手机号码" label-width="130" prop="mobile">
|
||||
|
@ -59,7 +59,7 @@ export default {
|
|||
// ios系统
|
||||
permision.judgeIosPermission("location")
|
||||
? (this.mapFlage = true)
|
||||
: this.refuseMapOuther() ;
|
||||
: this.refuseMapOuther();
|
||||
} else {
|
||||
// 安卓
|
||||
this.requestAndroidPermission(
|
||||
|
@ -116,6 +116,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 选择地址后数据的回调
|
||||
callBackAddress(val) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -132,15 +133,19 @@ export default {
|
|||
uni.hideLoading();
|
||||
}
|
||||
|
||||
this.mapFlage = !this.mapFlage;
|
||||
this.mapFlage = !this.mapFlage; //关闭地图
|
||||
},
|
||||
|
||||
// 保存当前 地址
|
||||
save() {
|
||||
this.$refs.uForm.validate((valid) => {
|
||||
if (valid) {
|
||||
let pages = getCurrentPages(); //获取页面栈
|
||||
let beforePage = pages[pages.length - 2]; //上个页面
|
||||
console.log(beforePage);
|
||||
|
||||
// 如果没有id则为新增地址
|
||||
if (!this.form.id) {
|
||||
// 删除没有的数据
|
||||
delete this.form.___path;
|
||||
addAddress(this.form).then((res) => {
|
||||
if (res.data.success) {
|
||||
|
@ -156,6 +161,7 @@ export default {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
// 修改地址
|
||||
delete this.form.___path;
|
||||
delete this.form.updateBy;
|
||||
delete this.form.updateTime;
|
||||
|
@ -167,18 +173,20 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log("验证失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 三级地址联动回调
|
||||
getpickerParentValue(e) {
|
||||
// 将需要绑定的地址设置为空,并赋值
|
||||
this.form.consigneeAddressIdPath = [];
|
||||
this.form.consigneeAddressPath = [];
|
||||
let name = "";
|
||||
|
||||
e.forEach((item, index) => {
|
||||
console.log(item);
|
||||
if (item.id) {
|
||||
// 遍历数据
|
||||
this.form.consigneeAddressIdPath.push(item.id);
|
||||
this.form.consigneeAddressPath.push(item.localName);
|
||||
name += item.localName;
|
||||
|
@ -194,8 +202,9 @@ export default {
|
|||
this.form.lon = _town[0].center.split(",")[1];
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 显示三级地址联动
|
||||
showPicker() {
|
||||
this.$refs.cityPicker.show();
|
||||
},
|
||||
|
@ -203,24 +212,19 @@ export default {
|
|||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$lightColor,
|
||||
addSyncData: "",
|
||||
mapFlage: false,
|
||||
longitude: "",
|
||||
markers: [],
|
||||
latitude: "",
|
||||
lightColor: this.$lightColor, //高亮颜色
|
||||
mapFlage: false, // 地图选择开
|
||||
routerVal: "",
|
||||
show: false,
|
||||
form: {
|
||||
detail: "",
|
||||
name: "",
|
||||
mobile: "",
|
||||
consigneeAddressIdPath: [],
|
||||
consigneeAddressPath: [],
|
||||
___path: "",
|
||||
isDefault: false,
|
||||
detail: "", //地址详情
|
||||
name: "", //收货人姓名
|
||||
mobile: "", //手机号码
|
||||
consigneeAddressIdPath: [], //地址id
|
||||
consigneeAddressPath: [], //地址名字
|
||||
___path: "", //所在区域
|
||||
isDefault: false, //是否默认地址
|
||||
},
|
||||
|
||||
// 表单提交校验规则
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
|
@ -272,6 +276,7 @@ export default {
|
|||
title: "加载中",
|
||||
});
|
||||
this.routerVal = option;
|
||||
// 如果当前是编辑地址,则需要查询出地址详情信息
|
||||
if (option.id) {
|
||||
getAddressDetail(option.id).then((res) => {
|
||||
const params = res.data.result;
|
||||
|
@ -283,10 +288,7 @@ export default {
|
|||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||
// 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||
onReady() {
|
||||
this.$refs.uForm.setRules(this.rules);
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="address">
|
||||
<view class="bar"></view>
|
||||
<empty v-if="empty"></empty>
|
||||
|
||||
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
|
||||
<view class="list" v-else>
|
||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||
<view class="basic" @click="selectAddressData(item)">
|
||||
|
@ -10,21 +10,11 @@
|
|||
<text class="default" v-show="item.isDefault">默认</text>
|
||||
<view>
|
||||
<div class="region">
|
||||
<span v-if="item.consigneeAddressPath[0]">{{
|
||||
item.consigneeAddressPath[0]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{
|
||||
item.consigneeAddressPath[1]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{
|
||||
item.consigneeAddressPath[2]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[3]">{{
|
||||
item.consigneeAddressPath[3]
|
||||
}}</span>
|
||||
<span>
|
||||
{{ item.detail }}
|
||||
</span>
|
||||
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
|
||||
<span>{{ item.detail }}</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -38,7 +28,7 @@
|
|||
<view class="alifont icon-bianji-copy"></view>
|
||||
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
||||
<view class="alifont icon-lajitong"></view>
|
||||
<text @click="delAddress(item.id)">删除</text>
|
||||
<text @click="removeAddress(item.id)">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -48,7 +38,7 @@
|
|||
<u-icon name="plus-circle"></u-icon>
|
||||
添加新收货人
|
||||
</button>
|
||||
<u-action-sheet :list="delList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -58,12 +48,10 @@ import * as API_Address from "@/api/address.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
ifOnShow: false, //组件加载为true 离开为false
|
||||
activeClass: "activeClass",
|
||||
addressList: [],
|
||||
showAction: false,
|
||||
empty: false,
|
||||
delList: [
|
||||
addressList: [], //地址列表
|
||||
showAction: false, //是否显示下栏框
|
||||
empty: false, //是否为空
|
||||
removeList: [
|
||||
{
|
||||
text: "确定",
|
||||
},
|
||||
|
@ -71,12 +59,11 @@ export default {
|
|||
tips: {
|
||||
text: "确定要删除该收货人信息吗?",
|
||||
},
|
||||
delId: "",
|
||||
addid: "",
|
||||
removeId: "", //删除的地址id
|
||||
routerVal: "",
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 50,
|
||||
pageSize: 1000,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -122,7 +109,6 @@ export default {
|
|||
|
||||
this.$set(this, "addressList", res.data.result.records);
|
||||
|
||||
|
||||
console.log(this.addressList);
|
||||
}
|
||||
|
||||
|
@ -130,12 +116,12 @@ export default {
|
|||
});
|
||||
},
|
||||
//删除地址
|
||||
delAddress(id) {
|
||||
this.delId = id;
|
||||
removeAddress(id) {
|
||||
this.removeId = id;
|
||||
this.showAction = true;
|
||||
},
|
||||
deleteAddressMessage() {
|
||||
API_Address.deleteAddress(this.delId).then((res) => {
|
||||
API_Address.deleteAddress(this.removeId).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
|
@ -186,158 +172,10 @@ export default {
|
|||
this.getAddressList();
|
||||
});
|
||||
},
|
||||
|
||||
// 地址id
|
||||
addId(params) {
|
||||
API_Trade.setAddressId(params.address_id).then((res) => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.active {
|
||||
background: #f19736;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.region {
|
||||
span {
|
||||
margin: 0 4rpx !important;
|
||||
}
|
||||
}
|
||||
.address {
|
||||
.bar {
|
||||
height: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
background: url("/pages/floor/imgs/line.png") no-repeat;
|
||||
background-size: 100%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: scale(1, 0.8);
|
||||
}
|
||||
.default {
|
||||
border: 1px solid #ff6262;
|
||||
color: #ff6262;
|
||||
font-size: 22rpx;
|
||||
border-radius: 6rpx;
|
||||
align-self: center;
|
||||
padding: 2rpx 20rpx;
|
||||
}
|
||||
.list {
|
||||
.item:hover {
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-top: 20rpx;
|
||||
font-size: $font-base;
|
||||
color: #666;
|
||||
|
||||
.basic {
|
||||
padding: 30rpx;
|
||||
line-height: 1.5em;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
|
||||
:nth-child(2) {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
:nth-child(4) {
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
|
||||
margin-top: 10rpx;
|
||||
|
||||
text:nth-child(2) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
vertical-align: middle;
|
||||
height: 80rpx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.unchecked {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #e0e0e0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 8rpx;
|
||||
position: relative;
|
||||
top: -2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
view:nth-child(1) {
|
||||
font-size: $font-base;
|
||||
color: $main-color;
|
||||
margin-right: 8rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
text {
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.icon-bianji-copy {
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
top: 2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.icon-lajitong {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mr-40 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: $light-color;
|
||||
position: fixed;
|
||||
width: 690rpx;
|
||||
bottom: 60rpx;
|
||||
height: 80rpx;
|
||||
left: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
.u-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './address.scss';
|
||||
</style>
|
||||
|
|
|
@ -1,32 +1,19 @@
|
|||
<template>
|
||||
<view class="address">
|
||||
<view class="bar"></view>
|
||||
<empty v-if="empty"></empty>
|
||||
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
|
||||
<view class="list" v-else>
|
||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||
|
||||
<view class="basic">
|
||||
<text>{{ item.name }}</text>
|
||||
<text>{{ item.mobile }}</text>
|
||||
<text class="default" v-show="item.isDefault">默认</text>
|
||||
<view>
|
||||
<div class="region">
|
||||
<span v-if="item.consigneeAddressPath[0]">{{
|
||||
item.consigneeAddressPath[0]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{
|
||||
item.consigneeAddressPath[1]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{
|
||||
item.consigneeAddressPath[2]
|
||||
}}</span>
|
||||
|
||||
<span v-if="item.consigneeAddressPath[3]">{{
|
||||
item.consigneeAddressPath[3]
|
||||
}}</span>
|
||||
<span>
|
||||
{{ item.detail }}
|
||||
</span>
|
||||
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
|
||||
<span>{{ item.detail }}</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -40,7 +27,7 @@
|
|||
<view class="alifont icon-bianji-copy"></view>
|
||||
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
||||
<view class="alifont icon-lajitong"></view>
|
||||
<text @click="delAddress(item.id)">删除</text>
|
||||
<text @click="removeAddress(item.id)">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -52,22 +39,19 @@
|
|||
添加新收货人
|
||||
</button>
|
||||
|
||||
<u-action-sheet :list="delList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Trade from "@/api/trade";
|
||||
import * as API_Address from "@/api/address.js";
|
||||
import storage from "@/utils/storage.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeClass: "activeClass",
|
||||
addressList: [],
|
||||
showAction: false,
|
||||
empty: false,
|
||||
delList: [
|
||||
addressList: [], //地址列表
|
||||
showAction: false, //是否显示下栏框
|
||||
empty: false, //是否为空
|
||||
removeList: [
|
||||
{
|
||||
text: "确定",
|
||||
},
|
||||
|
@ -75,9 +59,8 @@ export default {
|
|||
tips: {
|
||||
text: "确定要删除该收货人信息吗?",
|
||||
},
|
||||
delId: "",
|
||||
addid: "",
|
||||
routerVal: "",
|
||||
removeId: "", //删除的地址id
|
||||
routerVal: "",
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 1000,
|
||||
|
@ -94,22 +77,33 @@ export default {
|
|||
onLoad: function (val) {
|
||||
this.routerVal = val;
|
||||
},
|
||||
/**
|
||||
* 进入页面检测当前账户是否登录
|
||||
*/
|
||||
onShow() {
|
||||
let userInfo = storage.getUserInfo();
|
||||
|
||||
if (userInfo && userInfo.id) {
|
||||
if (this.$options.filters.isLogin("auth")) {
|
||||
this.getAddressList();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "检测到您的账号还未登录,是否去登录?",
|
||||
confirmColor: this.$lightColor,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getAddressList();
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
methods: {
|
||||
//获取地址列表
|
||||
getAddressList() {
|
||||
uni.showLoading();
|
||||
|
||||
API_Address.getAddressList(
|
||||
this.params.pageNumber,
|
||||
this.params.pageSize
|
||||
|
@ -120,19 +114,19 @@ export default {
|
|||
res.data.result.records.forEach((item) => {
|
||||
item.consigneeAddressPath = item.consigneeAddressPath.split(",");
|
||||
});
|
||||
|
||||
this.addressList = res.data.result.records;
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
//删除地址
|
||||
delAddress(id) {
|
||||
this.delId = id;
|
||||
removeAddress(id) {
|
||||
this.removeId = id;
|
||||
this.showAction = true;
|
||||
},
|
||||
// 删除地址
|
||||
deleteAddressMessage() {
|
||||
API_Address.deleteAddress(this.delId).then((res) => {
|
||||
API_Address.deleteAddress(this.removeId).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
|
@ -150,15 +144,9 @@ export default {
|
|||
},
|
||||
//新建。编辑地址
|
||||
addAddress(id) {
|
||||
if (id) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/address/add?id=" + id,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/address/add",
|
||||
});
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/address/add${id ? "?id=" + id : ""}`,
|
||||
});
|
||||
},
|
||||
//设为默认地址
|
||||
setDefault(item) {
|
||||
|
@ -168,7 +156,7 @@ export default {
|
|||
|
||||
item.isDefault ? "" : (item.isDefault = !item.isDefault);
|
||||
|
||||
API_Address.editAddress(item).then((res) => {
|
||||
API_Address.editAddress(item).then(() => {
|
||||
uni.showToast({
|
||||
title: "设置默认地址成功",
|
||||
icon: "none",
|
||||
|
@ -176,154 +164,10 @@ export default {
|
|||
this.getAddressList();
|
||||
});
|
||||
},
|
||||
|
||||
// 地址id
|
||||
addId(params) {
|
||||
API_Trade.setAddressId(params.address_id).then((res) => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.active {
|
||||
background: #f19736;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.region {
|
||||
span {
|
||||
margin: 0 4rpx !important;
|
||||
}
|
||||
}
|
||||
.address {
|
||||
.bar {
|
||||
height: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
background: url("/pages/floor/imgs/line.png") no-repeat;
|
||||
background-size: 100%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: scale(1, 0.8);
|
||||
}
|
||||
.default {
|
||||
border: 1px solid #ff6262;
|
||||
color: #ff6262;
|
||||
font-size: 22rpx;
|
||||
border-radius: 6rpx;
|
||||
align-self: center;
|
||||
padding: 2rpx 20rpx;
|
||||
}
|
||||
.list {
|
||||
.item {
|
||||
margin-top: 20rpx;
|
||||
font-size: $font-base;
|
||||
color: #666;
|
||||
|
||||
.basic {
|
||||
padding: 30rpx;
|
||||
line-height: 1.5em;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
|
||||
:nth-child(2) {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
:nth-child(4) {
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
|
||||
margin-top: 10rpx;
|
||||
|
||||
text:nth-child(2) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
vertical-align: middle;
|
||||
height: 80rpx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.unchecked {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #e0e0e0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 8rpx;
|
||||
position: relative;
|
||||
top: -2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
view:nth-child(1) {
|
||||
font-size: $font-base;
|
||||
color: $main-color;
|
||||
margin-right: 8rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
text {
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.icon-bianji-copy {
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
top: 2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.icon-lajitong {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mr-40 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: $light-color;
|
||||
position: fixed;
|
||||
width: 690rpx;
|
||||
bottom: 60rpx;
|
||||
height: 80rpx;
|
||||
left: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
.u-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './address.scss';
|
||||
</style>
|
||||
|
|
|
@ -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>
|
|
@ -1,10 +1,12 @@
|
|||
<template></template>
|
||||
<script>
|
||||
import { getAddressCode } from "@/api/address";
|
||||
|
||||
import config from '@/config/config'
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
config
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
@ -33,7 +35,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
// 根据当前客户端判断
|
||||
// 根据当前客户端判断展示不同类型数据
|
||||
init() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.wechatMap();
|
||||
|
@ -60,12 +62,14 @@ export default {
|
|||
cancelText: "取消",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 打开设置好后重新刷新地图
|
||||
uni.openSetting({
|
||||
success: (res) => {
|
||||
that.initMap();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 取消后关闭
|
||||
that.$emit("close");
|
||||
return false;
|
||||
}
|
||||
|
@ -75,18 +79,18 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取城市的数据
|
||||
posToCity(latitude, longitude) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `https://restapi.amap.com/v3/geocode/regeo`,
|
||||
method: "GET",
|
||||
data: {
|
||||
key: "d649892b3937a5ad20b76dacb2bcb5bd", //web服务的key
|
||||
key: config.aMapKey, //web服务的key
|
||||
location: `${longitude},${latitude}`,
|
||||
},
|
||||
success: ({ data }) => {
|
||||
const { status, info, regeocode } = data;
|
||||
const { status, info } = data;
|
||||
if (status === "1") {
|
||||
resolve(data);
|
||||
} else {
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="navbar">
|
||||
<!-- 循环出顶部nav栏 -->
|
||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="tabClick(index)">
|
||||
<text :class="{current: tabCurrentIndex === index}">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swiper-box" duration="300" @change="changeTab">
|
||||
<view class="swiper-box">
|
||||
<!-- 显示商品栏 -->
|
||||
<view v-if="tabCurrentIndex == 0" class="tab-content">
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
||||
<!-- 空白页 -->
|
||||
<empty v-if="goodsEmpty"></empty>
|
||||
|
||||
<!-- 数据 -->
|
||||
<u-swipe-action @open="openChange(item,index,'goods')" :show="item.selected" btn-width="180" :options="options" v-else v-for="(item,index) in goodList"
|
||||
<u-empty text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
|
||||
<!-- 商品展示数据 -->
|
||||
<u-swipe-action @open="openLeftChange(item,index,'goods')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in goodList"
|
||||
@click="clickGoodsSwiperAction(item,index)" :index="index" :key="index">
|
||||
<view class="goods" @click="goGoodsDetail(item)">
|
||||
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
|
||||
|
@ -23,20 +24,19 @@
|
|||
<view class="goods-sn">{{item.goods_sn}}</view>
|
||||
<view>¥{{item.price | unitPrice}}</view>
|
||||
</view>
|
||||
<!-- <button @click.stop="goSimilar(item)">找相似</button> -->
|
||||
</view>
|
||||
</u-swipe-action>
|
||||
|
||||
<uni-load-more :status="goodLoad"></uni-load-more>
|
||||
<uni-load-more :status="goodsLoad"></uni-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 显示收藏的店铺栏 -->
|
||||
<view v-else class="tab-content">
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadMore">
|
||||
<!-- 空白页 -->
|
||||
<empty v-if="storeEmpty"></empty>
|
||||
<!-- 数据 -->
|
||||
|
||||
<u-swipe-action @open="openChange(item,index,'store')" :show="item.selected" btn-width="180" :options="options" v-else v-for="(item,index) in storeList" :key="index"
|
||||
<u-empty text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
|
||||
<!-- 店铺展示数据 -->
|
||||
<u-swipe-action @open="openLeftChange(item,'store')" :show="item.selected" btn-width="180" :options="LeftOptions" v-else v-for="(item,index) in storeList" :key="index"
|
||||
@click="clickstoreSwiperAction(item)">
|
||||
<view class="store" @click="gostoreMainPage(item.storeId)">
|
||||
<view class="intro">
|
||||
|
@ -48,10 +48,8 @@
|
|||
<view class="store-name">
|
||||
<view>{{item.storeName}}</view>
|
||||
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated" text="自营" mode="plain" shape="circle" />
|
||||
|
||||
</view>
|
||||
<view class="store-collect">
|
||||
|
||||
<view>进店逛逛</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -73,7 +71,8 @@ import {
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
// 商品左滑侧边栏
|
||||
LeftOptions: [
|
||||
{
|
||||
text: "取消",
|
||||
style: {
|
||||
|
@ -81,8 +80,9 @@ export default {
|
|||
},
|
||||
},
|
||||
],
|
||||
tabCurrentIndex: 0,
|
||||
tabCurrentIndex: 0, //tab的下标默认为0,也就是说会默认请求商品
|
||||
navList: [
|
||||
//tab显示数据
|
||||
{
|
||||
text: "商品(0)",
|
||||
loadingType: "more",
|
||||
|
@ -100,54 +100,51 @@ export default {
|
|||
},
|
||||
},
|
||||
],
|
||||
goodLoad: "more",
|
||||
storeLoad: "more",
|
||||
goodsEmpty: false,
|
||||
storeEmpty: false,
|
||||
goodList: [],
|
||||
storeList: [],
|
||||
goodsLoad: "more", //商品加载
|
||||
storeLoad: "more", //店铺加载
|
||||
goodsEmpty: false, //商品数据是否为空
|
||||
storeEmpty: false, //店铺数据是否为空
|
||||
goodList: [], //商品集合
|
||||
storeList: [], //店铺集合
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// this.loadData();
|
||||
this.getGoodList();
|
||||
this.getstoreList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
openChange(val, index, type) {
|
||||
/**
|
||||
* 打开商品左侧取消收藏
|
||||
*/
|
||||
openLeftChange(val, type) {
|
||||
const { goodList, storeList } = this;
|
||||
let way;
|
||||
type == "goods" ? (way = goodList) : (way = storeList);
|
||||
|
||||
way.forEach((item, ids) => {
|
||||
way.forEach((item) => {
|
||||
this.$set(item, "selected", false);
|
||||
});
|
||||
|
||||
this.$set(val, "selected", false);
|
||||
val.selected = true;
|
||||
console.log(val.selected);
|
||||
},
|
||||
/* openstore(val, index) {
|
||||
this.storeList.forEach((item, ids) => {
|
||||
this.$set(item, "selected", false);
|
||||
});
|
||||
|
||||
this.$set(val, "selected", false);
|
||||
val.selected = true;
|
||||
}, */
|
||||
/** 点击取消按钮 */
|
||||
clickGoodsSwiperAction(val, index) {
|
||||
/**
|
||||
* 点击商品左侧取消收藏
|
||||
*/
|
||||
clickGoodsSwiperAction(val) {
|
||||
deleteGoodsCollection(val.skuId).then((res) => {
|
||||
console.log(res);
|
||||
if (res.statusCode == 200) {
|
||||
this.storeList = [];
|
||||
this.goodList = []
|
||||
this.goodList = [];
|
||||
this.getGoodList();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击店铺左侧取消收藏
|
||||
*/
|
||||
clickstoreSwiperAction(val) {
|
||||
deleteStoreCollection(val.storeId).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
|
@ -157,34 +154,37 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
//顶部tab点击
|
||||
/**
|
||||
* 顶部tab点击
|
||||
*/
|
||||
tabClick(index) {
|
||||
this.tabCurrentIndex = index;
|
||||
console.log(this.tabCurrentIndex);
|
||||
},
|
||||
changeTab(e) {
|
||||
this.tabCurrentIndex = e.target.current;
|
||||
},
|
||||
goSimilar(goods) {
|
||||
//找相似
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/user/similarGoods?goods=" +
|
||||
encodeURIComponent(JSON.stringify(goods)),
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看商品详情
|
||||
*/
|
||||
goGoodsDetail(val) {
|
||||
//商品详情
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + val.skuId +"&goodsId="+val.goodsId,
|
||||
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看店铺详情
|
||||
*/
|
||||
gostoreMainPage(id) {
|
||||
//店铺主页
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/shopPage?id=" + id,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取商品集合
|
||||
*/
|
||||
getGoodList() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -192,24 +192,26 @@ export default {
|
|||
getGoodsCollection(this.navList[0].params, "GOODS").then((res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.statusCode == 200) {
|
||||
if (res.statusCode == 200) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[0].text = `商品(${data.total})`;
|
||||
if (data.total == 0) {
|
||||
this.goodsEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.goodLoad = "noMore";
|
||||
this.goodList.push(...data.records);
|
||||
} else {
|
||||
this.goodList.push(...data.records);
|
||||
if (data.total.length < 10) this.goodLoad = "noMore";
|
||||
}
|
||||
if (res.data.success) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[0].text = `商品(${data.total})`;
|
||||
if (data.total == 0) {
|
||||
this.goodsEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.goodsLoad = "noMore";
|
||||
this.goodList.push(...data.records);
|
||||
} else {
|
||||
this.goodList.push(...data.records);
|
||||
if (data.total.length < 10) this.goodsLoad = "noMore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取店铺集合
|
||||
*/
|
||||
getstoreList() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -217,24 +219,26 @@ export default {
|
|||
getGoodsCollection(this.navList[1].params, "store").then((res) => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.statusCode == 200) {
|
||||
if (res.statusCode == 200) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[1].text = `店铺(${data.total})`;
|
||||
if (data.total == 0) {
|
||||
this.storeEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.storeLoad = "noMore";
|
||||
this.storeList.push(...data.records);
|
||||
} else {
|
||||
this.storeList.push(...data.records);
|
||||
if (data.total.length < 10) this.storeLoad = "noMore";
|
||||
}
|
||||
if (res.data.success) {
|
||||
let data = res.data.result;
|
||||
data.selected = false;
|
||||
this.navList[1].text = `店铺(${data.total})`;
|
||||
if (data.total == 0) {
|
||||
this.storeEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.storeLoad = "noMore";
|
||||
this.storeList.push(...data.records);
|
||||
} else {
|
||||
this.storeList.push(...data.records);
|
||||
if (data.total.length < 10) this.storeLoad = "noMore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 底部加载更多
|
||||
*/
|
||||
loadMore() {
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.navList[0].params.pageNumber++;
|
||||
|
@ -245,6 +249,10 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 下拉刷新时
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
if (this.tabCurrentIndex == 0) {
|
||||
this.navList[0].params.pageNumber = 1;
|
||||
|
@ -260,201 +268,154 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
page,
|
||||
.content {
|
||||
background: $page-color-base;
|
||||
height: 100%;
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.swiper-box {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
overflow-y: auto;
|
||||
}
|
||||
.goods-price {
|
||||
text-align: left;
|
||||
}
|
||||
.list-scroll-content {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.goods-name {
|
||||
color: #333 !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
/deep/ .u-swipe-content{
|
||||
overflow: hidden;
|
||||
|
||||
/deep/ .u-swipe-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
.goods {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
height: 190rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 20rpx;
|
||||
margin-top: 20rpx;
|
||||
image {
|
||||
width: 131rpx;
|
||||
height: 131rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.goods-intro {
|
||||
flex: 1;
|
||||
font-size: $font-base;
|
||||
line-height: 48rpx;
|
||||
margin-left: 30rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
height: 190rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 20rpx;
|
||||
margin-top: 20rpx;
|
||||
image {
|
||||
width: 131rpx;
|
||||
height: 131rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.goods-intro {
|
||||
flex: 1;
|
||||
font-size: $font-base;
|
||||
line-height: 48rpx;
|
||||
margin-left: 30rpx;
|
||||
|
||||
view:nth-child(1) {
|
||||
line-height: 1.4em;
|
||||
font-size: 24rpx;
|
||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
color: #cccccc;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
view:nth-child(3) {
|
||||
color: $light-color;
|
||||
}
|
||||
}
|
||||
button {
|
||||
color: $main-color;
|
||||
height: 50rpx;
|
||||
width: 120rpx;
|
||||
font-size: $font-sm;
|
||||
padding: 0;
|
||||
line-height: 50rpx;
|
||||
background-color: #ffffff;
|
||||
margin-top: 80rpx;
|
||||
&::after {
|
||||
border-color: $main-color;
|
||||
}
|
||||
}
|
||||
view:nth-child(1) {
|
||||
line-height: 1.4em;
|
||||
font-size: 24rpx;
|
||||
max-height: 2.8em; //height是line-height的整数倍,防止文字显示不全
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
color: #cccccc;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
view:nth-child(3) {
|
||||
color: $light-color;
|
||||
}
|
||||
}
|
||||
button {
|
||||
color: $main-color;
|
||||
height: 50rpx;
|
||||
width: 120rpx;
|
||||
font-size: $font-sm;
|
||||
padding: 0;
|
||||
line-height: 50rpx;
|
||||
background-color: #ffffff;
|
||||
margin-top: 80rpx;
|
||||
&::after {
|
||||
border-color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
.store {
|
||||
background-color: #fff;
|
||||
border: 1px solid $border-color-light;
|
||||
border-radius: 16rpx;
|
||||
margin: 20rpx 10rpx;
|
||||
.intro {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 30rpx 0 40rpx;
|
||||
height: 170rpx;
|
||||
background-color: #fff;
|
||||
border: 1px solid $border-color-light;
|
||||
border-radius: 16rpx;
|
||||
margin: 20rpx 10rpx;
|
||||
.intro {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 30rpx 0 40rpx;
|
||||
height: 170rpx;
|
||||
|
||||
.store-logo {
|
||||
width: 102rpx;
|
||||
height: 102rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.store-name {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
line-height: 2em;
|
||||
:first-child {
|
||||
font-size: $font-base;
|
||||
}
|
||||
:last-child {
|
||||
font-size: $font-sm;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.store-collect {
|
||||
border-left: 1px solid $border-color-light;
|
||||
padding-left: 20rpx;
|
||||
text-align: center;
|
||||
:last-child {
|
||||
color: #999;
|
||||
font-size: $font-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
.store-goods {
|
||||
// height: 300rpx;
|
||||
// width: 750rpx;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
padding: 30rpx 20rpx;
|
||||
&::before {
|
||||
content: "";
|
||||
width: calc(100% - 40rpx);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 20rpx;
|
||||
z-index: 2;
|
||||
border-top: 2rpx solid #eeeeee;
|
||||
}
|
||||
.store-item {
|
||||
display: inline-block;
|
||||
margin-left: 10rpx;
|
||||
width: 250rpx;
|
||||
overflow: hidden;
|
||||
image {
|
||||
width: 228rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
> .goods-price {
|
||||
color: $main-color;
|
||||
text:first-child {
|
||||
font-size: $font-sm;
|
||||
}
|
||||
text:last-child {
|
||||
font-size: $font-base;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.store-logo {
|
||||
width: 102rpx;
|
||||
height: 102rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.store-name {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
line-height: 2em;
|
||||
:first-child {
|
||||
font-size: $font-base;
|
||||
}
|
||||
:last-child {
|
||||
font-size: $font-sm;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.store-collect {
|
||||
border-left: 1px solid $border-color-light;
|
||||
padding-left: 20rpx;
|
||||
text-align: center;
|
||||
:last-child {
|
||||
color: #999;
|
||||
font-size: $font-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navbar {
|
||||
display: flex;
|
||||
height: 40px;
|
||||
padding: 0 5px;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
font-size: 26rpx;
|
||||
|
||||
text {
|
||||
position: relative;
|
||||
}
|
||||
text.current {
|
||||
color: $light-color;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
bottom: -10rpx;
|
||||
width: 30rpx;
|
||||
height: 0;
|
||||
border-bottom: 2px solid $light-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
display: flex;
|
||||
height: 40px;
|
||||
padding: 0 5px;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
font-size: 26rpx;
|
||||
|
||||
text {
|
||||
position: relative;
|
||||
}
|
||||
text.current {
|
||||
color: $light-color;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
bottom: -10rpx;
|
||||
width: 30rpx;
|
||||
height: 0;
|
||||
border-bottom: 2px solid $light-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<template>
|
||||
<view class="myTracks" v-if="refresh">
|
||||
<empty v-if="nomsg"></empty>
|
||||
<view v-else v-for="(item, index) in list" :key="index">
|
||||
<view class="myTracks-title" @click="gostore(item)">{{item.storeName}}</view>
|
||||
<view class="myTracks">
|
||||
<empty v-if="whetherEmpty"></empty>
|
||||
<view v-else v-for="(item, index) in trackList" :key="index">
|
||||
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
|
||||
<view class="myTracks-items">
|
||||
<view class="myTracks-item">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view class="myTracks-item-img" @click.stop="goDetail(item)">
|
||||
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
|
||||
<image :src="item.thumbnail"></image>
|
||||
</view>
|
||||
<view class="myTracks-item-content" @click.stop="goDetail(item)">
|
||||
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
|
||||
<view class="myTracks-item-title">
|
||||
{{ item.goodsName }}
|
||||
<view class="myTracks-item-title-desc"> </view>
|
||||
|
@ -19,9 +19,6 @@
|
|||
<view class="myTracks-item-price">
|
||||
¥{{ item.price | unitPrice }}
|
||||
</view>
|
||||
<!-- <view class="myTracks-item-btn" @click.stop="goSimilar(item)">
|
||||
找相似
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -54,23 +51,22 @@ import { myTrackList, deleteHistoryListId } from "@/api/members.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
editFlag: false,
|
||||
allChecked: false,
|
||||
loadStatus: "more",
|
||||
nomsg: false,
|
||||
editFlag: false, //是否编辑
|
||||
allChecked: false, //是否全选
|
||||
loadStatus: "more", //底部下拉加载状态
|
||||
whetherEmpty: false, //是否数据为空
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
refresh: true,
|
||||
list: [],
|
||||
|
||||
trackList: [], //足迹列表
|
||||
};
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.params.pageNumber = 1;
|
||||
this.list = [];
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 滑到底部加载下一页数据
|
||||
*/
|
||||
onReachBottom() {
|
||||
if (this.loadStatus != "noMore") {
|
||||
this.params.pageNumber++;
|
||||
|
@ -81,11 +77,18 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
gostore(val) {
|
||||
/**
|
||||
* 导航到店铺
|
||||
*/
|
||||
navgaiteToStore(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置右侧导航栏文本
|
||||
*/
|
||||
setStyle(text) {
|
||||
//导航按钮文本设置
|
||||
let pages = getCurrentPages();
|
||||
|
@ -95,7 +98,7 @@ export default {
|
|||
let titleNView = currentWebview.getStyle().titleNView;
|
||||
titleNView.buttons[0].text = text;
|
||||
if (text == "完成") {
|
||||
this.list.forEach((key) => {
|
||||
this.trackList.forEach((key) => {
|
||||
key.history.forEach((item) => {
|
||||
this.$set(item, "___isDel", false);
|
||||
});
|
||||
|
@ -110,20 +113,19 @@ export default {
|
|||
document.getElementsByClassName("uni-btn-icon")[1].innerText = text;
|
||||
// #endif
|
||||
},
|
||||
goDetail(item) {
|
||||
//跳转详情
|
||||
|
||||
/**
|
||||
* 跳转详情
|
||||
*/
|
||||
navgaiteToDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + item.id + "&goodsId=" + item.goodsId,
|
||||
});
|
||||
},
|
||||
goSimilar(item) {
|
||||
//找相似
|
||||
uni.navigateTo({
|
||||
url:
|
||||
"/pages/user/similaritem?item=" +
|
||||
encodeURIComponent(JSON.stringify(item)),
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取我的足迹列表
|
||||
*/
|
||||
getList() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -139,35 +141,44 @@ export default {
|
|||
|
||||
let data = res.data.result;
|
||||
if (data.total == 0) {
|
||||
this.nomsg = true;
|
||||
this.whetherEmpty = true;
|
||||
} else if (data.total < 10) {
|
||||
this.loadStatus = "noMore";
|
||||
this.list.push(...data);
|
||||
this.trackList.push(...data);
|
||||
} else {
|
||||
this.list.push(...data);
|
||||
this.trackList.push(...data);
|
||||
if (data.length < 10) this.loadStatus = "noMore";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击后判断是不是全选
|
||||
*/
|
||||
changeChecked(val) {
|
||||
//点击后判断是不是全选
|
||||
console.log(val);
|
||||
const isCheckedAll = this.list.every((key) => {
|
||||
console.log(key);
|
||||
const isCheckedAll = this.trackList.every((key) => {
|
||||
return key.___isDel == val.___isDel;
|
||||
});
|
||||
this.allChecked = isCheckedAll;
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击全选按钮
|
||||
*/
|
||||
checkedAllitem() {
|
||||
//全选按钮
|
||||
this.list.forEach((key) => {
|
||||
this.trackList.forEach((key) => {
|
||||
this.$set(key, "___isDel", this.allChecked);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除足迹
|
||||
*/
|
||||
delAllTracks() {
|
||||
let way = [];
|
||||
this.list.forEach((key) => {
|
||||
this.trackList.forEach((key) => {
|
||||
if (key.___isDel) {
|
||||
way.push(key.goodsId);
|
||||
}
|
||||
|
@ -175,10 +186,8 @@ export default {
|
|||
if (way.length == 0) return false;
|
||||
deleteHistoryListId(way).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.list = [];
|
||||
|
||||
this.trackList = [];
|
||||
this.allChecked = false;
|
||||
|
||||
this.getList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
|
@ -190,6 +199,10 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 右侧标签栏切换
|
||||
*/
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (!this.editFlag) {
|
||||
this.setStyle("完成");
|
||||
|
@ -255,9 +268,6 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.myTracks-item-content {
|
||||
}
|
||||
|
||||
.myTracks-item-title {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
@ -274,36 +284,6 @@ export default {
|
|||
padding: 10rpx 0 0 0;
|
||||
}
|
||||
|
||||
.myTracks-item-price-now {
|
||||
font-size: 28rpx;
|
||||
color: $light-color;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
|
||||
.myTracks-item-price-origin {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
-webkit-text-decoration-line: line-through;
|
||||
text-decoration-line: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.myTracks-item-btn {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
width: 120rpx;
|
||||
height: 42rpx;
|
||||
background-color: #fff;
|
||||
border: 1px solid $aider-light-color;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: $aider-light-color;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.myTracks-action-btn {
|
||||
width: 130rpx;
|
||||
height: 60rpx;
|
||||
|
@ -319,21 +299,6 @@ export default {
|
|||
height: 110rpx;
|
||||
}
|
||||
|
||||
.myTracks-action {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.myTracks-action-check {
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
|
|
|
@ -18,104 +18,56 @@
|
|||
<text class="pcolor">{{ pointData.variablePoint || 0 }}</text>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-row class="portrait-box3">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<u-col span="8">近30天记录</u-col>
|
||||
<u-col textAlign="right" span="4" @click="goDetail" class="more">更多</u-col>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="mp-weixin-more">
|
||||
<view>近30天记录</view>
|
||||
<view @click="goDetail">更多</view>
|
||||
<div class="point-list">
|
||||
<view class="point-item" v-for="(item, index) in pointList" :key="index">
|
||||
<view>
|
||||
<view>{{ item.content }}</view>
|
||||
<view>{{ item.createTime}}</view>
|
||||
</view>
|
||||
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</u-row>
|
||||
|
||||
<view class="dataList" v-for="(item, index) in list" :key="index">
|
||||
<view>
|
||||
<view>{{ item.content }}</view>
|
||||
<view>{{ item.createTime}}</view>
|
||||
</view>
|
||||
<view><span>{{item.pointType == "1" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
|
||||
</view>
|
||||
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
||||
<u-popup v-model="show" mode="bottom" :closeable="true">
|
||||
<view class="title">申请积分</view>
|
||||
<u-form :model="form" ref="uForm">
|
||||
<u-form-item label="选择店铺" label-width="140">
|
||||
<u-input v-model="storeParams.storeName" type="select" @click="showstore" placeholder="请选择店铺" />
|
||||
</u-form-item>
|
||||
<u-form-item label="申请积分" label-width="140">
|
||||
<u-input v-model="storeParams.point" type="number" placeholder="请输入积分数量" />
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<button class="btn-mini" @click="submit" :disabled="avoidClick">提交申请</button>
|
||||
</u-popup>
|
||||
<uni-load-more :status="count.loadStatus"></uni-load-more>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPoints, getPointsData } from "@/api/members.js";
|
||||
import { getPointsData } from "@/api/members.js";
|
||||
import { getMemberPointSum } from "@/api/members.js";
|
||||
import { contractStep } from "@/api/safe.js";
|
||||
|
||||
import storage from "@/utils/storage.js";
|
||||
export default {
|
||||
onShow() {
|
||||
this.userInfo = storage.getUserInfo();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
count: {
|
||||
loadStatus: "more",
|
||||
},
|
||||
list: [],
|
||||
userInfo: [],
|
||||
pointList: [], //积分数据集合
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
start_time: 0,
|
||||
end_time: 0,
|
||||
},
|
||||
pointData: {},
|
||||
show: false,
|
||||
form: {},
|
||||
showAction: false,
|
||||
actionList: [],
|
||||
storeParams: {
|
||||
point: 0,
|
||||
storeId: 0,
|
||||
storeName: "请选择店铺",
|
||||
},
|
||||
avoidClick: false,
|
||||
isCertificate: true,
|
||||
pointData: {}, //累计获取 未输入 集合
|
||||
};
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
contractStep().then((res) => {
|
||||
//是否实名认证
|
||||
console.log(res);
|
||||
this.isCertificate = res.data == 1 ? true : false;
|
||||
});
|
||||
getPoints().then((res) => {
|
||||
this.count = res.data;
|
||||
});
|
||||
this.initpointDataData();
|
||||
this.initPointData();
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 触底加载
|
||||
*/
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取积分数据
|
||||
*/
|
||||
getList() {
|
||||
let date = Date.parse(new Date()) / 1000;
|
||||
let params = this.params;
|
||||
params.start_time = date - 60 * 60 * 24 * 30; //30天前时间
|
||||
params.end_time = date;
|
||||
// console.log(params)
|
||||
// return;
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
|
@ -125,55 +77,28 @@ export default {
|
|||
let data = res.data.result.records;
|
||||
if (data.length < 10) {
|
||||
this.$set(this.count, "loadStatus", "noMore");
|
||||
this.list.push(...data);
|
||||
this.pointList.push(...data);
|
||||
} else {
|
||||
this.list.push(...data);
|
||||
this.pointList.push(...data);
|
||||
if (data.length < 10) this.$set(this.count, "loadStatus", "noMore");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
initpointDataData() {
|
||||
//累计获得累计使用
|
||||
|
||||
/**
|
||||
* 获得累计使用
|
||||
*/
|
||||
initPointData() {
|
||||
getMemberPointSum().then((res) => {
|
||||
this.pointData = res.data.result;
|
||||
});
|
||||
},
|
||||
goDetail() {
|
||||
//积分明细
|
||||
uni.navigateTo({
|
||||
url: "/pages/point/pointDetail",
|
||||
});
|
||||
},
|
||||
goIntro() {
|
||||
//跳转详情
|
||||
uni.navigateTo({
|
||||
url: "/pages/pointTrade/pointIntro",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mp-weixin-more {
|
||||
width: 96vw;
|
||||
padding: 0 2vw;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.u-close--top-right {
|
||||
top: 22rpx;
|
||||
}
|
||||
|
||||
.i_time {
|
||||
color: $u-tips-color;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
|
@ -182,40 +107,22 @@ export default {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.btn-mini {
|
||||
margin: 20rpx auto;
|
||||
font-size: 24rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.u-form-item {
|
||||
padding: 10rpx 30rpx 10rpx 20rpx;
|
||||
}
|
||||
|
||||
.dataList {
|
||||
.point-item {
|
||||
width: 100%;
|
||||
height: 130rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #ffffff;
|
||||
font-size: $font-sm;
|
||||
// line-height: 2em;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.colorRed {
|
||||
color: #f04844;
|
||||
}
|
||||
|
||||
> view:nth-child(1) {
|
||||
flex: 1;
|
||||
line-height: 40rpx;
|
||||
|
||||
view {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
:last-child {
|
||||
color: #999;
|
||||
}
|
||||
|
@ -233,35 +140,17 @@ export default {
|
|||
border-radius: 0 0 20rpx 20rpx;
|
||||
margin: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
/deep/ .u-col {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/deep/ .u-col:first-child {
|
||||
border-right: 1px solid $border-color-light;
|
||||
}
|
||||
|
||||
.pcolor {
|
||||
color: #4ebb9d;
|
||||
}
|
||||
}
|
||||
|
||||
.portrait-box3 {
|
||||
// #ifdef MP-WEIXIN
|
||||
display: flex;
|
||||
// #endif
|
||||
|
||||
height: 110rpx;
|
||||
background-color: #f1f1f1;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.u-col {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
@ -312,27 +201,11 @@ export default {
|
|||
border-radius: 20rpx 0px 0px 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.point-img {
|
||||
height: 108rpx;
|
||||
width: 108rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.current {
|
||||
font-size: 26rpx;
|
||||
|
||||
text {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
> text:nth-child(2) {
|
||||
color: #ffee80;
|
||||
font-size: 40rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.point {
|
||||
font-size: 56rpx;
|
||||
}
|
||||
|
|
|
@ -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> {{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>
|
|
@ -1,125 +1,122 @@
|
|||
// TODO 第一版本暂无此功能 后续优化以及更新
|
||||
<template>
|
||||
<view class="edition-intro">
|
||||
<view class="logo c-content">
|
||||
<view>
|
||||
<image src="/static/img/edition.png" mode=""></image>
|
||||
</view>
|
||||
<view>版本不息 优化不止</view>
|
||||
</view>
|
||||
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
|
||||
<view class="level">
|
||||
<text style="color: #1ABC9C;">{{item.version}}</text>
|
||||
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
|
||||
</view>
|
||||
<view class="detail" v-html="item.content"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edition-intro">
|
||||
<view class="logo c-content">
|
||||
<view>
|
||||
<image src="/static/img/edition.png" mode=""></image>
|
||||
</view>
|
||||
<view>版本不息 优化不止</view>
|
||||
</view>
|
||||
<view class="edition c-content" v-for="(item,index) in editionHistory" :key="index">
|
||||
<view class="level">
|
||||
<text style="color: #1ABC9C;">{{item.version}}</text>
|
||||
<text>{{$u.timeFormat(item.update_time, 'yyyy-mm-dd')}}</text>
|
||||
</view>
|
||||
<view class="detail" v-html="item.content"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Message from "@/api/message.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editionHistory:[],
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 5
|
||||
},
|
||||
loadStatus:'more'
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
if (uni.getSystemInfoSync().platform === 'android') {
|
||||
this.params.type = 0;
|
||||
} else {
|
||||
this.params.type = 1;
|
||||
}
|
||||
this.GET_AppVersionList(true);
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.loadStatus!='noMore'){
|
||||
this.params.pageNumber++
|
||||
this.GET_AppVersionList(false)
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
GET_AppVersionList(reset){
|
||||
if (reset) {
|
||||
this.params.pageNumber = 1
|
||||
}
|
||||
uni.showLoading({
|
||||
title:"加载中"
|
||||
})
|
||||
API_Message.getAppVersionList(this.params).then(response => {
|
||||
uni.hideLoading()
|
||||
if(response.statusCode==200){
|
||||
const { data } = response
|
||||
if(data.data.length<10){
|
||||
this.loadStatus = 'noMore';
|
||||
}
|
||||
this.editionHistory.push(...data.data)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
import * as API_Message from "@/api/message.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editionHistory: [], //版本历史
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 5,
|
||||
},
|
||||
loadStatus: "more",
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
if (uni.getSystemInfoSync().platform === "android") {
|
||||
this.params.type = 0;
|
||||
} else {
|
||||
this.params.type = 1;
|
||||
}
|
||||
this.GET_AppVersionList(true);
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.loadStatus != "noMore") {
|
||||
this.params.pageNumber++;
|
||||
this.GET_AppVersionList(false);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
GET_AppVersionList(reset) {
|
||||
if (reset) {
|
||||
this.params.pageNumber = 1;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
API_Message.getAppVersionList(this.params).then((response) => {
|
||||
uni.hideLoading();
|
||||
if (response.statusCode == 200) {
|
||||
const { data } = response;
|
||||
if (data.data.length < 10) {
|
||||
this.loadStatus = "noMore";
|
||||
}
|
||||
this.editionHistory.push(...data.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.edition-intro{
|
||||
.logo{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
height: 330rpx;
|
||||
margin-bottom: 20rpx;
|
||||
>view:nth-child(1){
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
border: 1px solid #FFC71C;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
image{
|
||||
width: 80rpx;
|
||||
height: 113rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin:auto;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.edition{
|
||||
margin-bottom: 20rpx;
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
.level{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx ;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
text:nth-child(1){
|
||||
font-size: $font-base;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.detail{
|
||||
margin-left: 20rpx;
|
||||
line-height: 2em;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
<style lang="scss" scoped>
|
||||
.edition-intro {
|
||||
.logo {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
font-size: $font-lg;
|
||||
color: $font-color-light;
|
||||
height: 330rpx;
|
||||
margin-bottom: 20rpx;
|
||||
> view:nth-child(1) {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
border: 1px solid #ffc71c;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 113rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
.edition {
|
||||
margin-bottom: 20rpx;
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
.level {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 2rpx solid $border-color-light;
|
||||
text:nth-child(1) {
|
||||
font-size: $font-base;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
.detail {
|
||||
margin-left: 20rpx;
|
||||
line-height: 2em;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -45,9 +45,9 @@ export default {
|
|||
storage,
|
||||
config,
|
||||
feedBack: {
|
||||
type:"FUNCTION"
|
||||
type: "FUNCTION", //默认反馈问题为 '功能相关'
|
||||
},
|
||||
action: upload,
|
||||
action: upload, //图片上传地址
|
||||
list: [
|
||||
{ text: "功能相关", value: "FUNCTION" },
|
||||
{ text: "优化反馈", value: "OPTIMIZE" },
|
||||
|
@ -55,8 +55,8 @@ export default {
|
|||
],
|
||||
};
|
||||
},
|
||||
onReady() {},
|
||||
methods: {
|
||||
// 点击反馈内容
|
||||
handleClick(index) {
|
||||
this.$set(this.feedBack, "type", this.list[index].value);
|
||||
},
|
||||
|
@ -64,14 +64,15 @@ export default {
|
|||
//图片上传
|
||||
onUploaded(lists) {
|
||||
let images = [];
|
||||
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
});
|
||||
console.log(images);
|
||||
this.feedBack.images = images.join(",");
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交意见反馈
|
||||
*/
|
||||
submit() {
|
||||
if (!this.feedBack.type) {
|
||||
uni.showToast({
|
||||
|
@ -97,7 +98,7 @@ export default {
|
|||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 提交 */
|
||||
feedBack(this.feedBack).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
|
|
|
@ -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>
|
|
@ -40,10 +40,9 @@
|
|||
|
||||
<script>
|
||||
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
|
||||
|
||||
import storage from "@/utils/storage.js";
|
||||
import { md5 } from "@/utils/md5.js";
|
||||
import myVerification from "@/components/verification/verification.vue";
|
||||
import { md5 } from "@/utils/md5.js"; // md5
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
export default {
|
||||
components: {
|
||||
|
@ -65,15 +64,15 @@ export default {
|
|||
],
|
||||
step: 0, //当前验证步骤
|
||||
flage: false, //是否验证码验证
|
||||
// 验证码登录form
|
||||
|
||||
codeForm: {
|
||||
mobile: "", //手机号
|
||||
code: "", //验证码
|
||||
},
|
||||
newPassword: "",//新密码
|
||||
newPassword: "", //新密码
|
||||
password: "", //密码
|
||||
tips: "", //提示
|
||||
seconds: 60,
|
||||
tips: "", //提示
|
||||
seconds: 60, // 60s等待时间
|
||||
|
||||
// 验证码登录校验
|
||||
codeRules: {
|
||||
|
@ -174,7 +173,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
codeChange(text) {
|
||||
this.tips = text;
|
||||
},
|
||||
|
|
|
@ -1,80 +1,82 @@
|
|||
// TODO 第一版本暂无此功能 后续优化以及更新
|
||||
<template>
|
||||
<view class="face-login">
|
||||
<u-cell-group>
|
||||
<u-cell-item class="border-top" :arrow="false" title="面容登录">
|
||||
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="describe">开启后可使用面容认证完成快捷登录,设置仅对本机生效。</view>
|
||||
</view>
|
||||
<view class="face-login">
|
||||
<u-cell-group>
|
||||
<u-cell-item class="border-top" :arrow="false" title="面容登录">
|
||||
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="describe">开启后可使用面容认证完成快捷登录,设置仅对本机生效。</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from '@/utils/storage.js';
|
||||
import { setBiolofy } from '@/api/passport.js';
|
||||
import storage from "@/utils/storage.js";
|
||||
import { setBiolofy } from "@/api/passport.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checked: true
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
faceSwitchChange(value) {
|
||||
if (value === true) {
|
||||
const res = uni.getSystemInfoSync();
|
||||
plus.device.getInfo({
|
||||
success: function(e) {
|
||||
let params = {
|
||||
mobile_type: res.model,
|
||||
secret_key: e.uuid
|
||||
};
|
||||
setBiolofy(params).then(res => {
|
||||
if (res.statusCode === 200) {
|
||||
storage.setFaceLogin(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(e) {
|
||||
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
|
||||
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
storage.setFaceLogin(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP-PLUS
|
||||
uni.checkIsSupportSoterAuthentication({
|
||||
success(res) {
|
||||
if (!res.supportMode.find(e => e === 'facial')) {
|
||||
plus.nativeUI.toast('此设备不支持面部识别');
|
||||
uni.navigateBack();
|
||||
}
|
||||
uni.checkIsSoterEnrolledInDevice({
|
||||
checkAuthMode: 'facial',
|
||||
success(_res) {
|
||||
if (!_res.isEnrolled) {
|
||||
plus.nativeUI.toast('此设备未录入面部信息');
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
fail(_err) {
|
||||
// plus.nativeUI.toast(JSON.stringify(_err));
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
// plus.nativeUI.toast(JSON.stringify(err));
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
this.checked = storage.getFaceLogin() || false;
|
||||
// #endif
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$lightColor,
|
||||
checked: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
faceSwitchChange(value) {
|
||||
if (value === true) {
|
||||
const res = uni.getSystemInfoSync();
|
||||
plus.device.getInfo({
|
||||
success: function (e) {
|
||||
let params = {
|
||||
mobile_type: res.model,
|
||||
secret_key: e.uuid,
|
||||
};
|
||||
setBiolofy(params).then((res) => {
|
||||
if (res.statusCode === 200) {
|
||||
storage.setFaceLogin(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function (e) {
|
||||
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
|
||||
console.error("getDeviceInfo failed: " + JSON.stringify(e));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
storage.setFaceLogin(false);
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP-PLUS
|
||||
uni.checkIsSupportSoterAuthentication({
|
||||
success(res) {
|
||||
if (!res.supportMode.find((e) => e === "facial")) {
|
||||
plus.nativeUI.toast("此设备不支持面部识别");
|
||||
uni.navigateBack();
|
||||
}
|
||||
uni.checkIsSoterEnrolledInDevice({
|
||||
checkAuthMode: "facial",
|
||||
success(_res) {
|
||||
if (!_res.isEnrolled) {
|
||||
plus.nativeUI.toast("此设备未录入面部信息");
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
fail(_err) {
|
||||
// plus.nativeUI.toast(JSON.stringify(_err));
|
||||
uni.navigateBack();
|
||||
},
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
// plus.nativeUI.toast(JSON.stringify(err));
|
||||
uni.navigateBack();
|
||||
},
|
||||
});
|
||||
this.checked = storage.getFaceLogin() || false;
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,70 +1,70 @@
|
|||
// TODO 第一版本暂无此功能 后续优化以及更新
|
||||
<template>
|
||||
<view class="finger">
|
||||
<u-cell-group>
|
||||
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
|
||||
<u-switch slot="right-icon" @change="fingerSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="describe">开启后可使用指纹认证完成快捷登录,设置仅对本机生效。如需修改指纹,请在系统设置中操作。</view>
|
||||
</view>
|
||||
<view class="finger">
|
||||
<u-cell-group>
|
||||
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
|
||||
<u-switch slot="right-icon" @change="fingerSwitchChange" :active-color="lightColor" size="40" v-model="checked"></u-switch>
|
||||
</u-cell-item>
|
||||
</u-cell-group>
|
||||
<view class="describe">开启后可使用指纹认证完成快捷登录,设置仅对本机生效。如需修改指纹,请在系统设置中操作。</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from '@/utils/storage.js';
|
||||
import { setBiolofy } from '@/api/passport.js';
|
||||
import storage from "@/utils/storage.js";
|
||||
import { setBiolofy } from "@/api/passport.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checked: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
fingerSwitchChange(value) {
|
||||
if (value === true) {
|
||||
const res = uni.getSystemInfoSync();
|
||||
plus.device.getInfo({
|
||||
success: function(e) {
|
||||
let params = {
|
||||
mobile_type: res.model,
|
||||
secret_key: e.uuid
|
||||
};
|
||||
setBiolofy(params).then(res => {
|
||||
if (res.statusCode === 200) {
|
||||
storage.setFingerLogin(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(e) {
|
||||
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
storage.setFingerLogin(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!plus.fingerprint.isSupport()) {
|
||||
plus.nativeUI.toast('此设备不支持指纹识别');
|
||||
uni.navigateBack();
|
||||
}
|
||||
if (!plus.fingerprint.isKeyguardSecure()) {
|
||||
plus.nativeUI.toast('此设备未设置密码锁屏');
|
||||
uni.navigateBack();
|
||||
}
|
||||
if (!plus.fingerprint.isEnrolledFingerprints()) {
|
||||
plus.nativeUI.toast('此设备未录入指纹');
|
||||
uni.navigateBack();
|
||||
}
|
||||
this.checked = storage.getFingerLogin() || false;
|
||||
// #endif
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
lightColor: this.$lightColor,
|
||||
checked: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
fingerSwitchChange(value) {
|
||||
if (value === true) {
|
||||
const res = uni.getSystemInfoSync();
|
||||
plus.device.getInfo({
|
||||
success: function (e) {
|
||||
let params = {
|
||||
mobile_type: res.model,
|
||||
secret_key: e.uuid,
|
||||
};
|
||||
setBiolofy(params).then((res) => {
|
||||
if (res.statusCode === 200) {
|
||||
storage.setFingerLogin(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function (e) {
|
||||
console.error("getDeviceInfo failed: " + JSON.stringify(e));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
storage.setFingerLogin(false);
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!plus.fingerprint.isSupport()) {
|
||||
plus.nativeUI.toast("此设备不支持指纹识别");
|
||||
uni.navigateBack();
|
||||
}
|
||||
if (!plus.fingerprint.isKeyguardSecure()) {
|
||||
plus.nativeUI.toast("此设备未设置密码锁屏");
|
||||
uni.navigateBack();
|
||||
}
|
||||
if (!plus.fingerprint.isEnrolledFingerprints()) {
|
||||
plus.nativeUI.toast("此设备未录入指纹");
|
||||
uni.navigateBack();
|
||||
}
|
||||
this.checked = storage.getFingerLogin() || false;
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.finger {
|
||||
}
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
|
@ -323,6 +323,9 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview(urls, index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<view class="cell-view"> {{ complainTopic }} </view>
|
||||
<u-icon style="margin-left: 20rpx" name="arrow-down"></u-icon>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="cell-item complain-content">
|
||||
<view class="cell-title title"> 投诉内容 </view>
|
||||
<view class="cell-view content">
|
||||
|
@ -47,7 +47,8 @@
|
|||
<view class="cell-item">
|
||||
<view class="cell-title"> 投诉凭证 </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>
|
||||
|
@ -65,8 +66,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
storage,
|
||||
action: upload,
|
||||
action: upload, //上传图片地址
|
||||
orderStatusList: {
|
||||
//订单状态列表
|
||||
UNDELIVERED: "待发货",
|
||||
UNPAID: "未付款",
|
||||
PAID: "已付款",
|
||||
|
@ -77,45 +79,44 @@ export default {
|
|||
},
|
||||
complainValue: "", //投诉内容
|
||||
complainShow: false, //投诉主题开关
|
||||
complainTopic: "",
|
||||
// 投诉列表
|
||||
complainList: [],
|
||||
images: [],
|
||||
order: "",
|
||||
orderGoodsList: "",
|
||||
orderDetail: "",
|
||||
complainTopic: "", //投诉抱怨话题
|
||||
complainList: [], // 投诉列表
|
||||
images: [], //投诉内容图片
|
||||
order: "", //订单
|
||||
orderGoodsList: "", //订单商品
|
||||
orderDetail: "", //订单详情
|
||||
sn: "",
|
||||
skuId: "",
|
||||
skuId: "", //商品skuid
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
console.log(option);
|
||||
this.loadData(option.sn);
|
||||
this.sn = option.sn;
|
||||
this.skuId = option.skuId;
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getReasion();
|
||||
},
|
||||
methods: {
|
||||
onUploaded(lists) {
|
||||
console.log(lists);
|
||||
let images = [];
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 上传完成
|
||||
*/
|
||||
onUploaded(lists) {
|
||||
let images = [];
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
});
|
||||
|
||||
this.images = images;
|
||||
console.log(this.images);
|
||||
},
|
||||
// 提交
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSumit() {
|
||||
// 循环出商品
|
||||
let goods = this.orderGoodsList.filter((item) => {
|
||||
return item.skuId == this.skuId;
|
||||
});
|
||||
|
||||
//数据赋值
|
||||
let data = {
|
||||
complainTopic: this.complainTopic, //投诉主题,
|
||||
content: this.complainValue, //投诉内容
|
||||
|
@ -124,7 +125,6 @@ export default {
|
|||
orderSn: this.sn, //订单号
|
||||
skuId: this.skuId, //skuid
|
||||
};
|
||||
|
||||
addComplain(data).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
|
@ -142,6 +142,9 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取投诉原因
|
||||
*/
|
||||
getReasion() {
|
||||
getComplainReason().then((res) => {
|
||||
if (res.data.result.length >= 1) {
|
||||
|
@ -153,10 +156,13 @@ export default {
|
|||
this.complainList.push(way);
|
||||
});
|
||||
this.complainTopic = res.data.result[0].reason;
|
||||
console.log(this.complainTopic);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载订单详情
|
||||
*/
|
||||
loadData(sn) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -166,12 +172,14 @@ export default {
|
|||
this.order = order.order;
|
||||
this.orderGoodsList = order.orderItems;
|
||||
this.orderDetail = res.data.result;
|
||||
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认投诉
|
||||
*/
|
||||
confirmComplain(e) {
|
||||
console.log(e);
|
||||
this.complainTopic = e[0].label;
|
||||
},
|
||||
},
|
||||
|
|
|
@ -2,76 +2,28 @@
|
|||
<view class="wrapper">
|
||||
<view class="tips">我的投诉信息</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.goodsName"
|
||||
title="投诉商品"
|
||||
></u-cell-item>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="statusData[detail.complainStatus]"
|
||||
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)"
|
||||
/>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.goodsName" title="投诉商品"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="statusData[complainDetail.complainStatus]" title="投诉状态"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.createTime" title="投诉时间"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.complainTopic" title="投诉主题"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.content" title="投诉内容"></u-cell-item>
|
||||
<view class="row" v-if="complainDetail.orderComplaintImages">
|
||||
<u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.orderComplaintImages" :key="index" :src="item"
|
||||
@click="preview(complainDetail.orderComplaintImages, index)" />
|
||||
</view>
|
||||
</u-cell-group>
|
||||
<view class="tips">商家申诉信息</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
:value="detail.appealTime || '暂无'"
|
||||
title="申诉时间"
|
||||
></u-cell-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"
|
||||
/>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.appealTime || '暂无'" title="申诉时间"></u-cell-item>
|
||||
<u-cell-item :arrow="false" :value="complainDetail.appealContent || '暂无'" title="申诉内容"></u-cell-item>
|
||||
<view class="row" v-if="complainDetail.appealImagesList">
|
||||
<u-image width="100rpx" height="100rpx" border-radius="10" style="margin: 0 10rpx" v-for="(item, index) in complainDetail.appealImagesList"
|
||||
@click="preview(complainDetail.appealImagesList, index)" :key="index" :src="item" />
|
||||
</view>
|
||||
</u-cell-group>
|
||||
<view class="tips">对话详情</view>
|
||||
<view class="speak-way" v-if="detail.orderComplaintCommunications">
|
||||
<view
|
||||
class="speak-msg seller"
|
||||
:key="i"
|
||||
v-for="(complaint, i) in detail.orderComplaintCommunications"
|
||||
>
|
||||
<view class="speak-way" v-if="complainDetail.orderComplaintCommunications">
|
||||
<view class="speak-msg seller" :key="i" v-for="(complaint, i) in complainDetail.orderComplaintCommunications">
|
||||
{{
|
||||
complaint.owner == "PLATFORM"
|
||||
? "平台"
|
||||
|
@ -85,11 +37,7 @@
|
|||
<view class="speak-way" v-else>暂无对话</view>
|
||||
<view class="tips">平台仲裁</view>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
:arrow="false"
|
||||
title="仲裁意见"
|
||||
:value="detail.arbitrationResult || '暂无'"
|
||||
></u-cell-item>
|
||||
<u-cell-item :arrow="false" title="仲裁意见" :value="complainDetail.arbitrationResult || '暂无'"></u-cell-item>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -99,8 +47,7 @@ import { getComplainDetail } from "@/api/after-sale";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
detail: "",
|
||||
|
||||
complainDetail: "", //投诉详情
|
||||
statusData: {
|
||||
NO_APPLY: "未申请",
|
||||
APPLYING: "申请中",
|
||||
|
@ -110,10 +57,14 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.init(option.id);
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview(urls, index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
|
@ -125,24 +76,29 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 初始化投诉详情
|
||||
*/
|
||||
init(id) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
getComplainDetail(id).then((res) => {
|
||||
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();
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.row {
|
||||
display: flex;
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
<view
|
||||
class="seller-view"
|
||||
v-for="(item, index) in complaionData"
|
||||
:key="index"
|
||||
>
|
||||
<view class="seller-view" v-for="(item, index) in complaionData" :key="index">
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name">
|
||||
<view class="name">{{ item.storeName }}</view>
|
||||
|
@ -14,12 +10,7 @@
|
|||
<u-line color="#DCDFE6"></u-line>
|
||||
<view class="goods-item-view">
|
||||
<view class="goods-img" @click="handleToGoods(item)">
|
||||
<u-image
|
||||
border-radius="6"
|
||||
width="131rpx"
|
||||
height="131rpx"
|
||||
:src="item.goodsImage"
|
||||
></u-image>
|
||||
<u-image border-radius="6" width="131rpx" height="131rpx" :src="item.goodsImage"></u-image>
|
||||
</view>
|
||||
<view class="goods-info" @click="handleToGoods(item)">
|
||||
<view class="goods-title u-line-2">{{ item.goodsName }}</view>
|
||||
|
@ -37,34 +28,16 @@
|
|||
<view class="complain-speak"> {{ item.complainTopic }} </view>
|
||||
</view>
|
||||
<view class="complain-btn">
|
||||
<u-tag
|
||||
mode="plain"
|
||||
@click="handleClear(item)"
|
||||
class="complain-tag"
|
||||
text="撤销投诉"
|
||||
type="info"
|
||||
v-if="
|
||||
<u-tag mode="plain" @click="handleClear(item)" class="complain-tag" text="撤销投诉" type="info" v-if="
|
||||
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 v-if="empty" style="margin-top: 40rpx">
|
||||
<u-empty text="暂无投诉列表" mode="list"></u-empty>
|
||||
</view>
|
||||
<u-modal
|
||||
show-cancel-button
|
||||
@confirm="handleClearConfirm"
|
||||
v-model="show"
|
||||
:content="content"
|
||||
></u-modal>
|
||||
|
||||
<u-empty v-if="empty" :style="{'marginTop':complaionDetail.total == 0 ? '200rpx':'0rpx'}" class="empty" style="" text="暂无投诉列表" mode="list"></u-empty>
|
||||
|
||||
<u-modal show-cancel-button @confirm="handleClearConfirm" v-model="show" :content="content"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -87,38 +60,49 @@ export default {
|
|||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
// memberId: "",
|
||||
// memberName: "",
|
||||
},
|
||||
complaionData: [],
|
||||
complaionDetail: "", //返回的整个response
|
||||
complaionData: [], //投诉列表
|
||||
empty: false,
|
||||
rows: "",
|
||||
checkComplainData: "", //存储投诉信息
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
/**
|
||||
* 触底加载
|
||||
*/
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.init();
|
||||
if (
|
||||
this.complaionDetail &&
|
||||
this.complaionDetail.total < this.params.pageNumber * this.params.pageSize
|
||||
) {
|
||||
this.params.pageNumber++;
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 点击跳转到商品
|
||||
handleToGoods(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/goods?id=" + val.skuId+"&goodsId="+val.goodsId,
|
||||
url: "/pages/product/goods?id=" + val.skuId + "&goodsId=" + val.goodsId,
|
||||
});
|
||||
},
|
||||
|
||||
// 撤销投诉
|
||||
/**
|
||||
* 点击撤销投诉
|
||||
*/
|
||||
handleClear(val) {
|
||||
console.log(val);
|
||||
this.show = true;
|
||||
this.rows = val;
|
||||
this.checkComplainData = val;
|
||||
},
|
||||
/**
|
||||
* 执行撤销
|
||||
*/
|
||||
handleClearConfirm() {
|
||||
clearComplain(this.rows.id).then((res) => {
|
||||
clearComplain(this.checkComplainData.id).then((res) => {
|
||||
if (res.data.success) {
|
||||
uni.showToast({
|
||||
title: "撤销成功",
|
||||
|
@ -131,19 +115,25 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*/
|
||||
handleInfo(val) {
|
||||
uni.navigateTo({
|
||||
url: "./complainInfo?id=" + val.id,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化投诉列表
|
||||
*/
|
||||
init() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
|
||||
getComplain(this.params).then((res) => {
|
||||
console.log(res);
|
||||
this.complaionDetail = res.data.result;
|
||||
if (res.data.result.records.length >= 1) {
|
||||
this.complaionData.push(...res.data.result.records);
|
||||
} else {
|
||||
|
@ -185,4 +175,7 @@ export default {
|
|||
.complain-tag {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.empty {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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>
|
|
@ -3,13 +3,7 @@
|
|||
<view class="exaluate-member-view">
|
||||
<view class="member-view">
|
||||
<view class="member-img">
|
||||
<u-image
|
||||
width="82rpx"
|
||||
style="border: 1px solid #ededed"
|
||||
height="82rpx"
|
||||
shape="circle"
|
||||
:src="comment.memberProfile || '/static/missing-face.png'"
|
||||
></u-image>
|
||||
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
|
||||
</view>
|
||||
<view class="member-info">
|
||||
<view class="memName">{{ comment.memberName }}</view>
|
||||
|
@ -17,21 +11,13 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="goods-view">
|
||||
<view class="goods-title"
|
||||
>商品评价: {{ gradeList[comment.grade] }}</view
|
||||
>
|
||||
<view class="goods-title">商品评价: {{ gradeList[comment.grade] }}</view>
|
||||
<view class="goods-subtitle">
|
||||
{{ comment.content }}
|
||||
|
||||
</view>
|
||||
<view class="goods-imgs-view" v-if="comment.image != null && comment.image.length != 0">
|
||||
|
||||
<view
|
||||
class="img-view"
|
||||
v-for="(img, imgIndex) in comment.image.split(',')"
|
||||
:key="imgIndex"
|
||||
|
||||
>
|
||||
<!-- 如果有图片则会循环显示评价的图片 -->
|
||||
<view class="goods-imgs-view" v-if="comment.image != null && comment.image.length != 0">
|
||||
<view 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>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -39,38 +25,7 @@
|
|||
{{ comment.goodsName }}
|
||||
</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>
|
||||
|
@ -80,9 +35,9 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: "",
|
||||
comment: {},
|
||||
gradeList: {
|
||||
comment: {}, //评论信息
|
||||
gradeList: {
|
||||
//评价grade
|
||||
GOOD: "好评",
|
||||
MODERATE: "中评",
|
||||
WORSE: "差评",
|
||||
|
@ -92,11 +47,12 @@ export default {
|
|||
},
|
||||
onLoad(options) {
|
||||
this.comment = JSON.parse(decodeURIComponent(options.comment));
|
||||
|
||||
},
|
||||
methods: {
|
||||
preview(urls, index) {
|
||||
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview(urls, index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
.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;
|
||||
}
|
||||
<style lang="scss" scoped>
|
||||
.memName {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.additional {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.goods-name {
|
||||
border-bottom: 1px solid #ededed;
|
||||
padding-bottom: 30rpx;
|
||||
|
@ -162,73 +86,7 @@ page,
|
|||
background: $page-color-base;
|
||||
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 {
|
||||
background-color: #fff;
|
||||
margin-top: 12rpx;
|
||||
|
@ -247,26 +105,26 @@ page,
|
|||
}
|
||||
.goods-view {
|
||||
margin-left: 15rpx;
|
||||
.border-bottom {
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
.goods-title {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-subtitle {
|
||||
margin-bottom: 20rpx;
|
||||
color: #909399;
|
||||
}
|
||||
.goods-imgs-view {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.img-view {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.border-bottom {
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
.goods-title {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-subtitle {
|
||||
margin-bottom: 20rpx;
|
||||
color: #909399;
|
||||
}
|
||||
.goods-imgs-view {
|
||||
margin: 20rpx 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.img-view {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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>
|
|
@ -2,9 +2,9 @@
|
|||
<view>
|
||||
<view class="wrap">
|
||||
<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>
|
||||
<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">
|
||||
<scroll-view scroll-y style="height: 100%" @scrolltolower="renderData(listIndex)">
|
||||
<u-empty text="尚无需要评价的商品" mode="list" v-if="orderList.length == 0"></u-empty>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<rich-text :nodes="'评论内容:' + order.content || ''"></rich-text>
|
||||
</u-read-more>
|
||||
</view>
|
||||
|
||||
|
||||
<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">
|
||||
<u-image v-if="order.image" @click.native="
|
||||
|
@ -47,7 +47,7 @@
|
|||
</view>
|
||||
<view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'">
|
||||
<view class="evaluate">
|
||||
<view @click="onCommont(order)">
|
||||
<view @click="talkCommont(order)">
|
||||
<u-tag text="发表评价" shape="circle" mode="plain" type="error" />
|
||||
</view>
|
||||
</view>
|
||||
|
@ -69,14 +69,7 @@ import { getComments } from "@/api/members.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
customStyle: {
|
||||
backgroundColor: this.$lightColor,
|
||||
color: "#FFF",
|
||||
height: "60rpx",
|
||||
width: "150rpx",
|
||||
margin: "20rpx 0",
|
||||
},
|
||||
list: [
|
||||
list: [ //顶部tab
|
||||
{
|
||||
name: "待评价",
|
||||
},
|
||||
|
@ -84,28 +77,32 @@ export default {
|
|||
name: "已评价",
|
||||
},
|
||||
],
|
||||
gradeList: {
|
||||
gradeList: { //评论表
|
||||
GOOD: "好评",
|
||||
MODERATE: "中评",
|
||||
WORSE: "差评",
|
||||
haveImage: "有图",
|
||||
},
|
||||
current: 0,
|
||||
orderList: [],
|
||||
current: 0, //当前tabIndex
|
||||
orderList: [], //商品集合
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
orderStatus: "",
|
||||
loadStatus: "more",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.orderList = [];
|
||||
this.params.pageNumber = 1;
|
||||
this.current == 0 ? this.loadData() : this.loadComments();
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
* 切换current
|
||||
* 更改页面并重新加载数据
|
||||
*/
|
||||
current(val) {
|
||||
this.params.pageNumber = 1;
|
||||
this.params.loadStatus = "more";
|
||||
|
@ -120,16 +117,16 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 判断当前店铺是否有可评价的商品
|
||||
/**
|
||||
* 判断当前店铺是否有可评价的商品
|
||||
*/
|
||||
commentStatus(val) {
|
||||
if (this.current == 1) {
|
||||
return true;
|
||||
} else {
|
||||
let show;
|
||||
|
||||
val.orderItems &&
|
||||
val.orderItems.forEach((item) => {
|
||||
if (item.commentStatus == "UNFINISHED") {
|
||||
|
@ -143,6 +140,9 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview(urls, index) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
|
@ -155,14 +155,27 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
change(index) {
|
||||
/**
|
||||
* 点击tab触发
|
||||
*/
|
||||
changeTab(index) {
|
||||
this.current = index;
|
||||
},
|
||||
changeTab(e) {
|
||||
|
||||
/**
|
||||
* 点击swiper
|
||||
*/
|
||||
changeSwiper(e) {
|
||||
this.current = e.target.current;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取订单数据
|
||||
*/
|
||||
loadData() {
|
||||
uni.showLoading({});
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
getOrderList(this.params).then((res) => {
|
||||
uni.hideLoading();
|
||||
const orderList = res.data.result.records;
|
||||
|
@ -175,15 +188,25 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
onCommont(order) {
|
||||
|
||||
/**
|
||||
* 发表评价
|
||||
*/
|
||||
talkCommont(order) {
|
||||
uni.navigateTo({
|
||||
url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent(
|
||||
JSON.stringify(order)
|
||||
)}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载已评价数据
|
||||
*/
|
||||
loadComments() {
|
||||
uni.showLoading({});
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
getComments(this.params).then((res) => {
|
||||
uni.hideLoading();
|
||||
let orderList = res.data.result.records;
|
||||
|
@ -200,19 +223,14 @@ export default {
|
|||
},
|
||||
];
|
||||
});
|
||||
|
||||
this.orderList = this.orderList.concat(orderList);
|
||||
|
||||
this.params.pageNumber += 1;
|
||||
});
|
||||
},
|
||||
onAgain(order) {
|
||||
uni.navigateTo({
|
||||
url: `./againEvaluate?order=${encodeURIComponent(
|
||||
JSON.stringify(order)
|
||||
)}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滑到底部加载数据
|
||||
*/
|
||||
renderData(index) {
|
||||
if (this.params.loadStatus == "noMore") return;
|
||||
if (index == 0) {
|
||||
|
@ -224,13 +242,11 @@ export default {
|
|||
this.params.comment_status = "WAIT_CHASE";
|
||||
this.loadComments();
|
||||
}
|
||||
if (index == 2) {
|
||||
this.params.audit_status = "";
|
||||
this.params.comments_type = "";
|
||||
this.params.comment_status = "FINISHED";
|
||||
this.loadComments();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 评价详情
|
||||
*/
|
||||
onDetail(comment) {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 遍历出评价商品 -->
|
||||
<view v-for="(sku, index) in order.orderItems" :key="index">
|
||||
<view class="after-sales-goods-detail-view">
|
||||
<view>
|
||||
|
@ -45,7 +46,7 @@
|
|||
</view>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -88,47 +89,45 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
storage,
|
||||
value: "",
|
||||
type: "textarea",
|
||||
border: false,
|
||||
maxlength: 500,
|
||||
type: "textarea", //输入框状态为 textarea
|
||||
border: false, //没有border
|
||||
maxlength: 500, //评价最大字数为500字
|
||||
placeholder:
|
||||
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
|
||||
order: {},
|
||||
order: {}, //订单信息
|
||||
form: {
|
||||
content: "",
|
||||
goodsId: "",
|
||||
grade: "GOOD",
|
||||
orderItemSn: "",
|
||||
skuId: "",
|
||||
descriptionScore: 5,
|
||||
serviceScore: 5,
|
||||
deliveryScore: 5,
|
||||
// // 是否为初评价 true 默认为初评
|
||||
// first_comment: true,
|
||||
//content,grade: 'GOOD',skuId,images:[]
|
||||
content: "", //评价详情
|
||||
goodsId: "", //商品id
|
||||
grade: "GOOD", //默认为好评
|
||||
orderItemSn: "", //商品的sn
|
||||
skuId: "", //商品skuId
|
||||
descriptionScore: 5, //默认描述得分为5分
|
||||
serviceScore: 5, //默认服务得分为5分
|
||||
deliveryScore: 5, //默认物流得分为5分
|
||||
},
|
||||
currentIndex: 0,
|
||||
action: upload,
|
||||
action: upload, //图片上传地址
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// 获取上一级传过来的数据进行解析
|
||||
this.form.orderItemSn = options.sn;
|
||||
this.order = JSON.parse(decodeURIComponent(options.order));
|
||||
//现在只能一个商品一个评价
|
||||
},
|
||||
mounted() {
|
||||
this.form.goodsId = this.order.orderItems[0].goodsId;
|
||||
this.form.orderItemSn = this.order.orderItems[0].sn;
|
||||
this.form.skuId = this.order.orderItems[0].skuId;
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(index) {
|
||||
this.currentIndex = index;
|
||||
},
|
||||
onGrade(grade, index) {
|
||||
|
||||
/**
|
||||
* 点击评价
|
||||
*/
|
||||
onGrade(grade) {
|
||||
this.form.grade = grade;
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交评价
|
||||
*/
|
||||
onSubmit() {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
|
@ -148,9 +147,12 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 图片成功后回调
|
||||
*/
|
||||
onUploaded(lists) {
|
||||
let images = [];
|
||||
console.log(lists);
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
});
|
||||
|
|
|
@ -63,6 +63,9 @@ export default {
|
|||
this.order = order;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
preview() {
|
||||
//预览发票
|
||||
if (this.order.elec_file_list.length) {
|
||||
|
|
|
@ -23,31 +23,30 @@
|
|||
<script>
|
||||
import { sendMobile, smsLogin } from "@/api/login";
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import storage from "@/utils/storage.js";
|
||||
|
||||
import myVerification from "@/components/verification/verification.vue";
|
||||
import uuid from "@/utils/uuid.modified.js";
|
||||
import storage from "@/utils/storage.js"; //缓存
|
||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
||||
import uuid from "@/utils/uuid.modified.js"; // uuid
|
||||
export default {
|
||||
components: {
|
||||
myVerification,
|
||||
},
|
||||
props: ["status"],
|
||||
props: ["status"], //是否勾选 《用户隐私》和《隐私政策》
|
||||
data() {
|
||||
return {
|
||||
uuid,
|
||||
flage: false, //是否验证码验证
|
||||
codeFlag: true,
|
||||
|
||||
// 验证码登录form
|
||||
codeFlag: true, //验证开关
|
||||
codeForm: {
|
||||
mobile: "",
|
||||
code: "",
|
||||
mobile: "", //手机号
|
||||
code: "", //验证码
|
||||
},
|
||||
tips: "",
|
||||
clientType: "",
|
||||
tips: "", //提示
|
||||
clientType: "", // 客户端类型
|
||||
seconds: 60,
|
||||
// 验证码登录校验
|
||||
|
||||
codeRules: {
|
||||
// 手机号验证
|
||||
mobile: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
|
@ -57,6 +56,7 @@ export default {
|
|||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
// 验证码验证
|
||||
code: [
|
||||
{
|
||||
min: 4,
|
||||
|
@ -72,6 +72,9 @@ export default {
|
|||
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||
mounted() {
|
||||
this.$refs.validateCodeForm.setRules(this.codeRules);
|
||||
/**
|
||||
* 条件编译判断当前客户端类型
|
||||
*/
|
||||
//#ifdef H5
|
||||
this.clientType = "H5";
|
||||
//#endif
|
||||
|
@ -115,6 +118,10 @@ export default {
|
|||
// 登录
|
||||
submit() {
|
||||
if (!this.status) {
|
||||
/**
|
||||
* 用户必须了解
|
||||
* 用户协议以及隐私政策
|
||||
*/
|
||||
uni.showToast({
|
||||
title: "请您阅读并同意用户协议以及隐私政策",
|
||||
duration: 2000,
|
||||
|
@ -125,18 +132,30 @@ export default {
|
|||
let _this = this;
|
||||
this.$refs.validateCodeForm.validate((valid) => {
|
||||
if (valid) {
|
||||
/**
|
||||
* 清空当前账号信息
|
||||
*/
|
||||
storage.setHasLogin(false);
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUuid(this.uuid.v1());
|
||||
storage.setUserInfo({});
|
||||
/**
|
||||
* 执行登录
|
||||
*/
|
||||
smsLogin(this.codeForm, _this.clientType).then((res) => {
|
||||
if (res.data.success) {
|
||||
storage.setAccessToken(res.data.result.accessToken);
|
||||
storage.setRefreshToken(res.data.result.refreshToken);
|
||||
|
||||
/**
|
||||
* 登录成功后获取个人信息
|
||||
*/
|
||||
getUserInfo().then((user) => {
|
||||
if (user.data.success) {
|
||||
/**
|
||||
* 个人信息存储到缓存userInfo中
|
||||
*/
|
||||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
// 登录成功
|
||||
|
@ -145,34 +164,12 @@ export default {
|
|||
icon: "none",
|
||||
});
|
||||
|
||||
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",
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 计算出当前router路径
|
||||
* 1.如果跳转的链接为登录页面或跳转的链接为空页面。则会重新跳转到首页
|
||||
* 2.都不满足返回跳转页面
|
||||
*/
|
||||
whetherNavigate();
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
|
@ -184,15 +181,16 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 跳转到一键登录
|
||||
clickLogin() {
|
||||
this.$emit("open", "click");
|
||||
},
|
||||
|
||||
/**点击验证码*/
|
||||
codeChange(text) {
|
||||
console.log(text);
|
||||
this.tips = text;
|
||||
},
|
||||
/** 结束验证码后执行 */
|
||||
end() {},
|
||||
/**获取验证码 */
|
||||
getCode() {
|
||||
|
@ -219,6 +217,8 @@ export default {
|
|||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 点击获取验证码
|
||||
start() {
|
||||
this.$u.toast("验证码已发送");
|
||||
this.flage = false;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<div class="form">
|
||||
<u-form ref="validateCodeForm">
|
||||
<div class="login-list">
|
||||
|
||||
<!-- 循环出当前可使用的第三方登录模式 -->
|
||||
<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>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
<script>
|
||||
import { webConnect, openIdLogin } from "@/api/connect.js";
|
||||
|
||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||
import { getUserInfo } from "@/api/members";
|
||||
import storage from "@/utils/storage.js";
|
||||
|
||||
|
@ -48,7 +48,7 @@ export default {
|
|||
props: ["status"],
|
||||
mounted() {
|
||||
//#ifdef APP-PLUS
|
||||
//如果是app 加载支持的登录方式
|
||||
/**如果是app 加载支持的登录方式*/
|
||||
let _this = this;
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
|
@ -94,7 +94,11 @@ export default {
|
|||
});
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log("获取登录通道失败", error);
|
||||
uni.showToast({
|
||||
title: "获取登录通道失败" + error,
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
},
|
||||
});
|
||||
//#endif
|
||||
|
@ -111,21 +115,28 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
/** 根据参数显示登录模块 */
|
||||
methodFilter(code) {
|
||||
let way = [];
|
||||
this.loginList.forEach((item) => {
|
||||
code.length != 0
|
||||
? code.forEach((val) => {
|
||||
if (item.code == val) {
|
||||
way.push(item);
|
||||
}
|
||||
})
|
||||
: console.error("error");
|
||||
if (code.length != 0) {
|
||||
code.forEach((val) => {
|
||||
if (item.code == val) {
|
||||
way.push(item);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '配置有误请联系管理员',
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
});
|
||||
}
|
||||
});
|
||||
this.loginList = way;
|
||||
},
|
||||
|
||||
toLogin(connectLogin) {
|
||||
/**跳转到登录页面 */
|
||||
navigateLogin(connectLogin) {
|
||||
if (!this.status) {
|
||||
uni.showToast({
|
||||
title: "请您阅读并同意用户协议以及隐私政策",
|
||||
|
@ -148,6 +159,8 @@ export default {
|
|||
this.nonH5OpenId(connectLogin);
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 跳转到一键登录
|
||||
clickCodeLogin() {
|
||||
this.$emit("open", "code");
|
||||
},
|
||||
|
@ -169,7 +182,6 @@ export default {
|
|||
// #endif
|
||||
},
|
||||
fail(e) {
|
||||
console.log(e);
|
||||
uni.showToast({
|
||||
title: "第三方登录暂不可用!",
|
||||
icon: "none",
|
||||
|
@ -184,15 +196,15 @@ export default {
|
|||
//写入用户信息
|
||||
uni.setStorageSync("nickname", infoRes.userInfo.nickName);
|
||||
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
//微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
|
||||
_this.weixinMPOpenID(res).then((res) => {
|
||||
//这里需要先行获得openid,再使用openid登录,小程序登录需要两步,所以这里特殊编译
|
||||
_this.goOpenidLogin("WECHAT_MP");
|
||||
});
|
||||
// #endif
|
||||
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
_this.goOpenidLogin("APP");
|
||||
//#endif
|
||||
|
@ -230,23 +242,17 @@ export default {
|
|||
title: "第三方登录成功!",
|
||||
icon: "none",
|
||||
});
|
||||
// 执行登录
|
||||
getUserInfo().then((user) => {
|
||||
storage.setUserInfo(user.data.result);
|
||||
storage.setHasLogin(true);
|
||||
});
|
||||
getCurrentPages().length > 1
|
||||
? uni.navigateBack({
|
||||
delta: getCurrentPages().length - 2,
|
||||
})
|
||||
: uni.switchTab({
|
||||
url: "/pages/tabbar/home/index",
|
||||
});
|
||||
whetherNavigate()
|
||||
}
|
||||
});
|
||||
},
|
||||
//微信小程序获取openid
|
||||
async weixinMPOpenID(res) {
|
||||
let openId = "";
|
||||
await miniProgramLogin(res.code).then((res) => {
|
||||
uni.setStorageSync("openid", res.data);
|
||||
});
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<view class="comment">
|
||||
<!-- <view class="status_bar" -->
|
||||
<!--</view> -->
|
||||
<view class="top-tab">
|
||||
<!-- <view class="good-comment">商品好评率{{ grade || "100" }}%</view> -->
|
||||
<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(1)" :class="{ cur: selectIndex == 1 }">好评{{ commentDetail.good }}</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>
|
||||
</view>
|
||||
|
||||
<!-- 评价 -->
|
||||
|
||||
<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">
|
||||
<div class="nodata" v-if="commDetail.length < 1">
|
||||
<div class="empty" v-if="commDetail.length < 1">
|
||||
<view>
|
||||
<image style="height: 240rpx; width: 320rpx" src="/static/nodata.png" alt="" />
|
||||
</view>
|
||||
<view>
|
||||
<p>暂无评价</p>
|
||||
<u-empty mode="message" text="赞无评论"></u-empty>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<view class="eva-box" v-for="(item, index) in commDetail" :key="index">
|
||||
<view class="section-info">
|
||||
<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="time">{{ item.createTime }}</text>
|
||||
</view>
|
||||
|
@ -44,48 +34,30 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="section-contant">
|
||||
<div class="con">{{ item.content }}</div>
|
||||
<div class="content">{{ item.content }}</div>
|
||||
<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>
|
||||
</view>
|
||||
<view class="bot">
|
||||
<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 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">
|
||||
商家回复:
|
||||
<span class="addCommentSpan">{{ item.reply }}</span>
|
||||
<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)">
|
||||
</u-image>
|
||||
</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>
|
||||
<u-loadmore bg-color="transparent" style="margin:40rpx 0" :status="status" @loadmore="loadmore()" icon-type="iconType" />
|
||||
</view>
|
||||
|
||||
<!-- <u-loadmore :status="status" @loadmore="loadmore()" icon-type="iconType" /> -->
|
||||
</scroll-view>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -93,23 +65,14 @@
|
|||
<script>
|
||||
// import { getGoodsDetail } from '@/api/goods.js';
|
||||
import * as membersApi from "@/api/members.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
header: {
|
||||
top: 0,
|
||||
height: 50,
|
||||
},
|
||||
DivHeight: "",
|
||||
status: "loadmore",
|
||||
commentObj: {},
|
||||
selectObj: [],
|
||||
commentDetail: "",
|
||||
status: "loadmore", //底部刷新状态
|
||||
commentDetail: "", //评价详情
|
||||
selectIndex: "0", //检索条件
|
||||
imgUrl: "",
|
||||
previewImgFlag: false,
|
||||
// 评论分页提交数据
|
||||
params: {
|
||||
params: { // 评论分页提交数据
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
grade: "",
|
||||
|
@ -122,21 +85,28 @@ export default {
|
|||
},
|
||||
// 评论详情
|
||||
commDetail: [],
|
||||
dataTotal: 0,
|
||||
|
||||
opid: "",
|
||||
grade: "100%",
|
||||
dataTotal: 0, //评论的总total数量
|
||||
opid: "", //上级传参id
|
||||
};
|
||||
},
|
||||
async onLoad(options) {
|
||||
this.grade = options.grade;
|
||||
|
||||
this.getGoodsCommentsFun(options.id);
|
||||
this.getGoodsCommentsNum(options.id);
|
||||
this.opid = options.id;
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
/**
|
||||
* 触底加载
|
||||
*/
|
||||
onReachBottom() {
|
||||
this.params.pageNumber++;
|
||||
this.getGoodsCommentsFun(this.opid);
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 切割图像
|
||||
*/
|
||||
splitImg(val) {
|
||||
if (val && val.split(",")) {
|
||||
return val.split(",");
|
||||
|
@ -146,12 +116,10 @@ export default {
|
|||
return false;
|
||||
}
|
||||
},
|
||||
loadmore() {
|
||||
this.params.pageNumber++;
|
||||
this.getGoodsCommentsFun(this.opid);
|
||||
},
|
||||
|
||||
// 获取商品评论
|
||||
/**
|
||||
* 获取商品评论
|
||||
*/
|
||||
getGoodsCommentsFun(id) {
|
||||
this.status = "loading";
|
||||
// getGoodsComments
|
||||
|
@ -165,13 +133,14 @@ export default {
|
|||
return false;
|
||||
}
|
||||
this.commDetail = this.commDetail.concat(res.data.result.records);
|
||||
|
||||
console.log(this.commDetail);
|
||||
this.dataTotal = res.data.result.total;
|
||||
this.status = "loadmore";
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取商品评论数
|
||||
*/
|
||||
getGoodsCommentsNum(id) {
|
||||
membersApi.getGoodsCommentsCount(id).then((res) => {
|
||||
if (res.statusCode === 200) {
|
||||
|
@ -179,10 +148,12 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 顶部筛选条件
|
||||
*/
|
||||
select(index) {
|
||||
//顶部筛选条件
|
||||
this.selectIndex = index;
|
||||
console.log(this.selectIndex);
|
||||
this.params.grade = ["", "GOOD", "MODERATE", "WORSE", ""][
|
||||
this.selectIndex
|
||||
];
|
||||
|
@ -197,27 +168,14 @@ export default {
|
|||
grade: "",
|
||||
};
|
||||
}
|
||||
|
||||
// 重新加载评论
|
||||
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) {
|
||||
console.log(urls);
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: urls,
|
||||
|
@ -240,10 +198,6 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.previewImgFlag = false;
|
||||
this.imgUrl = "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -285,123 +239,14 @@ export default {
|
|||
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 {
|
||||
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 {
|
||||
color: #333;
|
||||
background: #f7f7f7;
|
||||
|
||||
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 {
|
||||
background: #fff;
|
||||
|
@ -412,11 +257,6 @@ page {
|
|||
padding: 0 30rpx 0 30rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.good-comment {
|
||||
text-align: right;
|
||||
color: #a5a5a5;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
|
@ -449,7 +289,7 @@ page {
|
|||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
/* star */
|
||||
.star-con {
|
||||
.star-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
@ -493,7 +333,7 @@ page {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.con {
|
||||
.content {
|
||||
font-size: 24rpx;
|
||||
line-height: 46rpx;
|
||||
font-weight: 400;
|
||||
|
@ -519,7 +359,7 @@ page {
|
|||
color: $font-color-light;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.zan {
|
||||
.good {
|
||||
color: #333;
|
||||
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;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 346rpx;
|
||||
height: 304rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</view>
|
||||
<view class="section-contant">
|
||||
<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>
|
||||
<scroll-view scroll-x class="scroll-x" v-if="commItem.image">
|
||||
<view class="img">
|
||||
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
</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>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -48,7 +48,7 @@ import * as API_Members from "@/api/members.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
lightColor:this.$lightColor,
|
||||
lightColor: this.$lightColor,
|
||||
// 评论集合
|
||||
commDetail: [],
|
||||
// 评论分页提交数据
|
||||
|
@ -81,7 +81,9 @@ export default {
|
|||
url: `/pages/product/comment?id=${id}&grade=${grade}`,
|
||||
});
|
||||
},
|
||||
// 预览
|
||||
/**
|
||||
* 点击图片放大或保存
|
||||
*/
|
||||
previewImg(url, index) {
|
||||
uni.previewImage({
|
||||
urls: url,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* 一些常用的基础方法
|
||||
* whetherNavigate 登录后跳转判断
|
||||
* unixToDate 将unix时间戳转换为指定格式
|
||||
* dateToUnix 将时间转unix时间戳
|
||||
* deepClone 对一个对象进行深拷贝
|
||||
|
@ -8,6 +9,39 @@
|
|||
* 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时间戳转换为指定格式
|
||||
* @param unix 时间戳【秒】
|
||||
|
@ -15,23 +49,30 @@
|
|||
* @returns {*|string}
|
||||
*/
|
||||
export function unixToDate(unix, format) {
|
||||
if (!unix) return unix
|
||||
let _format = format || 'yyyy-MM-dd hh:mm:ss'
|
||||
const d = new Date(unix)
|
||||
const o = {
|
||||
'M+': d.getMonth() + 1,
|
||||
'd+': d.getDate(),
|
||||
'h+': d.getHours(),
|
||||
'm+': d.getMinutes(),
|
||||
's+': d.getSeconds(),
|
||||
'q+': Math.floor((d.getMonth() + 3) / 3),
|
||||
S: d.getMilliseconds()
|
||||
}
|
||||
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
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
|
||||
if (!unix) return unix;
|
||||
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||
const d = new Date(unix);
|
||||
const o = {
|
||||
"M+": d.getMonth() + 1,
|
||||
"d+": d.getDate(),
|
||||
"h+": d.getHours(),
|
||||
"m+": d.getMinutes(),
|
||||
"s+": d.getSeconds(),
|
||||
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||
S: d.getMilliseconds(),
|
||||
};
|
||||
if (/(y+)/.test(_format))
|
||||
_format = _format.replace(
|
||||
RegExp.$1,
|
||||
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||
);
|
||||
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} 【秒】
|
||||
*/
|
||||
export function dateToUnix(date) {
|
||||
let newStr = date.replace(/:/g, '-')
|
||||
newStr = newStr.replace(/ /g, '-')
|
||||
const arr = newStr.split('-')
|
||||
const datum = new Date(Date.UTC(
|
||||
arr[0],
|
||||
arr[1] - 1,
|
||||
arr[2],
|
||||
arr[3] - 8 || -8,
|
||||
arr[4] || 0,
|
||||
arr[5] || 0
|
||||
))
|
||||
return parseInt(datum.getTime() / 1000)
|
||||
let newStr = date.replace(/:/g, "-");
|
||||
newStr = newStr.replace(/ /g, "-");
|
||||
const arr = newStr.split("-");
|
||||
const datum = new Date(
|
||||
Date.UTC(
|
||||
arr[0],
|
||||
arr[1] - 1,
|
||||
arr[2],
|
||||
arr[3] - 8 || -8,
|
||||
arr[4] || 0,
|
||||
arr[5] || 0
|
||||
)
|
||||
);
|
||||
return parseInt(datum.getTime() / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,8 +103,8 @@ export function dateToUnix(date) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function formatPrice(price) {
|
||||
if (typeof price !== 'number') return price
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
if (typeof price !== "number") return price;
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,11 +114,11 @@ export function formatPrice(price) {
|
|||
* @returns {*}
|
||||
*/
|
||||
export function secrecyMobile(mobile) {
|
||||
mobile = String(mobile)
|
||||
if (!/\d{11}/.test(mobile)) {
|
||||
return mobile
|
||||
}
|
||||
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
|
||||
mobile = String(mobile);
|
||||
if (!/\d{11}/.test(mobile)) {
|
||||
return mobile;
|
||||
}
|
||||
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,13 +127,14 @@ export function secrecyMobile(mobile) {
|
|||
* @returns {string}
|
||||
*/
|
||||
export function randomString(length = 32) {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
||||
const maxPos = chars.length
|
||||
let _string = ''
|
||||
for (let i = 0; i < length; i++) {
|
||||
_string += chars.charAt(Math.floor(Math.random() * maxPos))
|
||||
}
|
||||
return _string
|
||||
const chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
const maxPos = chars.length;
|
||||
let _string = "";
|
||||
for (let i = 0; i < length; i++) {
|
||||
_string += chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return _string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,16 +144,16 @@ export function randomString(length = 32) {
|
|||
*/
|
||||
|
||||
export function countTimeDown(seconds) {
|
||||
const leftTime = (time) => {
|
||||
if (time < 10) time = '0' + time
|
||||
return time + ''
|
||||
}
|
||||
return {
|
||||
day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)),
|
||||
hours: leftTime(parseInt(seconds / 60 / 60 % 24, 10)),
|
||||
minutes: leftTime(parseInt(seconds / 60 % 60, 10)),
|
||||
seconds: leftTime(parseInt(seconds % 60, 10))
|
||||
}
|
||||
const leftTime = (time) => {
|
||||
if (time < 10) time = "0" + time;
|
||||
return time + "";
|
||||
};
|
||||
return {
|
||||
day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)),
|
||||
hours: leftTime(parseInt((seconds / 60 / 60) % 24, 10)),
|
||||
minutes: leftTime(parseInt((seconds / 60) % 60, 10)),
|
||||
seconds: leftTime(parseInt(seconds % 60, 10)),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,16 +161,25 @@ export function countTimeDown(seconds) {
|
|||
* @returns {number}
|
||||
*/
|
||||
export function theNextDayTime() {
|
||||
const nowDate = new Date()
|
||||
const time = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() + 1, 0, 0, 0).getTime() - nowDate.getTime()
|
||||
return parseInt(time / 1000)
|
||||
const nowDate = new Date();
|
||||
const time =
|
||||
new Date(
|
||||
nowDate.getFullYear(),
|
||||
nowDate.getMonth(),
|
||||
nowDate.getDate() + 1,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
).getTime() - nowDate.getTime();
|
||||
return parseInt(time / 1000);
|
||||
}
|
||||
module.exports = {
|
||||
unixToDate,
|
||||
dateToUnix,
|
||||
formatPrice,
|
||||
secrecyMobile,
|
||||
randomString,
|
||||
countTimeDown,
|
||||
theNextDayTime
|
||||
}
|
||||
unixToDate,
|
||||
dateToUnix,
|
||||
formatPrice,
|
||||
secrecyMobile,
|
||||
randomString,
|
||||
countTimeDown,
|
||||
theNextDayTime,
|
||||
whetherNavigate
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue