feat:v1.4前端更新

This commit is contained in:
超凡
2025-06-24 14:43:09 +08:00
parent 0268aa5033
commit 35fec82e4a
1026 changed files with 118424 additions and 56490 deletions

View File

@@ -0,0 +1,312 @@
<template>
<view :data-theme="theme">
<form @submit="formSubmit" report-submit='true'>
<view class='evaluate-con pad30'>
<view class='goodsStyle acea-row row-between borRadius14'>
<view class='pictrue'>
<image :src='productInfo.image'></image>
</view>
<view class='text acea-row row-between'>
<view>
<view class='name line2'>{{productInfo.storeName}}</view>
<view class='attr line1 font_sm' v-if="productInfo.sku">{{productInfo.sku}}</view>
</view>
<view class='money'>
<view>{{productInfo.truePrice}}</view>
<view class='num'>x{{productInfo.cartNum}}</view>
</view>
</view>
</view>
<view class='score borRadius14'>
<view class='item acea-row row-middle' v-for="(item,indexw) in scoreList" :key="indexw">
<view>{{item.name}}</view>
<view class='starsList'>
<text @click="stars(indexn, indexw)" v-for="(itemn, indexn) in item.stars" :key="indexn" class='iconfont' :class="item.index >= indexn? 'icon-shitixing':'icon-kongxinxing'"></text>
</view>
<text class='evaluate'>{{item.index === -1 ? "" : item.index + 1 + "分"}}</text>
</view>
<view class='textarea'>
<textarea placeholder='商品满足你的期待么?说说你的想法,分享给想买的他们吧~' name="comment" placeholder-class='placeholder'></textarea>
<view class='list acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in picsPath" :key="index">
<image :src='item'></image>
<text class='iconfont icon-guanbi1' @click='DelPic(index)'></text>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic' v-if="picsPath.length < 8">
<text class='iconfont icon-icon25201'></text>
<view>上传图片</view>
</view>
</view>
</view>
<button class='evaluateBnt bg_color' formType="submit">立即评价</button>
</view>
</view>
</form>
</view>
</template>
<script>
import {
orderProduct,
orderComment
} from '@/api/order.js';
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
let app = getApp();
export default {
data() {
return {
pics: [],
picsPath: [],
scoreList: [{
name: "商品质量",
stars: ["", "", "", "", ""],
index: -1
},
{
name: "服务态度",
stars: ["", "", "", "", ""],
index: -1
}
],
orderId: '',
productId: 0, //产品id
evaluateId: 0, //评价id
unique: '',
productInfo: {storeName:'',sku:'',truePrice:'',cartNum:'',image:''},
cart_num: 0,
id: 0 ,//订单id
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getOrderProduct();
}
},
deep: true
}
},
onLoad(options) {
if (!options.unique || !options.orderId ) return this.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
this.unique = Number(options.unique) || 0;
this.orderId = options.orderId || 0;
this.evaluateId = Number(options.id) || 0;
if (this.isLogin) {
this.getOrderProduct();
} else {
toLogin();
}
},
methods: {
/**
* 获取某个产品详情
*
*/
getOrderProduct: function() {
let that = this;
orderProduct({
orderId: that.evaluateId,
uni: that.unique
}).then(res => {
that.$set(that, 'productInfo', res.data);
// that.$set(that, 'cart_num', res.data.cartNum);
// that.$set(that, 'productId', res.data.productId);
});
},
stars: function(indexn, indexw) {
this.scoreList[indexw].index = indexn;
},
/**
* 删除图片
*
*/
DelPic: function(index) {
let that = this,
pic = this.picsPath[index];
that.picsPath.splice(index, 1);
that.pics.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'upload/image',
name: 'multipart',
model: "product",
pid: 1
}, function(res) {
that.pics.push(res.data.url);
that.picsPath.push(res.data.localPath);
that.$set(that, 'pics', that.pics);
that.$set(that, 'picsPath', that.picsPath);
});
},
/**
* 立即评价
*/
formSubmit: function(e) {
let formId = e.detail.formId,
value = e.detail.value,
that = this,
product_score = that.scoreList[0].index + 1 === 0 ? "" : that.scoreList[0].index + 1,
service_score = that.scoreList[1].index + 1 === 0 ? "" : that.scoreList[1].index + 1;
if (!value.comment) return that.$util.Tips({
title: '请填写你对宝贝的心得!'
});
value.productScore = product_score;
value.serviceScore = service_score;
value.pics = that.pics.length>0?JSON.stringify(that.pics):'';
value.productId = that.productInfo.productId;
value.orderNo = that.orderId;
value.unique = that.unique;
value.sku = that.productInfo.sku;
uni.showLoading({
title: "正在发布评论……"
});
orderComment(value).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '感谢您的评价!',
icon: 'success'
}, '/pages/order/order_details/index?order_id=' + that.orderId);
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
});
}
}
}
</script>
<style lang="scss" scoped>
.goodsStyle .text .name, .attr{
//width: 496rpx;
}
.font_sm{
width: 360rpx;
font-size: 24rpx;
color: #999;
padding-top: 10rpx;
}
.icon-shitixing{
color: #FFBB00 !important;
}
.evaluate-con .score {
background-color: #fff;
// border-top: 1rpx solid #f5f5f5;
margin-top: 20rpx;
font-size: 28rpx;
color: #282828;
padding: 46rpx 24rpx;
}
.evaluate-con .score .item~.item {
margin-top: 36rpx;
}
.evaluate-con .score .item .starsList {
padding: 0 35rpx 0 40rpx;
}
.evaluate-con .score .item .starsList .iconfont {
font-size: 40rpx;
color: #aaa;
}
.evaluate-con .score .item .starsList .iconfont~.iconfont {
margin-left: 20rpx;
}
.evaluate-con .score .item .evaluate {
color: #aaa;
font-size: 24rpx;
}
.evaluate-con .score .textarea {
width: 100%;
background-color: #F5F5F5;
border-radius: 14rpx;
margin-top: 55rpx;
}
.evaluate-con .score .textarea textarea {
font-size: 28rpx;
padding: 38rpx 30rpx 0 30rpx;
width: 100%;
box-sizing: border-box;
height: 160rpx;
width: auto !important;
}
.evaluate-con .score .textarea .placeholder {
color: #bbb;
}
.evaluate-con .score .textarea .list {
margin-top: 25rpx;
padding-left: 5rpx;
}
.evaluate-con .score .textarea .list .pictrue {
width: 140rpx;
height: 140rpx;
margin: 0 0 35rpx 25rpx;
position: relative;
font-size: 22rpx;
color: #bbb;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue:nth-last-child(1) {
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.evaluate-con .score .textarea .list .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue .icon-guanbi1 {
font-size: 45rpx;
position: absolute;
top: -20rpx;
right: -20rpx;
}
.evaluate-con .score .textarea .list .pictrue .icon-icon25201 {
color: #bfbfbf;
font-size: 50rpx;
}
.evaluate-con .score .evaluateBnt {
font-size: 30rpx;
color: #fff;
width: 100%;
height: 86rpx;
border-radius: 43rpx;
text-align: center;
line-height: 86rpx;
margin-top: 45rpx;
}
.bg_color{
@include main_bg_color(theme);
}
</style>

View File

@@ -0,0 +1,192 @@
<template>
<view :data-theme="theme">
<view style="height: 100%;">
<view class='evaluate-list'>
<view class='generalComment acea-row row-between-wrapper'>
<view class='acea-row row-middle font_color'>
<view class='evaluate'>评分</view>
<view class='start'
:class="'star'+ (replyData.sumCount===0?'3':Math.round(replyData.replyStar/replyData.sumCount))">
</view>
</view>
<view><text class='font_color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>全部({{replyData.sumCount}})
</view>
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>好评({{replyData.goodCount}})
</view>
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>中评({{replyData.inCount}})
</view>
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>差评({{replyData.poorCount}})
</view>
</view>
<userEvaluation :reply="reply"></userEvaluation>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-if="!(type==0&&replyData.sumCount||type==1&&replyData.goodCount||type==2&&replyData.inCount||type==3&&replyData.poorCount) && page > 1">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/perset/usersImg/noEvaluate.png'"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import {
getReplyList,
getReplyConfig
} from '@/api/store.js';
import userEvaluation from '@/components/userEvaluation';
let app = getApp();
export default {
components: {
userEvaluation
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
replyData: {},
product_id: 0,
reply: [],
type: 0,
loading: false,
loadend: false,
loadTitle: '加载更多',
page: 1,
limit: 20,
theme:app.globalData.theme,
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
if (!options.productId) return that.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
that.productId = options.productId;
},
onShow: function() {
this.getProductReplyCount();
this.getProductReplyList();
},
methods: {
/**
* 获取评论统计数据
*
*/
getProductReplyCount: function() {
let that = this;
getReplyConfig(that.productId).then(res => {
that.$set(that, 'replyData', res.data);
});
},
/**
* 分页获取评论
*/
getProductReplyList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '';
getReplyList(that.productId, {
page: that.page,
limit: that.limit,
type: that.type,
}).then(res => {
let list = res.data.list,
loadend = list.length < that.limit;
that.reply = that.$util.SplitArray(list, that.reply);
that.$set(that, 'reply', that.reply);
that.loading = false;
that.loadend = loadend;
if (that.reply.length) {
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
}
that.page = that.page + 1;
}).catch(err => {
that.loading = false,
that.loadTitle = '加载更多'
});
},
/*
* 点击事件切换
* */
changeType: function(e) {
let type = parseInt(e);
if (type == this.type) return;
this.type = type;
this.page = 1;
this.loadend = false;
this.$set(this, 'reply', []);
this.getProductReplyList();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getProductReplyList();
},
}
</script>
<style lang="scss">
page {
background-color: #fff;
height: 100%;
}
.font_color{
@include main_color(theme);
}
.evaluate-list{
padding: 30rpx 0 0 0;
background-color: #fff;
}
.evaluate-list .generalComment {
padding: 0 30rpx;
margin-top: 1rpx;
background-color: #fff;
font-size: 28rpx;
color: #808080;
}
.evaluate-list .generalComment .evaluate {
margin-right: 7rpx;
color: #333333;
font-size: 28rpx;
}
.evaluate-list .nav {
font-size: 24rpx;
color: #282828;
padding: 30rpx;
background-color: #fff;
border-bottom: 1rpx solid #f5f5f5;
}
.evaluate-list .nav .item {
font-size: 24rpx;
color: #282828;
border-radius: 27rpx;
height: 54rpx;
padding: 0 20rpx;
background-color: #f4f4f4;
line-height: 54rpx;
margin-right: 17rpx;
}
.evaluate-list .nav .item.bg-color {
color: #fff;
@include main_bg_color(theme);
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view :style="{ backgroundImage: `url(${productInfo.activityStyle})` }" class='nav acea-row row-between-wrapper '>
<view class='money skeleton-rect'>
<view class="price-box">
<view class="price">
<span class="price-icon"></span>{{productInfo.price}}
</view>
<view class="vip-price" v-if="productInfo.vipPrice">
<image :src="urlDomain+'crmebimage/perset/staticImg/vip_badge.png'" class="vip_icon"></image>
<view
class='vip_money skeleton-rect'>{{productInfo.vipPrice}}</view>
</view>
</view>
</view>
<view class='acea-row row-middle skeleton-rect'>
</view>
</view>
</template>
<script>
export default {
props: {
productInfo: {
type: Object,
default: () => {},
}
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
}
}
}
</script>
<style lang="scss" scoped>
.nav {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100rpx;
padding: 0 24px;
box-sizing: border-box;
.money {
font-size: 14px;
color: #fff;
}
.num {
font-size: 24px;
}
.y-money {
font-size: 26rpx;
margin-left: 10rpx;
text-decoration: line-through;
}
}
.price-box{
display: flex;
font-size: 48rpx;
font-weight: 700;
@include price_color(theme);
.price-icon{
font-size: 28rpx;
}
.vip-price{
display: flex;
align-items: center;
padding-left: 20rpx;
margin-top: 8rpx;
.vip_icon {
width: 44rpx;
height: 28rpx;
vertical-align: middle;
}
.vip_money {
background: #FFE7B9;
border-radius: 4px;
font-size: 22rpx;
color: #333;
text-align: center;
padding: 0 4rpx;
box-sizing: border-box;
margin-left: -7rpx;
height: 14px;
}
}
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,300 @@
<template>
<div>
<div class="storeBox" ref="container">
<div class="storeBox-box" v-for="(item, index) in storeList" :key="index" @click.stop="checked(item)">
<div class="store-img"><img :src="item.image" lazy-load="true" /></div>
<div class="store-cent-left">
<div class="store-name">{{ item.name }}</div>
<div class="store-address line1">
{{ item.address }}{{ ", " + item.detailedAddress }}
</div>
</div>
<div class="row-right">
<div>
<!-- #ifdef H5 -->
<a class="store-phone" :href="'tel:' + item.phone"><span
class="iconfont icon-dadianhua01"></span></a>
<!-- #endif -->
<!-- #ifdef MP || APP-PLUS -->
<view class="store-phone" @click="call(item.phone)"><text
class="iconfont icon-dadianhua01"></text></view>
<!-- #endif -->
</div>
<!-- <div>
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
</div> -->
<div class="store-distance" @click.stop="showMaoLocation(item)">
<span class="addressTxt" v-if="item.distance">距离{{ item.distance/1000 }}千米</span>
<span class="addressTxt" v-else>查看地图</span>
<span class="iconfont icon-youjian"></span>
</div>
</div>
</div>
<Loading :loaded="loaded" :loading="loading"></Loading>
</div>
<div>
<!-- <iframe v-if="locationShow && !isWeixin" ref="geoPage" width="0" height="0" frameborder="0" style="display:none;"
scrolling="no" :src="
'https://apis.map.qq.com/tools/geolocation?key=' +
mapKey +
'&referer=myapp'
">
</iframe> -->
</div>
</div>
</template>
<script>
import Loading from "@/components/Loading";
import {
storeListApi
} from "@/api/store";
import {
isWeixin
} from "@/utils/index";
// #ifdef H5
import {
wechatEvevt,
wxShowLocation
} from "@/libs/wechat";
// #endif
import {
mapGetters
} from "vuex";
// import cookie from "@/utils/store/cookie";
const LONGITUDE = "user_longitude";
const LATITUDE = "user_latitude";
const MAPKEY = "mapKey";
export default {
name: "storeList",
components: {
Loading
},
// computed: mapGetters(["goName"]),
data() {
return {
page: 1,
limit: 20,
loaded: false,
loading: false,
storeList: [],
system_store: {},
// mapKey: cookie.get(MAPKEY),
locationShow: false,
user_latitude: 0,
user_longitude: 0
};
},
onLoad() {
try {
this.user_latitude = uni.getStorageSync('user_latitude');
this.user_longitude = uni.getStorageSync('user_longitude');
} catch (e) {
// error
}
},
mounted() {
if (this.user_latitude && this.user_longitude) {
this.getList();
} else {
this.selfLocation();
this.getList();
}
// this.$scroll(this.$refs.container, () => {
// !this.loading && this.getList();
// });
},
methods: {
call(phone) {
uni.makePhoneCall({
phoneNumber: phone,
});
},
selfLocation() {
let self = this
// #ifdef H5
if (self.$wechat.isWeixin()) {
self.$wechat.location().then(res => {
this.user_latitude = res.latitude;
this.user_longitude = res.longitude;
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
self.getList();
})
} else {
// #endif
uni.getLocation({
type: 'wgs84',
success: (res) => {
try {
this.user_latitude = res.latitude;
this.user_longitude = res.longitude;
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
} catch {}
self.getList();
},
complete: function() {
self.getList();
}
});
// #ifdef H5
}
// #endif
},
showMaoLocation(e) {
let self = this;
// #ifdef H5
if (self.$wechat.isWeixin()) {
self.$wechat.seeLocation({
latitude: Number(e.latitude),
longitude: Number(e.longitude)
}).then(res => {
console.log('success');
})
} else {
// #endif
uni.openLocation({
latitude: Number(e.latitude),
longitude: Number(e.longitude),
name: e.name,
address: `${e.address}-${e.detailedAddress}`,
success: function() {
console.log('success');
}
});
// #ifdef H5
}
// #endif
},
// 选中门店
checked(e) {
uni.$emit("handClick", {
address: e
});
uni.navigateBack();
// if (this.goName === "orders") {
// this.$store.commit("GET_STORE", e);
// this.$router.go(-1); //返回上一层
// }
},
// 获取门店列表数据
getList: function() {
if (this.loading || this.loaded) return;
this.loading = true;
let data = {
latitude: this.user_latitude || "", //纬度
longitude: this.user_longitude || "", //经度
page: this.page,
limit: this.limit
};
storeListApi(data)
.then(res => {
this.loading = false;
this.loaded = res.data.list.length < this.limit;
this.storeList.push.apply(this.storeList, res.data.list);
this.page = this.page + 1;
})
.catch(err => {
this.$dialog.error(err);
});
}
},
onReachBottom() {
this.getList();
}
};
</script>
<style>
.geoPage {
position: fixed;
width: 100%;
height: 100%;
top: 0;
z-index: 10000;
}
.storeBox {
width: 100%;
background-color: #fff;
padding: 0 30rpx;
}
.storeBox-box {
width: 100%;
height: auto;
display: flex;
align-items: center;
padding: 23rpx 0;
justify-content: space-between;
border-bottom: 1px solid #eee;
}
.store-cent {
display: flex;
align-items: center;
width: 80%;
}
.store-cent-left {
width: 45%;
}
.store-img {
width: 120rpx;
height: 120rpx;
border-radius: 6rpx;
margin-right: 22rpx;
}
.store-img img {
width: 100%;
height: 100%;
}
.store-name {
color: #282828;
font-size: 30rpx;
margin-bottom: 22rpx;
font-weight: 800;
}
.store-address {
color: #666666;
font-size: 24rpx;
}
.store-phone {
width: 50rpx;
height: 50rpx;
color: #fff;
border-radius: 50%;
display: block;
text-align: center;
line-height: 48rpx;
background-color: #e83323;
margin-bottom: 22rpx;
text-decoration: none;
}
.store-distance {
font-size: 22rpx;
color: #e83323;
}
.iconfont {
font-size: 20rpx;
}
.row-right {
display: flex;
flex-direction: column;
align-items: flex-end;
width: 33.5%;
}
</style>

View File

@@ -0,0 +1,419 @@
<template>
<view :data-theme="theme">
<view class='productList'>
<view class='search bg_color acea-row row-between-wrapper'>
<!-- #ifdef H5 -->
<view class="iconfont icon-xiangzuo" @click="goback()"></view>
<!-- #endif -->
<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
:value='where.keyword' @confirm="searchSubmit" maxlength="20"></input>
</view>
<view class='iconfont' :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'>
</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='title ? "font_color":""' @click='set_where(1)'>{{title ? title:'默认'}}</view>
<view class='item' @click='set_where(2)'>
价格
<image v-if="price==1" :src="urlDomain+'crmebimage/perset/staticImg/up.png'"></image>
<image v-else-if="price==2" :src="urlDomain+'crmebimage/perset/staticImg/down.png'"></image>
<image v-else :src="urlDomain+'crmebimage/perset/staticImg/horn.png'"></image>
</view>
<view class='item' @click='set_where(3)'>
销量
<image v-if="stock==1" :src="urlDomain+'crmebimage/perset/staticImg/up.png'"></image>
<image v-else-if="stock==2" :src="urlDomain+'crmebimage/perset/staticImg/down.png'"></image>
<image v-else :src="urlDomain+'crmebimage/perset/staticImg/horn.png'"></image>
</view>
<!-- down -->
<view class='item' :class='nows ? "font_color":""' @click='set_where(4)'>新品</view>
</view>
<view :class='is_switch==true?"":"listBox"' v-if="productList.length>0">
<view class='list acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
<view class='item' :class='is_switch==true?"":"on"' hover-class='none'
v-for="(item,index) in productList" :key="index" @click="godDetail(item)">
<view class='pictrue' :class='is_switch==true?"":"on"'>
<image :src='item.image' :class='is_switch==true?"":"on"'></image>
<view :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '1'">秒杀</span>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '2'">砍价</span>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '3'">拼团</span>
</view>
<view class='text' :class='is_switch==true?"":"on"'>
<view class='name line1'>{{item.storeName}}</view>
<view class='x-money' :class='is_switch==true?"":"on"'><text
class='num'>{{item.price}}</text></view>
<view class='vip acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
<view class='vip-money' v-if="item.vip_price && item.vip_price > 0">{{item.vip_price}}
<image :src="urlDomain+'crmebimage/perset/staticImg/vip.png'"></image>
</view>
<view>已售{{Number(item.sales)}}{{item.unitName}}</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
</view>
</view>
<view class='noCommodity' v-if="productList.length==0 && where.page > 1">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/perset/staticImg/noShopper.png'"></image>
</view>
<recommend ref="recommendIndex"></recommend>
</view>
</view>
</template>
<script>
import {getProductslist,getProductHot} from '@/api/store.js';
import recommend from '@/components/recommend';
import {mapGetters} from "vuex";
import {goShopDetail} from '@/libs/order.js'
import animationType from '@/utils/animationType.js'
let app = getApp();
export default {
computed: mapGetters(['uid']),
components: {
recommend
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
productList: [],
is_switch: true,
where: {
keyword: '',
priceOrder: '',
salesOrder: '',
news: 0,
page: 1,
limit: 20,
cid: '',
},
price: 0,
stock: 0,
nows: false,
loadend: false,
loading: false,
loadTitle: '加载更多',
title: '',
theme:app.globalData.theme
};
},
onLoad: function(options) {
this.$set(this.where, 'cid', options.cid || '');
this.title = options.title || '';
this.$set(this.where, 'keyword', options.searchValue || '');
this.get_product_list();
},
methods: {
goback() {
// #ifdef H5
return history.back();
// #endif
// #ifndef H5
return uni.navigateBack({
delta: 1,
})
// #endif
},
// 去详情页
godDetail(item) {
goShopDetail(item, this.uid).then(res => {
uni.navigateTo({
animationType: animationType.type, animationDuration: animationType.duration,
url: `/pages/goods/goods_details/index?id=${item.id}`
})
})
},
Changswitch: function() {
let that = this;
that.is_switch = !that.is_switch
},
searchSubmit: function(e) {
let that = this;
that.$set(that.where, 'keyword', e.detail.value);
that.loadend = false;
that.$set(that.where, 'page', 1)
this.get_product_list(true);
},
//点击事件处理
set_where: function(e) {
switch (e) {
case 1:
return;
break;
case 2:
if (this.price == 0) this.price = 1;
else if (this.price == 1) this.price = 2;
else if (this.price == 2) this.price = 0;
this.stock = 0;
break;
case 3:
if (this.stock == 0) this.stock = 1;
else if (this.stock == 1) this.stock = 2;
else if (this.stock == 2) this.stock = 0;
this.price = 0
break;
case 4:
this.nows = !this.nows;
break;
}
this.loadend = false;
this.$set(this.where, 'page', 1);
this.get_product_list(true);
},
//设置where条件
setWhere: function() {
if (this.price == 0) this.where.priceOrder = '';
else if (this.price == 1) this.where.priceOrder = 'asc';
else if (this.price == 2) this.where.priceOrder = 'desc';
if (this.stock == 0) this.where.salesOrder = '';
else if (this.stock == 1) this.where.salesOrder = 'asc';
else if (this.stock == 2) this.where.salesOrder = 'desc';
this.where.news = this.nows ? 1 : 0;
},
//查找产品
get_product_list: function(isPage) {
let that = this;
that.setWhere();
if (that.loadend) return;
if (that.loading) return;
if (isPage === true) that.$set(that, 'productList', []);
that.loading = true;
that.loadTitle = '';
getProductslist(that.where).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.productList);
let loadend = list.length < that.where.limit;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
that.$set(that, 'productList', productList);
that.$set(that.where, 'page', that.where.page + 1);
if (that.productList.length === 0) {
this.get_host_product();
}
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
},
onReachBottom() {
if (this.productList.length > 0) {
this.get_product_list();
} else {
this.$refs.recommendIndex.get_host_product();
}
}
}
</script>
<style scoped lang="scss">
.bg_color{
@include main_bg_color(theme);
}
.font_color{
@include main_color(theme);
}
.x-money{
@include price_color(theme);
}
.iconfont {
color: #fff;
}
.listBox{
padding: 20px 15px;
margin-top: 154rpx;
}
.productList .search {
width: 100%;
height: 86rpx;
padding-left: 23rpx;
box-sizing: border-box;
position: fixed;
left: 0;
top: 0;
z-index: 9;
}
.productList .search .input {
// width: 640rpx;
height: 60rpx;
background-color: #fff;
border-radius: 50rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.productList .search .input input {
/* #ifdef H5 */
width: 528rpx;
/* #endif */
/* #ifndef H5 */
width: 548rpx;
/* #endif */
height: 100%;
font-size: 26rpx;
}
.productList .search .input .placeholder {
color: #999;
}
.productList .search .input .iconfont {
font-size: 35rpx;
color: #555;
}
.productList .search .icon-pailie,
.productList .search .icon-tupianpailie {
color: #fff;
width: 62rpx;
font-size: 40rpx;
height: 86rpx;
line-height: 86rpx;
}
.productList .nav {
height: 86rpx;
color: #454545;
position: fixed;
left: 0;
width: 100%;
font-size: 28rpx;
background-color: #fff;
margin-top: 86rpx;
top: 0;
z-index: 9;
}
.productList .nav .item {
width: 25%;
text-align: center;
}
.productList .nav .item.font-color {
font-weight: bold;
}
.productList .nav .item image {
width: 15rpx;
height: 19rpx;
margin-left: 10rpx;
}
.productList .list {
padding: 0 30rpx;
margin-top: 192rpx;
}
.productList .list.on {
border-radius: 14rpx;
margin-top: 0 !important;
background-color: #fff;
padding: 40rpx 0 0 0;
// margin: 20rpx 0;
// background-color: #fff;
}
.productList .list .item {
width: 335rpx;
background-color: #fff;
border-radius: 14rpx;
margin-bottom: 20rpx;
}
.productList .list .item.on {
width: 100%;
display: flex;
padding: 0 24rpx 50rpx 24rpx;
margin: 0;
border-radius: 14rpx;
}
.productList .list .item .pictrue {
position: relative;
width: 100%;
height: 335rpx;
}
.productList .list .item .pictrue.on {
width: 180rpx;
height: 180rpx;
}
.productList .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}
.productList .list .item .pictrue image.on {
border-radius: 6rpx;
}
.productList .list .item .text {
padding: 18rpx 20rpx;
font-size: 30rpx;
color: #222;
}
.productList .list .item .text.on {
width: 456rpx;
padding: 0 0 0 20rpx;
}
.productList .list .item .text .money {
font-size: 26rpx;
font-weight: bold;
margin-top: 8rpx;
}
.productList .list .item .text .money.on {
margin-top: 50rpx;
}
.productList .list .item .text .money .num {
font-size: 34rpx;
}
.productList .list .item .text .vip {
font-size: 22rpx;
color: #aaa;
margin-top: 7rpx;
}
.productList .list .item .text .vip.on {
margin-top: 12rpx;
}
.productList .list .item .text .vip .vip-money {
font-size: 24rpx;
color: #282828;
font-weight: bold;
}
.productList .list .item .text .vip .vip-money image {
width: 46rpx;
height: 21rpx;
margin-left: 4rpx;
}
.noCommodity {
background-color: #fff;
padding-bottom: 30rpx;
margin-top: 172rpx;
}
</style>

View File

@@ -0,0 +1,269 @@
<template>
<view>
<view class='logistics'>
<view class='header acea-row row-between row-top'>
<view class='pictrue'>
<image :src='product.productImg'></image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{product.productName}}</view>
<view class='money'>
<view>{{product.price}}</view>
<view>x{{product.payNum}}</view>
</view>
</view>
</view>
<view class='logisticsCon'>
<view class='company acea-row row-between-wrapper'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='iconfont icon-wuliu'></view>
<view class='text'>
<view><text class='name line1'>物流公司</text> {{orderInfo.deliveryName}}</view>
<view class='express line1'><text class='name'>快递单号</text> {{orderInfo.deliveryId}}</view>
</view>
</view>
<!-- #ifndef H5 -->
<view class='copy' @tap='copyOrderId'>复制单号</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class='copy copy-data' :data-clipboard-text="orderInfo.deliveryId">复制单号</view>
<!-- #endif -->
</view>
<view class='item' v-for="(item,index) in expressList" :key="index">
<view class='circular' :class='index === 0 ? "on":""'></view>
<view class='text' :class='index===0 ? "on-font on":""'>
<view>{{item.status}}</view>
<view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
</view>
</view>
</view>
<recommend ref="recommendIndex" v-if="expressList.length== 0 && isloading"></recommend>
</view>
</view>
</template>
<script>
import {
express
} from '@/api/order.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import recommend from '@/components/recommend';
export default {
components: {
recommend
},
data() {
return {
orderId: '',
product: {
productInfo: {}
},
orderInfo: {},
expressList: [],
loading: false,
isloading: false, //接口是否请求完毕
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getExpress();
}
},
deep:true
}
},
onLoad: function (options) {
if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
this.orderId = options.orderId;
if (this.isLogin) {
this.getExpress();
} else {
toLogin();
}
},
onReady: function() {
// #ifdef H5
this.$nextTick(function() {
const clipboard = new ClipboardJS(".copy-data");
clipboard.on("success", () => {
this.$util.Tips({
title: '复制成功'
});
});
});
// #endif
},
methods: {
copyOrderId:function(){
uni.setClipboardData({ data: this.orderInfo.deliveryId });
},
getExpress:function(){
let that=this;
that.isloading = false;
express(that.orderId).then(function(res){
let result = res.data.express|| {};
that.$set(that,'product',res.data.order.info[0] || {});
that.$set(that,'orderInfo',res.data.order);
that.$set(that,'expressList',result.list || []);
that.isloading = true;
}).catch(e => {
that.isloading = false;
return this.$util.Tips({
title: e
});
});
}
},
// 滚动到底部
onReachBottom() {
if (this.params.page != 1) {
this.$refs.recommendIndex.get_host_product();
}
},
}
</script>
<style scoped lang="scss">
.logistics .header {
padding: 23rpx 30rpx;
background-color: #fff;
height: 166rpx;
box-sizing: border-box;
}
.logistics .header .pictrue {
width: 120rpx;
height: 120rpx;
}
.logistics .header .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
.logistics .header .text {
width: 540rpx;
font-size: 28rpx;
color: #999;
margin-top: 6rpx;
}
.logistics .header .text .name {
width: 365rpx;
color: #282828;
}
.logistics .header .text .money {
text-align: right;
}
.logistics .logisticsCon {
background-color: #fff;
margin: 12rpx 0;
}
.logistics .logisticsCon .company {
height: 120rpx;
margin: 0 0 45rpx 30rpx;
padding-right: 30rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.logistics .logisticsCon .company .picTxt {
width: 520rpx;
}
.logistics .logisticsCon .company .picTxt .iconfont {
width: 50rpx;
height: 50rpx;
background-color: #666;
text-align: center;
line-height: 50rpx;
color: #fff;
font-size: 35rpx;
}
.logistics .logisticsCon .company .picTxt .text {
width: 450rpx;
font-size: 26rpx;
color: #282828;
}
.logistics .logisticsCon .company .picTxt .text .name {
color: #999;
}
.logistics .logisticsCon .company .picTxt .text .express {
margin-top: 5rpx;
}
.logistics .logisticsCon .company .copy {
font-size: 20rpx;
width: 106rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 20rpx;
border: 1rpx solid #999;
}
.logistics .logisticsCon .item {
padding: 0 40rpx;
position: relative;
}
.logistics .logisticsCon .item .circular {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
position: absolute;
top: -1rpx;
left: 31.5rpx;
background-color: #ddd;
}
.logistics .logisticsCon .item .circular.on {
background-color: $theme-color;
}
.logistics .logisticsCon .item .text.on-font {
color: $theme-color;
}
.logistics .logisticsCon .item .text .data.on-font {
color: $theme-color;
}
.logistics .logisticsCon .item .text {
font-size: 26rpx;
color: #666;
width: 615rpx;
border-left: 1rpx solid #e6e6e6;
padding: 0 0 60rpx 38rpx;
}
.logistics .logisticsCon .item .text.on {
border-left-color: #f8c1bd;
}
.logistics .logisticsCon .item .text .data {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
.logistics .logisticsCon .item .text .data .time {
margin-left: 15rpx;
}
</style>

View File

@@ -0,0 +1,322 @@
<template>
<view :data-theme="theme">
<form @submit="subRefund" report-submit='true'>
<view class='apply-return'>
<view class='goodsStyle acea-row row-between borRadius14'
v-for="(item,index) in orderInfo.orderInfoList" :key="index">
<view class='pictrue'>
<image :src='item.image'></image>
</view>
<view class='text acea-row row-between'>
<view>
<view class='name line2'>{{item.storeName}}</view>
<view class='attr line1' v-if="item.sku">{{item.sku}}</view>
</view>
<view class='money'>
<view>{{item.price}}</view>
<view class='num'>x{{item.cartNum}}</view>
</view>
</view>
</view>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>退货件数</view>
<view class='num'>{{orderInfo.totalNum}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>退款金额</view>
<view class='num'>{{orderInfo.payPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' @tap="toggleTab('region')">
<view>退款原因</view>
<picker class='num' @change="bindPickerChange" :value="index" :range="RefundArray">
<view class="picker acea-row row-between-wrapper">
<view class='reason'>{{RefundArray[index]}}</view>
<text class='iconfont icon-jiantou'></text>
</view>
</picker>
</view>
<view class='item textarea acea-row row-between'>
<view>备注说明</view>
<textarea placeholder='填写备注信息100字以内' class='num' name="refund_reason_wap_explain"
placeholder-class='填写备注信息100字以内'></textarea>
</view>
<view class='item acea-row row-between' style="border: none;">
<view class='title acea-row row-between-wrapper'>
<view>上传凭证</view>
<view class='tip'>( 最多可上传3张 )</view>
</view>
<view class='upload acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in refund_reason_wap_imgPath" :key="index">
<image :src='item'></image>
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)'></view>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
v-if="refund_reason_wap_imgPath.length < 3">
<text class='iconfont icon-icon25201'></text>
<view>上传凭证</view>
</view>
</view>
</view>
<button class='returnBnt bg_color' form-type="submit">申请退款</button>
</view>
</view>
</form>
</view>
</template>
<script>
import {
ordeRefundReason,
orderRefundVerify,
applyRefund
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import {
Debounce
} from '@/utils/validate.js'
let app = getApp();
export default {
data() {
return {
refund_reason_wap_img: [],
refund_reason_wap_imgPath: [],
orderInfo: {},
RefundArray: [],
index: 0,
orderId: 0,
theme: app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getOrderInfo();
this.getRefundReason();
}
},
deep: true
}
},
onLoad: function(options) {
if (!options.orderId) return this.$util.Tips({
title: '缺少订单id,无法退款'
}, {
tab: 3,
url: 1
});
this.orderId = options.orderId;
if (this.isLogin) {
this.getOrderInfo();
this.getRefundReason();
} else {
toLogin();
}
},
methods: {
onLoadFun: function() {
this.getOrderInfo();
this.getRefundReason();
},
/**
* 获取订单详情
*
*/
getOrderInfo: function() {
let that = this;
applyRefund(that.orderId).then(res => {
that.$set(that, 'orderInfo', res.data);
});
},
/**
* 获取退款理由
*/
getRefundReason: function() {
let that = this;
ordeRefundReason().then(res => {
that.$set(that, 'RefundArray', res.data);
})
},
/**
* 删除图片
*
*/
DelPic: function(e) {
let index = e,
that = this;
that.refund_reason_wap_imgPath.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'upload/image',
name: 'multipart',
model: "product",
pid: 1
}, function(res) {
that.refund_reason_wap_imgPath.push(res.data.url);
});
},
/**
* 申请退货
*/
subRefund: Debounce(function(e) {
let that = this,
value = e.detail.value;
//收集form表单
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
orderRefundVerify({
text: that.RefundArray[that.index] || '',
refund_reason_wap_explain: value.refund_reason_wap_explain,
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
uni: that.orderId
}).then(res => {
return this.$util.Tips({
title: '申请成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_return_list/index?isT=1'
});
}).catch(err => {
return this.$util.Tips({
title: err
});
})
}),
bindPickerChange: function(e) {
this.$set(this, 'index', e.detail.value);
}
}
}
</script>
<style scoped lang="scss">
.goodsStyle .text .name, {
height: 84rpx !important;
line-height: 40rpx !important;
}
.apply-return {
padding: 20rpx 30rpx 70rpx 30rpx;
}
.apply-return .list {
background-color: #fff;
margin-top: 18rpx;
padding: 0 24rpx 70rpx 24rpx;
}
.apply-return .list .item {
min-height: 90rpx;
border-bottom: 1rpx solid #eee;
font-size: 30rpx;
color: #333;
}
.apply-return .list .item .num {
color: #282828;
width: 427rpx;
text-align: right;
}
.apply-return .list .item .num .picker .reason {
width: 385rpx;
}
.apply-return .list .item .num .picker .iconfont {
color: #666;
font-size: 30rpx;
margin-top: 2rpx;
}
.apply-return .list .item.textarea {
padding: 24rpx 0;
}
.apply-return .list .item textarea {
height: 100rpx;
font-size: 30rpx;
}
.apply-return .list .item .placeholder {
color: #bbb;
}
.apply-return .list .item .title {
height: 95rpx;
width: 100%;
}
.apply-return .list .item .title .tip {
font-size: 30rpx;
color: #bbb;
}
.apply-return .list .item .upload {
padding-bottom: 36rpx;
}
.apply-return .list .item .upload .pictrue {
border-radius: 14rpx;
margin: 22rpx 23rpx 0 0;
width: 156rpx;
height: 156rpx;
position: relative;
font-size: 24rpx;
color: #bbb;
}
.apply-return .list .item .upload .pictrue:nth-of-type(4n) {
margin-right: 0;
}
.apply-return .list .item .upload .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.apply-return .list .item .upload .pictrue .icon-guanbi1 {
position: absolute;
font-size: 45rpx;
top: -10rpx;
right: -10rpx;
}
.apply-return .list .item .upload .pictrue .icon-icon25201 {
color: #bfbfbf;
font-size: 50rpx;
}
.apply-return .list .item .upload .pictrue:nth-last-child(1) {
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.apply-return .returnBnt {
font-size: 32rpx;
color: #fff;
width: 100%;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 43rpx auto;
}
.bg_color {
@include main_bg_color(theme);
}
</style>

View File

@@ -0,0 +1,254 @@
<template>
<view :data-theme="theme">
<view class='searchGood'>
<view class='search acea-row row-between-wrapper'>
<!-- #ifndef MP -->
<view class='input acea-row row-between-wrapper'>
<text class='iconfont icon-sousuo2'></text>
<input type='text' :value='searchValue'
:focus="focus" placeholder='点击搜索商品'
confirm-type='search' @confirm="searchBut"
placeholder-class='placeholder' @input="setValue"
maxlength="20"></input>
</view>
<view class='bnt' @tap='searchBut'>搜索</view>
<!-- #endif -->
<!-- #ifdef MP -->
<searchBox :searchValue="searchValue" class="searchBox" @searchChange="searchBut"></searchBox>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<view class='title' :style="{'margin-top':searchTop+60+'px'}">热门搜索</view>
<!-- #endif -->
<!-- #ifndef MP -->
<view class='title'>热门搜索</view>
<!-- #endif -->
<view class='list acea-row'>
<block v-for="(item,index) in hotSearchList" :key="index">
<view class='item' @tap='setHotSearchValue(item.title)'>{{item.title}}</view>
</block>
</view>
<view class='line'></view>
<goodList :bastList="bastList" v-if="bastList.length > 0"></goodList>
<view class='loadingicon acea-row row-center-wrapper' v-if="bastList.length > 0">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
</view>
<view class='noCommodity'>
<view class='pictrue' v-if="bastList.length == 0 && isbastList">
<image :src="urlDomain+'crmebimage/perset/staticImg/noSearch.png'"></image>
</view>
<recommend ref="recommendIndex" v-if="bastList.length == 0"></recommend>
</view>
</view>
</template>
<script>
import {
getSearchKeyword,
getProductslist
} from '@/api/store.js';
import goodList from '@/components/goodList';
import recommend from '@/components/recommend';
// #ifdef MP
import searchBox from "@/components/searchBox.vue";
// #endif
let app = getApp();
export default {
components: {
goodList,
recommend,
// #ifdef MP
searchBox
// #endif
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
searchValue: '',
focus: true,
bastList: [],
hotSearchList: [],
first: 0,
limit: 8,
page: 1,
loading: false,
loadend: false,
loadTitle: '加载更多',
isbastList: false,
theme:app.globalData.theme,
searchTop:''
};
},
onLoad(e){
// #ifdef MP
this.searchTop=uni.getMenuButtonBoundingClientRect().top
// #endif
},
onShow: function() {
this.getRoutineHotSearch();
},
onReachBottom: function() {
if(this.bastList.length>0){
this.getProductList();
}else{
this.$refs.recommendIndex.get_host_product();
}
},
methods: {
getRoutineHotSearch: function() {
let that = this;
getSearchKeyword().then(res => {
that.$set(that, 'hotSearchList', res.data);
});
},
getProductList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '';
getProductslist({
keyword: that.searchValue,
page: that.page,
limit: that.limit
}).then(res => {
let list = res.data.list,
loadend = list.length < that.limit;
that.bastList = that.$util.SplitArray(list, that.bastList);
that.$set(that,'bastList',that.bastList);
that.loading = false;
that.loadend = loadend;
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
that.page = that.page + 1;
that.isbastList = true;
}).catch(err => {
that.loading = false,
that.loadTitle = '加载更多'
});
},
setHotSearchValue: function(event) {
this.$set(this, 'searchValue', event);
this.page = 1;
this.loadend = false;
this.$set(this, 'bastList', []);
this.getProductList();
},
setValue: function(event) {
this.$set(this, 'searchValue', event.detail.value);
},
searchBut: function(e) {
let that = this;
that.focus = false;
if(e.detail.value){
this.searchValue =e.detail.value
}
if (that.searchValue.length > 0||val) {
that.page = 1;
that.loadend = false;
that.$set(that, 'bastList', []);
uni.showLoading({
title: '正在搜索中'
});
that.getProductList();
uni.hideLoading();
} else {
return this.$util.Tips({
title: '请输入要搜索的商品',
icon: 'none',
duration: 1000,
mask: true,
});
}
}
}
}
</script>
<style lang="scss">
page {
background-color: #fff !important;
}
.searchGood .search {
padding-left: 30rpx;
background-color: #fff !important;
}
.searchGood .search {
/* #ifndef MP */
padding-top: 20rpx;
padding-bottom: 20rpx;
/* #endif */
/* #ifdef MP */
position: fixed;
width: 100%;
z-index: 9999;
top: 0;
/* #endif */
}
.searchGood .search .input {
width: 598rpx;
background-color: #f7f7f7;
border-radius: 33rpx;
padding: 0 35rpx;
box-sizing: border-box;
height: 66rpx;
}
.searchGood .search .input input {
width: 472rpx;
font-size: 26rpx;
}
.searchGood .search .input .placeholder {
color: #bbb;
}
.searchGood .search .input .iconfont {
color: #000;
font-size: 35rpx;
}
.searchGood .search .bnt {
width: 120rpx;
text-align: center;
height: 66rpx;
line-height: 66rpx;
font-size: 30rpx;
color: #282828;
}
.searchGood .title {
font-weight: 500;
font-family: PingFang SC, PingFang SC;
font-size: 28rpx;
color: #333;
margin: 50rpx 30rpx 25rpx 30rpx;
}
.searchGood .list {
padding-left: 10rpx;
}
.searchGood .list .item {
font-size: 26rpx;
color: #454545;
padding: 0 21rpx;
height: 60rpx;
border-radius: 30rpx;
line-height: 60rpx;
border: 1rpx solid #aaa;
margin: 0 0 20rpx 20rpx;
}
.searchGood .line {
border-bottom: 1rpx solid #eee;
margin: 20rpx 30rpx 0 30rpx;
}
.searchBox{
width: 100%;
}
</style>